Class LambdaInfo
java.lang.Object
cloud.opencode.base.reflect.lambda.LambdaInfo
Lambda Information Holder
Lambda信息持有者
Holds metadata extracted from a serialized lambda expression.
持有从序列化lambda表达式提取的元数据。
Features | 主要功能:
- Lambda implementation class discovery - Lambda实现类发现
- Implementation method access - 实现方法访问
- SerializedLambda metadata extraction - SerializedLambda元数据提取
Usage Examples | 使用示例:
LambdaInfo info = LambdaInfo.from((SerializableFunction<User, String>) User::getName);
String methodName = info.getImplMethodName();
Class<?> implClass = info.getImplClass();
Security | 安全性:
- Thread-safe: Yes (immutable after construction) - 线程安全: 是(构造后不可变)
- Null-safe: No (lambda must be non-null and serializable) - 空值安全: 否(lambda须非空且可序列化)
- Since:
- JDK 25, opencode-base-reflect V1.0.0
- Author:
- Leon Soo www.LeonSoo.com
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionLambdaInfo(SerializedLambda serializedLambda, Class<?> implClass, Method implMethod) Creates a LambdaInfo 创建LambdaInfo -
Method Summary
Modifier and TypeMethodDescriptionstatic LambdaInfofrom(Serializable lambda) Creates LambdaInfo from a serializable lambda 从可序列化lambda创建LambdaInfogetCapturedArg(int index) Gets a captured argument 获取捕获的参数intGets the number of captured arguments 获取捕获参数数量Object[]Gets all captured arguments 获取所有捕获的参数Gets the functional interface class name 获取函数式接口类名Gets the functional interface method name 获取函数式接口方法名Class<?> Gets the implementation class 获取实现类Gets the implementation class name 获取实现类名Gets the implementation method 获取实现方法intGets the impl method kind 获取实现方法类型Gets the implementation method name 获取实现方法名Gets the underlying SerializedLambda 获取底层SerializedLambdabooleanChecks if this is a method reference 检查是否为方法引用toString()
-
Constructor Details
-
LambdaInfo
Creates a LambdaInfo 创建LambdaInfo- Parameters:
serializedLambda- the serialized lambda | 序列化的lambdaimplClass- the implementation class | 实现类implMethod- the implementation method | 实现方法
-
-
Method Details
-
from
Creates LambdaInfo from a serializable lambda 从可序列化lambda创建LambdaInfo- Parameters:
lambda- the lambda | lambda- Returns:
- the LambdaInfo | LambdaInfo
-
getFunctionalInterfaceClassName
Gets the functional interface class name 获取函数式接口类名- Returns:
- the interface class name | 接口类名
-
getFunctionalInterfaceMethodName
Gets the functional interface method name 获取函数式接口方法名- Returns:
- the method name | 方法名
-
getImplClassName
Gets the implementation class name 获取实现类名- Returns:
- the class name | 类名
-
getImplMethodName
Gets the implementation method name 获取实现方法名- Returns:
- the method name | 方法名
-
getImplClass
Gets the implementation class 获取实现类- Returns:
- the implementation class | 实现类
-
getImplMethod
Gets the implementation method 获取实现方法- Returns:
- the implementation method or null | 实现方法或null
-
getCapturedArgCount
public int getCapturedArgCount()Gets the number of captured arguments 获取捕获参数数量- Returns:
- the count | 数量
-
getCapturedArg
Gets a captured argument 获取捕获的参数- Parameters:
index- the index | 索引- Returns:
- the captured argument | 捕获的参数
-
getCapturedArgs
Gets all captured arguments 获取所有捕获的参数- Returns:
- array of captured arguments | 捕获参数数组
-
getSerializedLambda
Gets the underlying SerializedLambda 获取底层SerializedLambda- Returns:
- the SerializedLambda | SerializedLambda
-
isMethodReference
public boolean isMethodReference()Checks if this is a method reference 检查是否为方法引用- Returns:
- true if method reference | 如果是方法引用返回true
-
getImplMethodKind
public int getImplMethodKind()Gets the impl method kind 获取实现方法类型- Returns:
- the method kind | 方法类型
-
toString
-