Package ninja.utils
Class Lambdas
- java.lang.Object
-
- ninja.utils.Lambdas
-
public class Lambdas extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Lambdas.Kind
The kind of lambda.static class
Lambdas.LambdaInfo
-
Constructor Summary
Constructors Constructor Description Lambdas()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Method
getFunctionalMethod(SerializedLambda serializedLambda)
static Method
getImplementationMethod(SerializedLambda serializedLambda)
static Method
getMethod(Class<?> clazz, String methodName)
static Method
getMethod(String className, String methodName)
static SerializedLambda
getSerializedLambda(Object lambda)
Tries to get a SerializedLambda from an Object by searching the class hierarchy for awriteReplace
method.static Lambdas.LambdaInfo
reflect(Object lambda)
-
-
-
Method Detail
-
reflect
public static Lambdas.LambdaInfo reflect(Object lambda)
-
getSerializedLambda
public static SerializedLambda getSerializedLambda(Object lambda)
Tries to get a SerializedLambda from an Object by searching the class hierarchy for awriteReplace
method. The lambda must be serializable in order for this method to return a value.- Parameters:
lambda
- An object that is an instance of a functional interface.- Returns:
- The SerializedLambda
-
getFunctionalMethod
public static Method getFunctionalMethod(SerializedLambda serializedLambda) throws NoSuchMethodException, ClassNotFoundException
-
getImplementationMethod
public static Method getImplementationMethod(SerializedLambda serializedLambda) throws NoSuchMethodException, ClassNotFoundException
-
getMethod
public static Method getMethod(String className, String methodName) throws NoSuchMethodException, ClassNotFoundException
-
getMethod
public static Method getMethod(Class<?> clazz, String methodName) throws NoSuchMethodException, ClassNotFoundException
-
-