Class PatchOperation

  • All Implemented Interfaces:
    Serializable, Cloneable

    public class PatchOperation
    extends Object
    implements Serializable, Cloneable
    A single patch operation to apply to the specified resource. Please refer to http://tools.ietf.org/html/rfc6902#section-4 for an explanation of how each operation is used.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      PatchOperation()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      PatchOperation clone()  
      boolean equals​(Object obj)  
      String getFrom()
      The "move" and "copy" operation object MUST contain a "from" member, which is a string containing a JSON Pointer value that references the location in the target document to move the value from.
      String getOp()
      A patch operation whose value indicates the operation to perform.
      String getPath()
      Operation objects MUST have exactly one "path" member.
      String getValue()
      The actual value content.
      int hashCode()  
      void setFrom​(String from)
      The "move" and "copy" operation object MUST contain a "from" member, which is a string containing a JSON Pointer value that references the location in the target document to move the value from.
      void setOp​(Op op)
      A patch operation whose value indicates the operation to perform.
      void setOp​(String op)
      A patch operation whose value indicates the operation to perform.
      void setPath​(String path)
      Operation objects MUST have exactly one "path" member.
      void setValue​(String value)
      The actual value content.
      String toString()
      Returns a string representation of this object; useful for testing and debugging.
      PatchOperation withFrom​(String from)
      The "move" and "copy" operation object MUST contain a "from" member, which is a string containing a JSON Pointer value that references the location in the target document to move the value from.
      PatchOperation withOp​(Op op)
      A patch operation whose value indicates the operation to perform.
      PatchOperation withOp​(String op)
      A patch operation whose value indicates the operation to perform.
      PatchOperation withPath​(String path)
      Operation objects MUST have exactly one "path" member.
      PatchOperation withValue​(String value)
      The actual value content.
    • Constructor Detail

      • PatchOperation

        public PatchOperation()
    • Method Detail

      • setOp

        public void setOp​(String op)

        A patch operation whose value indicates the operation to perform. Its value MUST be one of "add", "remove", "replace", "move", "copy", or "test"; other values are errors.

        Parameters:
        op - A patch operation whose value indicates the operation to perform. Its value MUST be one of "add", "remove", "replace", "move", "copy", or "test"; other values are errors.
        See Also:
        Op
      • getOp

        public String getOp()

        A patch operation whose value indicates the operation to perform. Its value MUST be one of "add", "remove", "replace", "move", "copy", or "test"; other values are errors.

        Returns:
        A patch operation whose value indicates the operation to perform. Its value MUST be one of "add", "remove", "replace", "move", "copy", or "test"; other values are errors.
        See Also:
        Op
      • withOp

        public PatchOperation withOp​(String op)

        A patch operation whose value indicates the operation to perform. Its value MUST be one of "add", "remove", "replace", "move", "copy", or "test"; other values are errors.

        Parameters:
        op - A patch operation whose value indicates the operation to perform. Its value MUST be one of "add", "remove", "replace", "move", "copy", or "test"; other values are errors.
        Returns:
        Returns a reference to this object so that method calls can be chained together.
        See Also:
        Op
      • setOp

        public void setOp​(Op op)

        A patch operation whose value indicates the operation to perform. Its value MUST be one of "add", "remove", "replace", "move", "copy", or "test"; other values are errors.

        Parameters:
        op - A patch operation whose value indicates the operation to perform. Its value MUST be one of "add", "remove", "replace", "move", "copy", or "test"; other values are errors.
        See Also:
        Op
      • withOp

        public PatchOperation withOp​(Op op)

        A patch operation whose value indicates the operation to perform. Its value MUST be one of "add", "remove", "replace", "move", "copy", or "test"; other values are errors.

        Parameters:
        op - A patch operation whose value indicates the operation to perform. Its value MUST be one of "add", "remove", "replace", "move", "copy", or "test"; other values are errors.
        Returns:
        Returns a reference to this object so that method calls can be chained together.
        See Also:
        Op
      • setPath

        public void setPath​(String path)

        Operation objects MUST have exactly one "path" member. That member's value is a string containing a `JSON-Pointer` value that references a location within the target document (the "target location") where the operation is performed.

        Parameters:
        path - Operation objects MUST have exactly one "path" member. That member's value is a string containing a `JSON-Pointer` value that references a location within the target document (the "target location") where the operation is performed.
      • getPath

        public String getPath()

        Operation objects MUST have exactly one "path" member. That member's value is a string containing a `JSON-Pointer` value that references a location within the target document (the "target location") where the operation is performed.

        Returns:
        Operation objects MUST have exactly one "path" member. That member's value is a string containing a `JSON-Pointer` value that references a location within the target document (the "target location") where the operation is performed.
      • withPath

        public PatchOperation withPath​(String path)

        Operation objects MUST have exactly one "path" member. That member's value is a string containing a `JSON-Pointer` value that references a location within the target document (the "target location") where the operation is performed.

        Parameters:
        path - Operation objects MUST have exactly one "path" member. That member's value is a string containing a `JSON-Pointer` value that references a location within the target document (the "target location") where the operation is performed.
        Returns:
        Returns a reference to this object so that method calls can be chained together.
      • setValue

        public void setValue​(String value)

        The actual value content.

        Parameters:
        value - The actual value content.
      • getValue

        public String getValue()

        The actual value content.

        Returns:
        The actual value content.
      • withValue

        public PatchOperation withValue​(String value)

        The actual value content.

        Parameters:
        value - The actual value content.
        Returns:
        Returns a reference to this object so that method calls can be chained together.
      • setFrom

        public void setFrom​(String from)

        The "move" and "copy" operation object MUST contain a "from" member, which is a string containing a JSON Pointer value that references the location in the target document to move the value from.

        Parameters:
        from - The "move" and "copy" operation object MUST contain a "from" member, which is a string containing a JSON Pointer value that references the location in the target document to move the value from.
      • getFrom

        public String getFrom()

        The "move" and "copy" operation object MUST contain a "from" member, which is a string containing a JSON Pointer value that references the location in the target document to move the value from.

        Returns:
        The "move" and "copy" operation object MUST contain a "from" member, which is a string containing a JSON Pointer value that references the location in the target document to move the value from.
      • withFrom

        public PatchOperation withFrom​(String from)

        The "move" and "copy" operation object MUST contain a "from" member, which is a string containing a JSON Pointer value that references the location in the target document to move the value from.

        Parameters:
        from - The "move" and "copy" operation object MUST contain a "from" member, which is a string containing a JSON Pointer value that references the location in the target document to move the value from.
        Returns:
        Returns a reference to this object so that method calls can be chained together.
      • toString

        public String toString()
        Returns a string representation of this object; useful for testing and debugging.
        Overrides:
        toString in class Object
        Returns:
        A string representation of this object.
        See Also:
        Object.toString()
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object