Interface Description
- All Known Implementing Classes:
AnnotationDescription, ClassDescription, MethodDescription, PackageDescription, ParameterDescription
public sealed interface Description
permits AnnotationDescription<T>, ClassDescription, MethodDescription, PackageDescription, ParameterDescription
The common interface of all Description types.
A Description is, as the name says, a description of a class, method or parameter, similar to how
java.lang.reflect works.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondefault <T extends Annotation>
Optional<T> annotation(Class<T> type) Gets this elementsAnnotationfor the specified type if such an annotation is presenta possibly-emptyCollectionof allAnnotations this element is annotated with.
-
Method Details
-
annotations
Collection<AnnotationDescription<?>> annotations()a possibly-emptyCollectionof allAnnotations this element is annotated with. -
annotation
Gets this elementsAnnotationfor the specified type if such an annotation is present- Parameters:
type- the type of the annotation to get- Returns:
- an
Optionalholding theAnnotationif present at this element or else an emptyOptional
-