Class TranslatorRecycles<P,D>
java.lang.Object
com.googlecode.objectify.impl.translate.TranslatorRecycles<P,D>
- All Implemented Interfaces:
Recycles
,Translator<P,
D>
Combines Translator with Recycles, useful so that we can create anonymous classes.
Skips if the loaded value is the same as into; this means we won't need to modify potentially
final fields.
- Author:
- Jeff Schnitzer
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal P
load
(com.google.cloud.datastore.Value<D> node, LoadContext ctx, Path path) Loads the content of the specified datastore node, returning the pojo equivalent.protected abstract P
loadInto
(com.google.cloud.datastore.Value<D> node, LoadContext ctx, Path path, P into) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.googlecode.objectify.impl.translate.Translator
save
-
Constructor Details
-
TranslatorRecycles
public TranslatorRecycles()
-
-
Method Details
-
load
public final P load(com.google.cloud.datastore.Value<D> node, LoadContext ctx, Path path) throws SkipException Description copied from interface:Translator
Loads the content of the specified datastore node, returning the pojo equivalent.
There is one special return value: If a Resultinvalid input: '<'?> is returned, the content of the Result will be used instead, but delayed until ctx.done() is called. This happens at the end of a "round" of load operations and is the magic trick that makes populating entity references work efficiently.
- Specified by:
load
in interfaceTranslator<P,
D> - Parameters:
node
- is the part of the native datastore entity tree we are transforming.ctx
- holds state information during an entity load.path
- is the current path to this translator- Returns:
- an assembled pojo corresponding to the node subtree; if null is returned, that is the real value!
- Throws:
SkipException
- if the return value should be abandoned.- See Also:
-
loadInto
protected abstract P loadInto(com.google.cloud.datastore.Value<D> node, LoadContext ctx, Path path, P into)
-