ThirdFaceVerify thirdFaceVerify = new ThirdFaceVerify(); //以下是一个json对象中嵌套一个json子对象 String myJsonObj = "{\n" + " \"confidence\":\"91.702\",\n" + " \"request_id\":10000,\n" + " \"thresholds\": {\n" + " \"1e-6\":\"78.038\",\n" + " \"1e-5\":\"74.399\",\n" + " \"1e-4\":\"69.315\"\n" + " }\n" + "}"; JSONObject resultFaceid = JSON.parseObject(myJsonObj); thirdFaceVerify.setConfidence(resultFaceid.getString("confidence")); thirdFaceVerify.setThresholds(resultFaceid.getString("thresholds")); thirdFaceVerify.setContrastScore(resultFaceid.getString("confidence")); thirdFaceVerify.setThresholdScore(resultFaceid.getJSONObject("thresholds").getString("1e-4")); System.out.println(JSON.toJSONString(thirdFaceVerify));
05-17
5951
04-09
1245