Interface MapWidgetModel<K,V>
-
- Type Parameters:
K
- key typeV
- value type
- All Superinterfaces:
WidgetModel
- All Known Implementing Classes:
DefaultMapWidgetModel
public interface MapWidgetModel<K,V> extends WidgetModel
AMapWidgetModel
is aWidgetModel
holding mapped values.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description V
get(K key)
Returns the value associated with the specified key.java.util.Map<K,V>
getMap()
Returns the internal map used by this model.boolean
put(K key, V value)
Adds the key-value pair to the model.V
remove(K key)
Removes the mapping with the specified key.boolean
setMap(java.util.Map<K,V> map)
Sets the internal map used by this model.-
Methods inherited from interface de.hybris.platform.cockpit.widgets.models.WidgetModel
addWidgetModelListener, notifyListeners, removeWidgetModelLlistener
-
-
-
-
Method Detail
-
put
boolean put(K key, V value)
Adds the key-value pair to the model. Any previous value associated with the key will be overwritten.- Parameters:
key
- mapping keyvalue
- mapping value- Returns:
- true if a change was made, false otherwise
-
get
V get(K key)
Returns the value associated with the specified key.- Parameters:
key
- mapping key- Returns:
- the value associated with the specified key or
null
if no mapping is found
-
getMap
java.util.Map<K,V> getMap()
Returns the internal map used by this model.- Returns:
- map containing all the mappings held by this model
-
remove
V remove(K key)
Removes the mapping with the specified key.- Parameters:
key
- the key- Returns:
- the removed value or
null
if no mapping is found
-
-