编程语言
首页 > 编程语言> > java ListMap排序

java ListMap排序

作者:互联网

list.stream().sorted(Comparator.comparing(map -> Integer.parseInt(map.get("monthtime").toString()))).collect(Collectors.toList());
List<Map<String, Object>> lista = list.stream().sorted(Comparator.comparing(map -> Integer.parseInt(map.get("aa").toString()))).collect(Collectors.toList());
List<Map<String, Object>> sScore = lstMap.stream().sorted(
	Comparator.comparing(
		m -> {
				BigDecimal sScore1 = Convert.toBigDecimal(m.get("sScore").toString());
				return sScore1;
		})
).collect(Collectors.toList());

Collections.reverse(sScore);

标签:map,java,Comparator,stream,toList,ListMap,comparing,toString,排序
来源: https://www.cnblogs.com/linhan8888/p/16390403.html