/** * Adds a "test" JSON Patch operation. * @param path the "path" member of the operation * @param value the "value" member of the operation * @return this JsonPatchBuilder */ @Override public JsonPatchBuilder test(String path, int value) { builder.add(Json.createObjectBuilder() .add("op", Operation.TEST.operationName()) .add("path", path) .add("value", value) ); return this; }
/** * Adds an "add" JSON Patch operation * @param path the "path" member of the operation * @param value the "value" member of the operation * @return this JsonPatchBuilder */ @Override public JsonPatchBuilder add(String path, boolean value) { builder.add(Json.createObjectBuilder() .add("op", Operation.ADD.operationName()) .add("path", path) .add("value", value) ); return this; }
/** * Adds a "test" JSON Patch operation. * @param path the "path" member of the operation * @param value the "value" member of the operation * @return this JsonPatchBuilder */ @Override public JsonPatchBuilder test(String path, boolean value) { builder.add(Json.createObjectBuilder() .add("op", Operation.TEST.operationName()) .add("path", path) .add("value", value) ); return this; }
/** * Adds a "move" JSON Patch operation. * @param path the "path" member of the operation * @param from the "from" member of the operation * @return this JsonPatchBuilder */ @Override public JsonPatchBuilder move(String path, String from) { builder.add(Json.createObjectBuilder() .add("op", Operation.MOVE.operationName()) .add("path", path) .add("from", from) ); return this; }
/** * Adds a "test" JSON Patch operation. * @param path the "path" member of the operation * @param value the "value" member of the operation * @return this JsonPatchBuilder */ @Override public JsonPatchBuilder test(String path, JsonValue value) { builder.add(Json.createObjectBuilder() .add("op", Operation.TEST.operationName()) .add("path", path) .add("value", value) ); return this; }
/** * Adds an "add" JSON Patch operation * @param path the "path" member of the operation * @param value the "value" member of the operation * @return this JsonPatchBuilder */ @Override public JsonPatchBuilder add(String path, String value) { builder.add(Json.createObjectBuilder() .add("op", Operation.ADD.operationName()) .add("path", path) .add("value", value) ); return this; }
/** * Adds a "remove" JSON Patch operation. * @param path the "path" member of the operation * @return this JsonPatchBuilder */ @Override public JsonPatchBuilder remove(String path) { builder.add(Json.createObjectBuilder() .add("op", Operation.REMOVE.operationName()) .add("path", path) ); return this; }
/** * Adds a "test" JSON Patch operation. * @param path the "path" member of the operation * @param value the "value" member of the operation * @return this JsonPatchBuilder */ @Override public JsonPatchBuilder test(String path, String value) { builder.add(Json.createObjectBuilder() .add("op", Operation.TEST.operationName()) .add("path", path) .add("value", value) ); return this; }
/** * Adds a "replace" JSON Patch operation. * @param path the "path" member of the operation * @param value the "value" member of the operation * @return this JsonPatchBuilder */ @Override public JsonPatchBuilder replace(String path, int value) { builder.add(Json.createObjectBuilder() .add("op", Operation.REPLACE.operationName()) .add("path", path) .add("value", value) ); return this; }
/** * Adds a "copy" JSON Patch operation. * @param path the "path" member of the operation * @param from the "from" member of the operation * @return this JsonPatchBuilder */ @Override public JsonPatchBuilder copy(String path, String from) { builder.add(Json.createObjectBuilder() .add("op", Operation.COPY.operationName()) .add("path", path) .add("from", from) ); return this; }
/** * Adds a "move" JSON Patch operation. * @param path the "path" member of the operation * @param from the "from" member of the operation * @return this JsonPatchBuilder */ @Override public JsonPatchBuilder move(String path, String from) { builder.add(Json.createObjectBuilder() .add("op", Operation.MOVE.operationName()) .add("path", path) .add("from", from) ); return this; }
/** * Adds a "replace" JSON Patch operation. * @param path the "path" member of the operation * @param value the "value" member of the operation * @return this JsonPatchBuilder */ @Override public JsonPatchBuilder replace(String path, boolean value) { builder.add(Json.createObjectBuilder() .add("op", Operation.REPLACE.operationName()) .add("path", path) .add("value", value) ); return this; }
/** * Adds a "replace" JSON Patch operation. * @param path the "path" member of the operation * @param value the "value" member of the operation * @return this JsonPatchBuilder */ @Override public JsonPatchBuilder replace(String path, String value) { builder.add(Json.createObjectBuilder() .add("op", Operation.REPLACE.operationName()) .add("path", path) .add("value", value) ); return this; }
/** * Adds an "add" JSON Patch operation. * @param path the "path" member of the operation * @param value the "value" member of the operation * @return this JsonPatchBuilder */ @Override public JsonPatchBuilder add(String path, JsonValue value) { builder.add(Json.createObjectBuilder() .add("op", Operation.ADD.operationName()) .add("path", path) .add("value", value) ); return this; }
/** * Adds a "replace" JSON Patch operation. * @param path the "path" member of the operation * @param value the "value" member of the operation * @return this JsonPatchBuilder */ @Override public JsonPatchBuilder replace(String path, JsonValue value) { builder.add(Json.createObjectBuilder() .add("op", Operation.REPLACE.operationName()) .add("path", path) .add("value", value) ); return this; }
/** * Adds an "add" JSON Patch operation * @param path the "path" member of the operation * @param value the "value" member of the operation * @return this JsonPatchBuilder */ @Override public JsonPatchBuilder add(String path, int value) { builder.add(Json.createObjectBuilder() .add("op", Operation.ADD.operationName()) .add("path", path) .add("value", value) ); return this; }
/** * Adds an "add" JSON Patch operation * @param path the "path" member of the operation * @param value the "value" member of the operation * @return this JsonPatchBuilder */ @Override public JsonPatchBuilder add(String path, String value) { builder.add(Json.createObjectBuilder() .add("op", Operation.ADD.operationName()) .add("path", path) .add("value", value) ); return this; }
/** * Returns the enum constant with the specified name. * * @param operationName {@code operationName} to convert to the enum constant. * @return the enum constant for given {@code operationName} * @throws JsonException if given {@code operationName} is not recognized */ public static Operation fromOperationName(String operationName) { for (Operation op : values()) { if (op.operationName().equalsIgnoreCase(operationName)) { return op; } } throw new JsonException("Illegal value for the operationName of the JSON patch operation: " + operationName); } }
/** * Adds a "test" JSON Patch operation. * @param path the "path" member of the operation * @param value the "value" member of the operation * @return this JsonPatchBuilder */ @Override public JsonPatchBuilder test(String path, JsonValue value) { builder.add(Json.createObjectBuilder() .add("op", Operation.TEST.operationName()) .add("path", path) .add("value", value) ); return this; }
/** * Adds a "remove" JSON Patch operation. * @param path the "path" member of the operation * @return this JsonPatchBuilder */ @Override public JsonPatchBuilder remove(String path) { builder.add(Json.createObjectBuilder() .add("op", Operation.REMOVE.operationName()) .add("path", path) ); return this; }