本代码块去除List 集合中属性值dormitoryId和bedroomNo均相同的重复PowerModel对象 //对powerModels,按照dormitoryId和bedroomNo去重 for (int i = 0; i powerModels.size() - 1; i++) { for (int j = powerModels.size() - 1; j
//对powerModels,按照dormitoryId和bedroomNo去重 for (int i = 0; i < powerModels.size() - 1; i++) { for (int j = powerModels.size() - 1; j > i; j--) { if (powerModels.get(j).getBedroomNo().equals(powerModels.get(i).getBedroomNo()) && powerModels.get(j).getDormitoryId().equals(powerModels.get(i).getDormitoryId())) { powerModels.remove(j); } } }