1、toJSONString
String str = JSON.toJSONString(Entity);
2、parseObject
Entity toObj = JSON.parseObject(str, Entity.class);
3、parseArray
String arrJson = JSON.toJSONString(entityList); List<Entity> arrList = JSON.parseArray(arrJson, Entity.class);
JSON中toJSONString、parseObject、parseArray的作用
原文:https://www.cnblogs.com/lyx-2018-yh-qingliu/p/10399869.html