当前位置:网站首页>关于stream流,浅记一下------
关于stream流,浅记一下------
2022-04-23 14:00:00 【白云碎里一蓑舟】
- 逗号拼接list中的某一对象字段
millAndKilns.stream().map(MillAndKiln::getName).collect(Collectors.joining(","));
- 将对象集合中的某一个字段提取成一个新的集合
List<Long> appUnitIds = appUnitVOPage.getRecords().stream().map(AppUnitListVO::getId).collect(Collectors.toList());
- 根据id分组成key-value形式
Map<Long, List<AppField>> appFieldMap = fields.stream().collect(Collectors.groupingBy(AppField::getAppId));
- 判断集合中莫格对象字段是否包含指定值
versions.stream().map(AppVersion::getIsShelf).collect(Collectors.toList()).contains(PlatformConstant.IsShelf.ON_THE_SHELF)
- 集合根据莫格字段排序
versions.stream().sorted(Comparator.comparing(AppVersion::getUpdateTime).reversed()).collect(Collectors.toList())
版权声明
本文为[白云碎里一蓑舟]所创,转载请带上原文链接,感谢
https://blog.csdn.net/m0_49513507/article/details/123916107
边栏推荐
- Modify the Jupiter notebook style
- Chapter 15 new technologies of software engineering
- Port occupied 1
- 初探 Lambda Powertools TypeScript
- MySQL [SQL performance analysis + SQL tuning]
- Reading notes: fedgnn: Federated graph neural network for privacy preserving recommendation
- [VMware] address of VMware Tools
- go 语言 数组,字符串,切片
- 第一章 电商秒杀商品回顾
- 淘宝发布宝贝提示“您的消保保证金额度不足,已启动到期保障”
猜你喜欢
随机推荐
Get the attribute value difference between two different objects with reflection and annotation
The art of automation
自动化的艺术
Pytorch 经典卷积神经网络 LeNet
剑南春把文字游戏玩明白了
Atcoder beginer contest 248c dice sum (generating function)
Leetcode brush question 𞓜 13 Roman numeral to integer
Wechat applet
Express②(路由)
Kettle--控件解析
json反序列化匿名数组/对象
快捷键(多行)
Jenkins construction and use
Go语言 RPC通讯
Android篇:2019初中级Android开发社招面试解答(中
蓝绿发布、滚动发布、灰度发布,有什么区别?
YARN线上动态资源调优
Question bank and answer analysis of the 2022 simulated examination of the latest eight members of Jiangxi construction (quality control)
leetcode--977. Squares of a Sorted Array
Detailed explanation of redis (Basic + data type + transaction + persistence + publish and subscribe + master-slave replication + sentinel + cache penetration, breakdown and avalanche)









