Package org.github.jamm.utils
Class MethodHandleUtils
java.lang.Object
org.github.jamm.utils.MethodHandleUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic Optional<MethodHandle> mayBeMethodHandle(Class<?> klass, String methodName) Returns theMethodHandlefor the specified class and method if the method exists.static MethodHandlemethodHandle(Field field) Returns theMethodHandlefor the specified field.static MethodHandlemethodHandle(Method method) Returns theMethodHandlefor the specified method.
-
Method Details
-
mayBeMethodHandle
Returns theMethodHandlefor the specified class and method if the method exists.- Parameters:
klass- the classmethodName- the method name- Returns:
- an
Optionalfor theMethodHandle
-
methodHandle
Returns theMethodHandlefor the specified method.- Parameters:
method- the method- Returns:
- the
MethodHandlefor the specified method - Throws:
IllegalAccessException- if the method is not accessible
-
methodHandle
Returns theMethodHandlefor the specified field.- Parameters:
field- the field- Returns:
- the
MethodHandlefor the specified field - Throws:
IllegalAccessException- if the method is not accessible
-