public class InstantCodec extends TypeCodec<Instant>
TypeCodec that maps Instant to CQL timestamp allowing the
setting and retrieval of timestamp columns as Instant instances.
Since C* timestamp columns do not preserve timezones any attached timezone
information will be lost.
IMPORTANT: this codec's format method
formats timestamps using an ISO-8601 format that includes milliseconds. This format is
incompatible with Cassandra versions < 2.0.9.
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 InstantCodec |
instance |
| Modifier and Type | Method and Description |
|---|---|
Instant |
deserialize(ByteBuffer bytes,
ProtocolVersion protocolVersion) |
String |
format(Instant value) |
Instant |
parse(String value) |
ByteBuffer |
serialize(Instant value,
ProtocolVersion protocolVersion) |
accepts, accepts, accepts, accepts, ascii, bigint, blob, cboolean, cdouble, cfloat, cint, counter, custom, date, decimal, duration, getCqlType, getJavaType, inet, list, map, set, smallInt, time, timestamp, timeUUID, tinyInt, toString, tuple, userType, uuid, varchar, varintpublic static final InstantCodec instance
public ByteBuffer serialize(Instant value, ProtocolVersion protocolVersion)
public Instant deserialize(ByteBuffer bytes, ProtocolVersion protocolVersion)
deserialize in class TypeCodec<Instant>Copyright © 2012–2018. All rights reserved.