Class TimestampType
- java.lang.Object
-
- org.apache.cassandra.spark.common.schema.TimestampType
-
- All Implemented Interfaces:
java.io.Serializable,ColumnType<java.util.Date>
public class TimestampType extends java.lang.Object implements ColumnType<java.util.Date>
Provides functionality to convertByteBuffers to aDatecolumn type and to serializeDatetypes toByteBuffers- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static intTYPE_SIZE
-
Constructor Summary
Constructors Constructor Description TimestampType()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.DateparseColumn(java.nio.ByteBuffer buffer, int length)Parses a value of this type from buffer.java.nio.ByteBufferserialize(java.util.Date value)SerializeDateinto ByteBuffer and keeps the position at beginning of ByteBuffer
-
-
-
Field Detail
-
TYPE_SIZE
public static final int TYPE_SIZE
- See Also:
- Constant Field Values
-
-
Method Detail
-
parseColumn
public java.util.Date parseColumn(java.nio.ByteBuffer buffer, int length)Parses a value of this type from buffer. Value will be parsed from current position of the buffer. After completion of the function, position will be moved by "length" bytes.- Specified by:
parseColumnin interfaceColumnType<java.util.Date>- Parameters:
buffer- Buffer to parse column fromlength- Serialized value size in buffer is as big as length- Returns:
- value as
Datetype
-
serialize
public java.nio.ByteBuffer serialize(java.util.Date value)
SerializeDateinto ByteBuffer and keeps the position at beginning of ByteBuffer- Specified by:
serializein interfaceColumnType<java.util.Date>- Parameters:
value- the value to serialize- Returns:
- A ByteBuffer containing the serialized value
-
-