java Collection 排序
Integer排序
Collections.sort(resList, Comparator.comparingInt(SpecialStateCountVo::getSpecialNum).reversed());
String排序
list= list.stream()
.sorted(
Comparator.comparing(MajorDangerCntVO::getRegionCode)
.thenComparing(MajorDangerCntVO::getLv))
.collect(Collectors.toList());
String 转int 排序
Collections.sort(industryCountVOList,
(o1, o2) ->
Integer.valueOf(o2.getCnt())
.compareTo(Integer.valueOf(o1.getCnt()))
);
Double 排序
majorDangerRegionCntVOList=majorDangerRegionCntVOList.stream()
.sorted(Comparator.comparingDouble(MajorDangerRegionCntVO::getTotalCount).reversed())
.collect(Collectors.toList());