list 常用的一些

2019/7/1 21:08:00  人气 372    专业JAVA技术发表平台  
根据某些条件过滤这里根据specialPlanPeriods过滤
List<ApplyPlacingBizDTO> applyPlacingBizDTOList= iAccountInfoApi.getList(specialPlanId());
applyPlacingBizDTOList.stream().filter(item->applyPlacingDTOList.get(0).getSpecialPlanPeriods().equals(item.getSpecialPlanPeriods())).collect(Collectors.toList());

List<ApplyPlacingBizDTO> placingBizDTOS= entry.getValue().stream().filter(item->”0”.equals(item.getLockStatus())).collect(Collectors.toList());

从map中取出所有的keyId到List集合中
List<String> keyIds = applyPlacingDTOList.stream().map(ApplyPlacingBizDTO::getKeyId).collect(Collectors.toList());


List方法去重
List<UnderwritmgrInvestorBasicInfoArchives> infoArchives= infoArchives.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(o->o.getInvestorId()))), ArrayList::new));
支持多条件去重


根据userI剔除数据
List<String> userIds = userIds.parallelStream().filter(item -> !item.equals(userId)).collect(Collectors.toList());

. 微信,微博,QQ空间点击右上角的三个点分享给朋友。经典话题等你参与。关注baishiwlkj公众号成

发表回复

   


  通知楼主
暂无回复!