Interface AnnotationList
- All Superinterfaces:
Collection<AnnotationDescription>
,FilterableList<AnnotationDescription,
,AnnotationList> Iterable<AnnotationDescription>
,List<AnnotationDescription>
,SequencedCollection<AnnotationDescription>
- All Known Implementing Classes:
AnnotationList.AbstractBase
,AnnotationList.Empty
,AnnotationList.Explicit
,AnnotationList.ForLoadedAnnotations
Defines a list of annotation instances.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic class
An abstract base implementation of an annotation list.static class
Represents an empty annotation list.static class
Represents a list of explicitly provided annotation descriptions.static class
Describes an array of loadedAnnotation
s as an annotation list. -
Method Summary
Modifier and TypeMethodDescriptionReturns a list of the annotation types of this list.inherited
(Set<? extends TypeDescription> ignoredTypes) Returns only annotations that are marked asInherited
as long as they are not contained by the set of ignored annotation types.boolean
isAnnotationPresent
(Class<? extends Annotation> annotationType) Checks if this list contains an annotation of the given type.boolean
isAnnotationPresent
(TypeDescription annotationType) Checks if this list contains an annotation of the given type.<T extends Annotation>
AnnotationDescription.Loadable<T> Finds the first annotation of the given type and returns it.ofType
(TypeDescription annotationType) Finds the first annotation of the given type and returns it.visibility
(ElementMatcher<? super RetentionPolicy> matcher) Only retains annotations with the given retention policy.Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
Methods inherited from interface net.bytebuddy.matcher.FilterableList
filter, getOnly, subList
Methods inherited from interface java.util.List
add, add, addAll, addAll, addFirst, addLast, clear, contains, containsAll, equals, get, getFirst, getLast, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeFirst, removeLast, replaceAll, retainAll, reversed, set, size, sort, spliterator, toArray, toArray
-
Method Details
-
isAnnotationPresent
Checks if this list contains an annotation of the given type.- Parameters:
annotationType
- The type to find in the list.- Returns:
true
if the list contains the annotation type.
-
isAnnotationPresent
Checks if this list contains an annotation of the given type.- Parameters:
annotationType
- The type to find in the list.- Returns:
true
if the list contains the annotation type.
-
ofType
Finds the first annotation of the given type and returns it.- Type Parameters:
T
- The annotation type.- Parameters:
annotationType
- The type to be found in the list.- Returns:
- The annotation description or
null
if no such annotation was found.
-
ofType
Finds the first annotation of the given type and returns it.- Parameters:
annotationType
- The type to be found in the list.- Returns:
- The annotation description or
null
if no such annotation was found.
-
inherited
Returns only annotations that are marked asInherited
as long as they are not contained by the set of ignored annotation types.- Parameters:
ignoredTypes
- A list of annotation types to be ignored from the lookup.- Returns:
- A list of all inherited annotations besides of the given ignored types.
-
visibility
Only retains annotations with the given retention policy.- Parameters:
matcher
- A matcher for the required retention policy.- Returns:
- A of annotations only with elements
-
asTypeList
TypeList asTypeList()Returns a list of the annotation types of this list.- Returns:
- A list of the annotation types of this list.
-