Interface FailableFunction<T,​R,​E extends Throwable>

  • Type Parameters:
    T - Input type 1.
    R - Return type.
    E - Thrown exception.
    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 FailableFunction<T,​R,​E extends Throwable>
    A functional interface like Function that declares a Throwable.
    Since:
    3.11
    • Method Detail

      • identity

        static <T,​E extends ThrowableFailableFunction<T,​T,​E> identity()
        Returns a function that always returns its input argument.
        Type Parameters:
        T - the type of the input and output objects to the function
        E - Thrown exception.
        Returns:
        a function that always returns its input argument
      • nop

        static <T,​R,​E extends ThrowableFailableFunction<T,​R,​E> nop()
        Returns The NOP singleton.
        Type Parameters:
        T - Consumed type 1.
        R - Return type.
        E - Thrown exception.
        Returns:
        The NOP singleton.
      • apply

        R apply​(T input)
         throws E extends Throwable
        Applies this function.
        Parameters:
        input - the input for the function
        Returns:
        the result of the function
        Throws:
        E - Thrown when the function fails.
        E extends Throwable