Class MultivaluedMapContext<K,V>
- java.lang.Object
-
- org.apache.ofbiz.base.util.collections.MapContext<K,java.util.List<V>>
-
- org.apache.ofbiz.base.util.collections.MultivaluedMapContext<K,V>
-
- All Implemented Interfaces:
java.util.Map<K,java.util.List<V>>
,LocalizedMap<java.util.List<V>>
public class MultivaluedMapContext<K,V> extends MapContext<K,java.util.List<V>>
MultivaluedMap Context A MapContext which handles multiple values for the same key.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
module
-
Fields inherited from class org.apache.ofbiz.base.util.collections.MapContext
contexts
-
-
Constructor Summary
Constructors Constructor Description MultivaluedMapContext()
Create a multi-value map initialized with one context
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(K key, V value)
Associatekey
with the single valuevalue
.V
getFirst(java.lang.Object key)
Get the first value contained in the list of values associated withkey
.void
putSingle(K key, V value)
Associatekey
with the single valuevalue
.-
Methods inherited from class org.apache.ofbiz.base.util.collections.MapContext
addToBottom, clear, containsKey, containsValue, entrySet, get, get, isEmpty, keySet, pop, push, push, put, putAll, remove, size, toString, values
-
-
-
-
Method Detail
-
putSingle
public void putSingle(K key, V value)
Associatekey
with the single valuevalue
. If other values are already associated withkey
then override them.- Parameters:
key
- the key to associatevalue
withvalue
- the value to add to the context
-
add
public void add(K key, V value)
Associatekey
with the single valuevalue
. If other values are already associated withkey
, then addvalue
to them.- Parameters:
key
- the key to associatevalue
withvalue
- the value to add to the context
-
getFirst
public V getFirst(java.lang.Object key)
Get the first value contained in the list of values associated withkey
.- Parameters:
key
- a candidate key- Returns:
- the first value associated with
key
or null if no value is associated with it.
-
-