标签:int null err amp style else str col div
//给aqi升序排,null放到最后 Collections.sort(list,new Comparator<Map<String,Object>>() { @Override public int compare(Map<String, Object> o1, Map<String, Object> o2) { if (o1.get("aqi") != null && o2.get("aqi") != null) { return o1.get("aqi").toString().compareTo( o2.get("aqi").toString()); } else { return o1.get("aqi") == null ? 1 : -1; } } });
对list中的多个map按某个属性的值排序,null值放到最后
标签:int null err amp style else str col div
原文地址:https://www.cnblogs.com/KdeS/p/13299055.html