Package com.gravity9.jsonpatch
Class CopyOperation
- java.lang.Object
-
- com.gravity9.jsonpatch.JsonPatchOperation
-
- com.gravity9.jsonpatch.DualPathOperation
-
- com.gravity9.jsonpatch.CopyOperation
-
- All Implemented Interfaces:
com.fasterxml.jackson.databind.JsonSerializable
public final class CopyOperation extends DualPathOperation
JSON PatchcopyoperationFor this operation,
fromis the JSON Pointer of the value to copy, andpathis the destination where the value should be copied.As for
add:- the value at the destination path is either created or replaced;
- it is created only if the immediate parent exists;
-appends at the end of an array.
It is an error if
fromfails to resolve to a JSON value.
-
-
Field Summary
-
Fields inherited from class com.gravity9.jsonpatch.DualPathOperation
from
-
Fields inherited from class com.gravity9.jsonpatch.JsonPatchOperation
BUNDLE, op, path
-
-
Constructor Summary
Constructors Constructor Description CopyOperation(java.lang.String from, java.lang.String path)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.fasterxml.jackson.databind.JsonNodeapplyInternal(com.fasterxml.jackson.databind.JsonNode node)-
Methods inherited from class com.gravity9.jsonpatch.DualPathOperation
getFrom, serialize, serializeWithType, toString
-
Methods inherited from class com.gravity9.jsonpatch.JsonPatchOperation
apply, getOp, getPath
-
-
-
-
Method Detail
-
applyInternal
public com.fasterxml.jackson.databind.JsonNode applyInternal(com.fasterxml.jackson.databind.JsonNode node) throws JsonPatchException- Specified by:
applyInternalin classJsonPatchOperation- Throws:
JsonPatchException
-
-