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

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.

主站蜘蛛池模板: 安阳市| 峡江县| 弥勒县| 恩施市| 双鸭山市| 兴国县| 泰顺县| 通海县| 巴林右旗| 乌拉特后旗| 绥宁县| 紫金县| 股票| 海林市| 金门县| 财经| 綦江县| 张掖市| 达尔| 长白| 平陆县| 山西省| 临泉县| 武陟县| 景德镇市| 鄂托克前旗| 皮山县| 荥阳市| 宁城县| 吉木萨尔县| 晋宁县| 渑池县| 广昌县| 镶黄旗| 东乡县| 汉川市| 米林县| 吉首市| 蛟河市| 高唐县| 琼结县|