Package org.apache.hadoop.hbase.util
Class Pair<T1,T2>
java.lang.Object
org.apache.hadoop.hbase.util.Pair<T1,T2>
- All Implemented Interfaces:
Serializable
A generic class for pairs.
- See Also:
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
private static boolean
getFirst()
Return the first element stored in the pair.Return the second element stored in the pair.int
hashCode()
static <T1,
T2> Pair<T1, T2> newPair
(T1 a, T2 b) Constructs a new pair, inferring the type via the passed argumentsvoid
Replace the first element of the pair.void
Replace the second element of the pair.toString()
-
Field Details
-
serialVersionUID
- See Also:
-
first
-
second
-
-
Constructor Details
-
Pair
public Pair()Default constructor. -
Pair
Constructor- Parameters:
a
- operandb
- operand
-
-
Method Details
-
newPair
Constructs a new pair, inferring the type via the passed arguments- Type Parameters:
T1
- type for firstT2
- type for second- Parameters:
a
- first elementb
- second element- Returns:
- a new pair containing the passed arguments
-
setFirst
Replace the first element of the pair.- Parameters:
a
- operand
-
setSecond
Replace the second element of the pair.- Parameters:
b
- operand
-
getFirst
Return the first element stored in the pair. -
getSecond
Return the second element stored in the pair. -
equals
-
equals
-
hashCode
-
toString
-