public class ParameterUtils
extends Object
Utility methods for working with method and constructor parameters.
Provides predicates and comparison utilities for Parameter arrays, supporting parameter equality checks, compatibility analysis, and varargs detection. Used extensively in method resolution and signature matching during compilation and reflection.
| Type Params | Return Type | Name and description |
|---|---|---|
|
public static boolean |
isVargs(Parameter[] parameters)Checks if the last parameter in the array is a varargs parameter (array type). |
|
public static boolean |
parametersCompatible(Parameter[] source, Parameter[] target)Checks if source parameters are compatible with target parameters using type assignability. |
|
public static boolean |
parametersEqual(Parameter[] a, Parameter[] b)Checks if two parameter arrays have equal types (exact type matching). |
|
public static boolean |
parametersEqualWithWrapperType(Parameter[] a, Parameter[] b)Checks if two parameter arrays have equal types, treating wrapper and primitive types as equal. |
Checks if the last parameter in the array is a varargs parameter (array type).
parameters - the parameter array to check, may be nullChecks if source parameters are compatible with target parameters using type assignability. Each parameter type in source must be assignable to the corresponding target parameter type.
source - the source parameter array (may be null)target - the target parameter array (may be null)Checks if two parameter arrays have equal types (exact type matching).
a - the first parameter array, may be nullb - the second parameter array, may be nullChecks if two parameter arrays have equal types, treating wrapper and primitive types as equal.
For example, int.class and Integer.class are considered equal.
a - the first parameter array, may be nullb - the second parameter array, may be null