类 KeyValue<K,V>
- java.lang.Object
-
- org.apache.pulsar.common.schema.KeyValue<K,V>
-
-
嵌套类概要
嵌套类 修饰符和类型 类 说明 static interfaceKeyValue.KeyValueDecoder<K,V>Decoder to decode key/value bytes.
-
方法概要
所有方法 静态方法 实例方法 具体方法 修饰符和类型 方法 说明 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.booleanequals(java.lang.Object obj)KgetKey()VgetValue()inthashCode()java.lang.StringtoString()
-
-
-
方法详细资料
-
getKey
public K getKey()
-
getValue
public V getValue()
-
hashCode
public int hashCode()
- 覆盖:
hashCode在类中java.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- 覆盖:
equals在类中java.lang.Object
-
toString
public java.lang.String toString()
- 覆盖:
toString在类中java.lang.Object
-
encode
public 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.- 参数:
key- key object to encodekeyWriter- a writer to encode key objectvalue- value object to encodevalueWriter- a writer to encode value object- 返回:
- the encoded bytes array
-
decode
public static <K,V> KeyValue<K,V> decode(byte[] data, KeyValue.KeyValueDecoder<K,V> decoder)
Decode the value into a key/value pair.- 参数:
data- the encoded bytesdecoder- the decoder to decode encoded key/value bytes- 返回:
- the decoded key/value pair
-
-