- Spring 5.0 By Example
- Claudio Eduardo de Oliveira
- 70字
- 2021-06-24 19:17:36
Keeping the news safely
Also, we need to check if the news is fully revised by all mandatory reviewers. It is quite simple, we are using Java 8, and it provides the amazing Stream interface, which makes the collections interactions easier than before. Let's do this:
public Boolean revised() {
return this.mandatoryReviewers.stream().allMatch(reviewer -> this.reviewers.stream()
.anyMatch(review -> reviewer.id.equals(review.userId) && "approved".equals(review.status)));
}
Thanks, Java 8, we appreciate it.
推薦閱讀
- PWA入門與實踐
- C++程序設計(第3版)
- UML和模式應用(原書第3版)
- 單片機C語言程序設計實訓100例:基于STC8051+Proteus仿真與實戰
- Xamarin.Forms Projects
- GameMaker Programming By Example
- 自制編程語言
- Python Data Analysis Cookbook
- Instant Nancy Web Development
- Corona SDK Mobile Game Development:Beginner's Guide(Second Edition)
- Python算法詳解
- SQL Server 2008 R2數據庫技術及應用(第3版)
- 現代CPU性能分析與優化
- 實驗編程:PsychoPy從入門到精通
- 數據庫技術及應用教程上機指導與習題(第2版)