jdk1.8 List根据时间字段倒序排序

List<Template> template = this.templateService.findTemplate(directoryUuid);
if(template!=null && template.size()>0){
template =

template.stream().sorted(Comparator.comparing(Template::getCreateDate).reversed()).collect(Collectors.toList());
}

posted @ 2021-12-16 17:59  韩小陌  阅读(1121)  评论(0编辑  收藏  举报