JSON转换相关

  对象转json

1. JSONObject jsonObject1 = (JSONObject)JSONObject.toJSON(iotDeviceOnline.getData());  //fastjson 对象转json

2.   net.sf.json.JSONObject jsonObject2 = net.sf.json.JSONObject.fromObject(iotDeviceProperties.getData());// 对象转json

      jsonObject转list集合

1. List<DeviceInfoWifi> deviceInfoWifis = JSONObject.parseArray(jsonObject2.toString(), DeviceInfoWifi.class);// json转list

posted @ 2021-09-01 15:51  liberalartsy  阅读(40)  评论(0)    收藏  举报