Package net.apartium.cocoabeans.reflect
Class MethodUtils
java.lang.Object
net.apartium.cocoabeans.reflect.MethodUtils
Utilities to work with java Method class
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetAllMethods(Class<?> clazz) Get all methods from given class by recursion getting declared methods from super classgetDeclaredMethods(Class<?> clazz) Get declared methods from given classstatic @Nullable MethodgetInterfaceMethod(@NotNull Method method, Class<?> interfaceClass) Get interface method from the reflection cachestatic Method[]getInterfacesMethods(@NotNull Method method) Get methods from interfaces from the reflection cachegetMethods(Class<?> clazz) Get methods from given classGet all methods from super class / interfacestatic @Nullable MethodgetSuperClassMethod(@NotNull Method method) Get method from super class via reflection cache
-
Constructor Details
-
MethodUtils
public MethodUtils()
-
-
Method Details
-
getAllMethods
Get all methods from given class by recursion getting declared methods from super class- Parameters:
clazz- class- Returns:
- set consisting of all methods from given class including super class public & non-public methods
-
getDeclaredMethods
Get declared methods from given class- Parameters:
clazz- class- Returns:
- set consisting of all declared methods from given class
-
getMethods
Get methods from given class- Parameters:
clazz- class- Returns:
- set consisting of all methods from given class
-
getMethodsFromSuperClassAndInterface
@AvailableSince("0.0.29") public static Set<Method> getMethodsFromSuperClassAndInterface(Method method) Get all methods from super class / interface- Parameters:
method- method- Returns:
- all methods from super class / interface
-
getSuperClassMethod
@AvailableSince("0.0.29") @Nullable public static @Nullable Method getSuperClassMethod(@NotNull @NotNull Method method) Get method from super class via reflection cache- Parameters:
method- method- Returns:
- super class method, or null if not exists
-
getInterfacesMethods
@AvailableSince("0.0.29") public static Method[] getInterfacesMethods(@NotNull @NotNull Method method) Get methods from interfaces from the reflection cache- Parameters:
method- method- Returns:
- interfaces methods
-
getInterfaceMethod
@AvailableSince("0.0.29") @Nullable public static @Nullable Method getInterfaceMethod(@NotNull @NotNull Method method, Class<?> interfaceClass) Get interface method from the reflection cache- Parameters:
method- methodinterfaceClass- interface class- Returns:
- interface method or null
-