org.squirrelframework.foundation.fsm
Class Converter.EnumConverter<T extends Enum<T>>
java.lang.Object
org.squirrelframework.foundation.fsm.Converter.EnumConverter<T>
- Type Parameters:
T - enum type
- All Implemented Interfaces:
- SquirrelComponent, Converter<T>
- Enclosing interface:
- Converter<T>
public static class Converter.EnumConverter<T extends Enum<T>>
- extends Object
- implements Converter<T>
Enumeration converter which can convert Enum object to its name, and also
convert Enum name to Enum object.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Converter.EnumConverter
public Converter.EnumConverter(Class<T> enumType)
convertToString
public String convertToString(T obj)
- Description copied from interface:
Converter
- Convert object to string.
- Specified by:
convertToString in interface Converter<T extends Enum<T>>
- Parameters:
obj - converted object
- Returns:
- string description of object
convertFromString
public T convertFromString(String name)
- Description copied from interface:
Converter
- Convert string to object.
- Specified by:
convertFromString in interface Converter<T extends Enum<T>>
- Parameters:
name - name of the object
- Returns:
- converted object
Copyright © 2013-2014. All Rights Reserved.