Package org.rspeer.commons
Class Pair<L,R>
java.lang.Object
org.rspeer.commons.Pair<L,R>
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription<T> T
accumulate
(BiFunction<L, R, T> function) filter
(BiPredicate<L, R> predicate) getLeft()
getRight()
void
ifPresent
(BiConsumer<L, R> consumer) If neither element is null, applies the given consumer
-
Constructor Details
-
Pair
-
-
Method Details
-
getLeft
-
getRight
-
getLeft
-
getRight
-
accumulate
-
filter
- Parameters:
predicate
- The predicate to test the elements- Returns:
- The pair if the predicate accepts it, else returns a Pair where the left and right elements are null
-
ifPresent
If neither element is null, applies the given consumer- Parameters:
consumer
- The operation to perform on the elements
-