Class MethodWrapper
java.lang.Object
de.aristaflow.adept2.util.reflection.MethodWrapper
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 Summary
FieldsModifier and TypeFieldDescriptionprotected final Constructor<?>The wrapped constructor ornullin case of a wrapped method.protected final MethodThe wrapped method ornullin case of a wrapped constructor. -
Constructor Summary
ConstructorsConstructorDescriptionMethodWrapper(Constructor<?> constructor) Creates a new wrapper for the designated constructor.MethodWrapper(Method method) Creates a new wrapper for the designated method. -
Method Summary
Modifier and TypeMethodDescriptionConstructor<?>Gets the wrapped constructor ornullin case of a wrapped method.Gets the wrapped method ornullin case of a wrapped constructor.getName()Gets the name of the wrapped method or constructor.Class<?>[]Gets the parameter types of the wrapped method or constructor.
-
Field Details
-
method
The wrapped method ornullin case of a wrapped constructor. -
constructor
The wrapped constructor ornullin case of a wrapped method.
-
-
Constructor Details
-
MethodWrapper
Creates a new wrapper for the designated method.- Parameters:
method- The wrapped method.
-
MethodWrapper
Creates a new wrapper for the designated constructor.- Parameters:
constructor- The wrapped constructor.
-
-
Method Details
-
getMethod
Gets the wrapped method ornullin case of a wrapped constructor.- Returns:
- The wrapped method or
nullin case of a wrapped constructor.
-
getConstructor
Gets the wrapped constructor ornullin case of a wrapped method.- Returns:
- The wrapped constructor or
nullin case of a wrapped method.
-
getName
Gets the name of the wrapped method or constructor.- Returns:
- The name of the wrapped method or constructor.
-
getParameterTypes
Gets the parameter types of the wrapped method or constructor.- Returns:
- The parameter types of the wrapped method or constructor.
-