public class Pair<X,Y>
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
void |
apply(java.util.function.BiConsumer<X,Y> consumer)
Applies the given consumer to the values held by this pair.
|
boolean |
equals(java.lang.Object o) |
<S> S |
flatMap(java.util.function.BiFunction<X,Y,S> mapper)
Maps the values held by this pair to an object of type
S. |
int |
hashCode() |
X |
left() |
<R,S> Pair<R,S> |
map(java.util.function.Function<X,R> mapLeft,
java.util.function.Function<Y,S> mapRight)
Applies the respective mapper to the left or right values.
|
<S> Pair<S,Y> |
mapLeft(java.util.function.Function<X,S> mapper)
Applies the given mapper to the left value.
|
<S> Pair<X,S> |
mapRight(java.util.function.Function<Y,S> mapper)
Applies the given mapper to the right value.
|
static <X,Y> Pair<X,Y> |
of(X left,
Y right) |
Y |
right() |
public static <X,Y> Pair<X,Y> of(X left, Y right)
public X left()
public Y right()
public <S> Pair<S,Y> mapLeft(java.util.function.Function<X,S> mapper)
public <S> Pair<X,S> mapRight(java.util.function.Function<Y,S> mapper)
public <R,S> Pair<R,S> map(java.util.function.Function<X,R> mapLeft, java.util.function.Function<Y,S> mapRight)
public <S> S flatMap(java.util.function.BiFunction<X,Y,S> mapper)
S.public void apply(java.util.function.BiConsumer<X,Y> consumer)
public boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Object