java8组合优先级排序

List<JSONObject> collect = bannerList.stream().sorted(Comparator.comparing((JSONObject p)->(Integer)p.get("sortNo"))
    .thenComparing(Comparator.comparing((JSONObject p)->(Long)p.get("buId"))))
    .collect(Collectors.toList());
    原文作者:icool_ali
    原文地址: https://blog.csdn.net/icool_ali/article/details/80946706
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞