public class MapUtil extends Object
Map 工具类
| 构造器和说明 |
|---|
MapUtil() |
| 限定符和类型 | 方法和说明 |
|---|---|
<K,V> void |
forEach(Map<K,V> map,
BiConsumer<? super K,? super V> action)
遍历
|
boolean |
isEmpty(Map<?,?> map)
判断 map 为空
|
boolean |
isNotEmpty(Map<?,?> map)
判断 map 不为空
|
String |
parseMapToString(Map<String,String> params,
boolean encode)
map转字符串,转换后的字符串格式为
xxx=xxx&xxx=xxx |
Map<String,String> |
parseStringToMap(String str,
boolean decode)
字符串转map,字符串格式为
xxx=xxx&xxx=xxx |
public boolean isNotEmpty(Map<?,?> map)
map - maptrue - 不为空,false - 空public boolean isEmpty(Map<?,?> map)
map - maptrue - 空,false - 不为空public <K,V> void forEach(Map<K,V> map, BiConsumer<? super K,? super V> action)
K - map键泛型V - map值泛型map - 待遍历的 mapaction - 操作public String parseMapToString(Map<String,String> params, boolean encode)
xxx=xxx&xxx=xxxparams - 待转换的mapencode - 是否转码Copyright © 2020. All rights reserved.