map 里面的key值的改变

举例,将map的首字母小写

 HashMap posNoticesMap = new HashMap<>();
posNoticesMap.put("SDSD","sdsad");


Map newMap = posNoticesMap.entrySet().stream().collect(Collectors.toMap(entry -> StringUtils.uncapitalize(entry.getKey()), entry -> entry.getValue()));

你可能感兴趣的:(开发技巧,java,servlet,jvm)