com.github.fge.jsonpatch
Class ReplaceOperation
java.lang.Object
com.github.fge.jsonpatch.JsonPatchOperation
com.github.fge.jsonpatch.PathValueOperation
com.github.fge.jsonpatch.ReplaceOperation
- All Implemented Interfaces:
- JsonSerializable
public final class ReplaceOperation
- extends PathValueOperation
JSON Patch replace operation
For this operation, path points to the value to replace, and
value is the replacement value.
It is an error condition if path does not point to an actual JSON
value.
ReplaceOperation
public ReplaceOperation(JsonPointer path,
JsonNode value)
apply
public JsonNode apply(JsonNode node)
throws JsonPatchException
- Description copied from class:
JsonPatchOperation
- Apply this operation to a JSON value
- Specified by:
apply in class JsonPatchOperation
- Parameters:
node - the value to patch
- Returns:
- the patched value
- Throws:
JsonPatchException - operation failed to apply to this value