对List对象里的其中两个属性配套去重

List<User> disList= list.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(o -> o.getPxx() + ";" + o.getPxs()))), ArrayList::new));

 

posted @ 2020-03-25 19:02  云飞扬-88  阅读(650)  评论(0编辑  收藏  举报