标签:org 转换 string class res result 大小 || try
`
public class MapUtil {
public static Map<String, Object> keyToLowerCase(Map<String, Object> orgMap) {
Map<String, Object> resultMap = new HashMap<>();
if (orgMap == null || orgMap.isEmpty()) {
return resultMap;
}
Set<Map.Entry<String,Object>> entrySet = orgMap.entrySet();
for (Map.Entry<String, Object> entry : entrySet) {
String key = entry.getKey();
Object value = entry.getValue();
resultMap.put(key.toLowerCase(), value);
}
return resultMap;
}
public static Map<String, Object> keyToUpperCase(Map<String, Object> orgMap) {
Map<String, Object> resultMap = new HashMap<>();
if (orgMap == null || orgMap.isEmpty()) {
return resultMap;
}
Set<Map.Entry<String,Object>> entrySet = orgMap.entrySet();
for (Map.Entry<String, Object> entry : entrySet) {
String key = entry.getKey();
Object value = entry.getValue();
resultMap.put(key.toUpperCase(), value);
}
return resultMap;
}
}
标签:org 转换 string class res result 大小 || try
原文地址:https://www.cnblogs.com/caichaoxiang919/p/13214674.html