public final class ExecutableHelper extends Object
Constructor and Description |
---|
ExecutableHelper(TypeResolutionHelper typeResolutionHelper) |
Modifier and Type | Method and Description |
---|---|
static ElementType |
getElementType(Executable executable) |
static String |
getExecutableAsString(String name,
Class<?>... parameterTypes)
Returns a string representation of an executable with the given name and parameter types in the form
{@code
|
static Signature |
getSignature(Executable executable) |
static Signature |
getSignature(String name,
Class<?>[] parameterTypes) |
static String |
getSimpleName(Executable executable) |
boolean |
isResolvedToSameMethodInHierarchy(Class<?> mainSubType,
Method left,
Method right)
Checks if a pair of given methods (
left and right ) are resolved to the same
method based on the mainSubType type. |
boolean |
overrides(Callable subTypeMethod,
Callable superTypeMethod) |
boolean |
overrides(Method subTypeMethod,
Method superTypeMethod)
Checks, whether
subTypeMethod overrides superTypeMethod . |
public ExecutableHelper(TypeResolutionHelper typeResolutionHelper)
public boolean overrides(Method subTypeMethod, Method superTypeMethod)
subTypeMethod
overrides superTypeMethod
.subTypeMethod
- The sub type method (cannot be null
).superTypeMethod
- The super type method (cannot be null
).true
if subTypeMethod
overrides superTypeMethod
,
false
otherwise.public boolean isResolvedToSameMethodInHierarchy(Class<?> mainSubType, Method left, Method right)
left
and right
) are resolved to the same
method based on the mainSubType
type.mainSubType
- a type at the bottom of class hierarchy to be used to lookup the methods.left
- one of the methods to checkright
- another of the methods to checktrue
if a pair of methods are equal left == right
, or one of the methods
override another one in the class hierarchy with mainSubType
at the bottom,
false
otherwise.public static String getSimpleName(Executable executable)
public static Signature getSignature(Executable executable)
public static String getExecutableAsString(String name, Class<?>... parameterTypes)
<name>(<parameterType 0> ... <parameterType n>)
, e.g. for logging purposes.name
- the name of the executableparameterTypes
- the types of the executable's parameterspublic static ElementType getElementType(Executable executable)
Copyright © 2007-2021 Red Hat, Inc. All Rights Reserved