Top Description Fields Constructors Methods
io.github.classgraph

public Class MappableInfoList<T extends HasName>

extends InfoList<T extends HasName>
Class Inheritance
Known Direct Subclasses
io.github.classgraph.ModuleInfoList, io.github.classgraph.PackageInfoList, io.github.classgraph.AnnotationInfoList, io.github.classgraph.AnnotationParameterValueList, io.github.classgraph.ClassInfoList, io.github.classgraph.FieldInfoList
Type Parameters
<T>
the element type
Imports
java.util.Collection, .HashMap, .Map

A list of named objects that can be indexed by name.

Field Summary

Modifier and TypeField and Description
private static final long

Constructor Summary

AccessConstructor and Description
pack-priv
MappableInfoList()

Constructor.

pack-priv
MappableInfoList(final int
the size hint
sizeHint
)

Constructor.

pack-priv
MappableInfoList(final Collection<T>
the initial elements
infoCollection
)

Constructor.

Method Summary

Modifier and TypeMethod and Description
public Map<String, T>

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.
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.

public boolean

Returns:

true if this list contains an item with the given name.
containsName
(final String
The name to search for.
name
)

Check if this list contains an item with the given name.

public T

Returns:

The list item with the given name, or null if not found.
get
(final String
The name to search for.
name
)

Get the list item with the given name, or null if not found.

Inherited from io.github.classgraph.InfoList:
equalsgetAsStringsgetAsStringsWithSimpleNamesgetNameshashCode

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Hides io.github.classgraph.InfoList.serialVersionUID.

serialVersionUID

Constructor Detail

MappableInfoListback to summary
pack-priv MappableInfoList()

Constructor.

MappableInfoListback to summary
pack-priv MappableInfoList(final int sizeHint)

Constructor.

Parameters
sizeHint:int

the size hint

MappableInfoListback to summary
pack-priv MappableInfoList(final Collection<T> infoCollection)

Constructor.

Parameters
infoCollection:Collection<T>

the initial elements

Method Detail

asMapback to summary
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:Map<String, T>

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.

containsNameback to summary
public boolean containsName(final String name)

Check if this list contains an item with the given name.

Parameters
name:String

The name to search for.

Returns:boolean

true if this list contains an item with the given name.

getback to summary
public T get(final String name)

Get the list item with the given name, or null if not found.

Parameters
name:String

The name to search for.

Returns:T

The list item with the given name, or null if not found.

Annotations
@SuppressWarnings:null