Interface SerializableBiFunction<T,U,R>
- Type Parameters:
T- the first input type | 第一个输入类型U- the second input type | 第二个输入类型R- the output type | 输出类型
- 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 SerializableBiFunction<T,U,R>
extends BiFunction<T,U,R>, Serializable
Serializable BiFunction Interface
可序列化BiFunction接口
A BiFunction that is also Serializable, enabling lambda metadata extraction.
一个同时也是Serializable的BiFunction,可以提取lambda元数据。
Features | 主要功能:
- Serializable BiFunction for lambda metadata extraction - 可序列化BiFunction用于lambda元数据提取
- Composable with andThen - 可通过andThen组合
- Factory methods for common patterns - 常用模式的工厂方法
Usage Examples | 使用示例:
SerializableBiFunction<String, Integer, String> func = (s, i) -> s.repeat(i);
String result = func.apply("ab", 3); // "ababab"
Security | 安全性:
- Thread-safe: Depends on implementation - 线程安全: 取决于实现
- Null-safe: Depends on implementation - 空值安全: 取决于实现
- Since:
- JDK 25, opencode-base-reflect V1.0.0
- Author:
- Leon Soo www.LeonSoo.com
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondefault <V> SerializableBiFunction<T, U, V> andThen(SerializableFunction<? super R, ? extends V> after) Composes this function with another (after) 将此函数与另一个组合(之后)static <T,U, R> SerializableBiFunction <T, U, R> constant(R value) Creates a function that always returns a constant 创建总是返回常量的函数static <T,U> SerializableBiFunction <T, U, T> first()Creates a function that returns the first argument 创建返回第一个参数的函数static <T,U, R> SerializableBiFunction <T, U, R> of(SerializableBiFunction<T, U, R> function) Creates a SerializableBiFunction 创建SerializableBiFunctionstatic <T,U> SerializableBiFunction <T, U, U> second()Creates a function that returns the second argument 创建返回第二个参数的函数Methods inherited from interface BiFunction
andThen, apply
-
Method Details
-
of
Creates a SerializableBiFunction 创建SerializableBiFunction- Type Parameters:
T- the first input type | 第一个输入类型U- the second input type | 第二个输入类型R- the output type | 输出类型- Parameters:
function- the function | 函数- Returns:
- the serializable function | 可序列化函数
-
constant
Creates a function that always returns a constant 创建总是返回常量的函数- Type Parameters:
T- the first input type | 第一个输入类型U- the second input type | 第二个输入类型R- the output type | 输出类型- Parameters:
value- the value | 值- Returns:
- the constant function | 常量函数
-
first
Creates a function that returns the first argument 创建返回第一个参数的函数- Type Parameters:
T- the first input type | 第一个输入类型U- the second input type | 第二个输入类型- Returns:
- the first-returning function | 返回第一个参数的函数
-
second
Creates a function that returns the second argument 创建返回第二个参数的函数- Type Parameters:
T- the first input type | 第一个输入类型U- the second input type | 第二个输入类型- Returns:
- the second-returning function | 返回第二个参数的函数
-
andThen
default <V> SerializableBiFunction<T,U, andThenV> (SerializableFunction<? super R, ? extends V> after) Composes this function with another (after) 将此函数与另一个组合(之后)- Type Parameters:
V- the output type of after | after的输出类型- Parameters:
after- the function to apply after | 之后应用的函数- Returns:
- the composed function | 组合后的函数
-