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.Characterdecode(UTF8FaunaParser parser)Decodes aCharacterfrom the parser.voidencode(UTF8FaunaGenerator gen, java.lang.Character obj)Encodes aCharactervalue 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 aCharacterfrom the parser.- Parameters:
parser- the parser to read from- Returns:
- the decoded
Charactervalue, 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 aCharactervalue to the generator.- Parameters:
gen- the generator to write toobj- theCharactervalue to encode- Throws:
CodecException- if encoding fails
-
getCodecClass
public java.lang.Class<java.lang.Character> getCodecClass()
Returns the class type this codec supports.- Returns:
Characterclass
-
getSupportedTypes
public FaunaType[] getSupportedTypes()
Returns the Fauna types this codec supports.- Returns:
- supported Fauna types
-
-