Package io.github.classgraph
Class AnnotationInfoList
java.lang.Object
- All Implemented Interfaces:
Serializable,Cloneable,Iterable<AnnotationInfo>,Collection<AnnotationInfo>,List<AnnotationInfo>,RandomAccess
A list of
AnnotationInfo objects.- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceFilter anAnnotationInfoListusing a predicate mapping anAnnotationInfoobject to a boolean, producing anotherAnnotationInfoListfor all items in the list for which the predicate is true. -
Constructor Summary
ConstructorsConstructorDescriptionConstruct a new modifiable empty list ofAnnotationInfoobjects.AnnotationInfoList(int sizeHint) Construct a new modifiable empty list ofAnnotationInfoobjects, given a size hint.AnnotationInfoList(AnnotationInfoList reachableAnnotations) Construct a new modifiable emptyAnnotationInfoList, given an initial list ofAnnotationInfoobjects. -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(int index, AnnotationInfo element) booleanadd(AnnotationInfo element) booleanaddAll(int index, Collection<? extends AnnotationInfo> c) booleanaddAll(Collection<? extends AnnotationInfo> c) voidclear()returns the list of direct annotations, excluding meta-annotations.static AnnotationInfoListReturn an unmodifiable emptyAnnotationInfoList.booleanFind the subset of theAnnotationInfoobjects in this list for which the given filter predicate is true.getRepeatable(Class<? extends Annotation> annotationClass) Get theRepeatableannotation with the given class, or the empty list if none found.getRepeatable(String name) Get theRepeatableannotation with the given name, or the empty list if none found.inthashCode()iterator()remove(int index) booleanbooleanremoveAll(Collection<?> c) booleanretainAll(Collection<?> c) set(int index, AnnotationInfo element) Methods inherited from class io.github.classgraph.MappableInfoList
asMap, containsName, getMethods inherited from class io.github.classgraph.InfoList
getAsStrings, getAsStringsWithSimpleNames, getNamesMethods inherited from class java.util.ArrayList
clone, contains, ensureCapacity, forEach, get, indexOf, isEmpty, lastIndexOf, listIterator, removeIf, replaceAll, size, sort, spliterator, subList, toArray, toArray, trimToSizeMethods inherited from class java.util.AbstractCollection
containsAll, toStringMethods inherited from interface java.util.Collection
parallelStream, stream, toArrayMethods inherited from interface java.util.List
containsAll
-
Constructor Details
-
AnnotationInfoList
public AnnotationInfoList()Construct a new modifiable empty list ofAnnotationInfoobjects. -
AnnotationInfoList
public AnnotationInfoList(int sizeHint) Construct a new modifiable empty list ofAnnotationInfoobjects, given a size hint.- Parameters:
sizeHint- the size hint
-
AnnotationInfoList
Construct a new modifiable emptyAnnotationInfoList, given an initial list ofAnnotationInfoobjects.- Parameters:
reachableAnnotations- the reachable annotations
-
-
Method Details
-
emptyList
Return an unmodifiable emptyAnnotationInfoList.- Returns:
- the unmodifiable empty
AnnotationInfoList.
-
filter
Find the subset of theAnnotationInfoobjects in this list for which the given filter predicate is true.- Parameters:
filter- TheAnnotationInfoList.AnnotationInfoFilterto apply.- Returns:
- The subset of the
AnnotationInfoobjects in this list for which the given filter predicate is true.
-
directOnly
returns the list of direct annotations, excluding meta-annotations. If thisAnnotationInfoListconsists of class annotations, i.e. if it was produced using `ClassInfo#getAnnotationInfo()`, then the returned list also excludes annotations inherited from a superclass or implemented interface that was meta-annotated with@Inherited.- Returns:
- The list of directly-related annotations.
-
getRepeatable
Get theRepeatableannotation with the given class, or the empty list if none found.- Parameters:
annotationClass- The class to search for.- Returns:
- The list of annotations with the given class, or the empty list if none found.
-
getRepeatable
Get theRepeatableannotation with the given name, or the empty list if none found.- Parameters:
name- The name to search for.- Returns:
- The list of annotations with the given name, or the empty list if none found.
-
equals
- Specified by:
equalsin interfaceCollection<AnnotationInfo>- Specified by:
equalsin interfaceList<AnnotationInfo>- Overrides:
equalsin classInfoList<AnnotationInfo>
-
hashCode
public int hashCode()- Specified by:
hashCodein interfaceCollection<AnnotationInfo>- Specified by:
hashCodein interfaceList<AnnotationInfo>- Overrides:
hashCodein classInfoList<AnnotationInfo>
-
add
-
add
-
remove
-
remove
-
addAll
-
addAll
-
removeAll
-
retainAll
-
clear
public void clear() -
set
-
iterator
-
listIterator
- Specified by:
listIteratorin interfaceList<T>- Overrides:
listIteratorin classArrayList<T>
-