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 TypeMethodDescriptionvoid
Lookup the item with the specifiedid
and register it to this container.void
Register the specifieditem
with the specifiedid
.Return the item with the specifiedid
ornull
if no such item exists.boolean
Specify if this container has an item with the specified id.ids()
Return aStream
of registered identifiers.boolean
isEmpty()
Specify if this container is empty.items()
Return aStream
of registered items.boolean
Remove the item with the specifiedid
.
-
Constructor Details
-
BuildItemContainer
-
-
Method Details
-
isEmpty
public boolean isEmpty()Specify if this container is empty.- Returns:
true
if no item is registered
-
has
Specify if this container has an item with the specified id.- Parameters:
id
- the id of an item- Returns:
true
if an item with the specifiedid
is registered
-
ids
Return aStream
of registered identifiers.- Returns:
- a stream of ids
-
items
Return aStream
of registered items.- Returns:
- a stream of items
-
get
Return the item with the specifiedid
ornull
if no such item exists.- Parameters:
id
- the id of an item- Returns:
- the item or
null
-
add
Lookup the item with the specifiedid
and register it to this container.- Parameters:
id
- the id of an item
-
add
Register the specifieditem
with 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:
true
if such an item was registered,false
otherwise
-