stream流,通过集合里面的对象属性过滤数据
摘要:使用方法: List<BuLtReasonCodeDTO> categoryList = searchvo .stream() .filter(distinctByKey(BuLtReasonCodeDTO::getReasonCategory)) .collect(Collectors.toLis
阅读全文
获取一个集合出现重复的数据
摘要:1.对象集合: //单独String集合 List<Student> list = new ArrayList<>(); list.add(Student.builder().id("1").name("1").age("1").build()); list.add(Student.builder(
阅读全文
筛选两个集合不同数据
摘要:谁在最外面,最后返回的集合就是谁的数据,例子中返回的集合数据是newSupplierBiznoDetail的不同数据List<SqSupplierBiznoDetailVO> collect = newSupplierBiznoDetail.stream().filter(e -> { for (S
阅读全文