- java.lang.Object
-
- com.aoapps.lang.function.BiFunctions
-
public final class BiFunctions extends Object
Utilities for working withBiFunctionandBiFunctionE.- See Also:
BiFunction,BiFunctionE
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <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.EMPTYwhen no result.static <T,U,R,Ex extends Throwable>
Optional<R>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.EMPTYwhen no result.
-
-
-
Method Detail
-
coalesce
public static <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.EMPTYwhen no result.- Returns:
- The first non-null result or
Optional.EMPTYwhen all returnnull
-
coalesceE
public static <T,U,R,Ex extends Throwable> Optional<R> coalesceE(T t, U u, BiFunctionE<? super T,? super U,? extends R,? extends Ex>... functions) throws Ex extends Throwable
Lazily evaluates a set of bifunctions, returning the first non-null result orOptional.EMPTYwhen no result.- Returns:
- The first non-null result or
Optional.EMPTYwhen all returnnull - Throws:
Ex extends Throwable
-
-