Class MethodWrapper

java.lang.Object
de.aristaflow.adept2.util.reflection.MethodWrapper

public class MethodWrapper extends Object
Simple class allowing for treating methods and constructors similar. This allows to use the same code to search for an appropriate initialisation method or constructor.
  • Field Details

    • method

      protected final Method method
      The wrapped method or null in case of a wrapped constructor.
    • constructor

      protected final Constructor<?> constructor
      The wrapped constructor or null in case of a wrapped method.
  • Constructor Details

    • MethodWrapper

      public MethodWrapper(Method method)
      Creates a new wrapper for the designated method.
      Parameters:
      method - The wrapped method.
    • MethodWrapper

      public MethodWrapper(Constructor<?> constructor)
      Creates a new wrapper for the designated constructor.
      Parameters:
      constructor - The wrapped constructor.
  • Method Details

    • getMethod

      public Method getMethod()
      Gets the wrapped method or null in case of a wrapped constructor.
      Returns:
      The wrapped method or null in case of a wrapped constructor.
    • getConstructor

      public Constructor<?> getConstructor()
      Gets the wrapped constructor or null in case of a wrapped method.
      Returns:
      The wrapped constructor or null in case of a wrapped method.
    • getName

      public String getName()
      Gets the name of the wrapped method or constructor.
      Returns:
      The name of the wrapped method or constructor.
    • getParameterTypes

      public Class<?>[] getParameterTypes()
      Gets the parameter types of the wrapped method or constructor.
      Returns:
      The parameter types of the wrapped method or constructor.