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

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.

主站蜘蛛池模板: 綦江县| 清涧县| 贵州省| 安仁县| 乌拉特后旗| 咸阳市| 巫溪县| 通化市| 石嘴山市| 肥城市| 彭州市| 潼关县| 滁州市| 阆中市| 乌拉特后旗| 隆回县| 乌拉特后旗| 晋江市| 武隆县| 东源县| 特克斯县| 依兰县| 牡丹江市| 巩义市| 大余县| 庐江县| 龙岩市| 大宁县| 南宫市| 抚宁县| 汶川县| 博爱县| 大冶市| 深圳市| 东方市| 西峡县| 原平市| 安新县| 唐山市| 三门峡市| 娄底市|