public final class SerializedLambda extends Object implements Serializable
Lambda表达式实现的序列化,如编译器或语言运行库,将确保适当的实例序列化。这样做的一个手段,是确保writeReplace
方法返回SerializedLambda
实例,而不是默认的序列化进行。
SerializedLambda
有readResolve
方法找(可能是私人的)在捕捉类的静态方法称为$deserializeLambda$(SerializedLambda)
,调用本身作为第一个参数,并返回结果。λ类执行$deserializeLambda$
负责验证的SerializedLambda
性能随λ实际上被这类一致。
LambdaMetafactory
,
Serialized Form
Constructor and Description |
---|
SerializedLambda(类<?> capturingClass, String functionalInterfaceClass, String functionalInterfaceMethodName, String functionalInterfaceMethodSignature, int implMethodKind, String implClass, String implMethodName, String implMethodSignature, String instantiatedMethodType, Object[] capturedArgs)
创建在λ厂址底层信息的
SerializedLambda 。
|
Modifier and Type | Method and Description |
---|---|
Object |
getCapturedArg(int i)
获得动态参数λ的拍摄现场。
|
int |
getCapturedArgCount()
得到的动态参数λ捕捉现场清点。
|
String |
getCapturingClass()
得到了这λ的类的名称。
|
String |
getFunctionalInterfaceClass()
把名字调用的类型,这λ已转换
|
String |
getFunctionalInterfaceMethodName()
获得的主要方法的名称的功能界面,这λ已转换。
|
String |
getFunctionalInterfaceMethodSignature()
获得的主要方法签名的功能界面,这λ已转换。
|
String |
getImplClass()
获取包含实现方法的类的名称。
|
int |
getImplMethodKind()
获得方法处理类(见
MethodHandleInfo )的实现方法。
|
String |
getImplMethodName()
获取实现方法的名称。
|
String |
getImplMethodSignature()
获取实现方法的签名。
|
String |
getInstantiatedMethodType()
在类型变量与从捕获的网站实例的主要功能界面的替代方法的签名。
|
String |
toString()
返回对象的字符串表示形式。
|
public SerializedLambda(类<?> capturingClass, String functionalInterfaceClass, String functionalInterfaceMethodName, String functionalInterfaceMethodSignature, int implMethodKind, String implClass, String implMethodName, String implMethodSignature, String instantiatedMethodType, Object[] capturedArgs)
SerializedLambda
。
capturingClass
-类中的lambda表达式出现
functionalInterfaceClass
名称,在斜线分隔的形式,对返回的lambda对象的静态类型
functionalInterfaceMethodName
名称功能界面的方法目前在λ厂网站
functionalInterfaceMethodSignature
-功能界面的方法目前在λ厂现场签名
implMethodKind
-实施方法处理类
implClass
名称,在斜线分隔的形式,为班级举办的实现方法
implMethodName
-实现方法的名称
implMethodSignature
-实现方法的签名
instantiatedMethodType
后型变量与他们从捕获的网站实例取代的主要功能的界面方法的签名
capturedArgs
-λ厂网站的动态参数,它表示由lambda捕获变量
public String getCapturingClass()
public String getFunctionalInterfaceClass()
public String getFunctionalInterfaceMethodName()
public String getFunctionalInterfaceMethodSignature()
public String getImplClass()
public String getImplMethodName()
public String getImplMethodSignature()
public int getImplMethodKind()
MethodHandleInfo
)的实现方法。
public final String getInstantiatedMethodType()
public int getCapturedArgCount()
public Object getCapturedArg(int i)
i
的论点来捕捉
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.