Interface ThrowingFunction<T,R,E extends Throwable>

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 ThrowingFunction<T,R,E extends Throwable>
  • Method Details

    • apply

      R apply(T t) throws E
      Throws:
      E extends Throwable
    • identity

      static <T, S extends Exception> ThrowingFunction<T,T,S> identity()
    • asFunction

      static <T, R, E extends Throwable> Function<T,R> asFunction(ThrowingFunction<T,R,E> function, Function<E,R> exceptionHandler)
      Map throwing function in default stream api with exception consume support
      Type Parameters:
      T - type of function parameter
      R - type of function result
      E - type of exception
      Parameters:
      function - the function to apply
      exceptionHandler - the exception consumer
      Returns:
      a new function