org.apache.cassandra.serializers

## Class CollectionSerializer<T>

- java.lang.Object
- - org.apache.cassandra.serializers.CollectionSerializer<T>

All Implemented Interfaces:
  TypeSerializer<T>

Direct Known Subclasses:
  ListSerializer, MapSerializer, SetSerializer

    public abstract class CollectionSerializer<T>
    extends java.lang.Object
    implements TypeSerializer<T>

### Constructor Summary

Constructors
Constructor and Description
`CollectionSerializer()`

### Method Summary

All Methods Static Methods Instance Methods Abstract Methods Concrete Methods
`T` `deserialize(java.nio.ByteBuffer bytes)`
`abstract T` `deserializeForNativeProtocol(java.nio.ByteBuffer buffer, int version)`
`protected abstract int` `getElementCount(T value)`
`static java.nio.ByteBuffer` `pack(java.util.Collection<java.nio.ByteBuffer> buffers, int elements, int version)`
`static int` `readCollectionSize(java.nio.ByteBuffer input, int version)`
`static java.nio.ByteBuffer` `readValue(java.nio.ByteBuffer input, int version)`
`java.nio.ByteBuffer` `reserializeToV3(java.nio.ByteBuffer bytes)`
`java.nio.ByteBuffer` `serialize(T value)`
`protected abstract java.util.List<java.nio.ByteBuffer>` `serializeValues(T value)`
`protected static int` `sizeOfCollectionSize(int elements, int version)`
`static int` `sizeOfValue(java.nio.ByteBuffer value, int version)`
`void` `validate(java.nio.ByteBuffer bytes)`
`abstract void` `validateForNativeProtocol(java.nio.ByteBuffer buffer, int version)`
`protected static void` `writeCollectionSize(java.nio.ByteBuffer output, int elements, int version)`
`static void` `writeValue(java.nio.ByteBuffer output, java.nio.ByteBuffer value, int version)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface org.apache.cassandra.serializers.TypeSerializer

`getType, toString`

### Constructor Detail

#### CollectionSerializer

    public CollectionSerializer()

### Method Detail

#### serializeValues

    protected abstract java.util.List<java.nio.ByteBuffer> serializeValues(T value)

#### getElementCount

    protected abstract int getElementCount(T value)

#### deserializeForNativeProtocol

    public abstract T deserializeForNativeProtocol(java.nio.ByteBuffer buffer,
                                                   int version)

#### validateForNativeProtocol

    public abstract void validateForNativeProtocol(java.nio.ByteBuffer buffer,
                                                   int version)

#### serialize

    public java.nio.ByteBuffer serialize(T value)

Specified by:
  `serialize` in interface `TypeSerializer<T>`

#### deserialize

    public T deserialize(java.nio.ByteBuffer bytes)

Specified by:
  `deserialize` in interface `TypeSerializer<T>`

#### reserializeToV3

    public java.nio.ByteBuffer reserializeToV3(java.nio.ByteBuffer bytes)

#### validate

    public void validate(java.nio.ByteBuffer bytes)
                  throws MarshalException

Specified by:
  `validate` in interface `TypeSerializer<T>`
Throws:
  `MarshalException`

#### pack

    public static java.nio.ByteBuffer pack(java.util.Collection<java.nio.ByteBuffer> buffers,
                                           int elements,
                                           int version)

#### writeCollectionSize

    protected static void writeCollectionSize(java.nio.ByteBuffer output,
                                              int elements,
                                              int version)

#### readCollectionSize

    public static int readCollectionSize(java.nio.ByteBuffer input,
                                         int version)

#### sizeOfCollectionSize

    protected static int sizeOfCollectionSize(int elements,
                                              int version)

#### writeValue

    public static void writeValue(java.nio.ByteBuffer output,
                                  java.nio.ByteBuffer value,
                                  int version)

#### readValue

    public static java.nio.ByteBuffer readValue(java.nio.ByteBuffer input,
                                                int version)

#### sizeOfValue

    public static int sizeOfValue(java.nio.ByteBuffer value,
                                  int version)