官术网_书友最值得收藏!

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.

主站蜘蛛池模板: 兴化市| 辽中县| 图们市| 应城市| 怀化市| 车险| 铅山县| 基隆市| 四会市| 增城市| 吴忠市| 虎林市| 皋兰县| 阳谷县| 酒泉市| 井陉县| 建湖县| 同仁县| 南溪县| 榆树市| 赤壁市| 雷波县| 吉林市| 梁山县| 安乡县| 莒南县| 姚安县| 永仁县| 长海县| 平远县| 时尚| 娱乐| 丰宁| 三原县| 汉川市| 儋州市| 永和县| 柳江县| 金沙县| 桐城市| 卓尼县|