public class SimpleTimestampCodec extends TypeCodec.PrimitiveLongCodec
TypeCodec.AbstractCollectionCodec<E,C extends Collection<E>>, TypeCodec.AbstractMapCodec<K,V>, TypeCodec.AbstractTupleCodec<T>, TypeCodec.AbstractUDTCodec<T>, TypeCodec.PrimitiveBooleanCodec, TypeCodec.PrimitiveByteCodec, TypeCodec.PrimitiveDoubleCodec, TypeCodec.PrimitiveFloatCodec, TypeCodec.PrimitiveIntCodec, TypeCodec.PrimitiveLongCodec, TypeCodec.PrimitiveShortCodec
Modifier and Type | Field and Description |
---|---|
static SimpleTimestampCodec |
instance |
Constructor and Description |
---|
SimpleTimestampCodec() |
Modifier and Type | Method and Description |
---|---|
long |
deserializeNoBoxing(ByteBuffer bytes,
ProtocolVersion protocolVersion) |
String |
format(Long value)
Format the given value as a valid CQL literal according
to the CQL type handled by this codec.
|
Long |
parse(String value)
Parse the given CQL literal into an instance of the Java type
handled by this codec.
|
ByteBuffer |
serializeNoBoxing(long value,
ProtocolVersion protocolVersion) |
deserialize, serialize
accepts, accepts, accepts, accepts, ascii, bigint, blob, cboolean, cdouble, cfloat, cint, counter, custom, date, decimal, getCqlType, getJavaType, inet, list, map, set, smallInt, time, timestamp, timeUUID, tinyInt, toString, tuple, userType, uuid, varchar, varint
public static final SimpleTimestampCodec instance
public ByteBuffer serializeNoBoxing(long value, ProtocolVersion protocolVersion)
serializeNoBoxing
in class TypeCodec.PrimitiveLongCodec
public long deserializeNoBoxing(ByteBuffer bytes, ProtocolVersion protocolVersion)
deserializeNoBoxing
in class TypeCodec.PrimitiveLongCodec
public Long parse(String value)
TypeCodec
"NULL"
;
in most cases, implementations should interpret these inputs has equivalent to a null
reference.
Implementing this method is not strictly mandatory: internally, the driver only uses it to
parse the INITCOND when building the metadata of an aggregate function (and in most cases it
will use a built-in codec, unless the INITCOND has a custom type).public String format(Long value)
TypeCodec
"NULL"
for null
inputs.
Implementing this method is not strictly mandatory. It is used:
BuiltStatement
for a detailed
explanation of when this happens);QueryLogger
, if parameter logging is enabled;AggregateMetadata.asCQLQuery(boolean)
;toString()
implementation of some objects (UDTValue
,
TupleValue
, and the internal representation of a ROWS
response),
which may appear in driver logs.