public class

LinkedMultiValueMap

extends Object
implements Serializable MultiValueMap<K, V>
java.lang.Object
   ↳ org.springframework.util.LinkedMultiValueMap<K, V>

Class Overview

Simple implementation of MultiValueMap that wraps a LinkedHashMap, storing multiple values in a LinkedList.

This Map implementation is generally not thread-safe. It is primarily designed for data structures exposed from request objects, for use in a single thread only.

Summary

Public Constructors
LinkedMultiValueMap()
Create a new LinkedMultiValueMap that wraps a LinkedHashMap.
LinkedMultiValueMap(int initialCapacity)
Create a new LinkedMultiValueMap that wraps a LinkedHashMap with the given initial capacity.
LinkedMultiValueMap(Map<K, List<V>> otherMap)
Copy constructor: Create a new LinkedMultiValueMap with the same mappings as the specified Map.
Public Methods
void add(K key, V value)
Add the given single value to the current list of values for the given key.
void clear()
boolean containsKey(Object key)
boolean containsValue(Object value)
Set<Entry<K, List<V>>> entrySet()
boolean equals(Object obj)
List<V> get(Object key)
V getFirst(K key)
Return the first value for the given key.
int hashCode()
boolean isEmpty()
Set<K> keySet()
List<V> put(K key, List<V> value)
void putAll(Map<? extends K, ? extends List<V>> m)
List<V> remove(Object key)
void set(K key, V value)
Set the given single value under the given key.
void setAll(Map<K, V> values)
Set the given values under.
int size()
Map<K, V> toSingleValueMap()
Returns the first values contained in this MultiValueMap.
String toString()
Collection<List<V>> values()
[Expand]
Inherited Methods
From class java.lang.Object
From interface java.util.Map
From interface org.springframework.util.MultiValueMap

Public Constructors

public LinkedMultiValueMap ()

Also: SpringCore

Create a new LinkedMultiValueMap that wraps a LinkedHashMap.

public LinkedMultiValueMap (int initialCapacity)

Also: SpringCore

Create a new LinkedMultiValueMap that wraps a LinkedHashMap with the given initial capacity.

Parameters
initialCapacity the initial capacity

public LinkedMultiValueMap (Map<K, List<V>> otherMap)

Also: SpringCore

Copy constructor: Create a new LinkedMultiValueMap with the same mappings as the specified Map.

Parameters
otherMap the Map whose mappings are to be placed in this Map

Public Methods

public void add (K key, V value)

Also: SpringCore

Add the given single value to the current list of values for the given key.

Parameters
key the key
value the value to be added

public void clear ()

Also: SpringCore

public boolean containsKey (Object key)

Also: SpringCore

public boolean containsValue (Object value)

Also: SpringCore

public Set<Entry<K, List<V>>> entrySet ()

Also: SpringCore

public boolean equals (Object obj)

public List<V> get (Object key)

Also: SpringCore

public V getFirst (K key)

Also: SpringCore

Return the first value for the given key.

Parameters
key the key
Returns
  • the first value for the specified key, or null

public int hashCode ()

public boolean isEmpty ()

Also: SpringCore

public Set<K> keySet ()

Also: SpringCore

public List<V> put (K key, List<V> value)

Also: SpringCore

public void putAll (Map<? extends K, ? extends List<V>> m)

Also: SpringCore

public List<V> remove (Object key)

Also: SpringCore

public void set (K key, V value)

Also: SpringCore

Set the given single value under the given key.

Parameters
key the key
value the value to set

public void setAll (Map<K, V> values)

Also: SpringCore

Set the given values under.

Parameters
values the values.

public int size ()

Also: SpringCore

public Map<K, V> toSingleValueMap ()

Also: SpringCore

Returns the first values contained in this MultiValueMap.

Returns
  • a single value representation of this map

public String toString ()

public Collection<List<V>> values ()

Also: SpringCore