Package io.github.classgraph
Class PackageInfoList
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- java.util.ArrayList<T>
-
- io.github.classgraph.PackageInfoList
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,java.lang.Iterable<PackageInfo>,java.util.Collection<PackageInfo>,java.util.List<PackageInfo>,java.util.RandomAccess
public class PackageInfoList extends java.util.ArrayList<T>A list ofPackageInfoobjects.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfacePackageInfoList.PackageInfoFilterFilter anPackageInfoListusing a predicate mapping anPackageInfoobject to a boolean, producing anotherPackageInfoListfor 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()booleancontainsName(java.lang.String name)PackageInfoListfilter(PackageInfoList.PackageInfoFilter filter)Find the subset of thePackageInfoobjects in this list for which the given filter predicate is true.Tget(java.lang.String name)java.util.List<java.lang.String>getAsStrings()java.util.List<java.lang.String>getNames()-
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 PackageInfoList filter(PackageInfoList.PackageInfoFilter filter)
Find the subset of thePackageInfoobjects in this list for which the given filter predicate is true.- Parameters:
filter- ThePackageInfoList.PackageInfoFilterto apply.- Returns:
- The subset of the
PackageInfoobjects in this list for which the given filter predicate is true.
-
asMap
public java.util.Map<java.lang.String,T> asMap()
- Returns:
- An index for this list, as a map from the name of each list item (obtained by calling
getNameon the list item) to the list item.
-
containsName
public boolean containsName(java.lang.String 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)
- 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()
- Returns:
- The names of all packages in this list, by calling
PackageInfo.getName()for each item in the list.
-
getAsStrings
public java.util.List<java.lang.String> getAsStrings()
- Returns:
- The string representations of all items in this list, obtained by calling
toString()on each item in the list.
-
-