I - the type of the identifierV - the type of the itempublic class BuildItemContainer<I,V> extends Object
| Modifier | Constructor and Description |
|---|---|
protected |
BuildItemContainer(Map<I,V> items,
Function<I,V> itemResolver) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(I id)
Lookup the item with the specified
id and register it to this container. |
void |
add(I id,
V item)
Register the specified
item with the specified id. |
V |
get(I id)
Return the item with the specified
id or null if no such item
exists. |
boolean |
has(I id)
Specify if this container has an item with the specified id.
|
Stream<I> |
ids()
Return a
Stream of registered identifiers. |
boolean |
isEmpty()
Specify if this container is empty.
|
Stream<V> |
items()
Return a
Stream of registered items. |
boolean |
remove(I id)
Remove the item with the specified
id. |
public boolean isEmpty()
true if no item is registeredpublic boolean has(I id)
id - the id of an itemtrue if an item with the specified id is registeredpublic V get(I id)
id or null if no such item
exists.id - the id of an itemnullpublic void add(I id)
id and register it to this container.id - the id of an itempublic void add(I id, V item)
item with the specified id.id - the id of the itemitem - the item to registerpublic boolean remove(I id)
id.id - the id of the item to removetrue if such an item was registered, false otherwiseCopyright © 2022 Pivotal Software, Inc.. All rights reserved.