Class MappableInfoList<T extends HasName>

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

public class MappableInfoList<T extends HasName> extends InfoList<T>
A list of named objects that can be indexed by name.
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      serialVersionUID
      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

      public Map<String,T> asMap()
      Get 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.
      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(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(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.