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 voidcompareValues(java.lang.String prefix, java.lang.Object expectedValue, java.lang.Object actualValue, JSONCompareResult result)Compares twoObjects on the provided path represented byprefixand updates the result of the comparison in theresultJSONCompareResultobject.-
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(java.lang.String prefix, java.lang.Object expectedValue, java.lang.Object actualValue, JSONCompareResult result) throws org.json.JSONExceptionDescription copied from interface:JSONComparatorCompares twoObjects on the provided path represented byprefixand updates the result of the comparison in theresultJSONCompareResultobject.- Specified by:
compareValuesin interfaceJSONComparator- Overrides:
compareValuesin 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
-
-