K
- type of the key in the messageV
- type of the value in the messagepublic class KVSerde<K,V> extends java.lang.Object implements Serde<KV<K,V>>
Constructor and Description |
---|
KVSerde(Serde<K> keySerde,
Serde<V> valueSerde) |
Modifier and Type | Method and Description |
---|---|
KV<K,V> |
fromBytes(byte[] bytes)
Deserializes given serialized object from an array of bytes to its original form.
|
Serde<K> |
getKeySerde() |
Serde<V> |
getValueSerde() |
static <K,V> KVSerde<K,V> |
of(Serde<K> keySerde,
Serde<V> valueSerde) |
byte[] |
toBytes(KV<K,V> obj)
Serializes given object to an array of bytes.
|
public KV<K,V> fromBytes(byte[] bytes)
Deserializer
fromBytes
in interface Deserializer<KV<K,V>>
bytes
- Array of bytes representing serialized object.public byte[] toBytes(KV<K,V> obj)
Serializer
toBytes
in interface Serializer<KV<K,V>>
obj
- Object of specific type to serialize.