org.squirrelframework.foundation.fsm
Interface Converter<T>

Type Parameters:
T - type of converted object
All Superinterfaces:
SquirrelComponent
All Known Subinterfaces:
StringConverter
All Known Implementing Classes:
Converter.EnumConverter, StringConverter.StringConverterImpl

public interface Converter<T>
extends SquirrelComponent

Convert object from string to object and object to string either.

Author:
Henry.He

Nested Class Summary
static class Converter.EnumConverter<T extends Enum<T>>
          Enumeration converter which can convert Enum object to its name, and also convert Enum name to Enum object.
 
Method Summary
 T convertFromString(String name)
          Convert string to object.
 String convertToString(T obj)
          Convert object to string.
 

Method Detail

convertToString

String convertToString(T obj)
Convert object to string.

Parameters:
obj - converted object
Returns:
string description of object

convertFromString

T convertFromString(String name)
Convert string to object.

Parameters:
name - name of the object
Returns:
converted object


Copyright © 2013-2014. All Rights Reserved.