public interface TypeTrait
| Modifier and Type | Method and Description |
|---|---|
default Method |
findMethod(Class<?> type,
String methodName,
Class<?>... methodArgTypes)
Find a method with the given name and argument types.
|
default Optional<Method> |
findMethod(String methodName)
Find a method with the given name.
|
default ClassLoader |
getClassLoader()
Get the type's class loader.
|
Type |
getGenericType()
Get the instance generic type.
|
Class<?> |
getType()
Get the instance type.
|
default String |
getTypeName()
Get human readable type name.
|
default <T> Optional<T> |
invoke(Object instance,
String methodName,
Object... methodArgs)
Invoke the given method with the given argument on the given instance.
|
default Boolean |
isSubtypeOf(Type type)
Determine if the type is a subtype of the given type.
|
default Boolean |
isSupertypeOf(Type type)
Determine if the type is a supertype of the given type.
|
Class<?> getType()
Type getGenericType()
default String getTypeName()
default ClassLoader getClassLoader()
default Boolean isSubtypeOf(Type type)
type - the subtypedefault Boolean isSupertypeOf(Type type)
type - the super typedefault <T> Optional<T> invoke(Object instance, String methodName, Object... methodArgs)
T - the return typeinstance - the instance the underlying method is invoked frommethodName - the method namemethodArgs - method argumentsdefault Method findMethod(Class<?> type, String methodName, Class<?>... methodArgTypes)
type - type that will be inspected for the methodmethodName - the method namemethodArgTypes - the method argument typesIllegalStateExceptiondefault Optional<Method> findMethod(String methodName)
methodName - the method nameIllegalStateExceptionCopyright © 2016–2018 Testify Project. All rights reserved.