com.alibaba.fastjson把JSONObject转换为Map<String, Object>对象或者List<String> 对象


JSONObject obj = new JSONObject();
{
obj.put("key1", "value1");
obj.put("key2", "value2");
obj.put("key3", "value3");
}
Map params = JSONObject.parseObject(obj.toJSONString(), new TypeReference>(){});
// JSONObject.parseObject(obj.toJSONString(), new TypeReference>(){});
System.out.println(params);

//输出:{key3=value3, key2=value2, key1=value1}