public static class TypeCodec.TimeUUIDCodec extends TypeCodec.AbstractUUIDCodec
DataType.timeuuid()
to a Java UUID
.TypeCodec.AbstractUUIDCodec, TypeCodec.AsciiCodec, TypeCodec.BigintCodec, TypeCodec.BlobCodec, TypeCodec.BooleanCodec, TypeCodec.CollectionCodec<E,C extends Collection<E>>, TypeCodec.CounterCodec, TypeCodec.CustomCodec, TypeCodec.DateCodec, TypeCodec.DecimalCodec, TypeCodec.DoubleCodec, TypeCodec.EnumIntCodec<E extends Enum<E>>, TypeCodec.EnumStringCodec<E extends Enum<E>>, TypeCodec.FloatCodec, TypeCodec.InetCodec, TypeCodec.IntCodec, TypeCodec.ListCodec<T>, TypeCodec.LongCodec, TypeCodec.MapCodec<K,V>, TypeCodec.MappingCodec<T,U>, TypeCodec.PrimitiveBooleanCodec, TypeCodec.PrimitiveByteCodec, TypeCodec.PrimitiveDoubleCodec, TypeCodec.PrimitiveFloatCodec, TypeCodec.PrimitiveIntCodec, TypeCodec.PrimitiveLongCodec, TypeCodec.PrimitiveShortCodec, TypeCodec.SetCodec<T>, TypeCodec.SmallIntCodec, TypeCodec.StringCodec, TypeCodec.StringParsingCodec<T>, TypeCodec.TimeCodec, TypeCodec.TimestampCodec, TypeCodec.TimeUUIDCodec, TypeCodec.TinyIntCodec, TypeCodec.TupleCodec, TypeCodec.UDTCodec, TypeCodec.UUIDCodec, TypeCodec.VarcharCodec, TypeCodec.VarintCodec
Modifier and Type | Field and Description |
---|---|
static TypeCodec.TimeUUIDCodec |
instance |
Modifier and Type | Method and Description |
---|---|
boolean |
accepts(Object value)
Return
true if this codec is capable of serializing
the given object. |
String |
format(UUID value)
Format the given value as a valid CQL literal according
to the CQL type handled by this codec.
|
ByteBuffer |
serialize(UUID value,
ProtocolVersion protocolVersion)
Serialize the given value according to the CQL type
handled by this codec.
|
deserialize, parse
accepts, accepts, equals, getCqlType, getJavaType, hashCode, toString
public static final TypeCodec.TimeUUIDCodec instance
public boolean accepts(Object value)
TypeCodec
true
if this codec is capable of serializing
the given object. Note that the object's Java type is inferred
from the object' runtime (raw) type, contrary
to TypeCodec.accepts(TypeToken)
which is capable of
handling generic types.
This method is intended mostly to be used by the QueryBuilder when no type information is available when the codec is used.
Implementation notes:
TypeCodec.TimeUUIDCodec
or TypeCodec.AsciiCodec
, must override
this method and manually inspect the object to check if it
complies or not with the codec's limitations.public String format(UUID value)
TypeCodec
"NULL"
for null
inputs.format
in class TypeCodec.AbstractUUIDCodec
value
- An instance of T; may be null
.public ByteBuffer serialize(UUID value, ProtocolVersion protocolVersion)
TypeCodec
Implementation notes:
null
input as
the equivalent of an empty collection.serialize
in class TypeCodec.AbstractUUIDCodec
value
- An instance of T; may be null
.protocolVersion
- the protocol version to use when serializing
bytes
. In most cases, the proper value to provide for this argument
is the value returned by ProtocolOptions.getProtocolVersion()
(which
is the protocol version in use by the driver).ByteBuffer
instance containing the serialized form of TCopyright © 2012–2015. All rights reserved.