@Immutable public interface AnnotationMetadata extends AnnotationSource
An interface implemented at compile time by Micronaut that allows the inspection of annotation metadata and stereotypes (meta-annotations)
.
This interface exposes fast and efficient means to expose annotation data at runtime without requiring reflective tricks to read the annotation metadata
Users of Micronaut should in general avoid the methods of the AnnotatedElement
interface and use this interface instead to obtain maximum efficiency
Core framework types such as io.micronaut.inject.BeanDefinition and io.micronaut.inject.ExecutableMethod implement this interface
Modifier and Type | Field and Description |
---|---|
static String |
CLASS_NAME_SUFFIX
The suffix used when saving compiled metadata to classes.
|
static AnnotationMetadata |
EMPTY_METADATA
A constant for representing empty metadata.
|
static String |
VALUE_MEMBER
The default value() member.
|
EMPTY
Modifier and Type | Method and Description |
---|---|
default Optional<Boolean> |
booleanValue(Class<? extends Annotation> annotation)
The value as an optional boolean for the given annotation and member.
|
default Optional<Boolean> |
booleanValue(Class<? extends Annotation> annotation,
String member)
The value as an optional boolean for the given annotation and member.
|
default Optional<Boolean> |
booleanValue(String annotation)
The value as an optional boolean for the given annotation and member.
|
default Optional<Boolean> |
booleanValue(String annotation,
String member)
The value as an optional boolean for the given annotation and member.
|
default Optional<Class> |
classValue(Class<? extends Annotation> annotation)
The value of the annotation as a Class.
|
default Optional<Class> |
classValue(Class<? extends Annotation> annotation,
String member)
The value of the annotation as a Class.
|
default Optional<Class> |
classValue(String annotation)
The value of the annotation as a Class.
|
default Optional<Class> |
classValue(String annotation,
String member)
The value of the annotation as a Class.
|
default <T> Class<T>[] |
classValues(Class<? extends Annotation> annotation)
The value of the annotation as a Class.
|
default <T> Class<T>[] |
classValues(Class<? extends Annotation> annotation,
String member)
The value of the annotation as a Class.
|
default <T> Class<T>[] |
classValues(String annotation)
The value of the annotation as a Class.
|
default <T> Class<T>[] |
classValues(String annotation,
String member)
The value of the annotation as a Class.
|
default OptionalDouble |
doubleValue(Class<? extends Annotation> annotation)
The value as an
OptionalDouble for the given annotation and member. |
default OptionalDouble |
doubleValue(Class<? extends Annotation> annotation,
String member)
The value as an
OptionalDouble for the given annotation and member. |
default OptionalDouble |
doubleValue(String annotation,
String member)
The value as an
OptionalDouble for the given annotation and member. |
default <E extends Enum> |
enumValue(Class<? extends Annotation> annotation,
Class<E> enumType)
The value of the annotation as a Class.
|
default <E extends Enum> |
enumValue(Class<? extends Annotation> annotation,
String member,
Class<E> enumType)
The value of the annotation as a Class.
|
default <E extends Enum> |
enumValue(String annotation,
Class<E> enumType)
The value of the given enum.
|
default <E extends Enum> |
enumValue(String annotation,
String member,
Class<E> enumType)
The value of the annotation as a Class.
|
default <T extends Annotation> |
findAnnotation(Class<T> annotationClass)
Get all of the values for the given annotation.
|
default <T extends Annotation> |
findDeclaredAnnotation(Class<T> annotationClass)
Get all of the values for the given annotation that are directly declared on the annotated element.
|
default Optional<String> |
getAnnotationNameByStereotype(Class<? extends Annotation> stereotype)
Find the first annotation name for the given stereotype.
|
default Optional<String> |
getAnnotationNameByStereotype(String stereotype)
Find the first annotation name for the given stereotype.
|
default Set<String> |
getAnnotationNames()
All the annotation names this metadata declares.
|
default List<String> |
getAnnotationNamesByStereotype(Class<? extends Annotation> stereotype)
Resolve all of the annotation names that feature the given stereotype.
|
default List<String> |
getAnnotationNamesByStereotype(String stereotype)
Resolve all of the annotation names that feature the given stereotype.
|
default Optional<Class<? extends Annotation>> |
getAnnotationType(String name)
Gets the type for a given annotation if it is present on the classpath.
|
default Optional<Class<? extends Annotation>> |
getAnnotationTypeByStereotype(Class<? extends Annotation> stereotype)
Find the first annotation name for the given stereotype.
|
default Optional<Class<? extends Annotation>> |
getAnnotationTypeByStereotype(String stereotype)
Find the first annotation name for the given stereotype.
|
default List<Class<? extends Annotation>> |
getAnnotationTypesByStereotype(Class<? extends Annotation> stereotype)
Resolve all of the annotation names that feature the given stereotype.
|
default <T extends Annotation> |
getAnnotationValuesByType(Class<T> annotationType)
Gets all the annotation values by the given repeatable type.
|
default Optional<String> |
getDeclaredAnnotationNameByStereotype(String stereotype)
Find the first annotation name for the given stereotype.
|
default Set<String> |
getDeclaredAnnotationNames()
All the declared annotation names this metadata declares.
|
default List<String> |
getDeclaredAnnotationNamesByStereotype(String stereotype)
Resolve all of the annotations names for the given stereotype that are declared annotations.
|
default Optional<Class<? extends Annotation>> |
getDeclaredAnnotationTypeByStereotype(Class<? extends Annotation> stereotype)
Find the first declared annotation name for the given stereotype.
|
default Optional<Class<? extends Annotation>> |
getDeclaredAnnotationTypeByStereotype(String stereotype)
Find the first annotation name for the given stereotype.
|
default <T extends Annotation> |
getDeclaredAnnotationValuesByType(Class<T> annotationType)
Gets only declared annotation values by the given repeatable type.
|
default <T> Optional<T> |
getDefaultValue(Class<? extends Annotation> annotation,
String member,
Argument<T> requiredType)
Return the default value for the given annotation member.
|
default <T> Optional<T> |
getDefaultValue(Class<? extends Annotation> annotation,
String member,
Class<T> requiredType)
Return the default value for the given annotation member.
|
default <T> Optional<T> |
getDefaultValue(String annotation,
String member,
Argument<T> requiredType)
Return the default value for the given annotation member.
|
default <T> Optional<T> |
getDefaultValue(String annotation,
String member,
Class<T> requiredType)
Return the default value for the given annotation member.
|
default Optional<Object> |
getValue(Class<? extends Annotation> annotation)
Get the value of default "value" the given annotation.
|
default <T> Optional<T> |
getValue(Class<? extends Annotation> annotation,
Argument<T> requiredType)
Get the value of default "value" the given annotation.
|
default <T> Optional<T> |
getValue(Class<? extends Annotation> annotation,
Class<T> requiredType)
Get the value of default "value" the given annotation.
|
default Optional<Object> |
getValue(Class<? extends Annotation> annotation,
String member)
Get the value of the given annotation member.
|
default <T> Optional<T> |
getValue(Class<? extends Annotation> annotation,
String member,
Argument<T> requiredType)
Get the value of the given annotation member.
|
default <T> Optional<T> |
getValue(Class<? extends Annotation> annotation,
String member,
Class<T> requiredType)
Get the value of the given annotation member.
|
default Optional<Object> |
getValue(String annotation)
Get the value of default "value" the given annotation.
|
default <T> Optional<T> |
getValue(String annotation,
Argument<T> requiredType)
Get the value of default "value" the given annotation.
|
default <T> Optional<T> |
getValue(String annotation,
Class<T> requiredType)
Get the value of default "value" the given annotation.
|
default Optional<Object> |
getValue(String annotation,
String member)
Get the value of the given annotation member.
|
default <T> Optional<T> |
getValue(String annotation,
String member,
Argument<T> requiredType)
Get the value of the given annotation member.
|
default <T> Optional<T> |
getValue(String annotation,
String member,
Class<T> requiredType)
Get the value of the given annotation member.
|
default <T> OptionalValues<T> |
getValues(Class<? extends Annotation> annotation,
Class<T> valueType)
Get all of the values for the given annotation.
|
default <T> OptionalValues<T> |
getValues(String annotation,
Class<T> valueType)
Get all of the values for the given annotation and type of the underlying values.
|
default boolean |
hasAnnotation(Class<? extends Annotation> annotation)
Checks whether this object has the given annotation on the object itself or inherited from a parent.
|
default boolean |
hasAnnotation(String annotation)
Checks whether this object has the given annotation on the object itself or inherited from a parent.
|
default boolean |
hasDeclaredAnnotation(Class<? extends Annotation> annotation)
Checks whether this object has the given annotation directly declared on the object.
|
default boolean |
hasDeclaredAnnotation(String annotation)
Checks whether this object has the given annotation directly declared on the object.
|
default boolean |
hasDeclaredStereotype(Class<? extends Annotation>... annotations)
Checks whether this object has any of the given stereotype directly declared on the object.
|
default boolean |
hasDeclaredStereotype(Class<? extends Annotation> stereotype)
Checks whether this object has the given stereotype directly declared on the object.
|
default boolean |
hasDeclaredStereotype(String annotation)
Checks whether this object has the given annotation stereotype on the object itself and not inherited from a parent
|
default boolean |
hasStereotype(Class<? extends Annotation>... annotations)
Check whether any of the given stereotypes is present.
|
default boolean |
hasStereotype(Class<? extends Annotation> annotation)
Checks whether this object has the given annotation stereotype on the object itself or inherited from a parent
|
default boolean |
hasStereotype(String annotation)
Checks whether this object has the given annotation stereotype on the object itself or inherited from a parent
|
default boolean |
hasStereotype(String[] annotations)
Check whether any of the given stereotypes is present.
|
default OptionalInt |
intValue(Class<? extends Annotation> annotation)
The value as an
OptionalInt for the given annotation and member. |
default OptionalInt |
intValue(Class<? extends Annotation> annotation,
String member)
The value as an
OptionalInt for the given annotation and member. |
default OptionalInt |
intValue(String annotation,
String member)
The value as an
OptionalInt for the given annotation and member. |
default boolean |
isAnnotationPresent(Class<? extends Annotation> annotationClass)
Return whether an annotation is present.
|
default boolean |
isDeclaredAnnotationPresent(Class<? extends Annotation> annotationClass)
Variation of
AnnotationSource.isAnnotationPresent(Class) for declared annotations. |
default boolean |
isEmpty()
Is the annotation metadata empty.
|
default boolean |
isFalse(Class<? extends Annotation> annotation,
String member)
Returns whether the value of the given member is true.
|
default boolean |
isFalse(String annotation,
String member)
Returns whether the value of the given member is true.
|
default boolean |
isPresent(Class<? extends Annotation> annotation,
String member)
Returns whether the value of the given member is present.
|
default boolean |
isPresent(String annotation,
String member)
Returns whether the value of the given member is present.
|
default boolean |
isTrue(Class<? extends Annotation> annotation,
String member)
Returns whether the value of the given member is true.
|
default boolean |
isTrue(String annotation,
String member)
Returns whether the value of the given member is true.
|
default OptionalLong |
longValue(Class<? extends Annotation> annotation,
String member)
The value as an
OptionalLong for the given annotation and member. |
default OptionalLong |
longValue(String annotation,
String member)
The value as an
OptionalLong for the given annotation and member. |
default Optional<String> |
stringValue(Class<? extends Annotation> annotation)
The value as an optional string for the given annotation and member.
|
default Optional<String> |
stringValue(Class<? extends Annotation> annotation,
String member)
The value as an optional string for the given annotation and member.
|
default Optional<String> |
stringValue(String annotation)
The value as an optional string for the given annotation and member.
|
default Optional<String> |
stringValue(String annotation,
String member)
The value as an optional string for the given annotation and member.
|
default String[] |
stringValues(Class<? extends Annotation> annotation)
The values as string array for the given annotation and member.
|
default String[] |
stringValues(Class<? extends Annotation> annotation,
String member)
The values as string array for the given annotation and member.
|
findAnnotation, findDeclaredAnnotation, getAnnotation, getAnnotation, getDeclaredAnnotation, getDeclaredAnnotation, synthesize, synthesizeAll, synthesizeAnnotationsByType, synthesizeDeclared, synthesizeDeclared, synthesizeDeclaredAnnotationsByType
static final AnnotationMetadata EMPTY_METADATA
static final String VALUE_MEMBER
static final String CLASS_NAME_SUFFIX
@Nonnull default List<String> getAnnotationNamesByStereotype(@Nullable String stereotype)
stereotype
- The annotation names@Nonnull default Set<String> getAnnotationNames()
@Nonnull default Set<String> getDeclaredAnnotationNames()
@Nonnull default List<String> getDeclaredAnnotationNamesByStereotype(@Nullable String stereotype)
stereotype
- The stereotype@Nonnull default <T> OptionalValues<T> getValues(@Nonnull String annotation, @Nonnull Class<T> valueType)
T
- Generic typeannotation
- The annotation namevalueType
- valueTypeOptionalValues
default <T> Optional<T> getDefaultValue(@Nonnull String annotation, @Nonnull String member, @Nonnull Argument<T> requiredType)
T
- The required generic typeannotation
- The annotationmember
- The memberrequiredType
- The required type@Nonnull default <T extends Annotation> List<AnnotationValue<T>> getAnnotationValuesByType(@Nonnull Class<T> annotationType)
T
- The annotation typeannotationType
- The annotation type@Nonnull default <T extends Annotation> List<AnnotationValue<T>> getDeclaredAnnotationValuesByType(@Nonnull Class<T> annotationType)
T
- The annotation typeannotationType
- The annotation typedefault boolean hasDeclaredAnnotation(@Nullable String annotation)
annotation
- The annotationdefault boolean hasAnnotation(@Nullable String annotation)
annotation
- The annotationdefault boolean hasStereotype(@Nullable String annotation)
Checks whether this object has the given annotation stereotype on the object itself or inherited from a parent
.
An annotation stereotype is a meta annotation potentially applied to another annotation
annotation
- The annotationdefault boolean hasDeclaredStereotype(@Nullable String annotation)
Checks whether this object has the given annotation stereotype on the object itself and not inherited from a parent
.
An annotation stereotype is a meta annotation potentially applied to another annotation
annotation
- The annotationdefault <T> Optional<T> getDefaultValue(@Nonnull String annotation, @Nonnull String member, @Nonnull Class<T> requiredType)
T
- The required generic typeannotation
- The annotationmember
- The memberrequiredType
- The required typedefault <T> Optional<T> getDefaultValue(@Nonnull Class<? extends Annotation> annotation, @Nonnull String member, @Nonnull Argument<T> requiredType)
T
- The required generic typeannotation
- The annotationmember
- The memberrequiredType
- The required typedefault boolean isAnnotationPresent(@Nonnull Class<? extends Annotation> annotationClass)
AnnotationSource
isAnnotationPresent
in interface AnnotationSource
annotationClass
- The annotation classAnnotationSource.isAnnotationPresent(Class)
default boolean isDeclaredAnnotationPresent(@Nonnull Class<? extends Annotation> annotationClass)
AnnotationSource
AnnotationSource.isAnnotationPresent(Class)
for declared annotations.isDeclaredAnnotationPresent
in interface AnnotationSource
annotationClass
- The annotation classAnnotationSource.isAnnotationPresent(Class)
default <T> Optional<T> getDefaultValue(@Nonnull Class<? extends Annotation> annotation, @Nonnull String member, @Nonnull Class<T> requiredType)
T
- The required generic typeannotation
- The annotationmember
- The memberrequiredType
- The required typedefault <T> Optional<T> getValue(@Nonnull Class<? extends Annotation> annotation, @Nonnull String member, @Nonnull Class<T> requiredType)
T
- The valueannotation
- The annotation classmember
- The annotation memberrequiredType
- The required typeOptional
of the valuedefault <T> Optional<T> getValue(@Nonnull Class<? extends Annotation> annotation, @Nonnull String member, @Nonnull Argument<T> requiredType)
T
- The valueannotation
- The annotation classmember
- The annotation memberrequiredType
- The required typeOptional
of the valuedefault Optional<String> getAnnotationNameByStereotype(@Nullable String stereotype)
stereotype
- The stereotypedefault Optional<String> getDeclaredAnnotationNameByStereotype(@Nullable String stereotype)
stereotype
- The stereotypedefault Optional<Class<? extends Annotation>> getAnnotationTypeByStereotype(@Nonnull Class<? extends Annotation> stereotype)
stereotype
- The stereotypedefault Optional<Class<? extends Annotation>> getDeclaredAnnotationTypeByStereotype(@Nonnull Class<? extends Annotation> stereotype)
stereotype
- The stereotypedefault Optional<Class<? extends Annotation>> getDeclaredAnnotationTypeByStereotype(@Nullable String stereotype)
stereotype
- The stereotypedefault Optional<Class<? extends Annotation>> getAnnotationType(@Nonnull String name)
name
- The type namedefault Optional<Class<? extends Annotation>> getAnnotationTypeByStereotype(@Nullable String stereotype)
stereotype
- The stereotypedefault Optional<String> getAnnotationNameByStereotype(@Nonnull Class<? extends Annotation> stereotype)
stereotype
- The stereotype@Nonnull default <T> OptionalValues<T> getValues(@Nonnull Class<? extends Annotation> annotation, @Nonnull Class<T> valueType)
T
- Generic typeannotation
- The annotation namevalueType
- valueTypeOptionalValues
@Nonnull default List<String> getAnnotationNamesByStereotype(@Nonnull Class<? extends Annotation> stereotype)
stereotype
- The annotation names@Nonnull default List<Class<? extends Annotation>> getAnnotationTypesByStereotype(@Nonnull Class<? extends Annotation> stereotype)
stereotype
- The annotation namesdefault <T extends Annotation> Optional<AnnotationValue<T>> findAnnotation(@Nonnull Class<T> annotationClass)
findAnnotation
in interface AnnotationSource
T
- The annotation typeannotationClass
- The annotation nameAnnotationValue
default <T extends Annotation> Optional<AnnotationValue<T>> findDeclaredAnnotation(@Nonnull Class<T> annotationClass)
findDeclaredAnnotation
in interface AnnotationSource
T
- The annotation typeannotationClass
- The annotation nameAnnotationValue
instancedefault <T> Optional<T> getValue(@Nonnull String annotation, @Nonnull String member, @Nonnull Class<T> requiredType)
T
- The valueannotation
- The annotation classmember
- The annotation memberrequiredType
- The required typeOptional
of the valuedefault <T> Optional<T> getValue(@Nonnull String annotation, @Nonnull String member, @Nonnull Argument<T> requiredType)
T
- The valueannotation
- The annotation classmember
- The annotation memberrequiredType
- The required typeOptional
of the valuedefault OptionalLong longValue(@Nonnull String annotation, @Nonnull String member)
OptionalLong
for the given annotation and member.annotation
- The annotationmember
- The memberOptionalLong
valuedefault OptionalLong longValue(@Nonnull Class<? extends Annotation> annotation, @Nonnull String member)
OptionalLong
for the given annotation and member.annotation
- The annotationmember
- The memberOptionalLong
valuedefault <E extends Enum> Optional<E> enumValue(@Nonnull String annotation, Class<E> enumType)
E
- The enum typeannotation
- The annotationenumType
- The enum typeOptional
enum valuedefault <E extends Enum> Optional<E> enumValue(@Nonnull String annotation, @Nonnull String member, Class<E> enumType)
E
- The enum typeannotation
- The annotationmember
- The annotation memberenumType
- The enum typeOptional
classdefault <E extends Enum> Optional<E> enumValue(@Nonnull Class<? extends Annotation> annotation, Class<E> enumType)
E
- The enum typeannotation
- The annotationenumType
- The enum typeOptional
classdefault <E extends Enum> Optional<E> enumValue(@Nonnull Class<? extends Annotation> annotation, @Nonnull String member, Class<E> enumType)
E
- The enum typeannotation
- The annotationmember
- The annotation memberenumType
- The enum typeOptional
class@Nonnull default <T> Class<T>[] classValues(@Nonnull String annotation)
T
- The type of the classannotation
- The annotationOptional
class@Nonnull default <T> Class<T>[] classValues(@Nonnull String annotation, @Nonnull String member)
T
- The type of the classannotation
- The annotationmember
- The annotation memberOptional
class@Nonnull default <T> Class<T>[] classValues(@Nonnull Class<? extends Annotation> annotation)
T
- The type of the classannotation
- The annotationOptional
class@Nonnull default <T> Class<T>[] classValues(@Nonnull Class<? extends Annotation> annotation, @Nonnull String member)
T
- The type of the classannotation
- The annotationmember
- The annotation memberOptional
classdefault Optional<Class> classValue(@Nonnull String annotation)
annotation
- The annotationOptional
classdefault Optional<Class> classValue(@Nonnull String annotation, @Nonnull String member)
annotation
- The annotationmember
- The annotation memberOptional
classdefault Optional<Class> classValue(@Nonnull Class<? extends Annotation> annotation)
annotation
- The annotationOptional
classdefault Optional<Class> classValue(@Nonnull Class<? extends Annotation> annotation, @Nonnull String member)
annotation
- The annotationmember
- The annotation memberOptional
classdefault OptionalInt intValue(@Nonnull String annotation, @Nonnull String member)
OptionalInt
for the given annotation and member.annotation
- The annotationmember
- The memberOptionalInt
valuedefault OptionalInt intValue(@Nonnull Class<? extends Annotation> annotation, @Nonnull String member)
OptionalInt
for the given annotation and member.annotation
- The annotationmember
- The memberOptionalInt
valuedefault OptionalInt intValue(@Nonnull Class<? extends Annotation> annotation)
OptionalInt
for the given annotation and member.annotation
- The annotationOptionalInt
valuedefault Optional<String> stringValue(@Nonnull String annotation, @Nonnull String member)
annotation
- The annotationmember
- The memberdefault Optional<String> stringValue(@Nonnull Class<? extends Annotation> annotation, @Nonnull String member)
annotation
- The annotationmember
- The member@Nonnull default Optional<String> stringValue(@Nonnull Class<? extends Annotation> annotation)
annotation
- The annotation@Nonnull default Optional<String> stringValue(@Nonnull String annotation)
annotation
- The annotationdefault Optional<Boolean> booleanValue(@Nonnull String annotation, @Nonnull String member)
annotation
- The annotationmember
- The memberdefault Optional<Boolean> booleanValue(@Nonnull Class<? extends Annotation> annotation, @Nonnull String member)
annotation
- The annotationmember
- The member@Nonnull default Optional<Boolean> booleanValue(@Nonnull Class<? extends Annotation> annotation)
annotation
- The annotation@Nonnull default Optional<Boolean> booleanValue(@Nonnull String annotation)
annotation
- The annotation@Nonnull default String[] stringValues(@Nonnull Class<? extends Annotation> annotation, @Nonnull String member)
annotation
- The annotationmember
- The member@Nonnull default String[] stringValues(@Nonnull Class<? extends Annotation> annotation)
annotation
- The annotation@Nonnull default OptionalDouble doubleValue(@Nonnull String annotation, @Nonnull String member)
OptionalDouble
for the given annotation and member.annotation
- The annotationmember
- The memberOptionalDouble
value@Nonnull default OptionalDouble doubleValue(@Nonnull Class<? extends Annotation> annotation, @Nonnull String member)
OptionalDouble
for the given annotation and member.annotation
- The annotationmember
- The memberOptionalDouble
value@Nonnull default OptionalDouble doubleValue(@Nonnull Class<? extends Annotation> annotation)
OptionalDouble
for the given annotation and member.annotation
- The annotationOptionalDouble
value@Nonnull default <T> Optional<T> getValue(@Nonnull String annotation, @Nonnull Class<T> requiredType)
T
- The valueannotation
- The annotation classrequiredType
- The required typeOptional
of the value@Nonnull default Optional<Object> getValue(@Nonnull String annotation, @Nonnull String member)
annotation
- The annotation classmember
- The annotation memberOptional
of the value@Nonnull default Optional<Object> getValue(@Nonnull Class<? extends Annotation> annotation, @Nonnull String member)
annotation
- The annotation classmember
- The annotation memberOptional
of the valuedefault boolean isTrue(@Nonnull String annotation, @Nonnull String member)
annotation
- The annotation classmember
- The annotation memberdefault boolean isTrue(@Nonnull Class<? extends Annotation> annotation, @Nonnull String member)
annotation
- The annotation classmember
- The annotation memberdefault boolean isPresent(@Nonnull String annotation, @Nonnull String member)
annotation
- The annotation classmember
- The annotation memberdefault boolean isPresent(@Nonnull Class<? extends Annotation> annotation, @Nonnull String member)
annotation
- The annotation classmember
- The annotation memberdefault boolean isFalse(@Nonnull Class<? extends Annotation> annotation, @Nonnull String member)
annotation
- The annotation classmember
- The annotation memberdefault boolean isFalse(@Nonnull String annotation, @Nonnull String member)
annotation
- The annotation classmember
- The annotation member@Nonnull default Optional<Object> getValue(@Nonnull String annotation)
annotation
- The annotation classOptional
of the value@Nonnull default Optional<Object> getValue(@Nonnull Class<? extends Annotation> annotation)
annotation
- The annotation classOptional
of the value@Nonnull default <T> Optional<T> getValue(@Nonnull Class<? extends Annotation> annotation, @Nonnull Class<T> requiredType)
T
- Generic typeannotation
- The annotation classrequiredType
- requiredTypeOptional
of the value@Nonnull default <T> Optional<T> getValue(@Nonnull Class<? extends Annotation> annotation, @Nonnull Argument<T> requiredType)
T
- Generic typeannotation
- The annotation classrequiredType
- requiredTypeOptional
of the value@Nonnull default <T> Optional<T> getValue(@Nonnull String annotation, @Nonnull Argument<T> requiredType)
T
- Generic typeannotation
- The annotation classrequiredType
- requiredTypeOptional
of the valuedefault boolean hasAnnotation(@Nullable Class<? extends Annotation> annotation)
annotation
- The annotationdefault boolean hasStereotype(@Nullable Class<? extends Annotation> annotation)
Checks whether this object has the given annotation stereotype on the object itself or inherited from a parent
.
An annotation stereotype is a meta annotation potentially applied to another annotation
annotation
- The annotationdefault boolean hasStereotype(@Nullable Class<? extends Annotation>... annotations)
annotations
- The annotationsdefault boolean hasStereotype(@Nullable String[] annotations)
annotations
- The annotationsdefault boolean hasDeclaredAnnotation(@Nullable Class<? extends Annotation> annotation)
annotation
- The annotationdefault boolean hasDeclaredStereotype(@Nullable Class<? extends Annotation> stereotype)
stereotype
- The annotationdefault boolean hasDeclaredStereotype(@Nullable Class<? extends Annotation>... annotations)
annotations
- The annotationsdefault boolean isEmpty()