public class Pair<K,V>
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable
| 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 |
|---|---|
Pair<K,V> |
clone() |
boolean |
equals(java.lang.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.
|
java.lang.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 pairpublic java.lang.String toString()
toString in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object o)
equals in class java.lang.Object