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.Byte
decode(UTF8FaunaParser parser)
Decodes aByte
from the parser.void
encode(UTF8FaunaGenerator gen, java.lang.Byte obj)
Encodes aByte
value 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 aByte
from the parser.- Parameters:
parser
- the parser to read from- Returns:
- the decoded
Byte
value, 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 aByte
value to the generator.- Parameters:
gen
- the generator to write toobj
- theByte
value to encode- Throws:
CodecException
- if encoding fails
-
getCodecClass
public java.lang.Class<java.lang.Byte> getCodecClass()
Returns the class type this codec supports.- Returns:
Byte
class
-
getSupportedTypes
public FaunaType[] getSupportedTypes()
Returns the Fauna types this codec supports.- Returns:
- supported Fauna types
-
-