-
- All Known Implementing Classes:
DefaultClassDescriptor
@API(status=STABLE, since="5.10") public interface ClassDescriptor
ClassDescriptor
encapsulates functionality for a givenClass
.- Since:
- 5.8
- See Also:
ClassOrdererContext
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <A extends java.lang.annotation.Annotation>
java.util.Optional<A>findAnnotation(java.lang.Class<A> annotationType)
Find the first annotation ofannotationType
that is either present or meta-present on theClass
for this descriptor.<A extends java.lang.annotation.Annotation>
java.util.List<A>findRepeatableAnnotations(java.lang.Class<A> annotationType)
Find all repeatable annotations ofannotationType
that are either present or meta-present on theClass
for this descriptor.java.lang.String
getDisplayName()
Get the display name for this descriptor'sclass
.java.lang.Class<?>
getTestClass()
Get the class for this descriptor.boolean
isAnnotated(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
Determine if an annotation ofannotationType
is either present or meta-present on theClass
for this descriptor.
-
-
-
Method Detail
-
getTestClass
java.lang.Class<?> getTestClass()
Get the class for this descriptor.- Returns:
- the class; never
null
-
getDisplayName
java.lang.String getDisplayName()
Get the display name for this descriptor'sclass
.- Returns:
- the display name for this descriptor's class; never
null
or blank
-
isAnnotated
boolean isAnnotated(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
Determine if an annotation ofannotationType
is either present or meta-present on theClass
for this descriptor.- Parameters:
annotationType
- the annotation type to search for; nevernull
- Returns:
true
if the annotation is present or meta-present- See Also:
findAnnotation(Class)
,findRepeatableAnnotations(Class)
-
findAnnotation
<A extends java.lang.annotation.Annotation> java.util.Optional<A> findAnnotation(java.lang.Class<A> annotationType)
Find the first annotation ofannotationType
that is either present or meta-present on theClass
for this descriptor.- Type Parameters:
A
- the annotation type- Parameters:
annotationType
- the annotation type to search for; nevernull
- Returns:
- an
Optional
containing the annotation; nevernull
but potentially empty - See Also:
isAnnotated(Class)
,findRepeatableAnnotations(Class)
-
findRepeatableAnnotations
<A extends java.lang.annotation.Annotation> java.util.List<A> findRepeatableAnnotations(java.lang.Class<A> annotationType)
Find all repeatable annotations ofannotationType
that are either present or meta-present on theClass
for this descriptor.- Type Parameters:
A
- the annotation type- Parameters:
annotationType
- the repeatable annotation type to search for; nevernull
- Returns:
- the list of all such annotations found; neither
null
nor mutable, but potentially empty - See Also:
isAnnotated(Class)
,findAnnotation(Class)
,Repeatable
-
-