Package com.fauna.codec.codecs
Class BaseCodec<T>
- java.lang.Object
-
- com.fauna.codec.codecs.BaseCodec<T>
-
- Type Parameters:
T
- the type this codec can encode or decode.
- All Implemented Interfaces:
Codec<T>
- Direct Known Subclasses:
BaseDocumentCodec
,BaseRefCodec
,BoolCodec
,ByteArrayCodec
,ByteCodec
,CharCodec
,ClassCodec
,DoubleCodec
,DynamicCodec
,EnumCodec
,EventSourceCodec
,FloatCodec
,InstantCodec
,IntCodec
,ListCodec
,LocalDateCodec
,LongCodec
,MapCodec
,ModuleCodec
,NullableDocumentCodec
,OptionalCodec
,PageCodec
,QueryArrCodec
,QueryCodec
,QueryLiteralCodec
,QueryObjCodec
,QueryValCodec
,ShortCodec
,StringCodec
public abstract class BaseCodec<T> extends java.lang.Object implements Codec<T>
Abstract base class for implementing codecs to handle encoding and decoding operations for specific types.
-
-
Field Summary
Fields Modifier and Type Field Description static java.util.Set<java.lang.String>
TAGS
Set of known tag identifiers for Fauna's tagged data format.
-
Constructor Summary
Constructors Constructor Description BaseCodec()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.String
unexpectedTokenExceptionMessage(FaunaTokenType token)
Returns a formatted message indicating an unexpected token encountered during decoding.protected java.lang.String
unexpectedTypeWhileDecoding(java.lang.reflect.Type type)
Returns a formatted message indicating an unexpected Java type encountered during decoding.protected java.lang.String
unsupportedTypeDecodingMessage(FaunaType type, FaunaType[] supportedTypes)
Returns a formatted message indicating an unsupported Fauna type encountered during decoding.protected java.lang.String
unsupportedTypeMessage(java.lang.reflect.Type type)
Returns a formatted message indicating an unsupported Java type encountered during encoding.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.fauna.codec.Codec
decode, encode, getCodecClass, getSupportedTypes
-
-
-
-
Method Detail
-
unexpectedTokenExceptionMessage
protected java.lang.String unexpectedTokenExceptionMessage(FaunaTokenType token)
Returns a formatted message indicating an unexpected token encountered during decoding.- Parameters:
token
- the unexpected token type encountered.- Returns:
- a formatted message string.
-
unsupportedTypeDecodingMessage
protected java.lang.String unsupportedTypeDecodingMessage(FaunaType type, FaunaType[] supportedTypes)
Returns a formatted message indicating an unsupported Fauna type encountered during decoding.- Parameters:
type
- the Fauna type encountered.supportedTypes
- an array of supported Fauna types for this codec.- Returns:
- a formatted message string.
-
unexpectedTypeWhileDecoding
protected java.lang.String unexpectedTypeWhileDecoding(java.lang.reflect.Type type)
Returns a formatted message indicating an unexpected Java type encountered during decoding.- Parameters:
type
- the unexpected Java type encountered.- Returns:
- a formatted message string.
-
unsupportedTypeMessage
protected java.lang.String unsupportedTypeMessage(java.lang.reflect.Type type)
Returns a formatted message indicating an unsupported Java type encountered during encoding.- Parameters:
type
- the unsupported Java type encountered.- Returns:
- a formatted message string.
-
-