Java8的Stream流的一些用法,

//排序   
carerVehEntityList = carerVehEntityList.stream().sorted(
Comparator.comparing(CarerVehInOrOutEntity::getDelintSortNum, Comparator.nullsFirst(Integer::compareTo))
.thenComparing(CarerVehInOrOutEntity::getDelintName, Comparator.nullsFirst(String::compareTo))
.thenComparing(CarerVehInOrOutEntity::getLadingSn, Comparator.nullsFirst(String::compareTo))
.thenComparing(CarerVehInOrOutEntity::getProductSortNum, Comparator.nullsFirst(Integer::compareTo))
.thenComparing(CarerVehInOrOutEntity::getProductName, Comparator.nullsFirst(String::compareTo))
.thenComparing(CarerVehInOrOutEntity::getProductGradeSortNum, Comparator.nullsFirst(Integer::compareTo))
.thenComparing(CarerVehInOrOutEntity::getProductGradeName, Comparator.nullsFirst(String::compareTo))
.thenComparing(CarerVehInOrOutEntity::getLadingId, Comparator.nullsFirst(Long::compareTo))
).collect(Collectors.toList());
//取出指定条数数据
List<CarerVehInOrOutEntity> entityList = carerVehEntityList.stream().skip(page.getPageSize() * page.getPageNumber())
.limit(page.getPageSize()).collect(Collectors.toList());
05-02 09:26