Package org.junit.jupiter.api
Interface ClassDescriptor
@API(status=STABLE,
since="5.10")
public interface ClassDescriptor
ClassDescriptor encapsulates functionality for a given Class.- Since:
- 5.8
- See Also:
-
Method Summary
Modifier and TypeMethodDescription<A extends Annotation>
Optional<A>findAnnotation(Class<A> annotationType) Find the first annotation ofannotationTypethat is either present or meta-present on theClassfor this descriptor.<A extends Annotation>
List<A>findRepeatableAnnotations(Class<A> annotationType) Find all repeatable annotations ofannotationTypethat are either present or meta-present on theClassfor this descriptor.Get the display name for this descriptor'sclass.Class<?>Get the class for this descriptor.booleanisAnnotated(Class<? extends Annotation> annotationType) Determine if an annotation ofannotationTypeis either present or meta-present on theClassfor this descriptor.
-
Method Details
-
getTestClass
Class<?> getTestClass()Get the class for this descriptor.- Returns:
- the class; never
null
-
getDisplayName
String getDisplayName()Get the display name for this descriptor'sclass.- Returns:
- the display name for this descriptor's class; never
nullor blank
-
isAnnotated
Determine if an annotation ofannotationTypeis either present or meta-present on theClassfor this descriptor.- Parameters:
annotationType- the annotation type to search for; nevernull- Returns:
trueif the annotation is present or meta-present- See Also:
-
findAnnotation
Find the first annotation ofannotationTypethat is either present or meta-present on theClassfor this descriptor.- Type Parameters:
A- the annotation type- Parameters:
annotationType- the annotation type to search for; nevernull- Returns:
- an
Optionalcontaining the annotation; nevernullbut potentially empty - See Also:
-
findRepeatableAnnotations
Find all repeatable annotations ofannotationTypethat are either present or meta-present on theClassfor 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
nullnor mutable, but potentially empty - See Also:
-