Class MethodUtils

java.lang.Object
net.apartium.cocoabeans.reflect.MethodUtils

public class MethodUtils extends Object
Utilities to work with java Method class
See Also:
  • Constructor Details

    • MethodUtils

      public MethodUtils()
  • Method Details

    • getAllMethods

      @AvailableSince("0.0.38") public static Set<Method> getAllMethods(Class<?> clazz)
      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

      public static Set<Method> getDeclaredMethods(Class<?> clazz)
      Get declared methods from given class
      Parameters:
      clazz - class
      Returns:
      set consisting of all declared methods from given class
    • getMethods

      public static Set<Method> getMethods(Class<?> clazz)
      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 - method
      interfaceClass - interface class
      Returns:
      interface method or null