Interface Operation<P>

Type Parameters:
P - the node type of the model of the patch document
All Known Implementing Classes:
Operation.Add, Operation.Copy, Operation.Move, Operation.Remove, Operation.Replace, Operation.Test

public sealed interface Operation<P> permits Operation.Add<P>, Operation.Remove<P>, Operation.Replace<P>, Operation.Move<P>, Operation.Copy<P>, Operation.Test<P>

An operation of a JSON Patch (RFC 6902, Section 4).

A value of an operation is a node of the patch document, in the model of the patch document (P). The patch does not copy it when it reads the document. JsonPatch.apply(N, M) copies it once into the target document.

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static final record 
    add (Section 4.1): adds a member, inserts an array element, or replaces the whole document.
    static final record 
    copy (Section 4.5): adds a copy of the value at from at the target location.
    static final record 
    move (Section 4.4): removes the value at from and adds it at the target location.
    static final record 
    remove (Section 4.2): removes the value at the target location.
    static final record 
    replace (Section 4.3): replaces the value at the target location.
    static final record 
    test (Section 4.6): tests that the value at the target location is equal to a value.
  • Method Summary

    Modifier and Type
    Method
    Description
    The target location of the operation: the path member.
  • Method Details

    • path

      JsonPointer path()
      The target location of the operation: the path member.
      Returns:
      the pointer to the target location