Package alluxio.collections
Class Pair<T1,T2>
- java.lang.Object
-
- alluxio.collections.Pair<T1,T2>
-
- Type Parameters:
T1
- the first element of the PairT2
- the second element of the Pair
- Direct Known Subclasses:
OperationId
@NotThreadSafe public class Pair<T1,T2> extends java.lang.Object
A pair representation defined by two elements (of type First and type Second).
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
T1
getFirst()
T2
getSecond()
int
hashCode()
void
setFirst(T1 first)
Set the first value.void
setSecond(T2 second)
Set the second value.java.lang.String
toString()
-
-
-
Constructor Detail
-
Pair
public Pair(T1 first, T2 second)
Constructs and initializes a Pair specified by the two input elements.- Parameters:
first
- the first element of the pair (of type First)second
- the second element of the pair (of type Second)
-
Pair
public Pair()
Default constructor for deserialization.
-
-
Method Detail
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
getFirst
public T1 getFirst()
- Returns:
- the first element of the pair
-
getSecond
public T2 getSecond()
- Returns:
- the second element of the pair
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
setFirst
public void setFirst(T1 first)
Set the first value.- Parameters:
first
- the value to be set
-
setSecond
public void setSecond(T2 second)
Set the second value.- Parameters:
second
- the value to be set
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-