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
`TypeSerializer<K>` `keys`
`TypeSerializer<V>` `values`

### Method Summary

Methods
`java.util.Map<K,V>` `deserialize(java.nio.ByteBuffer bytes)`
`static <K,V> MapSerializer<K,V>` `getInstance(TypeSerializer<K> keys, TypeSerializer<V> values)`
`java.lang.Class<java.util.Map<K,V>>` `getType()`
`java.nio.ByteBuffer` `serialize(java.util.Map<K,V> value)` Layout is: `<n><sk_1><k_1><sv_1><v_1>...<sk_n><k_n><sv_n><v_n>` where: n is the number of elements sk_i is the number of bytes composing the ith key k_i k_i is the sk_i bytes composing the ith key sv_i is the number of bytes composing the ith value v_i v_i is the sv_i bytes composing the ith value
`java.lang.String` `toString(java.util.Map<K,V> value)`

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

`getUnsignedShort, pack, pack, validate`

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

#### deserialize

    public java.util.Map<K,V> deserialize(java.nio.ByteBuffer bytes)

#### serialize

    public java.nio.ByteBuffer serialize(java.util.Map<K,V> value)

Layout is: `<n><sk_1><k_1><sv_1><v_1>...<sk_n><k_n><sv_n><v_n>` where: n is the number of elements sk_i is the number of bytes composing the ith key k_i k_i is the sk_i bytes composing the ith key sv_i is the number of bytes composing the ith value v_i v_i is the sv_i bytes composing the ith value

#### toString

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

#### getType

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