Package org.eclipse.xtext.xbase.lib
Class Pair<K,V>
java.lang.Object
org.eclipse.xtext.xbase.lib.Pair<K,V>
- Type Parameters:
K
- the key-type of the pair.V
- the value-type of the pair.
- All Implemented Interfaces:
Serializable
An immutable pair of
key
and value
. A pair is considered to be
equal
to another pair if both the key and the value are equal.- Author:
- Sebastian Zarnekow - Initial contribution and API
- See Also:
-
Constructor Summary
-
Method Summary
-
Constructor Details
-
Pair
Creates a new instance with the given key and value.- Parameters:
k
- the key. May benull
.v
- the value. May benull
.
-
-
Method Details
-
of
Creates a new instance with the given key and value. May be used instead of the constructor for convenience reasons.- Parameters:
k
- the key. May benull
.v
- the value. May benull
.- Returns:
- a newly created pair. Never
null
. - Since:
- 2.3
-
getKey
Returns the key.- Returns:
- the key.
-
getValue
Returns the value.- Returns:
- the value.
-
equals
-
hashCode
public int hashCode() -
toString
-