Top Description Inners Fields Constructors Methods
org.springframework.util

pack-priv final Class UnmodifiableMultiValueMap<K, V>

extends Object
implements MultiValueMap<K, V>, Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable, org.springframework.util.MultiValueMap, java.util.Map
Type Parameters
<K>
the key type
<V>
the value element type
Imports
java.io.Serializable, java.util.Collection, .Collections, .Comparator, .Iterator, .List, .Map, .Set, .Spliterator, java.util.function.BiConsumer, .BiFunction, .Consumer, .Function, .Predicate, java.util.stream.Stream, .StreamSupport, org.springframework.lang.Nullable

Unmodifiable wrapper for MultiValueMap.
Author
Arjen Poutsma
Since
6.0

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
private static class

Field Summary

Modifier and TypeField and Description
private final MultiValueMap<K, V>
private transient Set<Map.Entry<K, List<V>>>
private transient Set<K>
private static final long
private transient Collection<List<V>>

Constructor Summary

AccessConstructor and Description
public
UnmodifiableMultiValueMap(MultiValueMap<? extends K, ? extends V> delegate)

Method Summary

Modifier and TypeMethod and Description
public void
add(K
the key
key
,
V
the value to be added
value
)

Implements org.springframework.util.MultiValueMap.add.

Add the given single value to the current list of values for the given key.
public void
addAll(K
they key
key
,
List<? extends V>
the values to be added
values
)

Implements org.springframework.util.MultiValueMap.addAll.

Add all the values of the given list to the current list of values for the given key.
public void
addAll(MultiValueMap<K, V>
the values to be added
values
)

Implements org.springframework.util.MultiValueMap.addAll.

Add all the values of the given MultiValueMap to the current values.
public void
addIfAbsent(K
the key
key
,
V
the value to be added
value
)

Overrides default org.springframework.util.MultiValueMap.addIfAbsent.

Add the given value, only when the map does not contain the given key.
public void
clear()

Implements java.util.Map.clear.

Removes all of the mappings from this map (optional operation).
public List<V>
compute(K
key with which the specified value is to be associated
key
,
BiFunction<? super K, ? super List<V>, ? extends List<V>>
the remapping function to compute a value
remappingFunction
)

Overrides default java.util.Map.compute.

Attempts to compute a mapping for the specified key and its current mapped value (or null if there is no current mapping).
public List<V>
computeIfAbsent(K
key with which the specified value is to be associated
key
,
Function<? super K, ? extends List<V>>
the mapping function to compute a value
mappingFunction
)

Overrides default java.util.Map.computeIfAbsent.

If the specified key is not already associated with a value (or is mapped to null), attempts to compute its value using the given mapping function and enters it into this map unless null.
public List<V>
computeIfPresent(K
key with which the specified value is to be associated
key
,
BiFunction<? super K, ? super List<V>, ? extends List<V>>
the remapping function to compute a value
remappingFunction
)

Overrides default java.util.Map.computeIfPresent.

If the value for the specified key is present and non-null, attempts to compute a new mapping given the key and its current mapped value.
public boolean
containsKey(Object
key whose presence in this map is to be tested
key
)

Implements java.util.Map.containsKey.

Returns true if this map contains a mapping for the specified key.
public boolean
containsValue(Object
value whose presence in this map is to be tested
value
)

Implements java.util.Map.containsValue.

Returns true if this map maps one or more keys to the specified value.
public Set<Map.Entry<K, List<V>>>
entrySet()

Implements java.util.Map.entrySet.

Returns a Set view of the mappings contained in this map.
public boolean
equals(Object
object to be compared for equality with this map
other
)

Overrides java.lang.Object.equals.

Implements java.util.Map.equals.

Compares the specified object with this map for equality.
public void
forEach(BiConsumer<? super K, ? super List<V>>
The action to be performed for each entry
action
)

Overrides default java.util.Map.forEach.

Performs the given action for each entry in this map until all entries have been processed or the action throws an exception.
public List<V>
get(Object
the key whose associated value is to be returned
key
)

Implements java.util.Map.get.

Returns the value to which the specified key is mapped, or null if this map contains no mapping for the key.
public V
getFirst(K
the key
key
)

Implements org.springframework.util.MultiValueMap.getFirst.

Return the first value for the given key.
public List<V>
getOrDefault(Object
the key whose associated value is to be returned
key
,
List<V>
the default mapping of the key
defaultValue
)

Overrides default java.util.Map.getOrDefault.

Returns the value to which the specified key is mapped, or defaultValue if this map contains no mapping for the key.
public int
hashCode()

Overrides java.lang.Object.hashCode.

Implements java.util.Map.hashCode.

Returns the hash code value for this map.
public boolean
isEmpty()

Implements java.util.Map.isEmpty.

Returns true if this map contains no key-value mappings.
public Set<K>
keySet()

Implements java.util.Map.keySet.

Returns a Set view of the keys contained in this map.
public List<V>
merge(K
key with which the resulting value is to be associated
key
,
List<V>
the non-null value to be merged with the existing value associated with the key or, if no existing value or a null value is associated with the key, to be associated with the key
value
,
BiFunction<? super List<V>, ? super List<V>, ? extends List<V>>
the remapping function to recompute a value if present
remappingFunction
)

Overrides default java.util.Map.merge.

If the specified key is not already associated with a value or is associated with null, associates it with the given non-null value.
public List<V>
put(K
key with which the specified value is to be associated
key
,
List<V>
value to be associated with the specified key
value
)

Implements java.util.Map.put.

Associates the specified value with the specified key in this map (optional operation).
public void
putAll(Map<? extends K, ? extends List<V>>
mappings to be stored in this map
m
)

Implements java.util.Map.putAll.

Copies all of the mappings from the specified map to this map (optional operation).
public List<V>
putIfAbsent(K
key with which the specified value is to be associated
key
,
List<V>
value to be associated with the specified key
value
)

Overrides default java.util.Map.putIfAbsent.

If the specified key is not already associated with a value (or is mapped to null) associates it with the given value and returns null, else returns the current value.
public List<V>
remove(Object
key whose mapping is to be removed from the map
key
)

Implements java.util.Map.remove.

Removes the mapping for a key from this map if it is present (optional operation).
public boolean
remove(Object
key with which the specified value is associated
key
,
Object
value expected to be associated with the specified key
value
)

Overrides default java.util.Map.remove.

Removes the entry for the specified key only if it is currently mapped to the specified value.
public boolean
replace(K
key with which the specified value is associated
key
,
List<V>
value expected to be associated with the specified key
oldValue
,
List<V>
value to be associated with the specified key
newValue
)

Overrides default java.util.Map.replace.

Replaces the entry for the specified key only if currently mapped to the specified value.
public List<V>
replace(K
key with which the specified value is associated
key
,
List<V>
value to be associated with the specified key
value
)

Overrides default java.util.Map.replace.

Replaces the entry for the specified key only if it is currently mapped to some value.
public void
replaceAll(BiFunction<? super K, ? super List<V>, ? extends List<V>>
the function to apply to each entry
function
)

Overrides default java.util.Map.replaceAll.

Replaces each entry's value with the result of invoking the given function on that entry until all entries have been processed or the function throws an exception.
public void
set(K
the key
key
,
V
the value to set
value
)

Implements org.springframework.util.MultiValueMap.set.

Set the given single value under the given key.
public void
setAll(Map<K, V>
the values.
values
)

Implements org.springframework.util.MultiValueMap.setAll.

Set the given values under.
public int
size()

Implements java.util.Map.size.

Returns the number of key-value mappings in this map.
public Map<K, V>
toSingleValueMap()

Implements org.springframework.util.MultiValueMap.toSingleValueMap.

Return a Map with the first values contained in this MultiValueMap.
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
public Collection<List<V>>
values()

Implements java.util.Map.values.

Returns a Collection view of the values contained in this map.
Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait