-
Notifications
You must be signed in to change notification settings - Fork 196
Expand file tree
/
Copy pathCreateOperation.java
More file actions
28 lines (26 loc) · 970 Bytes
/
CreateOperation.java
File metadata and controls
28 lines (26 loc) · 970 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package com.github.fge.jsonpatch;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.JsonNode;
import com.github.fge.jackson.jsonpointer.JsonPointer;
/**
* JSON Patch {@code create} operation.
*
* <p>For this operation, {@code path} is the JSON Pointer where the value
* should be added, and {@code value} is the value to add.</p>
*
* <p>This operation behaves like {@code add}, except for JSON Objects,
* where it will raise an error if the target {@code path} points to an
* existing value. This is designed to prevent clients from actually
* overwriting values they don't think exist.</p>
*/
public final class CreateOperation
extends AdditionOperation
{
@JsonCreator
public CreateOperation(@JsonProperty("path") final JsonPointer path,
@JsonProperty("value") final JsonNode value)
{
super("create", path, value, false);
}
}