1.JSON转为实体类
Entity entity = JSONObject.parseObject(new JSONObject.toJSONString(), Entity.class);
2.List
//1.新建一个 List
3.实体类转为 JSON String
//1.创建实体类 Entity entity = new Entity; //2.创建Jackson对象 ObjectMapper ObjectMapper mapper = new ObjectMapper(); //3.转换为JSOn String json = mapper.writeValueAsString(entity);
4.List
//1.新建 临时 tempEntityList List> tempEntityList=new ArrayList >(); //2.获取 临时 tempEntityList 第一条数据 转为所需要的实体类 JSONObject.toJavaObject(JSONObject.parseObject(JSONObject.toJSONString(tempEntityList.get(0))),Entity.class)



