Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private Map<String, Certificate> getCertificates(){
- String response = obcsRestService.getPostPlainJson();
- JSONObject jstr = JSONObject.parseObject(response);
- JSONObject result = (JSONObject) jstr.get("result");
- String payload = (String) result.get("payload");
- JSONArray certificates = JSONArray.parseArray(payload);
- Map<String, Certificate> map = new HashMap<String, Certificate>();
- for (int i = 0; i < certificates.size(); i++) {
- JSONObject cert = certificates.getJSONObject(i);
- Certificate ceObj = JSONObject.parseObject(String.valueOf(cert.get("Record")), Certificate.class);
- map.put(cert.getString("Key"), ceObj);
- }
- return map;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement