JSONObject jsonObject = JSONObject.parseObject(XxJson); Map<String, Object> map= jsonObject;
如果json是数组,则转成list
JSONArray jsonObject = JSONArray.parseArray(XxJson); List list= jsonObject;
根据需要还可以将map转换为list
List<String> list = new ArrayList<String>(map.values());
转键也可以
List<String> list = new ArrayList<String>(map.keySet());
Json数据转Map
原文地址:https://www.cnblogs.com/IceBlueBrother/p/8421740.html