com.github.fge.jsonpatch.operation
Class TranslateOperationBase

java.lang.Object
  extended by com.github.fge.jsonpatch.operation.PathDualValueOperation
      extended by com.github.fge.jsonpatch.operation.TranslateOperationBase
All Implemented Interfaces:
JsonSerializable, JsonPatchOperation
Direct Known Subclasses:
TranslateOperation, TranslateOptionalOperation

public abstract class TranslateOperationBase
extends PathDualValueOperation

TranslateOperationBase implements the basic concept of translating from one specified value to another at the requested path.


Field Summary
 
Fields inherited from class com.github.fge.jsonpatch.operation.PathDualValueOperation
BUNDLE, fromValue, op, path, toValue
 
Constructor Summary
TranslateOperationBase(String op, JsonPointer path, JsonNode fromValue, JsonNode toValue, PathMissingPolicy pathMissingPolicy)
           
 
Method Summary
 JsonNode apply(JsonNode node)
          Apply this operation to a JSON value
 
Methods inherited from class com.github.fge.jsonpatch.operation.PathDualValueOperation
serialize, serializeWithType, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TranslateOperationBase

public TranslateOperationBase(String op,
                              JsonPointer path,
                              JsonNode fromValue,
                              JsonNode toValue,
                              PathMissingPolicy pathMissingPolicy)
Method Detail

apply

public JsonNode apply(JsonNode node)
               throws JsonPatchException
Description copied from interface: JsonPatchOperation
Apply 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