public class WebCmsComponentModelSet extends Object
WebCmsComponentModels that are accessible by name.
All components in a single set are expected to be owned by the value #getOwner().
A set can have a fetcher function value (#setFetcherFunction(BiFunction)). This function
will be used to retrieve a component if it is not yet present in the set. A component name will only
ever be looked up once unless it is removed again.| Constructor and Description |
|---|
WebCmsComponentModelSet() |
| Modifier and Type | Method and Description |
|---|---|
void |
add(WebCmsComponentModel componentModel)
Add a component to the ordered list.
|
void |
clear()
Remove all components from this set.
|
boolean |
contains(String name) |
WebCmsComponentModel |
get(String name)
Gets the component with that name.
|
void |
put(@NonNull String name,
WebCmsComponentModel componentModel)
Register a component under a specific name in the set.
|
WebCmsComponentModel |
remove(String name)
Removes the component registered with that name.
|
boolean |
remove(@NonNull WebCmsComponentModel componentModel)
Removes the component model.
|
public void add(WebCmsComponentModel componentModel)
componentModel - to addpublic void put(@NonNull
@NonNull String name,
WebCmsComponentModel componentModel)
WebCmsComponentModel.getName() will be ignored.
If the model is null, you are explicitly marking a component as unavailable.
In case of a fetcher function it will not be looked up either.name - to register the component undercomponentModel - to addpublic boolean contains(String name)
public WebCmsComponentModel get(String name)
fetcherFunction has been specified, it will be used to retrieve the component if it is not yet present.public WebCmsComponentModel remove(String name)
null.name - of the component to removepublic boolean remove(@NonNull
@NonNull WebCmsComponentModel componentModel)
componentModel - to removepublic void clear()
Copyright © 2020. All rights reserved.