Package com.bazaarvoice.jolt
Class Diffy
java.lang.Object
com.bazaarvoice.jolt.Diffy
- Direct Known Subclasses:
ArrayOrderObliviousDiffy
JSON Diff tool that will walk two "JSON" objects simultaneously and identify mismatches.
Algorithm :
1) make a copy of both input objects
2) walk both objects and _remove_ items that match
3) return what is left of the two objects in the Result
In the case a full / "sucessful" match, Diffy returns a Result object with isEmpty() == true.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Contains the unmatched fields from the Diffy operation. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Diffy.Result
diffHelper
(Object expected, Object actual) protected Diffy.Result
protected Diffy.Result
protected Diffy.Result
diffScalar
(Object expected, Object actual) protected boolean
scalarEquals
(Object expected, Object actual) Allow subclasses to handle things like Long 0 versus Int 0.
-
Field Details
-
jsonUtil
-
-
Constructor Details
-
Diffy
public Diffy() -
Diffy
Pass in a custom jsonUtil to use for the cloneJson method.
-
-
Method Details
-
diff
-
diffHelper
-
diffMap
-
diffList
-
diffScalar
-
scalarEquals
Allow subclasses to handle things like Long 0 versus Int 0. They should be the same, but the .equals doesn't handle it.
-