public class MapSerializer<K,V> extends CollectionSerializer<java.util.Map<K,V>>
Modifier and Type | Field and Description |
---|---|
TypeSerializer<K> |
keys |
TypeSerializer<V> |
values |
Modifier and Type | Method and Description |
---|---|
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) |
getUnsignedShort, pack, pack, validate
public final TypeSerializer<K> keys
public final TypeSerializer<V> values
public static <K,V> MapSerializer<K,V> getInstance(TypeSerializer<K> keys, TypeSerializer<V> values)
public java.nio.ByteBuffer serialize(java.util.Map<K,V> value)
<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 valueCopyright © 2013 The Apache Software Foundation