Class BiFunctions

java.lang.Object
com.aoapps.lang.function.BiFunctions

public final class BiFunctions extends Object
Utilities for working with BiFunction and BiFunctionE.
See Also:
  • Method Details

    • 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 or Optional.empty() when no result.
      Returns:
      The first non-null result or Optional.empty() when all return null
    • 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
      Lazily evaluates a set of bifunctions, returning the first non-null result or Optional.empty() when no result.
      Returns:
      The first non-null result or Optional.empty() when all return null
      Throws:
      Ex