List
//调用方法
Map<String, Object> replaceKeyLow = toReplaceKeyLow(map);
//时间格式转化
Object date = replaceKeyLow.get("date");
if(!ObjectUtils.isEmpty(date)) {
date = date.toString().substring(0, date.toString().length()-2);
replaceKeyLow.put("date", date);
}
//工具
public static Map<String, Object> toReplaceKeyLow(Map<String, Object> map) {
Map re_map = new HashMap();
if(re_map != null) {
Iterator var2 = map.entrySet().iterator();
while(var2.hasNext()) {
Entry<String, Object> entry = (Entry)var2.next();
re_map.put(underlineToCamelhump((String)entry.getKey()), map.get(entry.getKey()));
}
map.clear();
}
return re_map;
}
public static String underlineToCamelhump(String inputString) {
StringBuilder sb = new StringBuilder();
boolean nextUpperCase = false;
for (int i = 0; i < inputString.length(); i++) {
char c = inputString.charAt(i);
if (c == '_') {
if (sb.length() > 0) {
nextUpperCase = true;
}
} else {
if (nextUpperCase) {
sb.append(Character.toUpperCase(c));
nextUpperCase = false;
} else {
sb.append(Character.toLowerCase(c));
}
}
}
return sb.toString();
}