Interface Pair<A,B>
-
- Type Parameters:
A- the left valueB- the right value
@Immutable public interface Pair<A,B>Represent an immutable pair of values.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description Afirst()The first value in the pair.static <U,V>
Pair<U,V>of(java.util.Map.Entry<U,V> entry)Create a newPairfrom an existing map entry.static <U,V>
Pair<U,V>of(U one, V two)Create a newPair.Bsecond()The second value in the pair.
-
-
-
Method Detail
-
of
static <U,V> Pair<U,V> of(U one, V two)
Create a newPair.- Type Parameters:
U- left value typeV- right value type- Parameters:
one- the left value, non-nulltwo- the right value, non-null- Returns:
- a new
Pair
-
of
static <U,V> Pair<U,V> of(java.util.Map.Entry<U,V> entry)
Create a newPairfrom an existing map entry.
-
first
@Parameter A first()
The first value in the pair.- Returns:
- the first value
-
second
@Parameter B second()
The second value in the pair.- Returns:
- the first value
-
-