alibaba.fastjson demo
2019-04-16 本文已影响0人
shangyaqi
String jsonstr = {
"data":{
"result":[
{
"metric":{},
"value":[
1555398460.239,
"12"
]
}
],
"resultType":"vector"
},
"status":"success"
}
JSONObject json = JSONObject.parseObject(jsonstr);
System.out.println(JSONObject.toJSONString(json, true));
JSONArray array = json.getJSONObject("data").getJSONArray("result");
JSONObject jo = array.getJSONObject(0);
String d = jo.getJSONArray("value").getString(1);
System.out.println(d);