public class CommonMultiValueMap<K,V> extends Object implements MultiValueMap<K,V>
| 限定符和类型 | 字段和说明 |
|---|---|
protected Map<K,Collection<V>> |
targetMap |
| 构造器和说明 |
|---|
CommonMultiValueMap() |
CommonMultiValueMap(Map<K,Collection<V>> map,
Supplier<K,Collection<V>> valuesSupplier) |
CommonMultiValueMap(Supplier0<Map> mapSupplier,
Supplier<K,Collection<V>> valuesSupplier) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
add(K key,
V value)
Add the given single value to the current list of values for the given key.
|
void |
addAll(K key,
Collection<? extends V> values)
Add all the values of the given list to the current list of values for the given key.
|
void |
addAll(MultiValueMap<K,V> map)
Add all the values of the given
MultiValueMap to the current values. |
void |
addIfAbsent(K key,
V value)
|
void |
clear() |
boolean |
containsKey(Object key) |
boolean |
containsValue(Object value) |
Set<Map.Entry<K,Collection<V>>> |
entrySet() |
List<V> |
get(Object key) |
V |
getFirst(K key)
Return the first value for the given key.
|
boolean |
isEmpty() |
Set<K> |
keySet() |
Collection<V> |
put(K key,
Collection<V> values) |
void |
putAll(Map<? extends K,? extends Collection<V>> map) |
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()
Return a
Map with the first values contained in this MultiValueMap. |
int |
total() |
Collection<Collection<V>> |
values() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcompute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAllprotected Map<K,Collection<V>> targetMap
public CommonMultiValueMap()
public CommonMultiValueMap(@NonNull Supplier0<Map> mapSupplier, @NonNull Supplier<K,Collection<V>> valuesSupplier)
public CommonMultiValueMap(@NonNull Map<K,Collection<V>> map, @NonNull Supplier<K,Collection<V>> valuesSupplier)
public V getFirst(K key)
MultiValueMapgetFirst 在接口中 MultiValueMap<K,V>key - the keynull if nonepublic void add(K key, V value)
MultiValueMapadd 在接口中 MultiValueMap<K,V>key - the keyvalue - the value to be addedpublic void addAll(K key, Collection<? extends V> values)
MultiValueMapaddAll 在接口中 MultiValueMap<K,V>key - they keyvalues - the values to be addedpublic void addAll(MultiValueMap<K,V> map)
MultiValueMapMultiValueMap to the current values.addAll 在接口中 MultiValueMap<K,V>map - the values to be addedpublic void addIfAbsent(K key, V value)
MultiValueMapaddIfAbsent 在接口中 MultiValueMap<K,V>key - the keyvalue - the value to be addedpublic void set(K key, V value)
MultiValueMapset 在接口中 MultiValueMap<K,V>key - the keyvalue - the value to setpublic void setAll(Map<K,V> values)
MultiValueMapsetAll 在接口中 MultiValueMap<K,V>values - the values.public Map<K,V> toSingleValueMap()
MultiValueMapMap with the first values contained in this MultiValueMap.toSingleValueMap 在接口中 MultiValueMap<K,V>public int size()
size 在接口中 Map<K,Collection<V>>public int total()
total 在接口中 MultiValueMap<K,V>public boolean isEmpty()
isEmpty 在接口中 Map<K,Collection<V>>public boolean containsKey(Object key)
containsKey 在接口中 Map<K,Collection<V>>public boolean containsValue(Object value)
containsValue 在接口中 Map<K,Collection<V>>public Collection<V> put(K key, Collection<V> values)
put 在接口中 Map<K,Collection<V>>public void putAll(Map<? extends K,? extends Collection<V>> map)
putAll 在接口中 Map<K,Collection<V>>public void clear()
clear 在接口中 Map<K,Collection<V>>public Collection<Collection<V>> values()
values 在接口中 Map<K,Collection<V>>public Set<Map.Entry<K,Collection<V>>> entrySet()
entrySet 在接口中 Map<K,Collection<V>>Copyright © 2021. All rights reserved.