我有一个
List<Map<String, Object>> assetSubtypeClassification
其中包含以下值:
[{AssetName=HVAC, AssetSubTypeName=AHU, AssetClassificationName=Electric/Heat Recovery, FaultTypeName=No Power}]
我希望将此地图拆分为每个标题的单独字符串。做这个的最好方式是什么?抱歉,如果这是显而易见的,因为我是新手
你可能?想创建一个循环来“读取”你的对象,所以:
// go through the ArrayList
for (Map hashMap : assetSubtypeClassification) {
// for each hashmap get the key and value
for (Map.Entry<String, String> item : hashMap.entrySet()) {
String key = item.getKey();
String value = item.getValue();
}
}