zoukankan      html  css  js  c++  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::compareTo)) ).collect(Collectors.toList()); //取出指定条数数据 List<CarerVehInOrOutEntity> entityList = carerVehEntityList.stream().skip(page.getPageSize() * page.getPageNumber())
    .limit(page.getPageSize()).collect(Collectors.toList());
  • 相关阅读:
    Notepad++快捷键
    NAT123内网映射端口
    Maven 导出依赖Jar,生成source.jar,javadoc.jar
    自定义javascript log方法
    AmazeUI定制
    模板框架
    jquery checkbox全选 获取值
    首页导航点击A连接跳转并添加上背景色,
    Controller中的方法利用ip跨域访问
    Datatable转成List
  • 原文地址:https://www.cnblogs.com/yisheng/p/11897224.html
Copyright © 2011-2022 走看看