Class AnnotationList.Empty
java.lang.Object
java.util.AbstractCollection<AnnotationDescription>
java.util.AbstractList<AnnotationDescription>
net.bytebuddy.matcher.FilterableList.Empty<AnnotationDescription, AnnotationList>
net.bytebuddy.description.annotation.AnnotationList.Empty
- All Implemented Interfaces:
Iterable<AnnotationDescription>, Collection<AnnotationDescription>, List<AnnotationDescription>, SequencedCollection<AnnotationDescription>, AnnotationList, FilterableList<AnnotationDescription, AnnotationList>
- Enclosing interface:
AnnotationList
public static class AnnotationList.Empty
extends FilterableList.Empty<AnnotationDescription, AnnotationList>
implements AnnotationList
Represents an empty annotation list.
-
Nested Class Summary
Nested classes/interfaces inherited from interface AnnotationList
AnnotationList.AbstractBase, AnnotationList.Empty, AnnotationList.Explicit, AnnotationList.ForLoadedAnnotationsNested classes/interfaces inherited from interface FilterableList
FilterableList.AbstractBase<T,S>, FilterableList.Empty<T, S> -
Field Summary
Fields inherited from class AbstractList
modCount -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic List<AnnotationList> asList(int length) Creates a list of empty annotation lists of the given dimension.Returns a list of the annotation types of this list.Returns a list of the names of the annotation types.inherited(Set<? extends TypeDescription> ignoredTypes) Returns only annotations that are marked asInheritedas long as they are not contained by the set of ignored annotation types.booleanisAnnotationPresent(Class<? extends Annotation> annotationType) Checks if this list contains an annotation of the given type.booleanisAnnotationPresent(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 class AbstractList
add, add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, setMethods inherited from class AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toStringMethods inherited from interface Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface FilterableList
filter, getOnly, subListMethods inherited from interface 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
-
Constructor Details
-
Empty
public Empty()
-
-
Method Details
-
asList
Creates a list of empty annotation lists of the given dimension.- Parameters:
length- The length of the list.- Returns:
- A list of empty annotation lists of the given length.
-
isAnnotationPresent
Checks if this list contains an annotation of the given type.- Specified by:
isAnnotationPresentin interfaceAnnotationList- Parameters:
annotationType- The type to find in the list.- Returns:
trueif the list contains the annotation type.
-
isAnnotationPresent
Checks if this list contains an annotation of the given type.- Specified by:
isAnnotationPresentin interfaceAnnotationList- Parameters:
annotationType- The type to find in the list.- Returns:
trueif the list contains the annotation type.
-
ofType
@AlwaysNull public <T extends Annotation> AnnotationDescription.Loadable<T> ofType(Class<T> annotationType) Finds the first annotation of the given type and returns it.- Specified by:
ofTypein interfaceAnnotationList- Type Parameters:
T- The annotation type.- Parameters:
annotationType- The type to be found in the list.- Returns:
- The annotation description or
nullif no such annotation was found.
-
ofType
Finds the first annotation of the given type and returns it.- Specified by:
ofTypein interfaceAnnotationList- Parameters:
annotationType- The type to be found in the list.- Returns:
- The annotation description or
nullif no such annotation was found.
-
inherited
Returns only annotations that are marked asInheritedas long as they are not contained by the set of ignored annotation types.- Specified by:
inheritedin interfaceAnnotationList- 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.- Specified by:
visibilityin interfaceAnnotationList- Parameters:
matcher- A matcher for the required retention policy.- Returns:
- A of annotations only with elements
-
asTypeList
Returns a list of the annotation types of this list.- Specified by:
asTypeListin interfaceAnnotationList- Returns:
- A list of the annotation types of this list.
-
asTypeNames
Returns a list of the names of the annotation types. This list might contain the names of annotations that are not otherwise resolvable.- Specified by:
asTypeNamesin interfaceAnnotationList- Returns:
- A list of binary names of the represented annotations.
-