Package org.uberfire.commons.data
Class Pair<K1,K2>
- java.lang.Object
-
- org.uberfire.commons.data.Pair<K1,K2>
-
- Type Parameters:
K1-K2-
public class Pair<K1,K2> extends Object
This is a simple class to store a pair of objects.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPair.PairEqualsMode
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)K1getK1()K2getK2()inthashCode()static <K1,K2>
Pair<K1,K2>newPair(K1 k1, K2 k2)static factory methodstatic <K1,K2>
Pair<K1,K2>newPair(K1 k1, K2 k2, Pair.PairEqualsMode equalsMode)static factory methodStringtoString()
-
-
-
Constructor Detail
-
Pair
public Pair(K1 k1, K2 k2)
Creates a new pair using the two keys provided.- Parameters:
k1-k2-
-
Pair
public Pair(K1 k1, K2 k2, Pair.PairEqualsMode equalsMode)
Creates a new pair using the two keys provided.- Parameters:
k1-k2-
-
-
Method Detail
-
newPair
public static <K1,K2> Pair<K1,K2> newPair(K1 k1, K2 k2)
static factory method- Type Parameters:
K1-K2-- Parameters:
k1-k2-- Returns:
-
newPair
public static <K1,K2> Pair<K1,K2> newPair(K1 k1, K2 k2, Pair.PairEqualsMode equalsMode)
static factory method- Type Parameters:
K1-K2-- Parameters:
k1-k2-- Returns:
-
getK1
public K1 getK1()
- Returns:
- the first key
-
getK2
public K2 getK2()
- Returns:
- the second key
-
-