fastjson List<> 转Json , Json 转List<>

比如说List<Strudent>

List转Json

List<Student> students = new ArrayList();
String str = JSON.toJSONString(students); // List转json

Json 转List 

String str = ""; //获取的Json数据
List<Student> students = JSON.parseObject(str,new TypeReference<List<Student>>(){}); // Json 转List

猜你喜欢

转载自my.oschina.net/zjllovecode/blog/1802835