L
- Left value type.R
- Right value type.public final class Pair<L,R>
extends java.lang.Object
implements java.util.Map.Entry<L,R>
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o) |
static <L,R> java.util.stream.Stream<Pair<L,R>> |
flatMapStream(L left,
java.util.function.Function<L,java.util.Optional<R>> f)
Creates a
Stream of zero or one Pairs if the mapping function
returns a non-empty Optional . |
static <L,R> java.util.stream.Stream<Pair<L,R>> |
flatMapStream(L left,
java.util.function.Supplier<java.util.Optional<R>> f) |
L |
getKey() |
L |
getLeft() |
R |
getRight() |
R |
getValue() |
int |
hashCode() |
static <L,R> Pair<L,R> |
of(L left,
R right)
Creates a Pair from the given values.
|
R |
setValue(R value) |
java.lang.String |
toString() |
public static <L,R> Pair<L,R> of(L left, R right)
L
- Left value type.R
- Right value type.left
- Left value.right
- Right value.public static <L,R> java.util.stream.Stream<Pair<L,R>> flatMapStream(L left, java.util.function.Function<L,java.util.Optional<R>> f)
Stream
of zero or one Pairs if the mapping function
returns a non-empty Optional
.L
- Left value type.R
- Right value type.left
- Value to set as the left side of the pair.f
- Mapping function that accepts the left value and returns an
Optional value.public static <L,R> java.util.stream.Stream<Pair<L,R>> flatMapStream(L left, java.util.function.Supplier<java.util.Optional<R>> f)
public L getLeft()
public R getRight()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object o)