Map<String, ArrayList<OfflineGaAirportBean.GaAirportDTO.AirportAtsCommunicationFacilitiesDTO>> map = new HashMap<>();
String key;
for (int i = 0; i < info.size(); i++) {
// 通航根据Designator;运输根据Service_name来进行分组展示
if (info.get(i).getDesignator() == null) {
key = info.get(i).getService_name();
} else {
key = info.get(i).getDesignator();
}
ArrayList<OfflineGaAirportBean.GaAirportDTO.AirportAtsCommunicationFacilitiesDTO> list = map.get(key);
if (list == null) {
list = new ArrayList<>();
list.add(info.get(i));
map.put(key, list);
} else {
list.add(info.get(i));
}
}
根据字段来分组封装数据
最新推荐文章于 2024-08-23 00:00:00 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)