java8从集合中查找对象的属性 + 集合筛选功能
作者:互联网
// 根据流程实例ID查询已经撤销的流程 List<String> processInstanceIds = models.stream().map(ProcessForLineScreenResponse::getInstanceId).collect(Collectors.toList()); if (processInstanceIds.size() > 0) { List<String> ids = this.mapper.getStopedProcessInstanceByIds(processInstanceIds); // 过滤掉已撤销的流程 models = models.stream().filter(u -> !ids.contains(u.getInstanceId())).collect(Collectors.toList()); }
标签:toList,getInstanceId,stream,models,List,查找,processInstanceIds,集合,java8 来源: https://www.cnblogs.com/subendong/p/16531407.html