java.lang.Object
org.eclipse.parsson.JsonMergePatchImpl
- All Implemented Interfaces:
jakarta.json.JsonMergePatch
This class is an implementation of a JSON Merge Patch as specified in
RFC 7396.
- Since:
- 1.1
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionjakarta.json.JsonValue
apply
(jakarta.json.JsonValue target) (package private) static jakarta.json.JsonValue
diff
(jakarta.json.JsonValue source, jakarta.json.JsonValue target, JsonContext jsonContext) Generate a JSON Merge Patch from the source and targetJsonValue
.boolean
Compares thisJsonMergePatchImpl
with another object.int
hashCode()
Returns the hash code value for thisJsonMergePatchImpl
.private jakarta.json.JsonValue
mergePatch
(jakarta.json.JsonValue target, jakarta.json.JsonValue patch) Applies the specified patch to the specified target.jakarta.json.JsonValue
toString()
Returns the JSON Patch text
-
Field Details
-
patch
private final jakarta.json.JsonValue patch -
jsonContext
-
-
Constructor Details
-
JsonMergePatchImpl
-
-
Method Details
-
apply
public jakarta.json.JsonValue apply(jakarta.json.JsonValue target) - Specified by:
apply
in interfacejakarta.json.JsonMergePatch
-
toJsonValue
public jakarta.json.JsonValue toJsonValue()- Specified by:
toJsonValue
in interfacejakarta.json.JsonMergePatch
-
mergePatch
private jakarta.json.JsonValue mergePatch(jakarta.json.JsonValue target, jakarta.json.JsonValue patch) Applies the specified patch to the specified target. The target is not modified by the patch.- Parameters:
target
- theJsonValue
to apply the patch operationspatch
- the patch- Returns:
- the
JsonValue
as the result of applying the patch operations on the target.
-
diff
static jakarta.json.JsonValue diff(jakarta.json.JsonValue source, jakarta.json.JsonValue target, JsonContext jsonContext) Generate a JSON Merge Patch from the source and targetJsonValue
.- Parameters:
source
- the sourcetarget
- the target- Returns:
- a JSON Patch which when applied to the source, yields the target
-
equals
Compares thisJsonMergePatchImpl
with another object. -
hashCode
public int hashCode()Returns the hash code value for thisJsonMergePatchImpl
. -
toString
Returns the JSON Patch text
-