public class MapMarshaller<K,V> extends Object implements CompactBytesMarshaller<Map<K,V>>
BYTE_BUFFER_CODE, CLASS_CODE, DATE_CODE, DOUBLE_CODE, INT_CODE, LIST_CODE, LONG_CODE, MAP_CODE, SET_CODE, STRING_CODE, STRINGZ_CODE, STRINGZ_MAP_CODE| Modifier and Type | Method and Description |
|---|---|
byte |
code() |
static <K,V> BytesMarshaller<Map<K,V>> |
of(BytesMarshaller<K> keyMarshaller,
BytesMarshaller<V> valueMarshaller) |
Map<K,V> |
read(Bytes bytes)
Reads and returns an object from
bytes. |
Map<K,V> |
read(Bytes bytes,
Map<K,V> kvMap)
Reads and returns an object from
bytes, reusing the given object, if possible. |
void |
write(Bytes bytes,
Map<K,V> kvMap)
Write the object out to the
bytes. |
public static <K,V> BytesMarshaller<Map<K,V>> of(BytesMarshaller<K> keyMarshaller, BytesMarshaller<V> valueMarshaller)
public byte code()
code in interface CompactBytesMarshaller<Map<K,V>>public void write(Bytes bytes, Map<K,V> kvMap)
BytesMarshallerbytes.write in interface BytesMarshaller<Map<K,V>>bytes - to write tokvMap - the object to writepublic Map<K,V> read(Bytes bytes)
BytesMarshallerbytes.read in interface BytesMarshaller<Map<K,V>>bytes - to readpublic Map<K,V> read(Bytes bytes, @Nullable Map<K,V> kvMap)
BytesMarshallerbytes, reusing the given object, if possible.read in interface BytesMarshaller<Map<K,V>>bytes - to readkvMap - an object to reuse, if possible. null could be passed, in this case
a new object should be allocated anyway.Copyright © 2019. All rights reserved.