@ThreadSafe public class KeyValuePair extends Object implements Comparable<KeyValuePair>
Constructor and Description |
---|
KeyValuePair(byte[] key,
byte[] value)
Constructs a key-value pair.
|
KeyValuePair(ByteBuffer key,
ByteBuffer value)
Constructs a key-value pair.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(KeyValuePair o)
Compares this key-value pair to another.
|
boolean |
equals(Object o)
Tells whether or not this key-value pair is equal to another object.
|
ByteBuffer |
getKey() |
ByteBuffer |
getValue() |
int |
hashCode() |
public KeyValuePair(ByteBuffer key, ByteBuffer value)
key
- the key, cannot be nullvalue
- the value, cannot be nullpublic KeyValuePair(byte[] key, byte[] value)
ByteBuffer
, no copy happens.key
- the key, cannot be nullvalue
- the value, cannot be nullpublic ByteBuffer getKey()
public ByteBuffer getValue()
public int compareTo(KeyValuePair o)
Two pairs are compared by comparing their key ByteBuffer
.
compareTo
in interface Comparable<KeyValuePair>
o
- the object to be compared, cannot be nullpublic boolean equals(Object o)
Two key-value pairs are equal if, and only if, their key and value ByteBuffer
s are
equal to each other.
Copyright © 2023. All Rights Reserved.