This commit is contained in:
Gary Gregory 2024-05-24 09:15:59 -04:00
parent e7846f43c0
commit 0067a2d1d3
1 changed files with 14 additions and 8 deletions

View File

@ -66,6 +66,7 @@ public class MethodUtils {
/**
* Returns the aggregate number of inheritance hops between assignable argument class types. Returns -1
* if the arguments aren't assignable. Fills a specific purpose for getMatchingMethod and is not generalized.
*
* @param fromClassArray the Class array to calculate the distance from.
* @param toClassArray the Class array to calculate the distance to.
* @return the aggregate number of inheritance hops between assignable argument class types.
@ -95,7 +96,7 @@ public class MethodUtils {
}
/**
* Returns an accessible method (that is, one that can be invoked via
* Gets an accessible method (that is, one that can be invoked via
* reflection) with given name and parameters. If no such method
* can be found, return {@code null}.
* This is just a convenience wrapper for
@ -116,7 +117,7 @@ public class MethodUtils {
}
/**
* Returns an accessible method (that is, one that can be invoked via
* Gets an accessible method (that is, one that can be invoked via
* reflection) that implements the specified Method. If no such method
* can be found, return {@code null}.
*
@ -148,7 +149,7 @@ public class MethodUtils {
}
/**
* Returns an accessible method (that is, one that can be invoked via
* Gets an accessible method (that is, one that can be invoked via
* reflection) that implements the specified method, by scanning through
* all implemented interfaces and subinterfaces. If no such method
* can be found, return {@code null}.
@ -196,7 +197,7 @@ public class MethodUtils {
}
/**
* Returns an accessible method (that is, one that can be invoked via
* Gets an accessible method (that is, one that can be invoked via
* reflection) by scanning through the superclasses. If no such method
* can be found, return {@code null}.
*
@ -308,7 +309,7 @@ public class MethodUtils {
}
/**
* Finds an accessible method that matches the given name and has compatible parameters.
* Gets an accessible method that matches the given name and has compatible parameters.
* Compatible parameters mean that every method parameter is assignable from
* the given parameters.
* In other words, it finds a method with the given name
@ -375,8 +376,9 @@ public class MethodUtils {
}
/**
* Retrieves a method whether or not it's accessible. If no such method
* Gets a method whether or not it's accessible. If no such method
* can be found, return {@code null}.
*
* @param cls The class that will be subjected to the method search
* @param methodName The method that we wish to call
* @param parameterTypes Argument class types
@ -452,6 +454,7 @@ public class MethodUtils {
/**
* Gets all methods of the given class that are annotated with the given annotation.
*
* @param cls
* the {@link Class} to query
* @param annotationCls
@ -482,6 +485,7 @@ public class MethodUtils {
/**
* Gets all class level public methods of the given class that are annotated with the given annotation.
*
* @param cls
* the {@link Class} to query
* @param annotationCls
@ -496,6 +500,7 @@ public class MethodUtils {
/**
* Gets all methods of the given class that are annotated with the given annotation.
*
* @param cls
* the {@link Class} to query
* @param annotationCls
@ -515,6 +520,7 @@ public class MethodUtils {
/**
* Gets the hierarchy of overridden methods down to {@code result} respecting generics.
*
* @param method lowest to consider
* @param interfacesBehavior whether to search interfaces, {@code null} {@code implies} false
* @return Set<Method> in ascending order from sub- to superclass
@ -559,8 +565,8 @@ public class MethodUtils {
}
/**
* Given an arguments array passed to a varargs method, return an array of arguments in the canonical form,
* i.e. an array with the declared number of parameters, and whose last parameter is an array of the varargs type.
* Gets an array of arguments in the canonical form, given an arguments array passed to a varargs method,
* for example an array with the declared number of parameters, and whose last parameter is an array of the varargs type.
*
* @param args the array of arguments passed to the varags method
* @param methodParameterTypes the declared array of method parameter types