标签:
list:[{"ss":123,"dd":234,"dd":234},{"mm":99,"ff":oo,"ff":oo}]
这种形式的:
1 List<Map<String,Object>> newList 2 = new ArrayList<Map<String,Object>>(); 3 Set<Set<String>> keysSet = new HashSet<Set<String>>(); 4 for(Map<String, Object> map : list){ 5 Set<String> keys = map.keySet(); 6 int beforeSize = keysSet.size(); 7 keysSet.add(keys); 8 int afterSize = keysSet.size(); 9 if(afterSize == beforeSize + 1){ 10 newList.add(map); 11 } 12 } 13 return newList;
list:[{groupId=122}, {groupId=124}, {groupId=135}, {groupId=91},
{groupId=109}, {groupId=124}, {groupId=135}, {groupId=126},
{groupId=127}, {groupId=133}, {groupId=134}, {groupId=151}]
这种形式的:
1 List<Map<String,Object>> newList 2 = new ArrayList<Map<String,Object>>(); 3 Set<Map<String,Object>> mapSet 4 = new HashSet<Map<String,Object>>(); 5 for(Map<String, Object> map : list) { 6 mapSet.add(map); 7 } 8 Iterator<Map<String, Object>> iteratormap=mapSet.iterator(); 9 while(iteratormap.hasNext()){ 10 newList.add(iteratormap.next()); 11 } 12 return newList;
标签:
原文地址:http://www.cnblogs.com/cxj-qldxmf/p/5435991.html