判断某个值在list中是否存在


if (!startAds.stream().filter(w->String.valueOf(w.getId()).equals(startAdvertisingBean.getId())).findAny().isPresent()){ 
//说明不存在
if (startAds.getTotalElements() >= this.headMax) {
Map<String, String> result = new HashMap<>();
result.put("msg", "启动页广告启用数量超过上限,上限为" + this.headMax);
return ResponseBeanFactory.buildFailedModifyParmBean(result);
}
}

判断startAdvertisingBean.getId()在startAds这个list的id属性中是否存在


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM