Top Description Methods
org.junit.jupiter.api

public Interface ClassDescriptor

Annotations
@API
status:STABLE
since:5.10
Static Imports
org.apiguardian.api.API.Status.STABLE

ClassDescriptor encapsulates functionality for a given Class.
Since
5.8
See Also
ClassOrdererContext

Method Summary

Modifier and TypeMethod and Description
public <
the annotation type
A extends Annotation
>
Optional<A>

Returns:

an Optional containing the annotation; never null but potentially empty
findAnnotation
(Class<A>
the annotation type to search for; never null
annotationType
)

Find the first annotation of annotationType that is either present or meta-present on the Class for this descriptor.

public <
the annotation type
A extends Annotation
>
List<A>

Returns:

the list of all such annotations found; neither null nor mutable, but potentially empty
findRepeatableAnnotations
(Class<A>
the repeatable annotation type to search for; never null
annotationType
)

Find all repeatable annotations of annotationType that are either present or meta-present on the Class for this descriptor.

public String

Returns:

the display name for this descriptor's class; never null or blank
getDisplayName
()

Get the display name for this descriptor's class.

public Class<?>

Returns:

the class; never null
getTestClass
()

Get the class for this descriptor.

public boolean

Returns:

true if the annotation is present or meta-present
isAnnotated
(Class<? extends Annotation>
the annotation type to search for; never null
annotationType
)

Determine if an annotation of annotationType is either present or meta-present on the Class for this descriptor.

Method Detail

findAnnotationback to summary
public <A extends Annotation> Optional<A> findAnnotation(Class<A> annotationType)

Find the first annotation of annotationType that is either present or meta-present on the Class for this descriptor.

Parameters
<A>
the annotation type
annotationType:Class<A>

the annotation type to search for; never null

Returns:Optional<A>

an Optional containing the annotation; never null but potentially empty

See Also
isAnnotated(Class), findRepeatableAnnotations(Class)
findRepeatableAnnotationsback to summary
public <A extends Annotation> List<A> findRepeatableAnnotations(Class<A> annotationType)

Find all repeatable annotations of annotationType that are either present or meta-present on the Class for this descriptor.

Parameters
<A>
the annotation type
annotationType:Class<A>

the repeatable annotation type to search for; never null

Returns:List<A>

the list of all such annotations found; neither null nor mutable, but potentially empty

See Also
isAnnotated(Class), findAnnotation(Class), java.lang.annotation.Repeatable
getDisplayNameback to summary
public String getDisplayName()

Get the display name for this descriptor's class.

Returns:String

the display name for this descriptor's class; never null or blank

getTestClassback to summary
public Class<?> getTestClass()

Get the class for this descriptor.

Returns:Class<?>

the class; never null

isAnnotatedback to summary
public boolean isAnnotated(Class<? extends Annotation> annotationType)

Determine if an annotation of annotationType is either present or meta-present on the Class for this descriptor.

Parameters
annotationType:Class<? extends Annotation>

the annotation type to search for; never null

Returns:boolean

true if the annotation is present or meta-present

See Also
findAnnotation(Class), findRepeatableAnnotations(Class)