Package com.fauna.codec.codecs
Class DoubleCodec
- java.lang.Object
-
- com.fauna.codec.codecs.BaseCodec<java.lang.Double>
-
- com.fauna.codec.codecs.DoubleCodec
-
-
Field Summary
Fields Modifier and Type Field Description static DoubleCodec
SINGLETON
-
Constructor Summary
Constructors Constructor Description DoubleCodec()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Double
decode(UTF8FaunaParser parser)
Decodes aDouble
value from the Fauna tagged data format.void
encode(UTF8FaunaGenerator gen, java.lang.Double obj)
Encodes aDouble
value to Fauna's tagged data format.java.lang.Class<java.lang.Double>
getCodecClass()
Returns the class of the codec, which isDouble
.FaunaType[]
getSupportedTypes()
Returns the Fauna types supported by this codec.-
Methods inherited from class com.fauna.codec.codecs.BaseCodec
unexpectedTokenExceptionMessage, unexpectedTypeWhileDecoding, unsupportedTypeDecodingMessage, unsupportedTypeMessage
-
-
-
-
Field Detail
-
SINGLETON
public static final DoubleCodec SINGLETON
-
-
Method Detail
-
decode
public java.lang.Double decode(UTF8FaunaParser parser) throws CodecException
Decodes aDouble
value from the Fauna tagged data format.- Parameters:
parser
- The parser instance for reading Fauna tagged format data.- Returns:
- The decoded
Double
value ornull
if the token isNULL
. - Throws:
CodecException
- If the token type is unsupported for decoding aDouble
.
-
encode
public void encode(UTF8FaunaGenerator gen, java.lang.Double obj) throws CodecException
Encodes aDouble
value to Fauna's tagged data format.- Parameters:
gen
- The generator used to write Fauna tagged format data.obj
- TheDouble
value to encode, ornull
to write aNULL
value.- Throws:
CodecException
- If encoding fails.
-
getCodecClass
public java.lang.Class<java.lang.Double> getCodecClass()
Returns the class of the codec, which isDouble
.- Returns:
Double.class
.
-
-