public abstract static class TypeCodec.PrimitiveIntCodec extends TypeCodec<Integer>
TypeCodec.AbstractCollectionCodec<E,C extends Collection<E>>, TypeCodec.AbstractMapCodec<K,V>, TypeCodec.AbstractTupleCodec<T>, TypeCodec.AbstractUDTCodec<T>, TypeCodec.PrimitiveBooleanCodec, TypeCodec.PrimitiveByteCodec, TypeCodec.PrimitiveDoubleCodec, TypeCodec.PrimitiveFloatCodec, TypeCodec.PrimitiveIntCodec, TypeCodec.PrimitiveLongCodec, TypeCodec.PrimitiveShortCodec
Modifier | Constructor and Description |
---|---|
protected |
PrimitiveIntCodec(DataType cqlType) |
Modifier and Type | Method and Description |
---|---|
Integer |
deserialize(ByteBuffer bytes,
ProtocolVersion protocolVersion)
Deserialize the given
ByteBuffer instance according to the CQL type
handled by this codec. |
abstract int |
deserializeNoBoxing(ByteBuffer v,
ProtocolVersion protocolVersion) |
ByteBuffer |
serialize(Integer value,
ProtocolVersion protocolVersion)
Serialize the given value according to the CQL type
handled by this codec.
|
abstract ByteBuffer |
serializeNoBoxing(int v,
ProtocolVersion protocolVersion) |
accepts, accepts, accepts, accepts, ascii, bigint, blob, cboolean, cdouble, cfloat, cint, counter, custom, date, decimal, duration, format, getCqlType, getJavaType, inet, list, map, parse, set, smallInt, time, timestamp, timeUUID, tinyInt, toString, tuple, userType, uuid, varchar, varint
protected PrimitiveIntCodec(DataType cqlType)
public abstract ByteBuffer serializeNoBoxing(int v, ProtocolVersion protocolVersion)
public abstract int deserializeNoBoxing(ByteBuffer v, ProtocolVersion protocolVersion)
public ByteBuffer serialize(Integer value, ProtocolVersion protocolVersion)
TypeCodec
null
input as
the equivalent of an empty collection.serialize
in class TypeCodec<Integer>
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 Integer 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 (the driver's default collection codecs all comply with this rule).ByteBuffer
should never be consumed by read operations that
modify its current position; if necessary,
ByteBuffer.duplicate()
duplicate} it before consuming.deserialize
in class TypeCodec<Integer>
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).Copyright © 2012–2018. All rights reserved.