Interface KeyValuePair<O>
- Type Parameters:
O
- The type of the value
- All Known Implementing Classes:
ConcurrentRadixTree.KeyValuePairImpl
public interface KeyValuePair<O>
Encapsulates a key and a value.
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Compares thisKeyValuePair
object with another for equality.getKey()
Returns the key with which the value is associatedgetValue()
Returns the value associated with the keyint
hashCode()
Returns a hash code for this object.toString()
Returns a string representation as(key, value)
.
-
Method Details
-
getKey
CharSequence getKey()Returns the key with which the value is associated- Returns:
- The key with which the value is associated
-
getValue
O getValue()Returns the value associated with the key- Returns:
- The value associated with the key
-
equals
Compares thisKeyValuePair
object with another for equality. This is implemented based on equality of the keys.- Overrides:
equals
in classObject
- Parameters:
o
- The other object to compare- Returns:
- True if the other object is also a
KeyValuePair
and is equal to this one as specified above
-
hashCode
int hashCode()Returns a hash code for this object. -
toString
String toString()Returns a string representation as(key, value)
.
-