Package com.flipkart.zjsonpatch
Enum Class DiffFlags
- All Implemented Interfaces:
Serializable,Comparable<DiffFlags>,java.lang.constant.Constable
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThis flag normalizes aOperation.REPLACEoperation into its respectiveOperation.REMOVEandOperation.ADDoperations.This flag adds a fromValue field to allOperation.REPLACEoperations.This flag instructs the diff generator to emitOperation.TESToperations that validate the state of the source document before each mutation.This flag omits allOperation.COPYoperations, leaving onlyOperation.ADD,Operation.REMOVE,Operation.REPLACEandOperation.MOVEoperations.This flag omits allOperation.MOVEoperations, leaving onlyOperation.ADD,Operation.REMOVE,Operation.REPLACEandOperation.COPYoperations.This flag omits the value field on remove operations. -
Method Summary
-
Enum Constant Details
-
OMIT_VALUE_ON_REMOVE
This flag omits the value field on remove operations. This is a default flag. -
OMIT_MOVE_OPERATION
This flag omits allOperation.MOVEoperations, leaving onlyOperation.ADD,Operation.REMOVE,Operation.REPLACEandOperation.COPYoperations. In other words, without this flag,Operation.ADDandOperation.REMOVEoperations are not normalized intoOperation.MOVEoperations. -
OMIT_COPY_OPERATION
This flag omits allOperation.COPYoperations, leaving onlyOperation.ADD,Operation.REMOVE,Operation.REPLACEandOperation.MOVEoperations. In other words, without this flag,Operation.ADDoperations are not normalized intoOperation.COPYoperations. -
ADD_ORIGINAL_VALUE_ON_REPLACE
This flag adds a fromValue field to allOperation.REPLACEoperations. fromValue represents the the value replaced by aOperation.REPLACEoperation, in other words, the original value. This can be useful for debugging output or custom processing of the diffs by downstream systems. Please note that this is a non-standard extension to RFC 6902 and will not affect how patches produced by this library are processed by this or other libraries.- Since:
- 0.4.1
-
ADD_EXPLICIT_REMOVE_ADD_ON_REPLACE
This flag normalizes aOperation.REPLACEoperation into its respectiveOperation.REMOVEandOperation.ADDoperations. Although it adds a redundant step, this can be useful for auditing systems in which immutability is a requirement.For the flag to work,
ADD_ORIGINAL_VALUE_ON_REPLACEhas to be enabled as the new instructions in the patch need to grab the old fromValue"op": "replace", "fromValue": "F1", "value": "F2"The above instruction will be split into"op":"remove", "value":"F1"and"op":"add", "value":"F2"respectively.Please note that this is a non-standard extension to RFC 6902 and will not affect how patches produced by this library are processed by this or other libraries.
- Since:
- 0.4.11
-
EMIT_TEST_OPERATIONS
This flag instructs the diff generator to emitOperation.TESToperations that validate the state of the source document before each mutation. This can be useful if you want to ensure data integrity prior to applying the patch. The resulting patches are standard per RFC 6902 and should be processed correctly by any compliant library; due to the associated space and performance costs, however, this isn't default behavior.- Since:
- 0.4.8
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
defaults
-
dontNormalizeOpIntoMoveAndCopy
-