List 轉 JSONArray
// 通過JSONPath獲取其中數據,也可以說自己生成的List
List<JSONObject> caseList = JsonPath.read(resStr, "$.result.case");
// 轉換為JSONArray
JSONArray cases = JSONArray.parseArray(JSON.toJSONString(caseList));
JSONArray 轉 List
JSONArray array = new JSONArray();
List<T> list = JSONObject.parseArray(array.toJSONString(), T.class);
String 轉 List
String str = "";
List<T> list = JSONObject.parseArray(str, T.class);