List<Map> 转 Map、List分组
Map<String, Long> map = list.stream().collect(Collectors.toMap(s -> (String)s.get("key"), s -> (String) s.get("value")));
Map<String, List<User>> map = list().stream().collect(Collectors.groupingBy(User::getUserId));
Map<String, User> map = list().stream().collect(Collectors.toMap(e -> e.getUserId(), Function.identity(), (oldData, newData) -> newData));
浙公网安备 33010602011771号