eviceOperate deviceOperate = new DeviceOperate(); deviceOperate.setServiceId("1111111"); deviceOperate.setId(1); deviceOperate.setMac("2222222"); Map<String,Object> map = new HashMap<String, Object>(); map.put("param",deviceOperate); String ss = JSONObject.fromObject(map).toString(); Map<String,Object> map1= JSONObject.fromObject(ss); JSONObject jsonObject = (JSONObject) map1.get("param"); DeviceOperate deviceOperate1 = (DeviceOperate)JSONObject.toBean(jsonObject,DeviceOperate.class);
JSONObject to bean
最新推荐文章于 2022-05-13 16:34:03 发布