List 根据某字段去除重复

Java8 List 根据某字段去除重复 。。导入Java。util

List<CustomerSchedule> rows = customerScheduleService.selectList(null, customerSchedule);
		rows = rows.stream().collect(
                Collectors.collectingAndThen(
                        Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(CustomerSchedule::getInstitutionName))), ArrayList::new));
        
发布了15 篇原创文章 · 获赞 10 · 访问量 6543

猜你喜欢

转载自blog.csdn.net/weixin_42285162/article/details/85159509
今日推荐