A - the type of the first elementB - the type of the second elementpublic interface Pair<A,B>
| Modifier and Type | Method and Description |
|---|---|
default <T> T |
apply(java.util.function.BiFunction<? super A,? super B,? extends T> function)
Applies the two contained values to a given
BiFunction. |
default void |
feed(java.util.function.BiConsumer<? super A,? super B> consumer)
Feeds a given
BiConsumer with the two contained values. |
default void |
feed(java.util.function.Consumer<? super A> consumerA,
java.util.function.Consumer<? super B> consumerB)
Feeds two given
Consumers with the two contained values. |
A |
getA()
Returns the first element.
|
B |
getB()
Returns the second element.
|
static <A,B> Pair<A,B> |
of(A a,
B b)
Creates a new instance.
|
static <A,B> Pair<A,B> of(A a, B b)
A - the type of the first elementB - the type of the second elementa - the first elementb - the second elementPair instanceA getA()
B getB()
default void feed(java.util.function.BiConsumer<? super A,? super B> consumer)
BiConsumer with the two contained values.consumer - the BiConsumer to feed with the contained valuesdefault void feed(java.util.function.Consumer<? super A> consumerA, java.util.function.Consumer<? super B> consumerB)
Consumers with the two contained values.default <T> T apply(java.util.function.BiFunction<? super A,? super B,? extends T> function)
BiFunction.T - the return type of the BiFunctionfunction - the BiFunction where to apply the contained valuesBiFunctionCopyright © 2017. All rights reserved.