String str = "[{\"jinniantongqi\":1310416804.3,\"jinniandiNyue\":0},{\"jinniantongqi\":775262409.2,\"jinniandiNyue\":0}]";
List<HashMap<String, Object>> orderList = com.alibaba.fastjson.JSONObject.parseObject(str, List.class);
List<Map<String, Object>> list2 = new ArrayList<>();
for(int i=0;i<orderList.size();i++){
Map<String,Object> newMap = orderList.get(i);
Map<String, Object> Map = new HashMap<>();
for(Entry<String,Object> entry:newMap.entrySet()){
Map.put(entry.getKey(), entry.getValue());
}
list2.add(Map);
}
遍历<List<Map<String,Object>>>,List的JSONObject类型转HashMap类型
最新推荐文章于 2024-07-09 20:42:41 发布