class DefaultMethodDescriptor extends java.lang.Object implements MethodDescriptor
MethodDescriptor
, backed by
a MethodBasedTestDescriptor
.Modifier and Type | Field and Description |
---|---|
private MethodBasedTestDescriptor |
testDescriptor |
Constructor and Description |
---|
DefaultMethodDescriptor(MethodBasedTestDescriptor testDescriptor) |
Modifier and Type | Method and Description |
---|---|
<A extends java.lang.annotation.Annotation> |
findAnnotation(java.lang.Class<A> annotationType)
Find the first annotation of
annotationType that is either
present or meta-present on the Method for
this descriptor. |
<A extends java.lang.annotation.Annotation> |
findRepeatableAnnotations(java.lang.Class<A> annotationType)
Find all repeatable annotations of
annotationType that are either present or
meta-present on the Method for this descriptor. |
java.lang.reflect.Method |
getMethod()
Get the method for this descriptor.
|
(package private) MethodBasedTestDescriptor |
getTestDescriptor() |
boolean |
isAnnotated(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
Determine if an annotation of
annotationType is either
present or meta-present on the Method for
this descriptor. |
java.lang.String |
toString() |
private final MethodBasedTestDescriptor testDescriptor
DefaultMethodDescriptor(MethodBasedTestDescriptor testDescriptor)
MethodBasedTestDescriptor getTestDescriptor()
public final java.lang.reflect.Method getMethod()
MethodDescriptor
getMethod
in interface MethodDescriptor
null
public boolean isAnnotated(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
MethodDescriptor
annotationType
is either
present or meta-present on the Method
for
this descriptor.isAnnotated
in interface MethodDescriptor
annotationType
- the annotation type to search for; never null
true
if the annotation is present or meta-presentMethodDescriptor.findAnnotation(Class)
,
MethodDescriptor.findRepeatableAnnotations(Class)
public <A extends java.lang.annotation.Annotation> java.util.Optional<A> findAnnotation(java.lang.Class<A> annotationType)
MethodDescriptor
annotationType
that is either
present or meta-present on the Method
for
this descriptor.findAnnotation
in interface MethodDescriptor
A
- the annotation typeannotationType
- the annotation type to search for; never null
Optional
containing the annotation; never null
but
potentially emptyMethodDescriptor.isAnnotated(Class)
,
MethodDescriptor.findRepeatableAnnotations(Class)
public <A extends java.lang.annotation.Annotation> java.util.List<A> findRepeatableAnnotations(java.lang.Class<A> annotationType)
MethodDescriptor
annotationType
that are either present or
meta-present on the Method
for this descriptor.findRepeatableAnnotations
in interface MethodDescriptor
A
- the annotation typeannotationType
- the repeatable annotation type to search for; never
null
null
nor
mutable, but potentially emptyMethodDescriptor.isAnnotated(Class)
,
MethodDescriptor.findAnnotation(Class)
,
Repeatable
public java.lang.String toString()
toString
in class java.lang.Object