List pdVos = pdVoListList.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() ->new TreeSet<>(Comparator.comparing(o -> o.getPiCode() +";" + o.getDeveloperCode()))), ArrayList::new));// 按多个属性去重列表
Map<String,List<PdVo>> pdVoMap = pdVos.stream().collect(Collectors.groupingBy(PdVo::getDeveloperCode));// 按某个属性分组
网友评论