Package io.github.classgraph
Class ModuleInfoList
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- java.util.ArrayList<T>
-
- io.github.classgraph.ModuleInfoList
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,java.lang.Iterable<ModuleInfo>
,java.util.Collection<ModuleInfo>
,java.util.List<ModuleInfo>
,java.util.RandomAccess
public class ModuleInfoList extends java.util.ArrayList<T>
A list ofModuleInfo
objects.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
ModuleInfoList.ModuleInfoFilter
Filter anModuleInfoList
using a predicate mapping anModuleInfo
object to a boolean, producing anotherModuleInfoList
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 java.util.Map<java.lang.String,T>
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.boolean
containsName(java.lang.String name)
Check if this list contains an item with the given name.ModuleInfoList
filter(ModuleInfoList.ModuleInfoFilter filter)
Find the subset of theModuleInfo
objects in this list for which the given filter predicate is true.T
get(java.lang.String name)
Get the list item with the given name, or null if not found.java.util.List<java.lang.String>
getAsStrings()
Get the String representations of all items in this list, by callingtoString()
on each item in the list.java.util.List<java.lang.String>
getNames()
Get the names of all items in this list, by callinggetName()
on each item in the list.-
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, equals, forEach, get, hashCode, 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 ModuleInfoList filter(ModuleInfoList.ModuleInfoFilter filter)
Find the subset of theModuleInfo
objects in this list for which the given filter predicate is true.- Parameters:
filter
- TheModuleInfoList.ModuleInfoFilter
to apply.- Returns:
- The subset of the
ModuleInfo
objects in this list for which the given filter predicate is true.
-
asMap
public java.util.Map<java.lang.String,T> 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
public boolean containsName(java.lang.String name)
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
public T get(java.lang.String name)
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.
-
getNames
public java.util.List<java.lang.String> getNames()
Get the names of all items in this list, by callinggetName()
on each item in the list.- Returns:
- The names of all items in this list, by calling
getName()
on each item in the list.
-
getAsStrings
public java.util.List<java.lang.String> getAsStrings()
Get the String representations of all items in this list, by callingtoString()
on each item in the list.- Returns:
- The String representations of all items in this list, by calling
toString()
on each item in the list.
-
-