Package io.github.classgraph
Class MappableInfoList<T extends HasName>
java.lang.Object
java.util.AbstractCollection<T>
java.util.AbstractList<T>
java.util.ArrayList<T>
io.github.classgraph.PotentiallyUnmodifiableList<T>
io.github.classgraph.InfoList<T>
io.github.classgraph.MappableInfoList<T>
- Type Parameters:
T
- the element type
- All Implemented Interfaces:
Serializable
,Cloneable
,Iterable<T>
,Collection<T>
,List<T>
,RandomAccess
,SequencedCollection<T>
- Direct Known Subclasses:
AnnotationInfoList
,AnnotationParameterValueList
,ClassInfoList
,FieldInfoList
,ModuleInfoList
,PackageInfoList
A list of named objects that can be indexed by name.
- See Also:
-
Field Summary
FieldsFields inherited from class io.github.classgraph.PotentiallyUnmodifiableList
modifiable
Fields inherited from class java.util.AbstractList
modCount
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor.MappableInfoList
(int sizeHint) Constructor.MappableInfoList
(Collection<T> infoCollection) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionasMap()
Get an index for this list, as a map from the name of each list item (obtained by callinggetName()
on each list item) to the list item.boolean
containsName
(String name) Check if this list contains an item with the given name.Get the list item with the given name, or null if not found.Methods inherited from class io.github.classgraph.InfoList
equals, getAsStrings, getAsStringsWithSimpleNames, getNames, hashCode
Methods inherited from class io.github.classgraph.PotentiallyUnmodifiableList
add, add, addAll, addAll, clear, iterator, listIterator, makeUnmodifiable, remove, remove, removeAll, retainAll, set
Methods inherited from class java.util.ArrayList
addFirst, addLast, clone, contains, ensureCapacity, forEach, get, getFirst, getLast, indexOf, isEmpty, lastIndexOf, listIterator, removeFirst, removeIf, removeLast, removeRange, replaceAll, size, sort, spliterator, subList, toArray, toArray, trimToSize
Methods inherited from class java.util.AbstractCollection
containsAll, toString
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, stream, toArray
Methods inherited from interface java.util.List
containsAll, reversed
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDserialVersionUID- See Also:
-
-
Constructor Details
-
MappableInfoList
MappableInfoList()Constructor. -
MappableInfoList
MappableInfoList(int sizeHint) Constructor.- Parameters:
sizeHint
- the size hint
-
MappableInfoList
MappableInfoList(Collection<T> infoCollection) Constructor.- Parameters:
infoCollection
- the initial elements
-
-
Method Details
-
asMap
Get an index for this list, as a map from the name of each list item (obtained by callinggetName()
on each list item) to the list item.- Returns:
- An index for this list, as a map from the name of each list item (obtained by calling
getName()
on each list item) to the list item.
-
containsName
Check if this list contains an item with the given name.- Parameters:
name
- The name to search for.- Returns:
- true if this list contains an item with the given name.
-
get
Get the list item with the given name, or null if not found.- Parameters:
name
- The name to search for.- Returns:
- The list item with the given name, or null if not found.
-