public class MultiMap<T> extends Object implements Iterable<KeyValues<T>>, Serializable
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
ignoreCase |
protected Map<String,KeyValues<T>> |
innerMap |
| Constructor and Description |
|---|
MultiMap() |
MultiMap(boolean ignoreCase) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(String key,
T val)
添加值
|
void |
addAll(Map<String,T> values)
设置所有值
|
void |
clear()
清理
|
boolean |
containsKey(String key)
是否包含键
|
protected <V> Map<String,V> |
createMap(int size) |
T |
get(String key)
获取值
|
List<T> |
getAll(String key)
获取多值
|
T |
getOrDefault(String key,
T def)
获取值或默认
|
KeyValues<T> |
holder(String key)
持有
|
boolean |
isEmpty()
是否为空
|
Iterator<KeyValues<T>> |
iterator() |
Set<String> |
keySet()
键集合
|
void |
put(String key,
T val)
设置值
|
void |
putAll(Map<String,T> values)
设置所有值
|
void |
putIfAbsent(String key,
T val)
设置值如果没有
|
void |
remove(String key)
移除键
|
int |
size()
大小
|
String |
toString() |
Map<String,T> |
toValueMap()
转为单值 Map
|
Map<String,List<T>> |
toValuesMap()
转为多值 Map
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitforEach, spliteratorpublic boolean containsKey(String key)
public boolean isEmpty()
public int size()
public void remove(String key)
public void clear()
@Nullable public T getOrDefault(String key, T def)
key - 键def - 默认值Copyright © 2025. All rights reserved.