Package com.fauna.codec.codecs
Class CharCodec
- java.lang.Object
-
- com.fauna.codec.codecs.BaseCodec<java.lang.Character>
-
- com.fauna.codec.codecs.CharCodec
-
-
Constructor Summary
Constructors Constructor Description CharCodec()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Character
decode(UTF8FaunaParser parser)
Decodes aCharacter
from the parser.void
encode(UTF8FaunaGenerator gen, java.lang.Character obj)
Encodes aCharacter
value to the generator.java.lang.Class<java.lang.Character>
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 CharCodec SINGLETON
-
-
Method Detail
-
decode
public java.lang.Character decode(UTF8FaunaParser parser) throws CodecException
Decodes aCharacter
from the parser.- Parameters:
parser
- the parser to read from- Returns:
- the decoded
Character
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.Character obj) throws CodecException
Encodes aCharacter
value to the generator.- Parameters:
gen
- the generator to write toobj
- theCharacter
value to encode- Throws:
CodecException
- if encoding fails
-
getCodecClass
public java.lang.Class<java.lang.Character> getCodecClass()
Returns the class type this codec supports.- Returns:
Character
class
-
getSupportedTypes
public FaunaType[] getSupportedTypes()
Returns the Fauna types this codec supports.- Returns:
- supported Fauna types
-
-