Package io.github.classgraph
Class FieldInfoList
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- java.util.ArrayList<FieldInfo>
-
- io.github.classgraph.FieldInfoList
-
- All Implemented Interfaces:
Serializable,Cloneable,Iterable<FieldInfo>,Collection<FieldInfo>,List<FieldInfo>,RandomAccess
public class FieldInfoList extends ArrayList<FieldInfo>
A list ofFieldInfoobjects.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceFieldInfoList.FieldInfoFilterFilter anFieldInfoListusing a predicate mapping anFieldInfoobject to a boolean, producing anotherFieldInfoListfor all items in the list for which the predicate is true.
-
Field Summary
-
Fields inherited from class java.util.AbstractList
modCount
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontainsName(String fieldName)FieldInfoListfilter(FieldInfoList.FieldInfoFilter filter)Find the subset of theFieldInfoobjects in this list for which the given filter predicate is true.FieldInfoget(String fieldName)List<String>getAsStrings()List<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
-
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
-
-
-
-
Method Detail
-
getNames
public List<String> getNames()
- Returns:
- The names of all fields in this list, by calling
FieldInfo.getName()for each item in the list.
-
getAsStrings
public List<String> getAsStrings()
- Returns:
- The string representations of all fields in this list (with annotations, modifiers, etc.), by calling
FieldInfo.toString()for each item in the list.
-
containsName
public boolean containsName(String fieldName)
- Parameters:
fieldName- The name of a field.- Returns:
- true if this list contains a field with the given name.
-
get
public FieldInfo get(String fieldName)
- Parameters:
fieldName- The name of a field.- Returns:
- The
FieldInfoobject in the list with the given name, or null if not found.
-
filter
public FieldInfoList filter(FieldInfoList.FieldInfoFilter filter)
Find the subset of theFieldInfoobjects in this list for which the given filter predicate is true.- Parameters:
filter- TheFieldInfoList.FieldInfoFilterto apply.- Returns:
- The subset of the
FieldInfoobjects in this list for which the given filter predicate is true.
-
-