public final class JsonDiff extends Object
This class only has one method, asJson(JsonNode, JsonNode), which
takes two JSON values as arguments and returns a patch as a JsonNode.
This generated patch can then be used in JsonPatch.fromJson(JsonNode).
Numeric equivalence is respected. Operations are always generated in the following order:
Array values generate operations in the order of elements. Factorizing is done to merge add and remove into move operations and convert duplicate add to copy operations if values are equivalent. No test operations are generated (they don't really make sense for diffs anyway).
Note that due to the way JsonNode is implemented, this class is
inherently not thread safe (since JsonNode is mutable). It is
therefore the responsibility of the caller to ensure that the calling context
is safe (by ensuring, for instance, that only the diff operation has
references to the values to be diff'ed).