E - The Java array component type this codec handlespublic class ObjectArrayCodec<E> extends AbstractArrayCodec<E[]>
list<text> to String[],
declare the following:
ObjectArrayCodec<String> stringArrayCodec = new ObjectArrayCodec<>(
DataType.list(DataType.varchar()),
String[].class,
TypeCodec.varchar());
com.datastax.driver.core.TypeCodec.AbstractCollectionCodec<E,C extends Collection<E>>, com.datastax.driver.core.TypeCodec.AbstractMapCodec<K,V>, com.datastax.driver.core.TypeCodec.AbstractTupleCodec<T>, com.datastax.driver.core.TypeCodec.AbstractUDTCodec<T>, com.datastax.driver.core.TypeCodec.PrimitiveBooleanCodec, com.datastax.driver.core.TypeCodec.PrimitiveByteCodec, com.datastax.driver.core.TypeCodec.PrimitiveDoubleCodec, com.datastax.driver.core.TypeCodec.PrimitiveFloatCodec, com.datastax.driver.core.TypeCodec.PrimitiveIntCodec, com.datastax.driver.core.TypeCodec.PrimitiveLongCodec, com.datastax.driver.core.TypeCodec.PrimitiveShortCodec| Modifier and Type | Field and Description |
|---|---|
protected com.datastax.driver.core.TypeCodec<E> |
eltCodec |
| Constructor and Description |
|---|
ObjectArrayCodec(com.datastax.driver.core.DataType.CollectionType cqlType,
Class<E[]> javaClass,
com.datastax.driver.core.TypeCodec<E> eltCodec) |
| Modifier and Type | Method and Description |
|---|---|
E[] |
deserialize(ByteBuffer bytes,
com.datastax.driver.core.ProtocolVersion protocolVersion) |
protected void |
formatElement(StringBuilder output,
E[] array,
int index)
Format the
indexth element of array to output. |
protected E[] |
newInstance(int size)
Create a new array instance with the given size.
|
protected void |
parseElement(String input,
E[] array,
int index)
Parse the
indexth element of array from input. |
ByteBuffer |
serialize(E[] value,
com.datastax.driver.core.ProtocolVersion protocolVersion) |
format, parseaccepts, accepts, accepts, accepts, ascii, bigint, blob, cboolean, cdouble, cfloat, cint, counter, custom, date, decimal, getCqlType, getJavaType, inet, list, map, set, smallInt, time, timestamp, timeUUID, tinyInt, toString, tuple, userType, uuid, varchar, varintprotected final com.datastax.driver.core.TypeCodec<E> eltCodec
public ByteBuffer serialize(E[] value, com.datastax.driver.core.ProtocolVersion protocolVersion)
serialize in class com.datastax.driver.core.TypeCodec<E[]>public E[] deserialize(ByteBuffer bytes, com.datastax.driver.core.ProtocolVersion protocolVersion)
deserialize in class com.datastax.driver.core.TypeCodec<E[]>protected void formatElement(StringBuilder output, E[] array, int index)
AbstractArrayCodecindexth element of array to output.formatElement in class AbstractArrayCodec<E[]>output - The StringBuilder to write to.array - The array to read from.index - The element index.protected void parseElement(String input, E[] array, int index)
AbstractArrayCodecindexth element of array from input.parseElement in class AbstractArrayCodec<E[]>input - The String to read from.array - The array to write to.index - The element index.protected E[] newInstance(int size)
AbstractArrayCodecnewInstance in class AbstractArrayCodec<E[]>size - The size of the array to instantiate.Copyright © 2012–2018. All rights reserved.