- 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.
推薦閱讀
- 算法零基礎(chǔ)一本通(Python版)
- JS全書:JavaScript Web前端開發(fā)指南
- 軟件工程
- Responsive Web Design by Example
- Asynchronous Android Programming(Second Edition)
- 青少年信息學競賽
- 持續(xù)輕量級Java EE開發(fā):編寫可測試的代碼
- 現(xiàn)代CPU性能分析與優(yōu)化
- 分布式數(shù)據(jù)庫HBase案例教程
- Getting Started with hapi.js
- H5頁面設(shè)計與制作(全彩慕課版·第2版)
- Real-time Analytics with Storm and Cassandra
- Python編程零基礎(chǔ)入門
- Go底層原理與工程化實踐
- Android 3D游戲開發(fā)技術(shù)寶典:OpenGL ES 2.0