美文网首页
alibaba.fastjson demo

alibaba.fastjson demo

作者: shangyaqi | 来源:发表于2019-04-16 16:02 被阅读0次

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);

相关文章

网友评论

      本文标题:alibaba.fastjson demo

      本文链接:https://www.haomeiwen.com/subject/trwbwqtx.html