Class CustomComparator
- java.lang.Object
-
- org.skyscreamer.jsonassert.comparator.AbstractComparator
-
- org.skyscreamer.jsonassert.comparator.DefaultComparator
-
- org.skyscreamer.jsonassert.comparator.CustomComparator
-
- All Implemented Interfaces:
JSONComparator
public class CustomComparator extends DefaultComparator
-
-
Constructor Summary
Constructors Constructor Description CustomComparator(JSONCompareMode mode, Customization... customizations)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
compareValues(String prefix, Object expectedValue, Object actualValue, JSONCompareResult result)
Compares twoObject
s on the provided path represented byprefix
and updates the result of the comparison in theresult
JSONCompareResult
object.-
Methods inherited from class org.skyscreamer.jsonassert.comparator.DefaultComparator
areNotSameDoubles, areNumbers, compareJSON, compareJSONArray
-
Methods inherited from class org.skyscreamer.jsonassert.comparator.AbstractComparator
checkJsonObjectKeysActualInExpected, checkJsonObjectKeysExpectedInActual, compareJSON, compareJSON, compareJSONArrayOfJsonObjects, compareJSONArrayOfSimpleValues, compareJSONArrayWithStrictOrder, recursivelyCompareJSONArray
-
-
-
-
Constructor Detail
-
CustomComparator
public CustomComparator(JSONCompareMode mode, Customization... customizations)
-
-
Method Detail
-
compareValues
public void compareValues(String prefix, Object expectedValue, Object actualValue, JSONCompareResult result) throws org.json.JSONException
Description copied from interface:JSONComparator
Compares twoObject
s on the provided path represented byprefix
and updates the result of the comparison in theresult
JSONCompareResult
object.- Specified by:
compareValues
in interfaceJSONComparator
- Overrides:
compareValues
in classDefaultComparator
- Parameters:
prefix
- the path in the json where the comparison happensexpectedValue
- the expected valueactualValue
- the actual valueresult
- stores the actual state of the comparison result- Throws:
org.json.JSONException
- JSON parsing error
-
-