1.获取list中id的集合
List<Integer> lstVideoID = listVideoLine.stream().map(x -> x.getVideoId()).collect(Collectors.toList());
2.list通过过滤条件遍历
List<VideoGis> selectList = lstVideoGis.stream().filter(x-> x.getLineID().equals(d.getLineId())).collect(Collectors.toList());
3.排序
对年龄升序排序
//按年龄排序(Integer类型)
List<StudentInfo> studentsSortName = studentList.stream().sorted(Comparator.comparing(StudentInfo::getAge)).collect(Collectors.toList());
对年龄进行降序排序
//按年龄排序(Integer类型)
List<StudentInfo> studentsSortName = studentList.stream().sorted(Comparator.comparing(StudentInfo::getAge).reversed()).collect(Collectors.toList());
对年龄降序排序,年龄一样的在根据身高升序排序
List<StudentInfo> studentsSortName = studentList.stream()
.sorted(Comparator.comparing(StudentInfo::getAge).reversed().thenComparing(StudentInfo::getHeight)).collect(Collectors.toList());