Package com.uber.cadence.internal.common
Class LambdaUtils
- java.lang.Object
-
- com.uber.cadence.internal.common.LambdaUtils
-
public final class LambdaUtils extends java.lang.Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.Object
getTarget(java.lang.invoke.SerializedLambda l)
Get target of the method reference that was converted to a lambda.static java.lang.invoke.SerializedLambda
toSerializedLambda(java.lang.Object lambda)
Unfortunate sorcery to reflect on lambda.
-
-
-
Method Detail
-
getTarget
public static java.lang.Object getTarget(java.lang.invoke.SerializedLambda l)
Get target of the method reference that was converted to a lambda.- Parameters:
l
- lambda expression that could be a method reference.- Returns:
- either target of the method reference or null if it is not reference in form object::method.
-
toSerializedLambda
public static java.lang.invoke.SerializedLambda toSerializedLambda(java.lang.Object lambda)
Unfortunate sorcery to reflect on lambda. Works only if function that lambda implements is serializable. This is whyFunctions
is needed as all its functions are serializable.- Parameters:
lambda
- lambda that potentially implementsSerializable
.- Returns:
- lambda in
SerializedLambda
form or null if its function doesn't implement Serializable.
-
-