Class MultivaluedMapContext<K,V>

java.lang.Object
org.apache.ofbiz.base.util.collections.MapContext<K,List<V>>
org.apache.ofbiz.base.util.collections.MultivaluedMapContext<K,V>
All Implemented Interfaces:
Map<K,List<V>>, LocalizedMap<List<V>>

public class MultivaluedMapContext<K,V> extends MapContext<K,List<V>>
MultivaluedMap Context A MapContext which handles multiple values for the same key.
  • Constructor Details

    • MultivaluedMapContext

      public MultivaluedMapContext()
      Create a multi-value map initialized with one context
  • Method Details

    • putSingle

      public void putSingle(K key, V value)
      Associate key with the single value value. If other values are already associated with key then override them.
      Parameters:
      key - the key to associate value with
      value - the value to add to the context
    • add

      public void add(K key, V value)
      Associate key with the single value value. If other values are already associated with key, then add value to them.
      Parameters:
      key - the key to associate value with
      value - the value to add to the context
    • getFirst

      public V getFirst(Object key)
      Get the first value contained in the list of values associated with key.
      Parameters:
      key - a candidate key
      Returns:
      the first value associated with key or null if no value is associated with it.