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 classLambdas.KindThe kind of lambda.static classLambdas.LambdaInfo
-
Constructor Summary
Constructors Constructor Description Lambdas()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static MethodgetFunctionalMethod(SerializedLambda serializedLambda)static MethodgetImplementationMethod(SerializedLambda serializedLambda)static MethodgetMethod(Class<?> clazz, String methodName)static MethodgetMethod(String className, String methodName)static SerializedLambdagetSerializedLambda(Object lambda)Tries to get a SerializedLambda from an Object by searching the class hierarchy for awriteReplacemethod.static Lambdas.LambdaInforeflect(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 awriteReplacemethod. 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
-
-