Interface TriFunction<T1,T2,T3,R>

Type Parameters:
T1 - the type of the first argument - 第一个参数的类型
T2 - the type of the second argument - 第二个参数的类型
T3 - the type of the third argument - 第三个参数的类型
R - the type of the result - 结果的类型
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 TriFunction<T1,T2,T3,R>
Tri Function - Three-Argument Function Interface 三元函数 - 三参数函数接口

Represents a function that accepts three arguments and produces a result. This is the three-arity specialization of Function.

表示接受三个参数并产生结果的函数。这是 Function 的三元特化版本。

Example | 示例:

TriFunction<String, Integer, Boolean, String> fn =
    (name, age, active) -> name + ":" + age + ":" + active;
String result = fn.apply("John", 25, true);

Features | 主要功能:

  • Three-argument function interface - 三参数函数接口
  • andThen composition support - andThen组合支持
  • Functional interface (lambda compatible) - 函数式接口(兼容lambda)

Security | 安全性:

  • Thread-safe: Implementation dependent - 线程安全: 取决于实现
Since:
JDK 25, opencode-base-parallel V1.0.0
Author:
Leon Soo www.LeonSoo.com
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    default <V> TriFunction<T1,T2,T3,V>
    andThen(Function<? super R, ? extends V> after)
    Returns a composed function that first applies this function to its input, and then applies the after function to the result.
    apply(T1 t1, T2 t2, T3 t3)
    Applies this function to the given arguments.
  • Method Details

    • apply

      R apply(T1 t1, T2 t2, T3 t3)
      Applies this function to the given arguments. 将此函数应用于给定的参数。
      Parameters:
      t1 - the first function argument - 第一个函数参数
      t2 - the second function argument - 第二个函数参数
      t3 - the third function argument - 第三个函数参数
      Returns:
      the function result - 函数结果
    • andThen

      default <V> TriFunction<T1,T2,T3,V> andThen(Function<? super R, ? extends V> after)
      Returns a composed function that first applies this function to its input, and then applies the after function to the result. 返回一个组合函数,首先将此函数应用于其输入,然后将 after 函数应用于结果。
      Type Parameters:
      V - the type of output of the after function - after 函数输出的类型
      Parameters:
      after - the function to apply after this function - 在此函数之后应用的函数
      Returns:
      a composed function - 组合函数
      Throws:
      NullPointerException - if after is null - 如果 after 为 null