me.prettyprint.cassandra.serializers
Class DateSerializer

java.lang.Object
  extended by me.prettyprint.cassandra.serializers.AbstractSerializer<Date>
      extended by me.prettyprint.cassandra.serializers.DateSerializer
All Implemented Interfaces:
Serializer<Date>

public final class DateSerializer
extends AbstractSerializer<Date>

Converts bytes to Date and vice versa, by first converting the Date to or from a long which represents the specified number of milliseconds since the standard base time known as "the Unix epoch", that is January 1, 1970, 00:00:00 UTC.

Author:
Jim Ancona
See Also:
Date

Constructor Summary
DateSerializer()
           
 
Method Summary
 Date fromByteBuffer(ByteBuffer bytes)
          Extract an object of type T from the bytes.
static DateSerializer get()
           
 ByteBuffer toByteBuffer(Date obj)
          Extract bytes from the obj of type T
 
Methods inherited from class me.prettyprint.cassandra.serializers.AbstractSerializer
computeInitialHashSize, fromBytes, fromBytesList, fromBytesMap, fromBytesSet, getComparatorType, toBytes, toBytesList, toBytesMap, toBytesSet
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DateSerializer

public DateSerializer()
Method Detail

get

public static DateSerializer get()

toByteBuffer

public ByteBuffer toByteBuffer(Date obj)
Description copied from interface: Serializer
Extract bytes from the obj of type T

Specified by:
toByteBuffer in interface Serializer<Date>
Specified by:
toByteBuffer in class AbstractSerializer<Date>
Returns:

fromByteBuffer

public Date fromByteBuffer(ByteBuffer bytes)
Description copied from interface: Serializer
Extract an object of type T from the bytes.

Specified by:
fromByteBuffer in interface Serializer<Date>
Specified by:
fromByteBuffer in class AbstractSerializer<Date>
Returns:


Copyright © 2011. All Rights Reserved.