Interface ThrowingFunction2<A,B,R,T extends Throwable>

Type Parameters:
A - The 1st input argument type for the function
B - The 2nd input argument type for the function
R - The output result type for the function
T - The type of Throwable thrown by 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 ThrowingFunction2<A,B,R,T extends Throwable>
A better version of Java's BiFunction interface that allows for the functions to throw whatever Throwable is specified.
Version:
0.1-Alpha-SNAPSHOT
Author:
Logan Ferree (Tadukoo)
  • Method Summary

    Modifier and Type
    Method
    Description
    default <S> ThrowingFunction2<A,B,S,T>
    andThen(ThrowingFunction<? super R,? extends S,? extends T> after)
    Creates a ThrowingFunction2 that runs this ThrowingFunction2 and puts the result into the given ThrowingFunction.
    apply(A a, B b)
    Takes two arguments and returns a result.
  • Method Details

    • apply

      R apply(A a, B b) throws T
      Takes two arguments and returns a result.
      Parameters:
      a - The 1st argument
      b - The 2nd argument
      Returns:
      R result
      Throws:
      T - Determined by the function, not required
    • andThen

      default <S> ThrowingFunction2<A,B,S,T> andThen(ThrowingFunction<? super R,? extends S,? extends T> after)
      Creates a ThrowingFunction2 that runs this ThrowingFunction2 and puts the result into the given ThrowingFunction.
      Type Parameters:
      S - The output type of the ThrowingFunction
      Parameters:
      after - A ThrowingFunction to put the result of this ThrowingFunction2 into
      Returns:
      The ThrowingFunction2 made from composing this one and the given ThrowingFunction