Collections.sort(mapList,new Comparator<>(){...})
/**1.根据用户浏览量进行排序// 例:List<Map<String,Object>> mapList= new ArrayList<>();注:mapList里面存在 browserNum属性*///排序 倒序if (mapList != null && mapList .size() > 1) {Collections.sort(mapList , new Comparator<Map<String, Object>>() {@Overridepublic int compare(Map<String, Object> o1, Map<String, Object> o2) {Integer o1Value = Integer.valueOf(o1.get("browserNum").toString());Integer o2Value = Integer.valueOf(o2.get("browserNum").toString());return o1Value.compareTo(o2Value);}});}return mapList;//想要顺序的话可以调换一下返回值
