private static Pattern linePattern = Pattern.compile("_(\\w)");
/**
* @author pan
*@Description: 下划线转换成驼峰命名法
*@Create Date: 2020-09-03
*@param Map<String, Object> lineMap
*@return Map<String, Object>
*/
public Map<String, Object> lineToHump(Map<String, Object> lineMap){
Map<String, Object> humpMap=new HashMap<String, Object>();
for (String oldKey : lineMap.keySet()) {
oldKey = oldKey.toLowerCase();
Matcher matcher = linePattern.matcher(oldKey);
StringBuffer sb = new StringBuffer();
while (matcher.find()) {
matcher.appendReplacement(sb, matcher.group(1).toUpperCase());
}
StringBuffer covKey = matcher.appendTail(sb);
humpMap.put(covKey.toString(), lineMap.get(oldKey));
}
return humpMap;
}