Class DefaultMapWidgetModel<K,V>

java.lang.Object
de.hybris.platform.cockpit.widgets.models.impl.AbstractWidgetModel
de.hybris.platform.cockpit.widgets.models.impl.DefaultMapWidgetModel<K,V>
All Implemented Interfaces:
MapWidgetModel<K,V>, WidgetModel

public class DefaultMapWidgetModel<K,V> extends AbstractWidgetModel implements MapWidgetModel<K,V>
  • Constructor Details

    • DefaultMapWidgetModel

      public DefaultMapWidgetModel()
  • Method Details

    • get

      public V get(K key)
      Description copied from interface: MapWidgetModel
      Returns the value associated with the specified key.
      Specified by:
      get in interface MapWidgetModel<K,V>
      Parameters:
      key - mapping key
      Returns:
      the value associated with the specified key or null if no mapping is found
    • put

      public boolean put(K key, V value)
      Description copied from interface: MapWidgetModel
      Adds the key-value pair to the model.

      Any previous value associated with the key will be overwritten.

      Specified by:
      put in interface MapWidgetModel<K,V>
      Parameters:
      key - mapping key
      value - mapping value
      Returns:
      true if a change was made, false otherwise
    • setMap

      public boolean setMap(Map<K,V> map)
      Description copied from interface: MapWidgetModel
      Sets the internal map used by this model.
      Specified by:
      setMap in interface MapWidgetModel<K,V>
      Parameters:
      map - the map
      Returns:
      true if a change was made, false otherwise
    • getMap

      public Map<K,V> getMap()
      Description copied from interface: MapWidgetModel
      Returns the internal map used by this model.
      Specified by:
      getMap in interface MapWidgetModel<K,V>
      Returns:
      map containing all the mappings held by this model
    • remove

      public V remove(K key)
      Description copied from interface: MapWidgetModel
      Removes the mapping with the specified key.
      Specified by:
      remove in interface MapWidgetModel<K,V>
      Parameters:
      key - the key
      Returns:
      the removed value or null if no mapping is found