Package org.apache.cassandra.serializers
Class TimestampSerializer
- java.lang.Object
-
- org.apache.cassandra.serializers.TypeSerializer<java.util.Date>
-
- org.apache.cassandra.serializers.TimestampSerializer
-
public class TimestampSerializer extends TypeSerializer<java.util.Date>
-
-
Field Summary
Fields Modifier and Type Field Description static TimestampSerializer
instance
-
Constructor Summary
Constructors Constructor Description TimestampSerializer()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static long
dateStringToTimestamp(java.lang.String source)
<V> java.util.Date
deserialize(V value, ValueAccessor<V> accessor)
static java.text.Format
getJsonDateFormatter()
java.lang.Class<java.util.Date>
getType()
java.nio.ByteBuffer
serialize(java.util.Date value)
boolean
shouldQuoteCQLLiterals()
protected java.lang.String
toCQLLiteralNonNull(java.nio.ByteBuffer buffer)
java.lang.String
toString(java.util.Date value)
java.lang.String
toStringUTC(java.util.Date value)
<V> void
validate(V value, ValueAccessor<V> accessor)
-
Methods inherited from class org.apache.cassandra.serializers.TypeSerializer
deserialize, isNull, isNull, toCQLLiteral, toCQLLiteralNoQuote, validate
-
-
-
-
Field Detail
-
instance
public static final TimestampSerializer instance
-
-
Method Detail
-
deserialize
public <V> java.util.Date deserialize(V value, ValueAccessor<V> accessor)
- Specified by:
deserialize
in classTypeSerializer<java.util.Date>
-
serialize
public java.nio.ByteBuffer serialize(java.util.Date value)
- Specified by:
serialize
in classTypeSerializer<java.util.Date>
-
dateStringToTimestamp
public static long dateStringToTimestamp(java.lang.String source) throws MarshalException
- Throws:
MarshalException
-
getJsonDateFormatter
public static java.text.Format getJsonDateFormatter()
-
validate
public <V> void validate(V value, ValueAccessor<V> accessor) throws MarshalException
- Specified by:
validate
in classTypeSerializer<java.util.Date>
- Throws:
MarshalException
-
toString
public java.lang.String toString(java.util.Date value)
- Specified by:
toString
in classTypeSerializer<java.util.Date>
-
toStringUTC
public java.lang.String toStringUTC(java.util.Date value)
-
getType
public java.lang.Class<java.util.Date> getType()
- Specified by:
getType
in classTypeSerializer<java.util.Date>
-
shouldQuoteCQLLiterals
public boolean shouldQuoteCQLLiterals()
- Overrides:
shouldQuoteCQLLiterals
in classTypeSerializer<java.util.Date>
-
toCQLLiteralNonNull
protected java.lang.String toCQLLiteralNonNull(java.nio.ByteBuffer buffer)
- Overrides:
toCQLLiteralNonNull
in classTypeSerializer<java.util.Date>
-
-