public interface MethodTrait extends MemberTrait<Method>, AnnotationTrait<Method>
| Modifier and Type | Method and Description |
|---|---|
default Method |
getAnnotatedElement()
Get the method as the annotated element.
|
default List<Parameter> |
getParameters()
Get the method parameter types.
|
default List<Class> |
getParameterTypes()
Get the method parameter types.
|
default Class<?> |
getReturnType()
Method return type.
|
default Boolean |
hasParameterTypes(Type... parameterTypes)
Determine if the method has parameters of the given type.
|
default Boolean |
hasReturnType(Type returnType)
Determine if the method has the given return type.
|
default <T> Optional<T> |
invoke(Object instance,
Object... args)
Invoke the method on the given instance with the given arguments.
|
getDeclaringClass, getDeclaringClassLoader, getDeclaringClassName, getMember, getNamegetAnnotation, getAnnotations, getMetaAnnotations, hasAnyAnnotations, hasAnyAnnotationsdefault Method getAnnotatedElement()
getAnnotatedElement in interface AnnotationTrait<Method>default List<Class> getParameterTypes()
default List<Parameter> getParameters()
default Class<?> getReturnType()
default Boolean hasReturnType(Type returnType)
returnType - the method return typedefault Boolean hasParameterTypes(Type... parameterTypes)
parameterTypes - the parameter typesdefault <T> Optional<T> invoke(Object instance, Object... args)
T - the return typeinstance - the instance the underlying method is invoked fromargs - method argumentsCopyright © 2016–2018 Testify Project. All rights reserved.