{
"ErrorMessage": null,
"ResponseData": {
"Data": [
{
"DeviceTypeConfigId": "1",
"DeviceTypeName": "1",
"SensorInfos": [
{
"SensorCode": "AirTemperature",
"SensorConfigId": 1,
"SensorName": "空气温度",
"ValueType": "Value"
},
{
"SensorCode": "AirHumidity",
"SensorConfigId": 2,
"SensorName": "空气湿度",
"ValueType": "Value"
},
{
"SensorCode": "CarbonDioxide",
"SensorConfigId": 3,
"SensorName": "二氧化碳",
"ValueType": "Value"
},
{
"SensorCode": "Radiance",
"SensorConfigId": 4,
"SensorName": "辐射强度",
"ValueType": "Value"
},
{
"SensorCode": "SoilTemperature",
"SensorConfigId": 5,
"SensorName": "土壤温度",
"ValueType": "Value"
},
{
"SensorCode": "SoilHumidity",
"SensorConfigId": 6,
"SensorName": "土壤湿度",
"ValueType": "Value"
}
]
}
],
"Index": 1,
"PageSize": 1,
"TotalCount": 8
}
}
这是服务器返回的JSON数据,在转换的时候我是这样写的
jsonObject = new JSONObject(responseInfo.result);
JsonsRootBean jsonsRootBean=gson.fromJson(responseInfo.result, JsonsRootBean.class);
.Responsedata res=jsonsRootBean.getResponsedata();
System.out.println("--res-----"+res);
控制台中显示res 返回的值为NULL,请问这是为什么呢,实体类我已经写好了