当前位置 : 主页 > 编程语言 > java >

map排序

来源:互联网 收集:自由互联 发布时间:2021-06-28
gistfile1.txt map = list.stream().collect( Collectors.groupingBy(ClueRule::getCrScore ,Collectors.toList())) .entrySet().stream() .sorted(Map.Entry.comparingByKey()) .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValu
gistfile1.txt
map  = list.stream().collect(
                    Collectors.groupingBy(ClueRule::getCrScore ,Collectors.toList()))
                    .entrySet().stream()
                    .sorted(Map.Entry.comparingByKey())
                    .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue,
                            (oldValue, newValue) -> oldValue, LinkedHashMap::new));
网友评论