Module bus.core

Interface BiFunctionX<T,U,R>

Type Parameters:
T - 参数1的类型
U - 参数2的类型
R - 返回值类型
All Superinterfaces:
BiFunction<T,U,R>, Serializable
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 BiFunctionX<T,U,R> extends BiFunction<T,U,R>, Serializable
可序列化的BiFunction接口,支持异常抛出和函数组合。
Since:
Java 17+
Author:
Kimi Liu
  • Method Summary

    Modifier and Type
    Method
    Description
    default <V> BiFunctionX<T,U,V>
    andThen(FunctionX<? super R,? extends V> after)
    返回一个组合函数,先应用此函数,再将结果传递给after函数。
    default R
    apply(T t, U u)
    对给定两个参数应用此函数,自动处理异常。
    applying(T t, U u)
    对给定两个参数应用此函数,可能抛出异常。

    Methods inherited from interface java.util.function.BiFunction

    andThen
  • Method Details

    • applying

      R applying(T t, U u) throws Throwable
      对给定两个参数应用此函数,可能抛出异常。
      Parameters:
      t - 第一个函数参数
      u - 第二个函数参数
      Returns:
      函数执行结果
      Throws:
      Throwable - 可能抛出的异常
    • apply

      default R apply(T t, U u)
      对给定两个参数应用此函数,自动处理异常。
      Specified by:
      apply in interface BiFunction<T,U,R>
      Parameters:
      t - 第一个函数参数
      u - 第二个函数参数
      Returns:
      函数执行结果
      Throws:
      RuntimeException - 包装后的运行时异常
    • andThen

      default <V> BiFunctionX<T,U,V> andThen(FunctionX<? super R,? extends V> after)
      返回一个组合函数,先应用此函数,再将结果传递给after函数。
      Type Parameters:
      V - after函数输出类型及组合函数的输出类型
      Parameters:
      after - 在此函数应用后执行的函数
      Returns:
      组合函数,先应用此函数再应用after函数
      Throws:
      NullPointerException - 如果after为null