Class Parameters
java.lang.Object
dk.cloudcreate.essentials.shared.reflection.Parameters
Utility class for working with
Methods/Method parameters and Constructors/Constructor
declaration parameters or method/constructor call arguments-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classClass used to represent the unknown type for anullparameter toargumentTypes(Object...) -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Class<?>[]argumentTypes(Object... arguments) Convert method/constructor call arguments to their corresponding types.
nullvalues are represented using theParameters.NULL_ARGUMENT_TYPEtypestatic booleanparameterTypesMatches(Class<?>[] actualParameterTypes, Class<?>[] declaredParameterTypes, boolean exactMatch) Check if an array of actual-parameter-types MATCH an array of declared-parameter-types while takingnullactual parameter types andBoxedTypes.boxedType(java.lang.Class<?>)into consideration (in caseexactMatchis false)
-
Constructor Details
-
Parameters
public Parameters()
-
-
Method Details
-
parameterTypesMatches
public static boolean parameterTypesMatches(Class<?>[] actualParameterTypes, Class<?>[] declaredParameterTypes, boolean exactMatch) Check if an array of actual-parameter-types MATCH an array of declared-parameter-types while takingnullactual parameter types andBoxedTypes.boxedType(java.lang.Class<?>)into consideration (in caseexactMatchis false)- Parameters:
actualParameterTypes- the actual parameter types (deduced from actual parameter values)declaredParameterTypes- the declared parameter types defined on theMethodorConstructorexactMatch- Must the match be exact (each parameter type MUST match precisely)
or do we allow testing usingBoxedTypes.boxedType(Class),nullactualParameterTypes andisAssignableFromchecks to bypass individual type matches- Returns:
- true if the parameter types match or not
-
argumentTypes
Convert method/constructor call arguments to their corresponding types.
nullvalues are represented using theParameters.NULL_ARGUMENT_TYPEtype- Parameters:
arguments- arguments- Returns:
- the argument types
-