public class KeyValue<K,V> extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
KeyValue.KeyValueDecoder<K,V>
Decoder to decode key/value bytes.
|
Modifier and Type | Method and Description |
---|---|
static <K,V> KeyValue<K,V> |
decode(byte[] data,
KeyValue.KeyValueDecoder<K,V> decoder)
Decode the value into a key/value pair.
|
static <K,V> byte[] |
encode(K key,
Schema<K> keyWriter,
V value,
Schema<V> valueWriter)
Encode a key and value pair into a bytes array.
|
boolean |
equals(Object obj) |
K |
getKey() |
V |
getValue() |
int |
hashCode() |
String |
toString() |
public K getKey()
public V getValue()
public static <K,V> byte[] encode(K key, Schema<K> keyWriter, V value, Schema<V> valueWriter)
key
- key object to encodekeyWriter
- a writer to encode key objectvalue
- value object to encodevalueWriter
- a writer to encode value objectpublic static <K,V> KeyValue<K,V> decode(byte[] data, KeyValue.KeyValueDecoder<K,V> decoder)
data
- the encoded bytesdecoder
- the decoder to decode encoded key/value bytesCopyright © 2017–2021 Apache Software Foundation. All rights reserved.