Package io.github.classgraph
Class AnnotationInfoList
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- java.util.ArrayList<T>
-
- io.github.classgraph.InfoList<T>
-
- io.github.classgraph.MappableInfoList<AnnotationInfo>
-
- io.github.classgraph.AnnotationInfoList
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,java.lang.Iterable<AnnotationInfo>
,java.util.Collection<AnnotationInfo>
,java.util.List<AnnotationInfo>
,java.util.RandomAccess
public class AnnotationInfoList extends MappableInfoList<AnnotationInfo>
A list ofAnnotationInfo
objects.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
AnnotationInfoList.AnnotationInfoFilter
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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AnnotationInfoList
directOnly()
returns the list of direct annotations, excluding meta-annotations.boolean
equals(java.lang.Object obj)
AnnotationInfoList
filter(AnnotationInfoList.AnnotationInfoFilter filter)
Find the subset of theAnnotationInfo
objects in this list for which the given filter predicate is true.AnnotationInfoList
getRepeatable(java.lang.String name)
Get theRepeatable
annotation with the given name, or the empty list if none found.int
hashCode()
-
Methods inherited from class io.github.classgraph.MappableInfoList
asMap, containsName, get
-
Methods inherited from class io.github.classgraph.InfoList
getAsStrings, getNames
-
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, forEach, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
-
-
-
-
Method Detail
-
filter
public AnnotationInfoList filter(AnnotationInfoList.AnnotationInfoFilter 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
public AnnotationInfoList 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
public AnnotationInfoList getRepeatable(java.lang.String name)
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
public boolean equals(java.lang.Object obj)
- Specified by:
equals
in interfacejava.util.Collection<AnnotationInfo>
- Specified by:
equals
in interfacejava.util.List<AnnotationInfo>
- Overrides:
equals
in classjava.util.ArrayList<AnnotationInfo>
-
hashCode
public int hashCode()
- Specified by:
hashCode
in interfacejava.util.Collection<AnnotationInfo>
- Specified by:
hashCode
in interfacejava.util.List<AnnotationInfo>
- Overrides:
hashCode
in classjava.util.ArrayList<AnnotationInfo>
-
-