T1
- the type of the first valueT2
- the type of the second valuepublic final class Pair<T1,T2>
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Field and Description |
---|---|
T1 |
val1
The first value
|
T2 |
val2
The second value
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o) |
T1 |
getFirst()
Returns the first value in a pair.
|
T2 |
getSecond()
Returns the second value in a pair.
|
int |
hashCode() |
static <T1,T2> Pair<T1,T2> |
of(T1 first,
T2 second)
Constructs a new pair of values.
|
java.lang.String |
toString() |
public static <T1,T2> Pair<T1,T2> of(T1 first, T2 second)
T1
- the type of the first valueT2
- the type of the second valuefirst
- the first valuesecond
- the second valuepublic T1 getFirst()
public T2 getSecond()
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