list排序

List<xxBean> lst = new ArrayList<xxBean>() ;

单条件排序

lst.sort(Comparator.comparing(xxBean::get属性A))  ;

多条件排序

lst.sort(Comparator.comparing(xxBean::get属性A).thenComparing(xxBean::get属性B)) ;

原文地址:https://www.cnblogs.com/Wicher-lsl/p/11392998.html