Class MultiMap<V>
- Type Parameters:
V- the entry type for multimap values
- All Implemented Interfaces:
Serializable, Cloneable, Map<String,List<V>>, SequencedMap<String, List<V>>
-
Nested Class Summary
Nested classes/interfaces inherited from class AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K, V> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd value to multi valued entry.booleanaddAllValues(MultiMap<V> map) Merge values.voidAdd values to multi valued entry.voidAdd values to multi valued entry.booleancontainsSimpleValue(V value) Test for a specific single value in the map.Get value as String.Get the first value from a multiple value.Get a value from a multiple value.Get multiple values.Put multi valued entry.voidputAllValues(Map<String, V> input) Shorthand version of putAllPut multi valued entry.Put multi valued entry.booleanremoveValue(String name, V value) Remove value.toString()Methods inherited from class LinkedHashMap
clear, containsValue, entrySet, forEach, get, getOrDefault, keySet, newLinkedHashMap, putFirst, putLast, removeEldestEntry, replaceAll, reversed, sequencedEntrySet, sequencedKeySet, sequencedValues, valuesMethods inherited from class HashMap
clone, compute, computeIfAbsent, computeIfPresent, containsKey, isEmpty, merge, newHashMap, put, putAll, putIfAbsent, remove, remove, replace, replace, sizeMethods inherited from class AbstractMap
equals, hashCodeMethods inherited from interface Map
compute, computeIfAbsent, computeIfPresent, containsKey, equals, hashCode, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, sizeMethods inherited from interface SequencedMap
firstEntry, lastEntry, pollFirstEntry, pollLastEntry
-
Constructor Details
-
MultiMap
public MultiMap() -
MultiMap
-
MultiMap
-
-
Method Details
-
getValues
-
getValue
-
getValue
-
getString
Get value as String. Single valued items are converted to a String with the toString() Object method. Multi valued entries are converted to a comma separated List. No quoting of commas within values is performed.- Parameters:
name- The entry key.- Returns:
- String value.
-
put
-
putAllValues
-
putValues
-
putValues
Put multi valued entry.- Parameters:
name- The entry key.values- The array of multiple values.- Returns:
- The previous value or null.
-
add
-
addValues
-
addValues
-
addAllValues
-
removeValue
-
containsSimpleValue
Test for a specific single value in the map.NOTE: This is a SLOW operation, and is actively discouraged.
- Parameters:
value- the value to search for- Returns:
- true if contains simple value
-
toString
-
toStringArrayMap
-