Class CopyOperation
- java.lang.Object
-
- com.github.fge.jsonpatch.operation.DualPathOperation
-
- com.github.fge.jsonpatch.operation.CopyOperation
-
- All Implemented Interfaces:
com.fasterxml.jackson.databind.JsonSerializable,JsonPatchOperation
public 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 Modifier and Type Field Description static StringOPERATION_NAME-
Fields inherited from class com.github.fge.jsonpatch.operation.DualPathOperation
BUNDLE, from, op, path
-
-
Constructor Summary
Constructors Constructor Description CopyOperation(com.github.fge.jackson.jsonpointer.JsonPointer from, com.github.fge.jackson.jsonpointer.JsonPointer path)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.fasterxml.jackson.databind.JsonNodeapply(com.fasterxml.jackson.databind.JsonNode node)Apply this operation to a JSON value-
Methods inherited from class com.github.fge.jsonpatch.operation.DualPathOperation
serialize, serializeWithType, toString
-
-
-
-
Field Detail
-
OPERATION_NAME
public static final String OPERATION_NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
apply
public com.fasterxml.jackson.databind.JsonNode apply(com.fasterxml.jackson.databind.JsonNode node) throws JsonPatchExceptionDescription copied from interface:JsonPatchOperationApply this operation to a JSON value- Parameters:
node- the value to patch- Returns:
- the patched value
- Throws:
JsonPatchException- operation failed to apply to this value
-
-