对List<Map<String, Object>>里的Map某个键属性排序,升序、降序
Collections.sort(resultList, new Comparator<Map<String, Object>>() {
@Override
public int compare(Map<String, Object> firstMap, Map<String, Object> setondMap) {
Integer firstCaseNum = Integer.valueOf(firstMap.get(“caseNum”).toString());
Integer setondCaseNum = Integer.valueOf(setondMap.get(“caseNum”).toString());
if (setondCaseNum != null) {
return setondCaseNum.compareTo(firstCaseNum);
}
return 0;
}
});