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 DoubleCodecSINGLETON
-
Constructor Summary
Constructors Constructor Description DoubleCodec()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Doubledecode(UTF8FaunaParser parser)Decodes aDoublevalue from the Fauna tagged data format.voidencode(UTF8FaunaGenerator gen, java.lang.Double obj)Encodes aDoublevalue 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 aDoublevalue from the Fauna tagged data format.- Parameters:
parser- The parser instance for reading Fauna tagged format data.- Returns:
- The decoded
Doublevalue ornullif 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 aDoublevalue to Fauna's tagged data format.- Parameters:
gen- The generator used to write Fauna tagged format data.obj- TheDoublevalue to encode, ornullto write aNULLvalue.- 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.
-
-