Package org.apache.pulsar.common.schema
Class KeyValue<K,V>
java.lang.Object
org.apache.pulsar.common.schema.KeyValue<K,V>
A simple KeyValue class.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
Decoder to decode key/value bytes. -
Constructor Summary
-
Method Summary
-
Constructor Details
-
KeyValue
-
-
Method Details
-
getKey
-
getValue
-
hashCode
public int hashCode() -
equals
-
toString
-
encode
Encode a key and value pair into a bytes array.- Parameters:
key
- key object to encodekeyWriter
- a writer to encode key objectvalue
- value object to encodevalueWriter
- a writer to encode value object- Returns:
- the encoded bytes array
-
decode
Decode the value into a key/value pair.- Parameters:
data
- the encoded bytesdecoder
- the decoder to decode encoded key/value bytes- Returns:
- the decoded key/value pair
-