Package org.apache.juneau.bean.jsonpatch
Class JsonPatchOperation
java.lang.Object
org.apache.juneau.bean.jsonpatch.JsonPatchOperation
@Marshalled(typePropertyName="op",
dictionary={AddOp.class,RemoveOp.class,ReplaceOp.class,MoveOp.class,CopyOp.class,TestOp.class})
public abstract class JsonPatchOperation
extends Object
Abstract base for a JSON Patch operation per
RFC 6902.
Polymorphic dispatch is wired here via
@Marshalled(typePropertyName="op", dictionary={...}): on read, the parser inspects the op
member and instantiates the matching concrete subclass; on write, the serializer emits op as the
discriminator and the operation's own members alongside.
Not declared sealed - keeping it open lets downstream callers add their own ops if needed
(e.g. JSON Patch extensions or vendor-specific test operators) by adding the new subclass to a custom
dictionary.
See Also:
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDefault constructor.protectedJsonPatchOperation(String path) Convenience constructor. -
Method Summary
-
Constructor Details
-
JsonPatchOperation
protected JsonPatchOperation()Default constructor. -
JsonPatchOperation
Convenience constructor.- Parameters:
path- The JSON Pointer target of the operation. Can benull to leave the property unset.
-
-
Method Details
-
getPath
Bean property getter:path .The target JSON Pointer (RFC 6901) of this operation.
- Returns:
- The value of the
path property, ornull if it is not set.
-
setPath
Bean property setter:path .- Parameters:
value- The new value for this property. Can benull to unset the property.- Returns:
- This object.
-
toString
-