Interface ThrowableFunctionalInterfaces.Function<T,R,X extends Exception>

  • Type Parameters:
    T - the type of the input to the function
    R - the type of the result of the function
    X - the type of exception to be thrown by the function
    Enclosing interface:
    ThrowableFunctionalInterfaces
    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 static interface ThrowableFunctionalInterfaces.Function<T,R,X extends Exception>
    Extended Function<T, R> functional interface which allows the apply method to throw an exception of type X.
    • Method Detail

      • of

        static <T,R,X extends ExceptionThrowableFunctionalInterfaces.Function<T,R,X> of​(Function<T,R> function)
        Wraps the given function into a throwable function
        Type Parameters:
        T - the type of the input to the function
        R - the type of the result of the function
        X - the type of exception to be thrown by the function
        Parameters:
        function - The function to wrap
        Returns:
        The given function wrapped as a throwable function object
      • apply

        R apply​(T t)
         throws X extends Exception
        Applies this function to the given argument.
        Parameters:
        t - the function argument
        Returns:
        the function result
        Throws:
        X - When an exception occurred during invocation
        X extends Exception