java通过流查找指定内容_Java Stream流排序null以及获取指定条数数据

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::compareT

你可能感兴趣的:(java通过流查找指定内容)