Collections.sort(list, new Comparator<Map<String, Object>>() {
@Override
public int compare(Map<String, Object> o1, Map<String, Object> o2) {
Integer value1 = 0;
Integer value2 = 0;
for (String key : o1.keySet()) {
value1 = (Integer) o1.get(key);
}
for (String key : o2.keySet()) {
value2 = (Integer) o2.get(key);
}
return value2.compareTo(value1);
}
});
时间: 2024-10-05 17:12:00