Class EnumTranslatorFactory<E extends Enum<E>>
java.lang.Object
com.googlecode.objectify.impl.translate.ValueTranslatorFactory<Enum<E>,String>
com.googlecode.objectify.impl.translate.EnumTranslatorFactory<E>
- All Implemented Interfaces:
TranslatorFactory<Enum<E>,String>
public class EnumTranslatorFactory<E extends Enum<E>> extends ValueTranslatorFactory<Enum<E>,String>
Knows how to convert Enums to the datastore String
- Author:
- Jeff Schnitzer
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected ValueTranslator<Enum<E>,String>
createValueTranslator(TypeKey<Enum<E>> tk, CreateContext ctx, Path path)
Create a translator, knowing that we have the appropriate type.Methods inherited from class com.googlecode.objectify.impl.translate.ValueTranslatorFactory
create
-
Constructor Details
-
EnumTranslatorFactory
public EnumTranslatorFactory()
-
-
Method Details
-
createValueTranslator
protected ValueTranslator<Enum<E>,String> createValueTranslator(TypeKey<Enum<E>> tk, CreateContext ctx, Path path)Description copied from class:ValueTranslatorFactory
Create a translator, knowing that we have the appropriate type. You don't need to check for type matching.- Specified by:
createValueTranslator
in classValueTranslatorFactory<Enum<E extends Enum<E>>,String>
- Parameters:
tk
- type is guaranteed to erase to something assignable to Class
-