public abstract class ProjectionSafeTranslator<P,D> extends NullSafeTranslator<P,D>
Watches out for RawValue and performs the necessary conversion if we get one. This will happen during projection queries.
Constructor and Description |
---|
ProjectionSafeTranslator(Class<? extends D> projectionClass) |
Modifier and Type | Method and Description |
---|---|
protected P |
loadSafe(D value,
LoadContext ctx,
Path path)
Implement this, returning a proper translated value
|
protected abstract P |
loadSafe2(D value,
LoadContext ctx,
Path path)
Decode from a property value as stored in the datastore to a type that will be stored in a pojo.
|
load, save, saveSafe
protected final P loadSafe(D value, LoadContext ctx, Path path) throws SkipException
NullSafeTranslator
loadSafe
in class NullSafeTranslator<P,D>
value
- will never be nullSkipException
protected abstract P loadSafe2(D value, LoadContext ctx, Path path) throws SkipException
value
- will not be null and will not be RawValueSkipException
- if this field subtree should be skippedCopyright © 2016. All rights reserved.