Class JsonMergePatchImpl

java.lang.Object
org.eclipse.parsson.JsonMergePatchImpl
All Implemented Interfaces:
JsonMergePatch

public final class JsonMergePatchImpl extends Object implements JsonMergePatch
This class is an implementation of a JSON Merge Patch as specified in RFC 7396.
Since:
1.1
  • Constructor Details

    • JsonMergePatchImpl

      public JsonMergePatchImpl(JsonValue patch, org.eclipse.parsson.JsonContext jsonContext)
  • Method Details

    • apply

      public JsonValue apply(JsonValue target)
      Description copied from interface: JsonMergePatch
      Applies the JSON Merge Patch to the specified target. The target is not modified by the patch.
      Specified by:
      apply in interface JsonMergePatch
      Parameters:
      target - the target to apply the merge patch
      Returns:
      the transformed target after the patch
    • toJsonValue

      public JsonValue toJsonValue()
      Description copied from interface: JsonMergePatch
      Returns the JsonMergePatch as JsonValue.
      Specified by:
      toJsonValue in interface JsonMergePatch
      Returns:
      this JsonMergePatch as JsonValue
    • equals

      public boolean equals(Object obj)
      Compares this JsonMergePatchImpl with another object.
      Overrides:
      equals in class Object
      Parameters:
      obj - the object to compare this JsonMergePatchImpl against
      Returns:
      true if the given object is a JsonMergePatchImpl with the same reference tokens as this one, false otherwise.
    • hashCode

      public int hashCode()
      Returns the hash code value for this JsonMergePatchImpl.
      Overrides:
      hashCode in class Object
      Returns:
      the hash code value for this JsonMergePatchImpl object
    • toString

      public String toString()
      Returns the JSON Patch text
      Overrides:
      toString in class Object
      Returns:
      the JSON Patch text