当前位置:网站首页>Lambda终结操作查找与匹配findFirst
Lambda终结操作查找与匹配findFirst
2022-06-13 03:35:00 【Leon_Jinhai_Sun】
findFirst
获取流中的第一个元素。
例子:
获取一个年龄最小的作家,并输出他的姓名。
// 获取一个年龄最小的作家,并输出他的姓名。
List<Author> authors = getAuthors();
Optional<Author> first = authors.stream()
.sorted((o1, o2) -> o1.getAge() - o2.getAge())
.findFirst();
first.ifPresent(author -> System.out.println(author.getName()));边栏推荐
- LVS four layer load balancing cluster (4) main methods of load balancing
- MapReduce internal execution principle
- MySQL learning summary 12: system variables, user variables, definition conditions and handlers
- Part II. S3. intuitionistic fuzzy multi-attribute decision-making method when attribute weight is intuitionistic fuzzy number
- Batch image Download & socket dialogue
- Installing MySQL 8.0.20 under Linux and ubuntu20.04 LTS
- (9) Explain broadcasting mechanism in detail
- 【測試開發】自動化測試selenium(三)——unittest框架解析
- Jumpserver installation
- Azure SQL db/dw series (12) -- using query store (1) -- report Introduction (1)
猜你喜欢

Simulink代码生成: 查表模块及其代码

【测试开发】软件测试基础篇

【测试开发】测试的相关基本概念
![[azure data platform] ETL tool (6) -- re understanding azure data factory](/img/b5/da5dc9815fb9729fb367f2482913b7.jpg)
[azure data platform] ETL tool (6) -- re understanding azure data factory

The latest collation of the number of years of education per capita in the country and provinces -1989-2020- includes the annual original data, calculation process and result summary
![[azure data platform] ETL tool (2) -- azure data factory](/img/31/3561a3c3f24bce098330218a1d9ded.jpg)
[azure data platform] ETL tool (2) -- azure data factory "copy data" tool (cloud copy)

MapReduce internal execution principle

2000-2019 enterprise registration data of provinces, cities and counties in China (including longitude and latitude, number of registrations and other multi indicator information)

Simulink代码生成: 简单状态机及其代码

Spark optimization - Troubleshooting
随机推荐
Alipay open platform
Azure SQL db/dw series (13) -- using query store (2) -- report Introduction (2)
Azure SQL db/dw series (14) -- using query store (3) -- common scenarios
SQL injection case demonstration and preventive measures
[test development] automatic test selenium (I)
Doris data backup and recovery
Simulink代码生成: 查表模块及其代码
【测试开发】测试管理工具禅道的安装
LVS four layer load balancing cluster (6) LVS working mode
[azure data platform] ETL tool (2) -- azure data factory "copy data" tool (cloud copy)
Explain usage, field explanations, and optimization instances of MySQL
【测试开发】文件压缩项目实战
An error is reported in the JDBC connection database: connection to 139.9.130.37:15400 referred
Azure SQL db/dw series (10) -- re understanding the query store (3) -- configuring the query store
Azure SQL db/dw series (12) -- using query store (1) -- report Introduction (1)
Summary of the latest rail transit (Subway + bus) stops and routes in key cities in China (II)
Use of Oracle PL-SQL
footstep
China Civil Aviation Statistical Yearbook (1996-2020)
Onnx+tensorrt+yolov5: yolov5 deployment based on trt+onnx 1