public class LocalDateTimeCodec extends TypeCodec<LocalDateTime>
TypeCodec that maps LocalDateTime to CQL timestamp, allowing
the setting and retrieval of timestamp columns as LocalDateTime
instances.
IMPORTANT
1) The default timestamp formatter used by this codec produces CQL literals that may include milliseconds. This literal format is incompatible with Cassandra < 2.0.9.
2) Even if the ISO-8601 standard accepts timestamps with nanosecond precision, Cassandra
timestamps have millisecond precision; therefore, any sub-millisecond value set on a LocalDateTime will be lost when persisted to Cassandra.
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 LocalDateTimeCodec |
instance |
| Modifier and Type | Method and Description |
|---|---|
LocalDateTime |
deserialize(ByteBuffer bytes,
ProtocolVersion protocolVersion) |
String |
format(LocalDateTime value) |
LocalDateTime |
parse(String value) |
ByteBuffer |
serialize(LocalDateTime 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 LocalDateTimeCodec instance
public ByteBuffer serialize(LocalDateTime value, ProtocolVersion protocolVersion)
serialize in class TypeCodec<LocalDateTime>public LocalDateTime deserialize(ByteBuffer bytes, ProtocolVersion protocolVersion)
deserialize in class TypeCodec<LocalDateTime>public String format(LocalDateTime value)
format in class TypeCodec<LocalDateTime>public LocalDateTime parse(String value)
parse in class TypeCodec<LocalDateTime>Copyright © 2012–2018. All rights reserved.