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

org.apache.cassandra.serializers

## Class ListSerializer<T>

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

- All Implemented Interfaces:
    TypeSerializer<java.util.List<T>>

      public class ListSerializer<T>
      extends CollectionSerializer<java.util.List<T>>

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `TypeSerializer<T>` | `elements`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.util.List<T>` | `deserializeForNativeProtocol(java.nio.ByteBuffer bytes, ProtocolVersion version)`
    `java.nio.ByteBuffer` | `getElement(java.nio.ByteBuffer serializedList, int index)` Returns the element at the given index in a list.
    `int` | `getElementCount(java.util.List<T> value)`
    `static <T> ListSerializer<T>` | `getInstance(TypeSerializer<T> elements)`
    `java.lang.Class<java.util.List<T>>` | `getType()`
    `java.util.List<java.nio.ByteBuffer>` | `serializeValues(java.util.List<T> values)`
    `java.lang.String` | `toString(java.util.List<T> value)`
    `void` | `validateForNativeProtocol(java.nio.ByteBuffer bytes, ProtocolVersion version)`

    - ### Methods inherited from class org.apache.cassandra.serializers.CollectionSerializer

      `deserialize, pack, readCollectionSize, readValue, serialize, sizeOfCollectionSize, sizeOfValue, validate, writeCollectionSize, writeValue`

    - ### 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

      `toCQLLiteral`

- - ### Field Detail

    - #### elements

          public final TypeSerializer<T> elements

  - ### Method Detail

    - #### getInstance

          public static <T> ListSerializer<T> getInstance(TypeSerializer<T> elements)

    - #### serializeValues

          public java.util.List<java.nio.ByteBuffer> serializeValues(java.util.List<T> values)

      Specified by:
        `serializeValues` in class `CollectionSerializer<java.util.List<T>>`

    - #### getElementCount

          public int getElementCount(java.util.List<T> value)

      Specified by:
        `getElementCount` in class `CollectionSerializer<java.util.List<T>>`

    - #### validateForNativeProtocol

          public void validateForNativeProtocol(java.nio.ByteBuffer bytes,
                                                ProtocolVersion version)

      Specified by:
        `validateForNativeProtocol` in class `CollectionSerializer<java.util.List<T>>`

    - #### deserializeForNativeProtocol

          public java.util.List<T> deserializeForNativeProtocol(java.nio.ByteBuffer bytes,
                                                                ProtocolVersion version)

      Specified by:
        `deserializeForNativeProtocol` in class `CollectionSerializer<java.util.List<T>>`

    - #### getElement

          public java.nio.ByteBuffer getElement(java.nio.ByteBuffer serializedList,
                                                int index)

      Returns the element at the given index in a list.
      Parameters:
        `serializedList` - a serialized list
        `index` - the index to get
      Returns:
        the serialized element at the given index, or null if the index exceeds the list size

    - #### toString

          public java.lang.String toString(java.util.List<T> value)

    - #### getType

          public java.lang.Class<java.util.List<T>> getType()

Copyright © 2018 The Apache Software Foundation