Class Methods
java.lang.Object
dk.cloudcreate.essentials.shared.reflection.Methods
Utility class for working with
Method's-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfindMatchingMethod(Set<Method> methods, String methodName, Class<?> returnType, Class<?>... parametersTypes) Find a matching method based on: method name return type exact parameter-type comparison usingParameters.parameterTypesMatches(Class[], Class[], boolean)Get all methods on type.
-
Constructor Details
-
Methods
public Methods()
-
-
Method Details
-
findMatchingMethod
public static Optional<Method> findMatchingMethod(Set<Method> methods, String methodName, Class<?> returnType, Class<?>... parametersTypes) Find a matching method based on:- method name
- return type
- exact parameter-type comparison using
Parameters.parameterTypesMatches(Class[], Class[], boolean)
- Parameters:
methods- the set of method to search (e.g. fetched usingmethods(Class))methodName- the name of the method we're looking forreturnType- the method return type that much matchparametersTypes- the method parameter types that must be matched- Returns:
- Optional with the exact matching method or
Optional.empty()
-
methods
Get all methods on type. For overridden methods only the most specific (typically being the method overridden by a subclass) is returned- Parameters:
type- the type we want to find all methods within- Returns:
- the list of all methods (each marked as accessible) on this type
- See Also:
-