Interface ThrowingFunction<T,​R>

  • Type Parameters:
    T - the type of the input 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 ThrowingFunction<T,​R>
    This interface replaces Function in cases when execution of apply(Object) method may throw exception.

    Useful for capturing lambdas that throw exceptions.

    • Method Detail

      • apply

        R apply​(T t)
         throws java.lang.Throwable
        Applies this function to the given argument.
        Parameters:
        t - function argument
        Returns:
        function result
        Throws:
        java.lang.Throwable - exception that may be thrown