public final class AnnotationMetadataHierarchy extends Object implements AnnotationMetadata, Iterable<AnnotationMetadata>
AnnotationMetadata
instance passed
to the constructor represents the annotation metadata that is declared, hence methods like hasDeclaredAnnotation(String)
will return true for the last annotation metadata passed in the hierarchy.
This class is used to internally optimize memory usage and compilation time for classes that declare AOP advice at the type level and where the classes methods typically don't include any annotations and therefore would be wasteful to generate additional annotation metadata classes.
Modifier and Type | Field and Description |
---|---|
static AnnotationMetadata[] |
EMPTY_HIERARCHY
Constant to represent an empty hierarchy.
|
CLASS_NAME_SUFFIX, EMPTY_METADATA, VALUE_MEMBER
EMPTY
Constructor and Description |
---|
AnnotationMetadataHierarchy(AnnotationMetadata... hierarchy)
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
Optional<Boolean> |
booleanValue(Class<? extends Annotation> annotation,
String member)
The value as an optional boolean for the given annotation and member.
|
Optional<Boolean> |
booleanValue(Class<? extends Annotation> annotation,
String member,
Function<Object,Object> valueMapper)
Retrieve the boolean value and optionally map its value.
|
Optional<Boolean> |
booleanValue(String annotation,
String member)
The value as an optional boolean for the given annotation and member.
|
Optional<Boolean> |
booleanValue(String annotation,
String member,
Function<Object,Object> valueMapper)
Retrieve the boolean value and optionally map its value.
|
Optional<Class> |
classValue(Class<? extends Annotation> annotation,
String member)
The value of the annotation as a Class.
|
Optional<Class> |
classValue(Class<? extends Annotation> annotation,
String member,
Function<Object,Object> valueMapper)
Retrieve the class value and optionally map its value.
|
Optional<Class> |
classValue(String annotation,
String member)
The value of the annotation as a Class.
|
Optional<Class> |
classValue(String annotation,
String member,
Function<Object,Object> valueMapper)
Retrieve the class value and optionally map its value.
|
<T> Class<T>[] |
classValues(Class<? extends Annotation> annotation,
String member)
The value of the annotation as a Class.
|
<T> Class<T>[] |
classValues(String annotation,
String member)
The value of the annotation as a Class.
|
AnnotationMetadata |
createSibling(AnnotationMetadata child)
Create a new hierarchy instance from this metadata using this metadata's parents.
|
OptionalDouble |
doubleValue(Class<? extends Annotation> annotation,
String member)
The value as an
OptionalDouble for the given annotation and member. |
OptionalDouble |
doubleValue(Class<? extends Annotation> annotation,
String member,
Function<Object,Object> valueMapper)
Retrieve the double value and optionally map its value.
|
OptionalDouble |
doubleValue(String annotation,
String member)
The value as an
OptionalDouble for the given annotation and member. |
OptionalDouble |
doubleValue(String annotation,
String member,
Function<Object,Object> valueMapper)
Retrieve the double value and optionally map its value.
|
<E extends Enum> |
enumValue(Class<? extends Annotation> annotation,
String member,
Class<E> enumType)
The value of the annotation as a Class.
|
<E extends Enum> |
enumValue(Class<? extends Annotation> annotation,
String member,
Class<E> enumType,
Function<Object,Object> valueMapper)
Retrieve the enum value and optionally map its value.
|
<E extends Enum> |
enumValue(String annotation,
String member,
Class<E> enumType)
The value of the annotation as a Class.
|
<E extends Enum> |
enumValue(String annotation,
String member,
Class<E> enumType,
Function<Object,Object> valueMapper)
Retrieve the enum value and optionally map its value.
|
<E extends Enum> |
enumValues(Class<? extends Annotation> annotation,
String member,
Class<E> enumType)
The enum values for the given annotation.
|
<E extends Enum> |
enumValues(Class<? extends Annotation> annotation,
String member,
Class<E> enumType,
Function<Object,Object> valueMapper)
Retrieve the enum values and optionally map its value.
|
<E extends Enum> |
enumValues(String annotation,
String member,
Class<E> enumType)
The enum values for the given annotation.
|
<E extends Enum> |
enumValues(String annotation,
String member,
Class<E> enumType,
Function<Object,Object> valueMapper)
Retrieve the enum values and optionally map its value.
|
<T extends Annotation> |
findAnnotation(String annotation)
Find an
AnnotationValue for the given annotation name. |
<T extends Annotation> |
findDeclaredAnnotation(String annotation)
Get all of the values for the given annotation that are directly declared on the annotated element.
|
Optional<String> |
findRepeatableAnnotation(Class<? extends Annotation> annotation)
Find repeatable annotation container.
|
Optional<String> |
findRepeatableAnnotation(String annotation)
Find repeatable annotation container.
|
Set<String> |
getAnnotationNames()
All the annotation names this metadata declares.
|
List<String> |
getAnnotationNamesByStereotype(String stereotype)
Resolve all of the annotation names that feature the given stereotype.
|
Optional<Class<? extends Annotation>> |
getAnnotationType(String name)
Gets the type for a given annotation if it is present on the classpath.
|
Optional<Class<? extends Annotation>> |
getAnnotationType(String name,
ClassLoader classLoader)
Gets the type for a given annotation if it is present on the classpath.
|
<T extends Annotation> |
getAnnotationValuesByName(String annotationType)
Gets all the annotation values by the given repeatable type name.
|
<T extends Annotation> |
getAnnotationValuesByStereotype(String stereotype)
Resolve all of the annotation values that feature the given stereotype.
|
<T extends Annotation> |
getAnnotationValuesByType(Class<T> annotationType)
Gets all the annotation values by the given repeatable type.
|
Set<String> |
getDeclaredAnnotationNames()
All the declared annotation names this metadata declares.
|
<T extends Annotation> |
getDeclaredAnnotationValuesByName(String annotationType)
Gets only declared annotation values by the given repeatable type name.
|
<T extends Annotation> |
getDeclaredAnnotationValuesByType(Class<T> annotationType)
Gets only declared annotation values by the given repeatable type.
|
AnnotationMetadata |
getDeclaredMetadata()
Gets the declared metadata without inherited metdata.
|
<T> Optional<T> |
getDefaultValue(String annotation,
String member,
Argument<T> requiredType)
Return the default value for the given annotation member.
|
Map<String,Object> |
getDefaultValues(String annotation)
Return the default values for the given annotation name.
|
AnnotationMetadata |
getRootMetadata() |
<T> Optional<T> |
getValue(String annotation,
String member,
Argument<T> requiredType,
Function<Object,Object> valueMapper)
Resolves the given value performing type conversion as necessary.
|
<T> OptionalValues<T> |
getValues(String annotation,
Class<T> valueType)
Get all of the values for the given annotation and type of the underlying values.
|
boolean |
hasAnnotation(String annotation)
Checks whether this object has the given annotation on the object itself or inherited from a parent.
|
boolean |
hasDeclaredAnnotation(String annotation)
Checks whether this object has the given annotation directly declared on the object.
|
boolean |
hasDeclaredStereotype(String annotation)
Checks whether this object has the given annotation stereotype on the object itself and not inherited from a parent
|
boolean |
hasPropertyExpressions()
Does the metadata contain any property expressions like
${foo.bar} . |
boolean |
hasStereotype(String annotation)
Checks whether this object has the given annotation stereotype on the object itself or inherited from a parent
|
OptionalInt |
intValue(Class<? extends Annotation> annotation,
String member)
The value as an
OptionalInt for the given annotation and member. |
OptionalInt |
intValue(Class<? extends Annotation> annotation,
String member,
Function<Object,Object> valueMapper)
Retrieve the int value and optionally map its value.
|
OptionalInt |
intValue(String annotation,
String member)
The value as an
OptionalInt for the given annotation and member. |
OptionalInt |
intValue(String annotation,
String member,
Function<Object,Object> valueMapper)
Retrieve the int value and optionally map its value.
|
boolean |
isEmpty()
Is the annotation metadata empty.
|
boolean |
isFalse(Class<? extends Annotation> annotation,
String member)
Returns whether the value of the given member is true.
|
boolean |
isPresent(Class<? extends Annotation> annotation,
String member)
Returns whether the value of the given member is present.
|
boolean |
isRepeatableAnnotation(Class<? extends Annotation> annotation)
Is repeatable annotation?
|
boolean |
isRepeatableAnnotation(String annotation)
Is repeatable annotation?
|
boolean |
isTrue(Class<? extends Annotation> annotation,
String member)
Returns whether the value of the given member is true.
|
boolean |
isTrue(Class<? extends Annotation> annotation,
String member,
Function<Object,Object> valueMapper)
Retrieve the boolean value and optionally map its value.
|
boolean |
isTrue(String annotation,
String member)
Returns whether the value of the given member is true.
|
boolean |
isTrue(String annotation,
String member,
Function<Object,Object> valueMapper)
Retrieve the boolean value and optionally map its value.
|
Iterator<AnnotationMetadata> |
iterator() |
OptionalLong |
longValue(Class<? extends Annotation> annotation,
String member)
The value as an
OptionalLong for the given annotation and member. |
OptionalLong |
longValue(Class<? extends Annotation> annotation,
String member,
Function<Object,Object> valueMapper)
Retrieve the long value and optionally map its value.
|
OptionalLong |
longValue(String annotation,
String member)
The value as an
OptionalLong for the given annotation and member. |
OptionalLong |
longValue(String annotation,
String member,
Function<Object,Object> valueMapper)
Retrieve the long value and optionally map its value.
|
Optional<String> |
stringValue(Class<? extends Annotation> annotation,
String member)
The value as an optional string for the given annotation and member.
|
Optional<String> |
stringValue(Class<? extends Annotation> annotation,
String member,
Function<Object,Object> valueMapper)
Retrieve the string value and optionally map its value.
|
Optional<String> |
stringValue(String annotation,
String member)
The value as an optional string for the given annotation and member.
|
Optional<String> |
stringValue(String annotation,
String member,
Function<Object,Object> valueMapper)
Retrieve the string value and optionally map its value.
|
String[] |
stringValues(Class<? extends Annotation> annotation,
String member)
The values as string array for the given annotation and member.
|
String[] |
stringValues(Class<? extends Annotation> annotation,
String member,
Function<Object,Object> valueMapper)
Retrieve the string value and optionally map its value.
|
String[] |
stringValues(String annotation,
String member)
The values as string array for the given annotation and member.
|
String[] |
stringValues(String annotation,
String member,
Function<Object,Object> valueMapper)
Retrieve the string value and optionally map its value.
|
<T extends Annotation> |
synthesize(Class<T> annotationClass)
Synthesizes a new annotation from the metadata for the given annotation type.
|
<T extends Annotation> |
synthesize(Class<T> annotationClass,
String sourceAnnotation)
Synthesizes a new annotation for the given annotation type using the member values of the given source annotation.
|
Annotation[] |
synthesizeAll()
Synthesizes a new annotations from the metadata.
|
<T extends Annotation> |
synthesizeAnnotationsByType(Class<T> annotationClass)
Synthesizes a new annotations from the metadata for the given type.
|
Annotation[] |
synthesizeDeclared()
Synthesizes a new annotations from the metadata.
|
<T extends Annotation> |
synthesizeDeclared(Class<T> annotationClass)
Synthesizes a new annotation from the metadata for the given annotation type.
|
<T extends Annotation> |
synthesizeDeclared(Class<T> annotationClass,
String sourceAnnotation)
Synthesizes a new annotation declared for the given annotation type using the member values of the given source annotation.
|
<T extends Annotation> |
synthesizeDeclaredAnnotationsByType(Class<T> annotationClass)
Synthesizes a new annotations from the metadata for the given type.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
booleanValue, booleanValue, classValue, classValue, classValues, classValues, doubleValue, enumValue, enumValue, enumValues, enumValues, findAnnotation, findDeclaredAnnotation, getAnnotationNameByStereotype, getAnnotationNameByStereotype, getAnnotationNamesByStereotype, getAnnotationTypeByStereotype, getAnnotationTypeByStereotype, getAnnotationTypesByStereotype, getAnnotationTypesByStereotype, getAnnotationTypesByStereotype, getDeclaredAnnotationNameByStereotype, getDeclaredAnnotationNamesByStereotype, getDeclaredAnnotationTypeByStereotype, getDeclaredAnnotationTypeByStereotype, getDeclaredStereotypeAnnotationNames, getDefaultValue, getDefaultValue, getDefaultValue, getStereotypeAnnotationNames, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValues, getValues, hasAnnotation, hasDeclaredAnnotation, hasDeclaredStereotype, hasDeclaredStereotype, hasDeclaredStereotype, hasSimpleAnnotation, hasSimpleDeclaredAnnotation, hasStereotype, hasStereotype, hasStereotype, intValue, isAnnotationPresent, isAnnotationPresent, isDeclaredAnnotationPresent, isDeclaredAnnotationPresent, isFalse, isPresent, stringValue, stringValue, stringValues, stringValues
getAnnotation, getAnnotation, getDeclaredAnnotation, getDeclaredAnnotation
forEach, spliterator
public static final AnnotationMetadata[] EMPTY_HIERARCHY
public AnnotationMetadataHierarchy(AnnotationMetadata... hierarchy)
hierarchy
- The annotation hierarchypublic boolean hasPropertyExpressions()
AnnotationMetadata
${foo.bar}
. Note
this by default returns true
as previous versions of Micronaut must assume metadata
is present. The compilation time this is computed in order to decide whether to instrument
annotation metadata with environment specific logic.hasPropertyExpressions
in interface AnnotationMetadata
public Optional<Class<? extends Annotation>> getAnnotationType(@NonNull String name)
AnnotationMetadata
getAnnotationType
in interface AnnotationMetadata
name
- The type namepublic Optional<Class<? extends Annotation>> getAnnotationType(@NonNull String name, @NonNull ClassLoader classLoader)
AnnotationMetadata
getAnnotationType
in interface AnnotationMetadata
name
- The type nameclassLoader
- The ClassLoader to load the type@NonNull public AnnotationMetadata getDeclaredMetadata()
AnnotationMetadata
getDeclaredMetadata
in interface AnnotationMetadata
@NonNull public AnnotationMetadata getRootMetadata()
@NonNull public AnnotationMetadata createSibling(@NonNull AnnotationMetadata child)
child
- The child annotation metadata@Nullable public <T extends Annotation> T synthesize(@NonNull Class<T> annotationClass, @NonNull String sourceAnnotation)
AnnotationSource
This method allows supporting synthesizing annotations that have been renamed, for example a jakarta.inject.Named
annotation an be synthesized from the metadata of the a javax.inject.Named
annotation.
synthesize
in interface AnnotationSource
T
- The annotation generic typeannotationClass
- The annotation classsourceAnnotation
- The source annotation that provides the member valuespublic Annotation[] synthesizeAll()
AnnotationSource
synthesizeAll
in interface AnnotationSource
public Annotation[] synthesizeDeclared()
AnnotationSource
synthesizeDeclared
in interface AnnotationSource
public <T extends Annotation> T[] synthesizeAnnotationsByType(Class<T> annotationClass)
AnnotationSource
synthesizeAnnotationsByType
in interface AnnotationSource
T
- The annotation generic typeannotationClass
- The annotation typepublic <T extends Annotation> T[] synthesizeDeclaredAnnotationsByType(Class<T> annotationClass)
AnnotationSource
synthesizeDeclaredAnnotationsByType
in interface AnnotationSource
T
- The annotation generic typeannotationClass
- The annotation type@Nullable public <T extends Annotation> T synthesizeDeclared(@NonNull Class<T> annotationClass, @NonNull String sourceAnnotation)
AnnotationSource
This method allows supporting synthesizing annotations that have been renamed, for example a jakarta.inject.Named
annotation an be synthesized from the metadata of the a javax.inject.Named
annotation.
synthesizeDeclared
in interface AnnotationSource
T
- The annotation generic typeannotationClass
- The annotation classsourceAnnotation
- The source annotation that provides the member values@Nullable public <T extends Annotation> T synthesize(@NonNull Class<T> annotationClass)
AnnotationSource
synthesize
in interface AnnotationSource
T
- The annotation generic typeannotationClass
- The annotation class@Nullable public <T extends Annotation> T synthesizeDeclared(@NonNull Class<T> annotationClass)
AnnotationSource
This method ignores inherited annotations. (Returns null if no annotations are directly present on this element.)
synthesizeDeclared
in interface AnnotationSource
T
- The annotation generic typeannotationClass
- The annotation class@NonNull public <T extends Annotation> Optional<AnnotationValue<T>> findAnnotation(@NonNull String annotation)
AnnotationSource
AnnotationValue
for the given annotation name.findAnnotation
in interface AnnotationSource
T
- The annotation typeannotation
- The annotation nameAnnotationValue
instance@NonNull public <T extends Annotation> Optional<AnnotationValue<T>> findDeclaredAnnotation(@NonNull String annotation)
AnnotationSource
findDeclaredAnnotation
in interface AnnotationSource
T
- The annotation typeannotation
- The annotation nameAnnotationValue
instance@NonNull public OptionalDouble doubleValue(@NonNull Class<? extends Annotation> annotation, @NonNull String member)
AnnotationMetadata
OptionalDouble
for the given annotation and member.doubleValue
in interface AnnotationMetadata
annotation
- The annotationmember
- The memberOptionalDouble
value@NonNull public String[] stringValues(@NonNull Class<? extends Annotation> annotation, @NonNull String member)
AnnotationMetadata
stringValues
in interface AnnotationMetadata
annotation
- The annotationmember
- The member@NonNull public String[] stringValues(@NonNull String annotation, @NonNull String member)
AnnotationMetadata
stringValues
in interface AnnotationMetadata
annotation
- The annotationmember
- The memberpublic Optional<Boolean> booleanValue(@NonNull String annotation, @NonNull String member)
AnnotationMetadata
booleanValue
in interface AnnotationMetadata
annotation
- The annotationmember
- The memberpublic boolean isTrue(@NonNull String annotation, @NonNull String member)
AnnotationMetadata
isTrue
in interface AnnotationMetadata
annotation
- The annotation classmember
- The annotation memberpublic OptionalLong longValue(@NonNull String annotation, @NonNull String member)
AnnotationMetadata
OptionalLong
for the given annotation and member.longValue
in interface AnnotationMetadata
annotation
- The annotationmember
- The memberOptionalLong
valuepublic Optional<String> stringValue(@NonNull String annotation, @NonNull String member)
AnnotationMetadata
stringValue
in interface AnnotationMetadata
annotation
- The annotationmember
- The memberpublic OptionalInt intValue(@NonNull String annotation, @NonNull String member)
AnnotationMetadata
OptionalInt
for the given annotation and member.intValue
in interface AnnotationMetadata
annotation
- The annotationmember
- The memberOptionalInt
value@NonNull public OptionalDouble doubleValue(@NonNull String annotation, @NonNull String member)
AnnotationMetadata
OptionalDouble
for the given annotation and member.doubleValue
in interface AnnotationMetadata
annotation
- The annotationmember
- The memberOptionalDouble
valuepublic <E extends Enum> Optional<E> enumValue(@NonNull Class<? extends Annotation> annotation, @NonNull String member, Class<E> enumType)
AnnotationMetadata
enumValue
in interface AnnotationMetadata
E
- The enum typeannotation
- The annotationmember
- The annotation memberenumType
- The enum typeOptional
class@NonNull public <T> Class<T>[] classValues(@NonNull String annotation, @NonNull String member)
AnnotationMetadata
classValues
in interface AnnotationMetadata
T
- The type of the classannotation
- The annotationmember
- The annotation memberOptional
classpublic Optional<Class> classValue(@NonNull String annotation, @NonNull String member)
AnnotationMetadata
classValue
in interface AnnotationMetadata
annotation
- The annotationmember
- The annotation memberOptional
class@NonNull public List<String> getAnnotationNamesByStereotype(@Nullable String stereotype)
AnnotationMetadata
getAnnotationNamesByStereotype
in interface AnnotationMetadata
stereotype
- The annotation namespublic <T extends Annotation> List<AnnotationValue<T>> getAnnotationValuesByStereotype(String stereotype)
AnnotationMetadata
getAnnotationValuesByStereotype
in interface AnnotationMetadata
T
- The annotation typestereotype
- The annotation names@NonNull public Set<String> getDeclaredAnnotationNames()
AnnotationMetadata
getDeclaredAnnotationNames
in interface AnnotationMetadata
@NonNull public Set<String> getAnnotationNames()
AnnotationMetadata
getAnnotationNames
in interface AnnotationMetadata
@NonNull public <T> OptionalValues<T> getValues(@NonNull String annotation, @NonNull Class<T> valueType)
AnnotationMetadata
getValues
in interface AnnotationMetadata
T
- Generic typeannotation
- The annotation namevalueType
- valueTypeOptionalValues
public <T> Optional<T> getDefaultValue(@NonNull String annotation, @NonNull String member, @NonNull Argument<T> requiredType)
AnnotationMetadata
getDefaultValue
in interface AnnotationMetadata
T
- The required generic typeannotation
- The annotationmember
- The memberrequiredType
- The required type@NonNull public <T extends Annotation> List<AnnotationValue<T>> getAnnotationValuesByType(@NonNull Class<T> annotationType)
AnnotationMetadata
getAnnotationValuesByType
in interface AnnotationMetadata
T
- The annotation typeannotationType
- The annotation typepublic <T extends Annotation> List<AnnotationValue<T>> getAnnotationValuesByName(String annotationType)
AnnotationMetadata
getAnnotationValuesByName
in interface AnnotationMetadata
T
- The annotation typeannotationType
- The annotation type@NonNull public <T extends Annotation> List<AnnotationValue<T>> getDeclaredAnnotationValuesByType(@NonNull Class<T> annotationType)
AnnotationMetadata
getDeclaredAnnotationValuesByType
in interface AnnotationMetadata
T
- The annotation typeannotationType
- The annotation typepublic <T extends Annotation> List<AnnotationValue<T>> getDeclaredAnnotationValuesByName(String annotationType)
AnnotationMetadata
getDeclaredAnnotationValuesByName
in interface AnnotationMetadata
T
- The annotation typeannotationType
- The annotation typepublic boolean hasDeclaredAnnotation(@Nullable String annotation)
AnnotationMetadata
hasDeclaredAnnotation
in interface AnnotationMetadata
annotation
- The annotationpublic boolean hasAnnotation(@Nullable String annotation)
AnnotationMetadata
hasAnnotation
in interface AnnotationMetadata
annotation
- The annotationpublic boolean hasStereotype(@Nullable String annotation)
AnnotationMetadata
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
hasStereotype
in interface AnnotationMetadata
annotation
- The annotationpublic boolean hasDeclaredStereotype(@Nullable String annotation)
AnnotationMetadata
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
hasDeclaredStereotype
in interface AnnotationMetadata
annotation
- The annotationpublic <E extends Enum> Optional<E> enumValue(String annotation, String member, Class<E> enumType)
AnnotationMetadata
enumValue
in interface AnnotationMetadata
E
- The enum typeannotation
- The annotationmember
- The annotation memberenumType
- The enum typeOptional
classpublic <E extends Enum> E[] enumValues(String annotation, String member, Class<E> enumType)
AnnotationMetadata
enumValues
in interface AnnotationMetadata
E
- The enum typeannotation
- The annotationmember
- The annotation memberenumType
- The enum typepublic OptionalInt intValue(Class<? extends Annotation> annotation, String member)
AnnotationMetadata
OptionalInt
for the given annotation and member.intValue
in interface AnnotationMetadata
annotation
- The annotationmember
- The memberOptionalInt
valuepublic boolean isFalse(Class<? extends Annotation> annotation, String member)
AnnotationMetadata
isFalse
in interface AnnotationMetadata
annotation
- The annotation classmember
- The annotation member@NonNull public Map<String,Object> getDefaultValues(@NonNull String annotation)
AnnotationMetadata
getDefaultValues
in interface AnnotationMetadata
annotation
- The annotation namepublic <E extends Enum> Optional<E> enumValue(@NonNull Class<? extends Annotation> annotation, @NonNull String member, Class<E> enumType, @Nullable Function<Object,Object> valueMapper)
E
- The enum typeannotation
- The annotationmember
- The memberenumType
- The enum typevalueMapper
- The value mapperpublic <E extends Enum> Optional<E> enumValue(@NonNull String annotation, @NonNull String member, Class<E> enumType, @Nullable Function<Object,Object> valueMapper)
E
- The enum typeannotation
- The annotationmember
- The memberenumType
- The enum typevalueMapper
- The value mapperpublic <E extends Enum> E[] enumValues(@NonNull Class<? extends Annotation> annotation, @NonNull String member, Class<E> enumType, @Nullable Function<Object,Object> valueMapper)
E
- The enum typeannotation
- The annotationmember
- The memberenumType
- The enum typevalueMapper
- The value mapperpublic <E extends Enum> E[] enumValues(@NonNull String annotation, @NonNull String member, Class<E> enumType, @Nullable Function<Object,Object> valueMapper)
E
- The enum typeannotation
- The annotationmember
- The memberenumType
- The enum typevalueMapper
- The value mapperpublic Optional<Class> classValue(@NonNull Class<? extends Annotation> annotation, @NonNull String member, Function<Object,Object> valueMapper)
annotation
- The annotationmember
- The membervalueMapper
- The value mapperpublic Optional<Class> classValue(@NonNull String annotation, @NonNull String member, @Nullable Function<Object,Object> valueMapper)
annotation
- The annotationmember
- The membervalueMapper
- The value mapperpublic OptionalInt intValue(@NonNull Class<? extends Annotation> annotation, @NonNull String member, @Nullable Function<Object,Object> valueMapper)
annotation
- The annotationmember
- The membervalueMapper
- The value mapperpublic Optional<Boolean> booleanValue(@NonNull Class<? extends Annotation> annotation, @NonNull String member, Function<Object,Object> valueMapper)
annotation
- The annotationmember
- The membervalueMapper
- The value mapper@NonNull public Optional<Boolean> booleanValue(@NonNull String annotation, @NonNull String member, @Nullable Function<Object,Object> valueMapper)
annotation
- The annotationmember
- The membervalueMapper
- The value mapperpublic OptionalLong longValue(@NonNull Class<? extends Annotation> annotation, @NonNull String member, @Nullable Function<Object,Object> valueMapper)
annotation
- The annotationmember
- The membervalueMapper
- The value mapper@NonNull public OptionalLong longValue(@NonNull String annotation, @NonNull String member, @Nullable Function<Object,Object> valueMapper)
annotation
- The annotationmember
- The membervalueMapper
- The value mapper@NonNull public OptionalInt intValue(@NonNull String annotation, @NonNull String member, @Nullable Function<Object,Object> valueMapper)
annotation
- The annotationmember
- The membervalueMapper
- The value mapperpublic OptionalLong longValue(Class<? extends Annotation> annotation, String member)
AnnotationMetadata
OptionalLong
for the given annotation and member.longValue
in interface AnnotationMetadata
annotation
- The annotationmember
- The memberOptionalLong
valuepublic <E extends Enum> E[] enumValues(Class<? extends Annotation> annotation, String member, Class<E> enumType)
AnnotationMetadata
enumValues
in interface AnnotationMetadata
E
- The enum typeannotation
- The annotationmember
- The annotation memberenumType
- The enum typepublic <T> Class<T>[] classValues(Class<? extends Annotation> annotation, String member)
AnnotationMetadata
classValues
in interface AnnotationMetadata
T
- The type of the classannotation
- The annotationmember
- The annotation memberOptional
classpublic Optional<Class> classValue(Class<? extends Annotation> annotation, String member)
AnnotationMetadata
classValue
in interface AnnotationMetadata
annotation
- The annotationmember
- The annotation memberOptional
classpublic Optional<String> stringValue(Class<? extends Annotation> annotation, String member)
AnnotationMetadata
stringValue
in interface AnnotationMetadata
annotation
- The annotationmember
- The memberpublic Optional<Boolean> booleanValue(Class<? extends Annotation> annotation, String member)
AnnotationMetadata
booleanValue
in interface AnnotationMetadata
annotation
- The annotationmember
- The memberpublic boolean isTrue(Class<? extends Annotation> annotation, String member)
AnnotationMetadata
isTrue
in interface AnnotationMetadata
annotation
- The annotation classmember
- The annotation memberpublic boolean isPresent(Class<? extends Annotation> annotation, String member)
AnnotationMetadata
isPresent
in interface AnnotationMetadata
annotation
- The annotation classmember
- The annotation memberpublic Optional<String> stringValue(@NonNull Class<? extends Annotation> annotation, @NonNull String member, Function<Object,Object> valueMapper)
annotation
- The annotationmember
- The membervalueMapper
- The value mapper@NonNull public String[] stringValues(@NonNull Class<? extends Annotation> annotation, @NonNull String member, Function<Object,Object> valueMapper)
annotation
- The annotationmember
- The membervalueMapper
- The value mapperpublic String[] stringValues(String annotation, String member, Function<Object,Object> valueMapper)
annotation
- The annotationmember
- The membervalueMapper
- The value mapper@NonNull public Optional<String> stringValue(@NonNull String annotation, @NonNull String member, @Nullable Function<Object,Object> valueMapper)
annotation
- The annotationmember
- The membervalueMapper
- The value mapperpublic boolean isTrue(@NonNull Class<? extends Annotation> annotation, @NonNull String member, Function<Object,Object> valueMapper)
annotation
- The annotationmember
- The membervalueMapper
- The value mapperpublic boolean isTrue(@NonNull String annotation, @NonNull String member, @Nullable Function<Object,Object> valueMapper)
annotation
- The annotationmember
- The membervalueMapper
- The value mapperpublic OptionalDouble doubleValue(@NonNull Class<? extends Annotation> annotation, @NonNull String member, @Nullable Function<Object,Object> valueMapper)
annotation
- The annotationmember
- The membervalueMapper
- The value mapper@NonNull public OptionalDouble doubleValue(@NonNull String annotation, @NonNull String member, Function<Object,Object> valueMapper)
annotation
- The annotationmember
- The membervalueMapper
- The value mapper@NonNull public <T> Optional<T> getValue(@NonNull String annotation, @NonNull String member, @NonNull Argument<T> requiredType, @Nullable Function<Object,Object> valueMapper)
T
- The generic typeannotation
- The annotationmember
- The memberrequiredType
- The required typevalueMapper
- The value mapper@NonNull public Iterator<AnnotationMetadata> iterator()
iterator
in interface Iterable<AnnotationMetadata>
public boolean isEmpty()
AnnotationMetadata
isEmpty
in interface AnnotationMetadata
public boolean isRepeatableAnnotation(Class<? extends Annotation> annotation)
AnnotationMetadata
isRepeatableAnnotation
in interface AnnotationMetadata
annotation
- The annotationpublic boolean isRepeatableAnnotation(String annotation)
AnnotationMetadata
isRepeatableAnnotation
in interface AnnotationMetadata
annotation
- The annotationpublic Optional<String> findRepeatableAnnotation(Class<? extends Annotation> annotation)
AnnotationMetadata
findRepeatableAnnotation
in interface AnnotationMetadata
annotation
- The annotationpublic Optional<String> findRepeatableAnnotation(String annotation)
AnnotationMetadata
findRepeatableAnnotation
in interface AnnotationMetadata
annotation
- The annotation