集合流之“anyMatch”的应用【返回boolean类型】

判断集合中是否存在"字符串",返回boolean类型

boolean isExit = allSku.stream().map(Product::getFeatureList)
                        .anyMatch(featureList -> isNotEmpty(featureList) && featureList.contains("滞销"));

 

posted @ 2023-04-08 10:52  骚哥  阅读(44)  评论(0编辑  收藏  举报