Class BuildItemContainer<I,V>
java.lang.Object
io.spring.initializr.generator.buildsystem.BuildItemContainer<I,V>
- Type Parameters:
I- the type of the identifierV- the type of the item
- Direct Known Subclasses:
BomContainer,DependencyContainer,MavenRepositoryContainer
A container for items.
- Author:
- Stephane Nicoll
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidLookup the item with the specifiedidand register it to this container.voidRegister the specifieditemwith the specifiedid.Return the item with the specifiedidornullif no such item exists.booleanSpecify if this container has an item with the specified id.ids()Return aStreamof registered identifiers.booleanisEmpty()Specify if this container is empty.items()Return aStreamof registered items.booleanRemove the item with the specifiedid.
-
Constructor Details
-
BuildItemContainer
-
-
Method Details
-
isEmpty
public boolean isEmpty()Specify if this container is empty.- Returns:
trueif no item is registered
-
has
Specify if this container has an item with the specified id.- Parameters:
id- the id of an item- Returns:
trueif an item with the specifiedidis registered
-
ids
Return aStreamof registered identifiers.- Returns:
- a stream of ids
-
items
Return aStreamof registered items.- Returns:
- a stream of items
-
get
Return the item with the specifiedidornullif no such item exists.- Parameters:
id- the id of an item- Returns:
- the item or
null
-
add
Lookup the item with the specifiedidand register it to this container.- Parameters:
id- the id of an item
-
add
Register the specifieditemwith the specifiedid.- Parameters:
id- the id of the itemitem- the item to register
-
remove
Remove the item with the specifiedid.- Parameters:
id- the id of the item to remove- Returns:
trueif such an item was registered,falseotherwise
-