CollectionSerializer (apache-cassandra API)
Date: 2018-02-14

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
    Modifier and Type | Method and Description
    --- | ---
    `T` | `deserialize(java.nio.ByteBuffer bytes)`
    `abstract T` | `deserializeForNativeProtocol(java.nio.ByteBuffer buffer, ProtocolVersion version)`
    `protected abstract int` | `getElementCount(T value)`
    `static java.nio.ByteBuffer` | `pack(java.util.Collection<java.nio.ByteBuffer> buffers, int elements, ProtocolVersion version)`
    `static int` | `readCollectionSize(java.nio.ByteBuffer input, ProtocolVersion version)`
    `static java.nio.ByteBuffer` | `readValue(java.nio.ByteBuffer input, ProtocolVersion version)`
    `java.nio.ByteBuffer` | `serialize(T value)`
    `protected abstract java.util.List<java.nio.ByteBuffer>` | `serializeValues(T value)`
    `protected static int` | `sizeOfCollectionSize(int elements, ProtocolVersion version)`
    `static int` | `sizeOfValue(java.nio.ByteBuffer value, ProtocolVersion version)`
    `void` | `validate(java.nio.ByteBuffer bytes)`
    `abstract void` | `validateForNativeProtocol(java.nio.ByteBuffer buffer, ProtocolVersion version)`
    `protected static void` | `writeCollectionSize(java.nio.ByteBuffer output, int elements, ProtocolVersion version)`
    `static void` | `writeValue(java.nio.ByteBuffer output, java.nio.ByteBuffer value, ProtocolVersion 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, toCQLLiteral, 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,
                                                         ProtocolVersion version)

    - #### validateForNativeProtocol

          public abstract void validateForNativeProtocol(java.nio.ByteBuffer buffer,
                                                         ProtocolVersion 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>`

    - #### 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,
                                                 ProtocolVersion version)

    - #### writeCollectionSize

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

    - #### readCollectionSize

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

    - #### sizeOfCollectionSize

          protected static int sizeOfCollectionSize(int elements,
                                                    ProtocolVersion version)

    - #### writeValue

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

    - #### readValue

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

    - #### sizeOfValue

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

Copyright © 2018 The Apache Software Foundation