public ArrayList<ModelClass> clearListFromDuplicate (ArrayList<ModelClass> list1) {
Map<String, Property_Master> cleanMap = new LinkedHashMap<String, ModelClass>();
for (int i = 0; i < list1.size(); i++) {
cleanMap.put(String.valueOf(list1.get(i).getM_id()), list1.get(i));
}
ArrayList<ModelClass> list = new ArrayList<ModelClass>(cleanMap.values());
return list;
}
Map<String, Property_Master> cleanMap = new LinkedHashMap<String, ModelClass>();
for (int i = 0; i < list1.size(); i++) {
cleanMap.put(String.valueOf(list1.get(i).getM_id()), list1.get(i));
}
ArrayList<ModelClass> list = new ArrayList<ModelClass>(cleanMap.values());
return list;
}
No comments:
Post a Comment