接口 ThrowableBiFunction<T,​U,​R>

  • 类型参数:
    T - the type of the first argument to be applied for the function
    U - the type of the second argument to be applied for the function
    R - the type of the result of the function
    函数接口:
    这是一个函数接口, 因此可用作 lambda 表达式或方法引用的赋值目标。

    @FunctionalInterface
    public interface ThrowableBiFunction<T,​U,​R>
    BiFunction with Throwable
    从以下版本开始:
    1.0.0
    另请参阅:
    Function, Throwable
    • 方法详细资料

      • apply

        R apply​(T first,
                U second)
         throws java.lang.Throwable
        Applies this function to the given argument.
        参数:
        first - the first argument to be applied for the function
        second - the second argument to be applied for the function
        返回:
        the function result
        抛出:
        java.lang.Throwable - if met with any error
      • execute

        static <T,​U,​R> R execute​(T first,
                                             U second,
                                             ThrowableBiFunction<T,​U,​R> function)
                                      throws java.lang.NullPointerException
        类型参数:
        T - the first argument type
        U - the second argument type
        R - the return type
        参数:
        first - the first argument to be applied for the function
        second - the second argument to be applied for the function
        function - ThrowableBiFunction
        返回:
        the result after execution
        抛出:
        java.lang.NullPointerException - if function is null
      • execute

        static <T,​U,​R> R execute​(T first,
                                             U second,
                                             ThrowableBiFunction<T,​U,​R> function,
                                             ThrowableBiFunction.ExceptionHandler<T,​U,​R> exceptionHandler)
                                      throws java.lang.NullPointerException
        Executes ThrowableBiFunction with the customized exception handling
        类型参数:
        T - the first argument type
        U - the second argument type
        R - the return type
        参数:
        first - the first argument to be applied for the function
        second - the second argument to be applied for the function
        exceptionHandler - the handler to handle the function argument and the exception that the #apply(T, U) method throws
        function - ThrowableBiFunction
        返回:
        the result after execution
        抛出:
        java.lang.NullPointerException - if function and exceptionHandler is null