K - key typeV - value typepublic class Pair<K,V> extends Object implements Cloneable, Serializable
| Modifier and Type | Field and Description |
|---|---|
K |
key
Key of this
Pair. |
V |
value
Value of this this
Pair. |
| Constructor and Description |
|---|
Pair()
Constructs a new pair with
null key and value. |
Pair(K key)
Constructs a new pair with
null value. |
Pair(K key,
V value)
Constructs a new pair
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o) |
K |
getKey()
Gets the key for this pair.
|
V |
getValue()
Gets the value for this pair.
|
int |
hashCode() |
void |
setKey(K key)
Sets the key for this pair.
|
void |
setValue(V value)
Sets the value for this pair.
|
String |
toString() |
@XStreamAsAttribute public K key
Pair.@XStreamAsAttribute public V value
Pair.public Pair()
null key and value.public Pair(K key)
null value.key - The key for this pairpublic K getKey()
public void setKey(K key)
key - new key for this pairpublic V getValue()
public void setValue(V value)
value - new value for this pairCopyright © 2020. All rights reserved.