1.筛选出年龄大于等于13岁的对象。
注意:如果条件存在null值,需先筛选出!!
List<Student> filterList = students.stream().filter(vo -> Objects.nonNull(vo.getAge())) .filter(vo -> vo.getAge() >= 13).collect(Collectors.toList());
1.筛选出年龄大于等于13岁的对象。
注意:如果条件存在null值,需先筛选出!!
List<Student> filterList = students.stream().filter(vo -> Objects.nonNull(vo.getAge())) .filter(vo -> vo.getAge() >= 13).collect(Collectors.toList());