fastjson的json字符串转List

fastjson的json字符串转List

pom依赖
<dependency>
    <groupId>com.alibaba</groupId>
    <artifactId>fastjson</artifactId>
    <version>1.2.62</version>
</dependency>
json字符串转List:JSONObject.paresArray(str,class)
String string = redisTemplate.opsForValue().get("poetList",0,-1);
List<Poet> poetList = JSONObject.parseArray(string, Poet.class);//转换
上一篇:Java读取json文件转换为json


下一篇:Gson与FastJson