Class Methods
- java.lang.Object
-
- dk.cloudcreate.essentials.shared.reflection.Methods
-
-
Constructor Summary
Constructors Constructor Description Methods()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description 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 usingParameters.parameterTypesMatches(Class[], Class[], boolean)static Set<Method>methods(Class<?> type)Get all methods on type.
-
-
-
Method Detail
-
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
public static Set<Method> methods(Class<?> type)
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:
Accessibles.accessible(T)
-
-