K - the key typeV - the value typeS - an enum of sub containerspublic class MultiContainer<K,S extends Enum<S>,V> extends Object
for an example.| Constructor and Description |
|---|
MultiContainer(Logger logger,
Class<S> subContainersEnum)
Create a new multi container
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(K key,
S subContainer,
V value)
Add a value to this multi container
|
void |
debug()
Enable debug mode
|
void |
freeze()
Freeze the container: no more add is allowed
|
V |
get(K key,
S subContainer) |
Map<K,V> |
getValueByKey(S subContainer) |
Iterable<V> |
getValues(S subContainer) |
void |
setMode(Container.Mode mode)
Set the new mode to use
|
String |
toString() |
public void setMode(Container.Mode mode)
mode - the mode (CREATE, UPDATE, CREATE_OR_UPDATE)public boolean add(K key, S subContainer, V value)
key - the keysubContainer - the sub containervalue - the valuepublic V get(K key, S subContainer)
key - the keysubContainer - the sub containerpublic void debug()
public void freeze()
public Map<K,V> getValueByKey(S subContainer)
subContainer - the sub containerpublic Iterable<V> getValues(S subContainer)
subContainer - the sub containerCopyright © 2016–2021. All rights reserved.