![](https://img-blog.csdnimg.cn/20201014180756757.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
lambda
学无止境的程序猿
这个作者很懒,什么都没留下…
展开
-
Java8 对list集合的处理
1.list转map(List<User> 转 Map<user.getUid,user>) Map<Integer, User> userMap = userList.stream().collect(Collectors.toMap(User::getUid,Function.identity())); 2.list转map并且分组(根据list中的对...原创 2018-12-07 13:58:25 · 7232 阅读 · 2 评论 -
Java8 对集合进行排序
0.根据集合的对象或属性 正序排序 0.1根据属性 List<Goods> collect = goodsList.stream().sorted(Comparator.comparing(Goods::getAmunt)).collect(Collectors.toList()); 0.2根据对象本身,适应于(List<Integer> 或 Lis...原创 2019-10-16 11:24:26 · 1560 阅读 · 0 评论