Package com.datastax.driver.core
Class Token
- java.lang.Object
-
- com.datastax.driver.core.Token
-
- All Implemented Interfaces:
Comparable<Token>
public abstract class Token extends Object implements Comparable<Token>
A token on the Cassandra ring.
-
-
Constructor Summary
Constructors Constructor Description Token()
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract DataTypegetType()Returns the data type of this token's value.abstract ObjectgetValue()Returns the raw value of this token.abstract ByteBufferserialize(ProtocolVersion protocolVersion)Returns the serialized form of the current token, using the appropriate codec depending on the partitioner in use and the CQL datatype for the token.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.Comparable
compareTo
-
-
-
-
Method Detail
-
getType
public abstract DataType getType()
Returns the data type of this token's value.- Returns:
- the datatype.
-
getValue
public abstract Object getValue()
Returns the raw value of this token.- Returns:
- the value.
-
serialize
public abstract ByteBuffer serialize(ProtocolVersion protocolVersion)
Returns the serialized form of the current token, using the appropriate codec depending on the partitioner in use and the CQL datatype for the token.- Parameters:
protocolVersion- the protocol version in use.- Returns:
- the serialized form of the current token
-
-