1.fastjson  List转JSONArray

List<T> list = new ArrayList<T>();

JSONArray array= JSONArray.parseArray(JSON.toJSONString(list));

 

2.fastjson  JSONArray转List

JSONArray array = new JSONArray();

List<EventColAttr> list = JSONObject.parseArray(array.toJSONString(), EventColAttr.class);

 

3.fastjson  字符串转List

String str = "";

List<T> list = JSONObject.parseArray(str,T.class);

 

相关文章:

  • 2021-09-15
  • 2021-08-02
  • 2021-10-07
  • 2022-01-20
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-07-01
  • 2022-02-07
  • 2021-09-26
  • 2021-12-26
  • 2022-01-29
相关资源
相似解决方案