FastJson 將JSONArray轉換爲List

JSONArray test=new JSONArray();
test.add("1");
test.add("2");
test.add("3");
test.add("4");
//將JSONArray轉換爲String
String testString=JSONObject.toJSONString(test, SerializerFeature.WriteClassName);
//將String轉化爲List<String>
List<String> testList=JSONObject.parseArray(testString,String.class);

代碼如上java

相關文章
相關標籤/搜索