Class ReplaceOperation

  • All Implemented Interfaces:
    com.fasterxml.jackson.databind.JsonSerializable, JsonPatchOperation

    public 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.

    • Constructor Detail

      • ReplaceOperation

        public ReplaceOperation​(com.github.fge.jackson.jsonpointer.JsonPointer path,
                                com.fasterxml.jackson.databind.JsonNode value)
    • Method Detail

      • apply

        public com.fasterxml.jackson.databind.JsonNode apply​(com.fasterxml.jackson.databind.JsonNode node)
                                                      throws JsonPatchException
        Description copied from interface: JsonPatchOperation
        Apply this operation to a JSON value
        Parameters:
        node - the value to patch
        Returns:
        the patched value
        Throws:
        JsonPatchException - operation failed to apply to this value