public class CollectionTranslatorFactory extends Object implements TranslatorFactory<Collection<Object>,Collection<Object>>
Translator which can load things into a collection field. Those things are themselves translated.
This translator is clever about recycling an existing collection in the POJO field when loading. That way a collection that has been initialized with a sort (or other data) will remain intact.
Note that empty or null collections are not stored in the datastore, and null values for the collection 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 collection contents.
Constructor and Description |
---|
CollectionTranslatorFactory() |
Modifier and Type | Method and Description |
---|---|
Translator<Collection<Object>,Collection<Object>> |
create(TypeKey<Collection<Object>> tk,
CreateContext ctx,
Path path)
Create a translator for a type.
|
public Translator<Collection<Object>,Collection<Object>> create(TypeKey<Collection<Object>> tk, CreateContext ctx, Path path)
TranslatorFactory
create
in interface TranslatorFactory<Collection<Object>,Collection<Object>>
tk
- defines the type which is to be translatedpath
- is where this type was discovered, important for logging and exceptionsCopyright © 2015. All rights reserved.