- 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.
推薦閱讀
- SoapUI Cookbook
- JavaScript+jQuery網頁特效設計任務驅動教程(第2版)
- Python時間序列預測
- Mastering Linux Security and Hardening
- Fast Data Processing with Spark(Second Edition)
- Android嵌入式系統程序開發:基于Cortex-A8(第2版)
- 軟件體系結構
- Access數據庫應用教程(2010版)
- 3D Printing Designs:The Sun Puzzle
- Python數據預處理技術與實踐
- 大話代碼架構:項目實戰版
- Java面向對象程序設計教程
- Java EE 7 Development with WildFly
- Hands-On ROS for Robotics Programming
- Implementing Splunk(Second Edition)