public final class TranslateArrayOptionalOperation extends PathDualValueOperation
translateArray? operation.
The operation will translate all items equivalent to fromValue to a toValue in the array at
path if they exist.
The operation will do nothing if no items in the array at path are equivalent to fromValue.
The operation will throw an exception if the node at path is not an array.| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
OPERATION_NAME |
| Constructor and Description |
|---|
TranslateArrayOptionalOperation(JsonPointer path,
JsonNode fromValue,
JsonNode toValue) |
| Modifier and Type | Method and Description |
|---|---|
JsonNode |
apply(JsonNode node)
Apply this operation to a JSON value
|
serialize, serializeWithType, toStringpublic static final java.lang.String OPERATION_NAME
public TranslateArrayOptionalOperation(JsonPointer path, JsonNode fromValue, JsonNode toValue)
public JsonNode apply(JsonNode node) throws JsonPatchException
JsonPatchOperationnode - the value to patchJsonPatchException - operation failed to apply to this value