K
- the key-type of the pair.V
- the value-type of the pair.@GwtCompatible
public final class Pair<K,V>
extends java.lang.Object
key
and value
. A pair is considered to be
equal
to another pair if both the key and the value are equal.Constructor and Description |
---|
Pair(K k,
V v)
Creates a new instance with the given key and value.
|
@Pure public static <K,V> Pair<K,V> of(K k, V v)
k
- the key. May be null
.v
- the value. May be null
.null
.public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object