public final class TestOperation extends PathValueOperation
test
operation
The two arguments for this operation are the pointer containing the value
to test (path
) and the value to test equality against (value
).
It is an error if no value exists at the given path.
Also note that equality as defined by JSON Patch is exactly the same as it
is defined by JSON Schema itself. As such, this operation reuses JsonNumEquals
for testing equality.
Modifier and Type | Field and Description |
---|---|
static String |
OPERATION_NAME |
BUNDLE, op, path, value
Constructor and Description |
---|
TestOperation(JsonPointer path,
JsonNode value) |
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 TestOperation(JsonPointer path, JsonNode value)
public JsonNode apply(JsonNode node) throws JsonPatchException
JsonPatchOperation
node
- the value to patchJsonPatchException
- operation failed to apply to this value