集合比较器排序

      orderRefundDetailVos.add(orderRefundDetailVo);
            }
            //按照时间倒序
            Collections.sort(orderRefundDetailVos, new Comparator<OrderRefundDetailVo>() {
                @Override
                public int compare(OrderRefundDetailVo o1, OrderRefundDetailVo o2) {
                    if (o1.getCreateDateTime()==null || o2.getCreateDateTime()==null){
                        return 1;
                    }
                    return o2.getCreateDateTime().compareTo(o1.getCreateDateTime());
                }
            });
            return orderRefundDetailVos;

 

posted @ 2021-12-15 13:13  Joker-0927  阅读(27)  评论(0编辑  收藏  举报
// 侧边栏目录