public static Map<String, String> readJsonProperties(String jsonString) { Map<String, String> properties = new HashMap<>(); if (jsonString != null) { JsonUtil.readJsonObject(jsonString).forEach((k, v) -> properties.put(k, v.toString())); } return properties; }
private void diffObject(String path, JsonObject source, JsonObject target) { source.forEach((key, value) -> { if (target.containsKey(key)) { diff(path + '/' + key, value, target.get(key)); } else { builder.remove(path + '/' + key); } }); target.forEach((key, value) -> { if (! source.containsKey(key)) { builder.add(path + '/' + key, value); } }); }
JsonObjectBuilder builder = Json.createObjectBuilder(targetJsonObject); patch.asJsonObject().forEach((key, value) -> { if (value == JsonValue.NULL) { if (targetJsonObject.containsKey(key)) {
private void diffObject(String path, JsonObject source, JsonObject target) { source.forEach((key, value) -> { if (target.containsKey(key)) { diff(path + '/' + key, value, target.get(key)); } else { builder.remove(path + '/' + key); } }); target.forEach((key, value) -> { if (! source.containsKey(key)) { builder.add(path + '/' + key, value); } }); }
JsonObjectBuilder builder = Json.createObjectBuilder(targetJsonObject); patch.asJsonObject().forEach((key, value) -> { if (value == JsonValue.NULL) { if (targetJsonObject.containsKey(key)) {
/** * Ctor. * @param objects JsonObjects to combine. */ Merged(final JsonObject... objects) { super(() -> { final JsonObjectBuilder combined = Json.createObjectBuilder(); for(final JsonObject json : objects) { json.forEach(combined::add); } return combined.build(); }); }
public static Map<String, String> readJsonProperties(String jsonString) { Map<String, String> properties = new HashMap<>(); if (jsonString != null) { JsonUtil.readJsonObject(jsonString).forEach((k, v) -> properties.put(k, v.toString())); } return properties; }
public static Map<String, String> readJsonProperties(String jsonString) { Map<String, String> properties = new HashMap<>(); if (jsonString != null) { JsonUtil.readJsonObject(jsonString).forEach((k, v) -> properties.put(k, v.toString())); } return properties; }
public static Map<String, String> readJsonProperties(String jsonString) { Map<String, String> properties = new HashMap<>(); if (jsonString != null) { JsonUtil.readJsonObject(jsonString).forEach((k, v) -> properties.put(k, v.toString())); } return properties; }
public static Map<String, String> readJsonProperties(String jsonString) { Map<String, String> properties = new HashMap<>(); if (jsonString != null) { JsonUtil.readJsonObject(jsonString).forEach((k, v) -> properties.put(k, v.toString())); } return properties; }
public static Map<String, String> readJsonProperties(String jsonString) { Map<String, String> properties = new HashMap<>(); if (jsonString != null) { JsonUtil.readJsonObject(jsonString).forEach((k, v) -> properties.put(k, v.toString())); } return properties; }
public static Map<String, String> readJsonProperties(String jsonString) { Map<String, String> properties = new HashMap<>(); if (jsonString != null) { JsonUtil.readJsonObject(jsonString).forEach((k, v) -> properties.put(k, v.toString())); } return properties; }
@Override public Volume create(final String name, final JsonObject parameters) throws IOException, UnexpectedResponseException { JsonObjectBuilder json = Json.createObjectBuilder(); json.add("Name", name); parameters.forEach(json::add); return this.createVolume(json); }
@Override public Network create(final String name, final JsonObject filters) throws IOException, UnexpectedResponseException { final JsonObjectBuilder json = Json.createObjectBuilder(); json.add("Name", name); filters.forEach(json::add); return this.createNetwork(json); }
private void diffObject(String path, JsonObject source, JsonObject target) { source.forEach((key, value) -> { if (target.containsKey(key)) { diff(path + '/' + key, value, target.get(key)); } else { builder.remove(path + '/' + key); } }); target.forEach((key, value) -> { if (! source.containsKey(key)) { builder.add(path + '/' + key, value); } }); }
private void diffObject(String path, JsonObject source, JsonObject target) { source.forEach((key, value) -> { if (target.containsKey(key)) { diff(path + '/' + key, value, target.get(key)); } else { builder.remove(path + '/' + key); } }); target.forEach((key, value) -> { if (! source.containsKey(key)) { builder.add(path + '/' + key, value); } }); }
private void diffObject(String path, JsonObject source, JsonObject target) { source.forEach((key, value) -> { if (target.containsKey(key)) { diff(path + '/' + key, value, target.get(key)); } else { builder.remove(path + '/' + key); } }); target.forEach((key, value) -> { if (! source.containsKey(key)) { builder.add(path + '/' + key, value); } }); }
private void diffObject(String path, JsonObject source, JsonObject target) { source.forEach((key, value) -> { if (target.containsKey(key)) { diff(path + '/' + key, value, target.get(key)); } else { builder.remove(path + '/' + key); } }); target.forEach((key, value) -> { if (! source.containsKey(key)) { builder.add(path + '/' + key, value); } }); }