public final class CopyOperation extends DualPathOperation
copy
operation
For this operation, from
is the JSON Pointer of the value to copy,
and path
is the destination where the value should be copied.
As for add
:
-
appends at the end of an array.It is an error if from
fails to resolve to a JSON value.
Modifier and Type | Field and Description |
---|---|
static String |
OPERATION_NAME |
BUNDLE, from, op, path
Constructor and Description |
---|
CopyOperation(JsonPointer from,
JsonPointer path) |
Modifier and Type | Method and Description |
---|---|
JsonNode |
apply(JsonNode node)
Apply this operation to a JSON value
|
serialize, serializeWithType, toString
public static final String OPERATION_NAME
public CopyOperation(JsonPointer from, JsonPointer path)
public JsonNode apply(JsonNode node) throws JsonPatchException
JsonPatchOperation
node
- the value to patchJsonPatchException
- operation failed to apply to this value