stream流按某类型分组后操作
比如查询出了所有学生的各科成绩列表,再按学生分组求和
Map<Integer, Double> collect = testList.stream().collect(Collectors.groupingBy(UserEntity::getUserId, Collectors.summingDouble(f -> Double.parseDouble(f.getScore()))));
Collectors收集器
偶做前堂客
祝你天天开心
在未知的时间
在未知的地点