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>>
MultivaluedMap Context
A MapContext which handles multiple values for the same key.
-
Nested Class Summary
-
Constructor Summary
ConstructorDescriptionCreate a multi-value map initialized with one context -
Method Summary
Methods inherited from class org.apache.ofbiz.base.util.collections.MapContext
clear, containsKey, containsValue, entrySet, get, get, getContexts, isEmpty, keySet, pop, push, push, put, putAll, remove, size, toString, values
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Constructor Details
-
MultivaluedMapContext
public MultivaluedMapContext()Create a multi-value map initialized with one context
-
-
Method Details
-
putSingle
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
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
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.
-