stream 根据多个字段对List<Bean>去重

applyinstIdViewList = applyinstIdViewList
                .stream()
                .collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(
                        Comparator.comparing(x -> x.getAPPLYINST_ID() + x.getCardtype()+ x.getGcdm()))), ArrayList::new));
posted @ 2023-03-07 15:41  Ideaway  阅读(88)  评论(0)    收藏  举报