MapSerializer (apache-cassandra API)
Date: 2014-10-21

org.apache.cassandra.serializers

## Class MapSerializer<K,V>

- java.lang.Object
- - org.apache.cassandra.serializers.CollectionSerializer<java.util.Map<K,V>>
  - - org.apache.cassandra.serializers.MapSerializer<K,V>

- All Implemented Interfaces:
    TypeSerializer<java.util.Map<K,V>>

      public class MapSerializer<K,V>
      extends CollectionSerializer<java.util.Map<K,V>>

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `TypeSerializer<K>` | `keys`
    `TypeSerializer<V>` | `values`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.util.Map<K,V>` | `deserializeForNativeProtocol(java.nio.ByteBuffer bytes, int version)`
    `int` | `getElementCount(java.util.Map<K,V> value)`
    `static <K,V> MapSerializer<K,V>` | `getInstance(TypeSerializer<K> keys, TypeSerializer<V> values)`
    `java.lang.Class<java.util.Map<K,V>>` | `getType()`
    `java.util.List<java.nio.ByteBuffer>` | `serializeValues(java.util.Map<K,V> map)`
    `java.lang.String` | `toString(java.util.Map<K,V> value)`
    `void` | `validateForNativeProtocol(java.nio.ByteBuffer bytes, int version)`

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

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

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

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

- - ### Field Detail

    - #### keys

          public final TypeSerializer<K> keys

    - #### values

          public final TypeSerializer<V> values

  - ### Method Detail

    - #### getInstance

          public static <K,V> MapSerializer<K,V> getInstance(TypeSerializer<K> keys,
                                             TypeSerializer<V> values)

    - #### serializeValues

          public java.util.List<java.nio.ByteBuffer> serializeValues(java.util.Map<K,V> map)

      Specified by:
        `serializeValues` in class `CollectionSerializer<java.util.Map<K,V>>`

    - #### getElementCount

          public int getElementCount(java.util.Map<K,V> value)

      Specified by:
        `getElementCount` in class `CollectionSerializer<java.util.Map<K,V>>`

    - #### validateForNativeProtocol

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

      Specified by:
        `validateForNativeProtocol` in class `CollectionSerializer<java.util.Map<K,V>>`

    - #### deserializeForNativeProtocol

          public java.util.Map<K,V> deserializeForNativeProtocol(java.nio.ByteBuffer bytes,
                                                        int version)

      Specified by:
        `deserializeForNativeProtocol` in class `CollectionSerializer<java.util.Map<K,V>>`

    - #### toString

          public java.lang.String toString(java.util.Map<K,V> value)

    - #### getType

          public java.lang.Class<java.util.Map<K,V>> getType()

Copyright © 2014 The Apache Software Foundation