public abstract static class TypeCodec.LongCodec extends TypeCodec<Long> implements TypeCodec.PrimitiveLongCodec
DataType.bigint()
,
DataType.counter()
or DataType.time()
.TypeCodec.AbstractUUIDCodec, TypeCodec.AsciiCodec, TypeCodec.BigintCodec, TypeCodec.BlobCodec, TypeCodec.BooleanCodec, TypeCodec.CollectionCodec<E,C extends Collection<E>>, TypeCodec.CounterCodec, TypeCodec.CustomCodec, TypeCodec.DateCodec, TypeCodec.DecimalCodec, TypeCodec.DoubleCodec, TypeCodec.EnumIntCodec<E extends Enum<E>>, TypeCodec.EnumStringCodec<E extends Enum<E>>, TypeCodec.FloatCodec, TypeCodec.InetCodec, TypeCodec.IntCodec, TypeCodec.ListCodec<T>, TypeCodec.LongCodec, TypeCodec.MapCodec<K,V>, TypeCodec.MappingCodec<T,U>, TypeCodec.PrimitiveBooleanCodec, TypeCodec.PrimitiveByteCodec, TypeCodec.PrimitiveDoubleCodec, TypeCodec.PrimitiveFloatCodec, TypeCodec.PrimitiveIntCodec, TypeCodec.PrimitiveLongCodec, TypeCodec.PrimitiveShortCodec, TypeCodec.SetCodec<T>, TypeCodec.SmallIntCodec, TypeCodec.StringCodec, TypeCodec.StringParsingCodec<T>, TypeCodec.TimeCodec, TypeCodec.TimestampCodec, TypeCodec.TimeUUIDCodec, TypeCodec.TinyIntCodec, TypeCodec.TupleCodec, TypeCodec.UDTCodec, TypeCodec.UUIDCodec, TypeCodec.VarcharCodec, TypeCodec.VarintCodec
Modifier and Type | Method and Description |
---|---|
Long |
deserialize(ByteBuffer bytes,
ProtocolVersion protocolVersion)
Deserialize the given
ByteBuffer instance according to the CQL type
handled by this codec. |
long |
deserializeNoBoxing(ByteBuffer bytes,
ProtocolVersion protocolVersion) |
String |
format(Long value)
Format the given value as a valid CQL literal according
to the CQL type handled by this codec.
|
Long |
parse(String value)
Parse the given CQL literal into an instance of the Java type
handled by this codec.
|
ByteBuffer |
serialize(Long value,
ProtocolVersion protocolVersion)
Serialize the given value according to the CQL type
handled by this codec.
|
ByteBuffer |
serializeNoBoxing(long value,
ProtocolVersion protocolVersion) |
accepts, accepts, accepts, equals, getCqlType, getJavaType, hashCode, toString
public LongCodec(DataType cqlType)
public Long parse(String value)
TypeCodec
"NULL"
;
in most cases, implementations should interpret these inputs has equivalent to a null
reference.public String format(Long value)
TypeCodec
"NULL"
for null
inputs.public ByteBuffer serialize(Long value, ProtocolVersion protocolVersion)
TypeCodec
Implementation notes:
null
input as
the equivalent of an empty collection.serialize
in class TypeCodec<Long>
value
- An instance of T; may be null
.protocolVersion
- the protocol version to use when serializing
bytes
. In most cases, the proper value to provide for this argument
is the value returned by ProtocolOptions.getProtocolVersion()
(which
is the protocol version in use by the driver).ByteBuffer
instance containing the serialized form of Tpublic ByteBuffer serializeNoBoxing(long value, ProtocolVersion protocolVersion)
serializeNoBoxing
in interface TypeCodec.PrimitiveLongCodec
public Long deserialize(ByteBuffer bytes, ProtocolVersion protocolVersion)
TypeCodec
ByteBuffer
instance according to the CQL type
handled by this codec.
Implementation notes:
null
or a default value for the corresponding Java type, if applicable;null
;
they should return empty collections instead.deserialize
in class TypeCodec<Long>
bytes
- A ByteBuffer
instance containing the serialized form of T;
may be null
or empty.protocolVersion
- the protocol version to use when serializing
bytes
. In most cases, the proper value to provide for this argument
is the value returned by ProtocolOptions.getProtocolVersion()
(which
is the protocol version in use by the driver).public long deserializeNoBoxing(ByteBuffer bytes, ProtocolVersion protocolVersion)
deserializeNoBoxing
in interface TypeCodec.PrimitiveLongCodec
Copyright © 2012–2015. All rights reserved.