- 如果map的键值为空,则赋值 (只会在键不存在时,才将键值对添加到 Map 中)
map.putIfAbsent("defaultValue", "");
if (column.containsKey("dataLengthStr")) {
Object dataLengthStr = column.get("dataLengthStr");
column.put("length", dataLengthStr);
column.remove("dataLengthStr");
}
children.removeIf(e->StringUtils.isNotBlank(e.getDataId()));
boolean exists = map.containsKey("apple");
Map<String, Object> paramMap
Map<String, Object> datasMap = new CaseInsensitiveMap(paramMap);
dataSourceKeyList.contains(key)
map.forEach((key,value)->{
System.out.println(key);
System.out.println(value);
});
for(Map.Entry<Integer,String> entry:map.entrySet()){
System.out.println(entry.getKey());
System.out.println(entry.getValue());
};
Map<String, Object> dataMap = MapUtil.toMap(vo);
- 判断list和map是否包含这个值