Package com.fauna.codec.codecs
Class ByteCodec
- java.lang.Object
-
- com.fauna.codec.codecs.BaseCodec<java.lang.Byte>
-
- com.fauna.codec.codecs.ByteCodec
-
-
Constructor Summary
Constructors Constructor Description ByteCodec()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Bytedecode(UTF8FaunaParser parser)Decodes aBytefrom the parser.voidencode(UTF8FaunaGenerator gen, java.lang.Byte obj)Encodes aBytevalue to the generator.java.lang.Class<java.lang.Byte>getCodecClass()Returns the class type this codec supports.FaunaType[]getSupportedTypes()Returns the Fauna types this codec supports.-
Methods inherited from class com.fauna.codec.codecs.BaseCodec
unexpectedTokenExceptionMessage, unexpectedTypeWhileDecoding, unsupportedTypeDecodingMessage, unsupportedTypeMessage
-
-
-
-
Field Detail
-
SINGLETON
public static final ByteCodec SINGLETON
-
-
Method Detail
-
decode
public java.lang.Byte decode(UTF8FaunaParser parser) throws CodecException
Decodes aBytefrom the parser.- Parameters:
parser- the parser to read from- Returns:
- the decoded
Bytevalue, or null if the token represents a null value - Throws:
CodecException- if decoding fails due to an unexpected type
-
encode
public void encode(UTF8FaunaGenerator gen, java.lang.Byte obj) throws CodecException
Encodes aBytevalue to the generator.- Parameters:
gen- the generator to write toobj- theBytevalue to encode- Throws:
CodecException- if encoding fails
-
getCodecClass
public java.lang.Class<java.lang.Byte> getCodecClass()
Returns the class type this codec supports.- Returns:
Byteclass
-
getSupportedTypes
public FaunaType[] getSupportedTypes()
Returns the Fauna types this codec supports.- Returns:
- supported Fauna types
-
-