Class ArrayTranslatorFactory
java.lang.Object
com.googlecode.objectify.impl.translate.ArrayTranslatorFactory
- All Implemented Interfaces:
TranslatorFactory<Object,Collection<Object>>
public class ArrayTranslatorFactory extends Object implements TranslatorFactory<Object,Collection<Object>>
Translator which can load an array of things.
Note that empty or null arrays are not stored in the datastore, and null values for the array field are ignored when they are loaded from the Entity. This is because the datastore doesn't store empty collections, and storing null fields will confuse filtering for actual nulls in the array contents.
The reason the generic P type of this factory is Object instead of Object[] is that Object[] is incompatible with the primitive arrays. This factory handles primitives as well.
- Author:
- Jeff Schnitzer
- See Also:
CollectionTranslatorFactory
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncreate(TypeKey<Object> tk, CreateContext ctx, Path path)
Create a translator for a type.
-
Constructor Details
-
ArrayTranslatorFactory
public ArrayTranslatorFactory()
-
-
Method Details
-
create
public Translator<Object,Collection<Object>> create(TypeKey<Object> tk, CreateContext ctx, Path path)Description copied from interface:TranslatorFactory
Create a translator for a type.- Specified by:
create
in interfaceTranslatorFactory<Object,Collection<Object>>
- Parameters:
tk
- defines the type which is to be translatedpath
- is where this type was discovered, important for logging and exceptions- Returns:
- null if this factory does not know how to deal with that situation.
-