public class NumberTranslatorFactory extends Object implements TranslatorFactory<Number,Object>
Numbers are funky in the datastore. You can save numbers of any size, but they always retrieve as Long. For the hell of it, we also handle String in the datastore by trying to parse it.
Not a ValueTranslatorFactory because Numbers are not assignable to primitives. Java lame.
Constructor and Description |
---|
NumberTranslatorFactory() |
Modifier and Type | Method and Description |
---|---|
Translator<Number,Object> |
create(TypeKey<Number> tk,
CreateContext ctx,
Path path)
Create a translator for a type.
|
public Translator<Number,Object> create(TypeKey<Number> tk, CreateContext ctx, Path path)
TranslatorFactory
create
in interface TranslatorFactory<Number,Object>
tk
- defines the type which is to be translatedpath
- is where this type was discovered, important for logging and exceptionsCopyright © 2017. All rights reserved.