Class EnumStringifier<E extends Enum>
- java.lang.Object
-
- com.googlecode.objectify.stringifier.EnumStringifier<E>
-
- All Implemented Interfaces:
InitializeStringifier
,Stringifier<E>
public class EnumStringifier<E extends Enum> extends Object implements Stringifier<E>, InitializeStringifier
Converts Enums back and forth with their string representation
- Author:
- Jeff Schnitzer
-
-
Constructor Summary
Constructors Constructor Description EnumStringifier()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description E
fromString(String str)
Convert the string back to a thingvoid
init(ObjectifyFactory fact, Type keyType)
Informs the stringifier of the actual key type.String
toString(E obj)
Convert the thing to a string
-
-
-
Method Detail
-
init
public void init(ObjectifyFactory fact, Type keyType)
Description copied from interface:InitializeStringifier
Informs the stringifier of the actual key type.- Specified by:
init
in interfaceInitializeStringifier
- Parameters:
fact
- is just handy to have aroundkeyType
- is the declared type of the map key.
-
toString
public String toString(E obj)
Description copied from interface:Stringifier
Convert the thing to a string- Specified by:
toString
in interfaceStringifier<E extends Enum>
-
fromString
public E fromString(String str)
Description copied from interface:Stringifier
Convert the string back to a thing- Specified by:
fromString
in interfaceStringifier<E extends Enum>
-
-