T1
- the type of the first valueT2
- the type of the second valuepublic final class Pair<T1,T2> extends Object implements Serializable
Modifier and Type | Field and Description |
---|---|
T1 |
value1
The first value.
|
T2 |
value2
The second value.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(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.
|
String |
toString() |
public final T1 value1
public final T2 value2
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()
Copyright © 2023 The Apache Software Foundation. All rights reserved.