JSONArray与List集合之间的相互转换

1.List转fastjson JSONArray

List list = new ArrayList();

JSONArray jsonArray = JSONArray.parseArray(JSONArray.toString());

 

2.fastjson JSONArray转List

JSONArray json = new JSOArray();

List<T> list = JSONArray.parseArray(json.toString(),T.class);

posted @ 2023-02-27 09:24  清歌终末  阅读(4809)  评论(0)    收藏  举报