java.lang.Object
com.aoapps.lang.function.BiFunctions
Utilities for working with
BiFunction
and BiFunctionE
.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T,
U, R> Optional <R> coalesce
(T t, U u, BiFunction<? super T, ? super U, ? extends R>... functions) Lazily evaluates a set of bifunctions, returning the first non-null result orOptional.empty()
when no result.coalesceE
(T t, U u, BiFunctionE<? super T, ? super U, ? extends R, ? extends Ex>... functions) Lazily evaluates a set of bifunctions, returning the first non-null result orOptional.empty()
when no result.
-
Method Details
-
coalesce
public static <T,U, Optional<R> coalesceR> (T t, U u, BiFunction<? super T, ? super U, ? extends R>... functions) Lazily evaluates a set of bifunctions, returning the first non-null result orOptional.empty()
when no result.- Returns:
- The first non-null result or
Optional.empty()
when all returnnull
-
coalesceE
public static <T,U, Optional<R> coalesceER, Ex extends Throwable> (T t, U u, BiFunctionE<? super T, ? super U, throws Ex? extends R, ? extends Ex>... functions) Lazily evaluates a set of bifunctions, returning the first non-null result orOptional.empty()
when no result.- Returns:
- The first non-null result or
Optional.empty()
when all returnnull
- Throws:
Ex
-