public List<String> retrieveValidationStatuses(List<String> branchPaths) throws Exception { StringBuilder url = new StringBuilder(orchestrationUrl + VALIDATIONS_ENDPOINT + "/bulk/latest/statuses"); url.append("?paths="); boolean first = true; for (String branchPath : branchPaths) { if (!first) { url.append(","); } else { first = false; } url.append(branchPath); } final JSONResource resource = getResource(url.toString()); if (resource == null) { return null; } final JSONArray array = resource.array(); List<String> statuses = new ArrayList<>(); for (int a = 0; a < array.length(); a++) { final String string = array.getString(a); statuses.add(!string.equals("null") ? string : null); } return statuses; }
tagName = ja.getString(0); XML.noSpace(tagName); tagName = XML.escape(tagName);
tagName = ja.getString(0); XML.noSpace(tagName); tagName = XML.escape(tagName);
/** * Produce a JSONArray containing the values of the members of this * JSONObject. * * @param names * A JSONArray containing a list of key strings. This determines the * sequence of the values in the result. * @return A JSONArray of values. * @throws JSONException * If any of the values are non-finite numbers. */ public JSONArray toJSONArray(JSONArray names) throws JSONException { if (names == null || names.length() == 0) { return null; } JSONArray ja = new JSONArray(); for (int i = 0; i < names.length(); i += 1) { ja.put(this.opt(names.getString(i))); } return ja; }
/** * Produce a JSONArray containing the values of the members of this * JSONObject. * * @param names * A JSONArray containing a list of key strings. This determines the * sequence of the values in the result. * @return A JSONArray of values. * @throws JSONException * If any of the values are non-finite numbers. */ public JSONArray toJSONArray(JSONArray names) throws JSONException { if (names == null || names.length() == 0) { return null; } JSONArray ja = new JSONArray(); for (int i = 0; i < names.length(); i += 1) { ja.put(this.opt(names.getString(i))); } return ja; }
/** * Produce a JSONObject by combining a JSONArray of names with the values of * this JSONArray. * * @param names * A JSONArray containing a list of key strings. These will be paired * with the values. * @return A JSONObject, or null if there are no names or if this JSONArray * has no values. * @throws JSONException * If any of the names are null. */ public JSONObject toJSONObject(JSONArray names) throws JSONException { if (names == null || names.length() == 0 || length() == 0) { return null; } JSONObject jo = new JSONObject(); for (int i = 0; i < names.length(); i += 1) { jo.put(names.getString(i), this.opt(i)); } return jo; }
/** * Produce a JSONObject by combining a JSONArray of names with the values of * this JSONArray. * * @param names * A JSONArray containing a list of key strings. These will be paired * with the values. * @return A JSONObject, or null if there are no names or if this JSONArray * has no values. * @throws JSONException * If any of the names are null. */ public JSONObject toJSONObject(JSONArray names) throws JSONException { if (names == null || names.length() == 0 || length() == 0) { return null; } JSONObject jo = new JSONObject(); for (int i = 0; i < names.length(); i += 1) { jo.put(names.getString(i), this.opt(i)); } return jo; }