Package org.eclipse.jetty.util
Class MultiMap<V>
- java.lang.Object
-
- java.util.AbstractMap<K,V>
-
- java.util.HashMap<K,V>
-
- java.util.LinkedHashMap<java.lang.String,java.util.List<V>>
-
- org.eclipse.jetty.util.MultiMap<V>
-
- Type Parameters:
V
- the entry type for multimap values
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,java.util.Map<java.lang.String,java.util.List<V>>
- Direct Known Subclasses:
UrlEncoded
@Deprecated(since="2021-05-27") public class MultiMap<V> extends java.util.LinkedHashMap<java.lang.String,java.util.List<V>>
Deprecated.The Eclipse Jetty and Apache Felix Http Jetty packages are no longer supported.A multi valued Map.- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
add(java.lang.String name, V value)
Deprecated.Add value to multi valued entry.boolean
addAllValues(MultiMap<V> map)
Deprecated.Merge values.void
addValues(java.lang.String name, java.util.List<V> values)
Deprecated.Add values to multi valued entry.void
addValues(java.lang.String name, V[] values)
Deprecated.Add values to multi valued entry.boolean
containsSimpleValue(V value)
Deprecated.Test for a specific single value in the map.java.lang.String
getString(java.lang.String name)
Deprecated.Get value as String.V
getValue(java.lang.String name, int i)
Deprecated.Get a value from a multiple value.java.util.List<V>
getValues(java.lang.String name)
Deprecated.Get multiple values.java.util.List<V>
put(java.lang.String name, V value)
Deprecated.Put multi valued entry.void
putAllValues(java.util.Map<java.lang.String,V> input)
Deprecated.Shorthand version of putAlljava.util.List<V>
putValues(java.lang.String name, java.util.List<V> values)
Deprecated.Put multi valued entry.java.util.List<V>
putValues(java.lang.String name, V... values)
Deprecated.Put multi valued entry.boolean
removeValue(java.lang.String name, V value)
Deprecated.Remove value.java.lang.String
toString()
Deprecated.java.util.Map<java.lang.String,java.lang.String[]>
toStringArrayMap()
Deprecated.-
Methods inherited from class java.util.LinkedHashMap
clear, containsValue, entrySet, forEach, get, getOrDefault, keySet, replaceAll, values
-
-
-
-
Method Detail
-
getValues
public java.util.List<V> getValues(java.lang.String name)
Deprecated.Get multiple values. Single valued entries are converted to singleton lists.- Parameters:
name
- The entry key.- Returns:
- Unmodifieable List of values.
-
getValue
public V getValue(java.lang.String name, int i)
Deprecated.Get a value from a multiple value. If the value is not a multivalue, then index 0 retrieves the value or null.- Parameters:
name
- The entry key.i
- Index of element to get.- Returns:
- Unmodifieable List of values.
-
getString
public java.lang.String getString(java.lang.String name)
Deprecated.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
public java.util.List<V> put(java.lang.String name, V value)
Deprecated.Put multi valued entry.- Parameters:
name
- The entry key.value
- The simple value- Returns:
- The previous value or null.
-
putAllValues
public void putAllValues(java.util.Map<java.lang.String,V> input)
Deprecated.Shorthand version of putAll- Parameters:
input
- the input map
-
putValues
public java.util.List<V> putValues(java.lang.String name, java.util.List<V> values)
Deprecated.Put multi valued entry.- Parameters:
name
- The entry key.values
- The List of multiple values.- Returns:
- The previous value or null.
-
putValues
@SafeVarargs public final java.util.List<V> putValues(java.lang.String name, V... values)
Deprecated.Put multi valued entry.- Parameters:
name
- The entry key.values
- The array of multiple values.- Returns:
- The previous value or null.
-
add
public void add(java.lang.String name, V value)
Deprecated.Add value to multi valued entry. If the entry is single valued, it is converted to the first value of a multi valued entry.- Parameters:
name
- The entry key.value
- The entry value.
-
addValues
public void addValues(java.lang.String name, java.util.List<V> values)
Deprecated.Add values to multi valued entry. If the entry is single valued, it is converted to the first value of a multi valued entry.- Parameters:
name
- The entry key.values
- The List of multiple values.
-
addValues
public void addValues(java.lang.String name, V[] values)
Deprecated.Add values to multi valued entry. If the entry is single valued, it is converted to the first value of a multi valued entry.- Parameters:
name
- The entry key.values
- The String array of multiple values.
-
addAllValues
public boolean addAllValues(MultiMap<V> map)
Deprecated.Merge values.- Parameters:
map
- the map to overlay on top of this one, merging together values if needed.- Returns:
- true if an existing key was merged with potentially new values, false if either no change was made, or there were only new keys.
-
removeValue
public boolean removeValue(java.lang.String name, V value)
Deprecated.Remove value.- Parameters:
name
- The entry key.value
- The entry value.- Returns:
- true if it was removed.
-
containsSimpleValue
public boolean containsSimpleValue(V value)
Deprecated.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
public java.lang.String toString()
Deprecated.- Overrides:
toString
in classjava.util.AbstractMap<java.lang.String,java.util.List<V>>
-
toStringArrayMap
public java.util.Map<java.lang.String,java.lang.String[]> toStringArrayMap()
Deprecated.- Returns:
- Map of String arrays
-
-