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 interface
Filter anAnnotationInfoList
using a predicate mapping anAnnotationInfo
object to a boolean, producing anotherAnnotationInfoList
for all items in the list for which the predicate is true. -
Constructor Summary
ConstructorsConstructorDescriptionConstruct a new modifiable empty list ofAnnotationInfo
objects.AnnotationInfoList
(int sizeHint) Construct a new modifiable empty list ofAnnotationInfo
objects, given a size hint.AnnotationInfoList
(AnnotationInfoList reachableAnnotations) Construct a new modifiable emptyAnnotationInfoList
, given an initial list ofAnnotationInfo
objects. -
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(int index, AnnotationInfo element) boolean
add
(AnnotationInfo element) boolean
addAll
(int index, Collection<? extends AnnotationInfo> c) boolean
addAll
(Collection<? extends AnnotationInfo> c) void
clear()
returns the list of direct annotations, excluding meta-annotations.static AnnotationInfoList
Return an unmodifiable emptyAnnotationInfoList
.boolean
Find the subset of theAnnotationInfo
objects in this list for which the given filter predicate is true.getRepeatable
(Class<? extends Annotation> annotationClass) Get theRepeatable
annotation with the given class, or the empty list if none found.getRepeatable
(String name) Get theRepeatable
annotation with the given name, or the empty list if none found.int
hashCode()
iterator()
remove
(int index) boolean
boolean
removeAll
(Collection<?> c) boolean
retainAll
(Collection<?> c) set
(int index, AnnotationInfo element) Methods inherited from class io.github.classgraph.MappableInfoList
asMap, containsName, get
Methods inherited from class io.github.classgraph.InfoList
getAsStrings, getAsStringsWithSimpleNames, getNames
Methods inherited from class java.util.ArrayList
clone, contains, ensureCapacity, forEach, get, indexOf, isEmpty, lastIndexOf, listIterator, removeIf, replaceAll, size, sort, spliterator, subList, toArray, toArray, trimToSize
Methods inherited from class java.util.AbstractCollection
containsAll, toString
Methods inherited from interface java.util.Collection
parallelStream, stream, toArray
Methods inherited from interface java.util.List
containsAll
-
Constructor Details
-
AnnotationInfoList
public AnnotationInfoList()Construct a new modifiable empty list ofAnnotationInfo
objects. -
AnnotationInfoList
public AnnotationInfoList(int sizeHint) Construct a new modifiable empty list ofAnnotationInfo
objects, given a size hint.- Parameters:
sizeHint
- the size hint
-
AnnotationInfoList
Construct a new modifiable emptyAnnotationInfoList
, given an initial list ofAnnotationInfo
objects.- Parameters:
reachableAnnotations
- the reachable annotations
-
-
Method Details
-
emptyList
Return an unmodifiable emptyAnnotationInfoList
.- Returns:
- the unmodifiable empty
AnnotationInfoList
.
-
filter
Find the subset of theAnnotationInfo
objects in this list for which the given filter predicate is true.- Parameters:
filter
- TheAnnotationInfoList.AnnotationInfoFilter
to apply.- Returns:
- The subset of the
AnnotationInfo
objects in this list for which the given filter predicate is true.
-
directOnly
returns the list of direct annotations, excluding meta-annotations. If thisAnnotationInfoList
consists 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 theRepeatable
annotation 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 theRepeatable
annotation 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:
equals
in interfaceCollection<AnnotationInfo>
- Specified by:
equals
in interfaceList<AnnotationInfo>
- Overrides:
equals
in classInfoList<AnnotationInfo>
-
hashCode
public int hashCode()- Specified by:
hashCode
in interfaceCollection<AnnotationInfo>
- Specified by:
hashCode
in interfaceList<AnnotationInfo>
- Overrides:
hashCode
in classInfoList<AnnotationInfo>
-
add
-
add
-
remove
-
remove
-
addAll
-
addAll
-
removeAll
-
retainAll
-
clear
public void clear() -
set
-
iterator
-
listIterator
- Specified by:
listIterator
in interfaceList<T>
- Overrides:
listIterator
in classArrayList<T>
-