list<map> 排序

Collections.sort(list, new Comparator<Map<String, Object>>() {
@Override
public int compare(Map<String, Object> o1, Map<String, Object> o2) {
Date date1 = (Date)o1.get("date");
Date date2 = (Date)o2.get("date");
return date2.compareTo(date1);
}
});
posted @ 2019-10-10 11:50  zhangheliang  阅读(3482)  评论(0编辑  收藏