Package com.aspectran.core.util
Interface MultiValueMap<K,V>
-
- All Superinterfaces:
java.util.Map<K,java.util.List<V>>
- All Known Implementing Classes:
LinkedCaseInsensitiveMultiValueMap,LinkedMultiValueMap
public interface MultiValueMap<K,V> extends java.util.Map<K,java.util.List<V>>This class is a clone of org.springframework.util.MultiValueMap
Extension of theMapinterface that stores multiple values.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidadd(K key, V value)Add the given single value to the current list of values for the given key.voidaddAll(MultiValueMap<K,V> values)Add all the values of the givenMultiValueMapto the current values.voidaddAll(K key, java.util.List<? extends V> values)Add all the values of the given list to the current list of values for the given key.default voidaddIfAbsent(K key, V value)Addthe given value, only when the map does notcontainthe given key.VgetFirst(K key)Return the first value for the given key.voidset(K key, V value)Set the given single value under the given key.voidset(K key, V[] values)Set the given values under the given key.voidsetAll(java.util.Map<K,V> values)Set the given values under.java.util.Map<K,V>toSingleValueMap()Return aMapwith the first values contained in thisMultiValueMap.
-
-
-
Method Detail
-
getFirst
V getFirst(K key)
Return the first value for the given key.- Parameters:
key- the key- Returns:
- the first value for the specified key, or
null
-
add
void add(K key, V value)
Add the given single value to the current list of values for the given key.- Parameters:
key- the keyvalue- the value to be added
-
addAll
void addAll(K key, java.util.List<? extends V> values)
Add all the values of the given list to the current list of values for the given key.- Parameters:
key- they keyvalues- the values to be added
-
addAll
void addAll(MultiValueMap<K,V> values)
Add all the values of the givenMultiValueMapto the current values.- Parameters:
values- the values to be added
-
addIfAbsent
default void addIfAbsent(K key, @Nullable V value)
Addthe given value, only when the map does notcontainthe given key.- Parameters:
key- the keyvalue- the value to be added
-
set
void set(K key, V value)
Set the given single value under the given key.- Parameters:
key- the keyvalue- the value to set
-
set
void set(K key, V[] values)
Set the given values under the given key.- Parameters:
key- the keyvalues- the values
-
setAll
void setAll(java.util.Map<K,V> values)
Set the given values under.- Parameters:
values- the values
-
-