public class SimpleTimestampCodec
extends com.datastax.driver.core.TypeCodec.PrimitiveLongCodec
TypeCodec that maps CQL timestamps to Java primitive longs,
representing the number of milliseconds since the Epoch.
This codec can serve as a replacement for the driver's built-in
timestamp codec,
when application code prefers to deal with raw milliseconds than with
Date instances.com.datastax.driver.core.TypeCodec.AbstractCollectionCodec<E,C extends Collection<E>>, com.datastax.driver.core.TypeCodec.AbstractMapCodec<K,V>, com.datastax.driver.core.TypeCodec.AbstractTupleCodec<T>, com.datastax.driver.core.TypeCodec.AbstractUDTCodec<T>, com.datastax.driver.core.TypeCodec.PrimitiveBooleanCodec, com.datastax.driver.core.TypeCodec.PrimitiveByteCodec, com.datastax.driver.core.TypeCodec.PrimitiveDoubleCodec, com.datastax.driver.core.TypeCodec.PrimitiveFloatCodec, com.datastax.driver.core.TypeCodec.PrimitiveIntCodec, com.datastax.driver.core.TypeCodec.PrimitiveLongCodec, com.datastax.driver.core.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,
com.datastax.driver.core.ProtocolVersion protocolVersion) |
String |
format(Long value) |
Long |
parse(String value) |
ByteBuffer |
serializeNoBoxing(long value,
com.datastax.driver.core.ProtocolVersion protocolVersion) |
deserialize, serializeaccepts, 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, varintpublic static final SimpleTimestampCodec instance
public ByteBuffer serializeNoBoxing(long value, com.datastax.driver.core.ProtocolVersion protocolVersion)
serializeNoBoxing in class com.datastax.driver.core.TypeCodec.PrimitiveLongCodecpublic long deserializeNoBoxing(ByteBuffer bytes, com.datastax.driver.core.ProtocolVersion protocolVersion)
deserializeNoBoxing in class com.datastax.driver.core.TypeCodec.PrimitiveLongCodecpublic Long parse(String value)
parse in class com.datastax.driver.core.TypeCodec<Long>Copyright © 2012–2018. All rights reserved.