1、遍历集合并得到新对象
List<RpcCustomerImageDTO> customerImgList= customerImageList.stream().filter(a -> a.getImgKey() !=
null
).
collect(Collectors.toList());
2、遍历集合并得到新对象
List<RpcCustomerImageDTO> businessLicenseImgList = customerImageList.stream().filter(a -> a.getImgKey().equals(UserSyncWjConstant.BUSINESS_LICENSE_PICTURE)).collect(Collectors.toList());
3、返回集合中对象的属性
List<String> orgCodeList = orgList.stream().map(Org::getOrgCode).collect(Collectors.toList());