T - The Java primitive array type this codec handlespublic abstract class AbstractPrimitiveArrayCodec<T> extends AbstractArrayCodec<T>
serialize(Object, ProtocolVersion)
and deserialize(ByteBuffer, ProtocolVersion) for primitive arrays.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| Constructor and Description |
|---|
AbstractPrimitiveArrayCodec(DataType.CollectionType cqlType,
Class<T> javaClass) |
| Modifier and Type | Method and Description |
|---|---|
T |
deserialize(ByteBuffer bytes,
ProtocolVersion protocolVersion) |
protected abstract void |
deserializeElement(ByteBuffer input,
T array,
int index,
ProtocolVersion protocolVersion)
Read the
indexth element of array from input. |
ByteBuffer |
serialize(T array,
ProtocolVersion protocolVersion) |
protected abstract void |
serializeElement(ByteBuffer output,
T array,
int index,
ProtocolVersion protocolVersion)
Write the
indexth element of array to output. |
protected abstract int |
sizeOfComponentType()
Return the size in bytes of the array component type.
|
format, formatElement, newInstance, parse, parseElementaccepts, accepts, accepts, accepts, ascii, bigint, blob, cboolean, cdouble, cfloat, cint, counter, custom, date, decimal, duration, getCqlType, getJavaType, inet, list, map, set, smallInt, time, timestamp, timeUUID, tinyInt, toString, tuple, userType, uuid, varchar, varintpublic AbstractPrimitiveArrayCodec(DataType.CollectionType cqlType, Class<T> javaClass)
cqlType - The CQL type. Must be a list type.javaClass - The Java type. Must be an array class.public ByteBuffer serialize(T array, ProtocolVersion protocolVersion) throws InvalidTypeException
serialize in class TypeCodec<T>InvalidTypeExceptionpublic T deserialize(ByteBuffer bytes, ProtocolVersion protocolVersion) throws InvalidTypeException
deserialize in class TypeCodec<T>InvalidTypeExceptionprotected abstract int sizeOfComponentType()
protected abstract void serializeElement(ByteBuffer output, T array, int index, ProtocolVersion protocolVersion)
indexth element of array to output.output - The ByteBuffer to write to.array - The array to read from.index - The element index.protocolVersion - The protocol version to use.protected abstract void deserializeElement(ByteBuffer input, T array, int index, ProtocolVersion protocolVersion)
indexth element of array from input.input - The ByteBuffer to read from.array - The array to write to.index - The element index.protocolVersion - The protocol version to use.Copyright © 2012–2017. All rights reserved.