Class Parameters
- java.lang.Object
-
- dk.cloudcreate.essentials.shared.reflection.Parameters
-
public class Parameters extends Object
Utility class for working withMethods/Methodparameters andConstructors/Constructordeclaration parameters or method/constructor call arguments
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classParameters.NULL_ARGUMENT_TYPEClass used to represent the unknown type for anullparameter toargumentTypes(Object...)
-
Constructor Summary
Constructors Constructor Description Parameters()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static 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)
-
-
-
Method Detail
-
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
public static Class<?>[] argumentTypes(Object... arguments)
Convert method/constructor call arguments to their corresponding types.
nullvalues are represented using theParameters.NULL_ARGUMENT_TYPEtype- Parameters:
arguments- arguments- Returns:
- the argument types
-
-