public static class ConcurrentRadixTree.KeyValuePairImpl<O> extends Object implements KeyValuePair<O>
KeyValuePair
interface.Constructor and Description |
---|
KeyValuePairImpl(String key,
Object value)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o)
Compares this
KeyValuePair object with another for equality. |
CharSequence |
getKey()
Returns the key with which the value is associated
|
O |
getValue()
Returns the value associated with the key
|
int |
hashCode()
Returns a hash code for this object.
|
String |
toString()
Returns a string representation as
(key, value) . |
public KeyValuePairImpl(String key, Object value)
String
- this is to allow reliable testing of object equality; the alternative CharSequence
does not specify a contract for Object.equals(Object)
.key
- The key as a stringvalue
- The valuepublic CharSequence getKey()
getKey
in interface KeyValuePair<O>
public O getValue()
getValue
in interface KeyValuePair<O>
public boolean equals(Object o)
KeyValuePair
object with another for equality.
This is implemented based on equality of the keys.equals
in interface KeyValuePair<O>
equals
in class Object
o
- The other object to compareKeyValuePair
and is equal to this one as specified abovepublic int hashCode()
hashCode
in interface KeyValuePair<O>
hashCode
in class Object
Copyright © 2017. All rights reserved.