List<HighxjRollVo> collect9 = highxjRollVoList.stream().filter(x -> x.getGradets().length() == 1 && gradelist.contains(x.getGradets())).filter(x -> !((Calendar.getInstance().get(Calendar.MONTH) + 1)-8 >0 ? ("20"+String.valueOf(Integer.valueOf(x.getHighStudentId().substring(0, 2))+Integer.valueOf(x.getGradets())-10)).equals(yearLast) : ("20"+String.valueOf(Integer.valueOf(x.getHighStudentId().substring(0, 2))+Integer.valueOf(x.getGradets())-10)).equals(beforeYearLast))).collect(Collectors.toList());
前辈写的,而且没有换行,全在一行里面
给我看的头疼,我都是让 gpt 帮我解释一下这行代码干了啥🤣
1
OutOfMemoryError 2023-06-16 16:55:34 +08:00
idea 一键格式化不就好了么 这个项目的
|
2
hhjswf 2023-06-16 17:05:38 +08:00 via Android
咋一看像前端混淆的代码
|
3
PungentSauce 2023-06-16 17:24:05 +08:00
就俩过滤
|
4
chenPiMeiHaoChi 2023-06-16 17:27:44 +08:00
道理我都懂,但为什么是 collect9 ?想想还有 12345678 就更吓人了。
|
5
assiadamo 2023-06-16 17:28:19 +08:00
```
List<String> list = new ArryList<>(); for (int i = 0; i < strs.length; i++) { if (list.contains(strs[i])) continue; list.add(strs[i]); } ``` 刚刚看到的代码 |
6
haitaoli OP @chenPiMeiHaoChi 哈哈 看的好细 总共 collect29🤣
|
7
yazinnnn 2023-06-16 17:37:52 +08:00
|
8
jasonjames 2023-06-16 17:38:17 +08:00
大佬 囚牢囚牢
@haitaoli |
9
Jarred711 2023-06-21 11:02:58 +08:00
In summary, the code filters a list of HighxjRollVo objects based on specific conditions using Java 8 Stream API. The resulting filtered elements are collected into a new list assigned to the collect9 variable.
|