Interface ThrowingBiFunction<T,U,R>

Type Parameters:
T - the type of the first argument to the function
U - the type of the second argument to the function
R - the type of the result of the function
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface ThrowingBiFunction<T,U,R>
Variant of BiFunction whose apply(Object, Object) method is allowed to throw a checked Exception.

It can be used in place of a standard BiFunction when the operation may fail with a checked exception.

  • Method Summary

    Modifier and Type
    Method
    Description
    default <V> ThrowingBiFunction<T,U,V>
    andThen(@NonNull ThrowingFunction<? super R,? extends V> after)
    Returns a composed function that first applies this function to its input, and then applies the after function to the result.
    apply(T t, U u)
    Applies this function to the given arguments.
  • Method Details

    • apply

      R apply(T t, U u) throws Exception
      Applies this function to the given arguments.
      Parameters:
      t - the first function argument
      u - the second function argument
      Returns:
      the function result
      Throws:
      Exception - if unable to compute a result
    • andThen

      default <V> ThrowingBiFunction<T,U,V> andThen(@NonNull @NonNull ThrowingFunction<? super R,? extends V> after)
      Returns a composed function that first applies this function to its input, and then applies the after function to the result.
      Type Parameters:
      V - the type of output of the after function, and of the composed function
      Parameters:
      after - the function to apply after this function
      Returns:
      a composed function that first applies this function and then the after function