Package nl.pim16aap2.util.reflection
Class ParameterGroup
java.lang.Object
nl.pim16aap2.util.reflection.ParameterGroup
Represents a group of parameters that describes, for example, the input arguments of a
Constructor.
The advantage over using an array of raw Class objects is that these parameters can be marked optional,
allowing for greater freedom when searching for a method with a set of parameters.
For example, when providing the types {int.class, boolean.class, float.class} and mark float.class as
optional, this set of parameters can be used to match a method void fun(int, boolean) as well as a method
void fun(int, boolean, float.
Use ParameterGroup.Builder to create a new instance.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
ParameterGroup
-
-
Method Details
-
matches
Checks if a set of types matches the current set of parameters.Any optional parameters may be skipped if that helps to achieve a match.
- Parameters:
types- The types to compare the parameters against.- Returns:
- True if the provided types match the defined parameters.
-
toString
-