当前位置:网站首页>Lambda expressions sort list objects in multiple fields
Lambda expressions sort list objects in multiple fields
2022-07-24 06:58:00 【[email protected]】
1、 Code up
// Carry out positive joint sorting according to the year and number
// Year ascending
Comparator<ReplyInfoVo> year = Comparator.comparing(ReplyInfoVo::getCaseNo3);
// Number ascending
Comparator<ReplyInfoVo> num = Comparator.comparing(ReplyInfoVo::getCaseNo4);
// Joint sort
Comparator<ReplyInfoVo> finalComparator = year.thenComparing(num);
replyInfoVoArrayList = replyInfoVoArrayList.stream().sorted(finalComparator).collect(Collectors.toList());
You can arrange the fields in positive order by year first , Then arrange them in positive order , Try it yourself .
2、 Explain in detail
版权声明
本文为[[email protected] slightly fat]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/205/202207240548387728.html
边栏推荐
- 《大厂面试》之JVM篇21问与答
- String问题
- Special effects - when the mouse moves, there will be a custom expression trail
- [learning notes] what happens when the URL is input into the page presentation?
- 歹徒逃亡3
- Redis特殊数据类型-HyperLogLog
- 基于回归分析的广告投入销售额预测——K邻近,决策树,随机森林,线性回归,岭回归
- 10分钟就能写出来的——25~30K的国外企业招聘面试考题,这不是轻轻松松吗~
- 永远不要迷失自我!
- [lvgl (2)]
猜你喜欢

oss授权单个bucket权限
![[learning notes] possible reasons and optimization methods for white screen on Web pages](/img/80/152a2827b0e653ebf2365c16ce3b40.png)
[learning notes] possible reasons and optimization methods for white screen on Web pages

MapReduce(一)
![[lvgl (5)] label usage](/img/55/f25a510cf04caff7ee15e72360c3a1.png)
[lvgl (5)] label usage

数据分析思维之从整体出发分析零售行业——全方位多方面细节分析

Thinking of data analysis -- analyzing the retail industry as a whole -- an all-round and multifaceted detailed analysis
![[lvgl layout] grid layout](/img/36/47f586f3dc1a114ed7775c4e190872.png)
[lvgl layout] grid layout

Jinan renshe has signed 1w+ electronic labor contract, which greatly helps HR digitalization

渗透学习-SQL注入篇-靶场篇-安全狗的安装与绕过实验(后续还会更新)

Introduction to pyqt5 - student management system
随机推荐
不去和谁比较,只需做好自己
adb交互-干掉难看的默认shell界面
Breadth first search (template use)
Penetration learning - SQL injection - shooting range - installation and bypass experiment of safety dog (it will be updated later)
metaRTC5.0实现君正的纯C的webrtc版IPC
reflex
Redis.conf详解
[lvgl (important)] style attribute API function and its parameters
Practice of online problem feedback module (12): realize image deletion function
创建WPF项目
Redis basic type - hash
String问题
UE4/5 无法打开文件“xxx.generated.h”(Cannot open file xxx.generated.h)的解决方法总结
(笔记整理未完成)【图论:求单源最短路径】
[learning notes] Web page rendering process
安装snownlp包过程出现Requirement already satisfied:及Read timed out.问题解决方法
Mac解决 Can‘t connect to local MySQL server through socket ‘/tmp/mysql.sock‘ (2)问题
Redis special data type Geo
[lvgl (1)] a brief introduction to lvgl
postgresql 日期处理函数用法