Interface Description
- All Known Implementing Classes:
ClassDescription
,MethodDescription
,ParameterDescription
public sealed interface Description
permits ClassDescription, MethodDescription, 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>
@NotNull Optional<T> annotation
(@NotNull Class<T> type) Gets this element'sAnnotation
for the specified type if such an annotation is present@NotNull Collection
<Annotation> a possibly-emptyCollection
of allAnnotation
s this element is annotated with.
-
Method Details
-
annotations
a possibly-emptyCollection
of allAnnotation
s this element is annotated with. -
annotation
@NotNull default <T extends Annotation> @NotNull Optional<T> annotation(@NotNull @NotNull Class<T> type) Gets this element'sAnnotation
for the specified type if such an annotation is present- Parameters:
type
- the type of the annotation to get- Returns:
- an
Optional
holding theAnnotation
if present at this element or else an emptyOptional
-