Class AbstractComparator
java.lang.Object
org.skyscreamer.jsonassert.comparator.AbstractComparator
- All Implemented Interfaces:
JSONComparator
- Direct Known Subclasses:
DefaultComparator
This class provides a skeletal implementation of the
JSONComparator
interface, to minimize the effort required to implement this interface.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcheckJsonObjectKeysActualInExpected(String prefix, org.json.JSONObject expected, org.json.JSONObject actual, JSONCompareResult result) protected voidcheckJsonObjectKeysExpectedInActual(String prefix, org.json.JSONObject expected, org.json.JSONObject actual, JSONCompareResult result) final JSONCompareResultcompareJSON(org.json.JSONArray expected, org.json.JSONArray actual) Compares JSONArray provided to the expected JSONArray, and returns the results of the comparison.final JSONCompareResultcompareJSON(org.json.JSONObject expected, org.json.JSONObject actual) Compares JSONObject provided to the expected JSONObject, and returns the results of the comparison.protected voidcompareJSONArrayOfJsonObjects(String key, org.json.JSONArray expected, org.json.JSONArray actual, JSONCompareResult result) protected voidcompareJSONArrayOfSimpleValues(String key, org.json.JSONArray expected, org.json.JSONArray actual, JSONCompareResult result) protected voidcompareJSONArrayWithStrictOrder(String key, org.json.JSONArray expected, org.json.JSONArray actual, JSONCompareResult result) protected voidrecursivelyCompareJSONArray(String key, org.json.JSONArray expected, org.json.JSONArray actual, JSONCompareResult result) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.skyscreamer.jsonassert.comparator.JSONComparator
compareJSON, compareJSONArray, compareValues
-
Constructor Details
-
AbstractComparator
public AbstractComparator()Default constructor
-
-
Method Details
-
compareJSON
public final JSONCompareResult compareJSON(org.json.JSONObject expected, org.json.JSONObject actual) Compares JSONObject provided to the expected JSONObject, and returns the results of the comparison.- Specified by:
compareJSONin interfaceJSONComparator- Parameters:
expected- Expected JSONObjectactual- JSONObject to compare- Returns:
- the result of the comparison
-
compareJSON
Compares JSONArray provided to the expected JSONArray, and returns the results of the comparison.- Specified by:
compareJSONin interfaceJSONComparator- Parameters:
expected- Expected JSONArrayactual- JSONArray to compare- Returns:
- the result of the comparison
-
checkJsonObjectKeysActualInExpected
protected void checkJsonObjectKeysActualInExpected(String prefix, org.json.JSONObject expected, org.json.JSONObject actual, JSONCompareResult result) - Parameters:
prefix-expected-actual-result-
-
checkJsonObjectKeysExpectedInActual
protected void checkJsonObjectKeysExpectedInActual(String prefix, org.json.JSONObject expected, org.json.JSONObject actual, JSONCompareResult result) - Parameters:
prefix-expected-actual-result-
-
compareJSONArrayOfJsonObjects
protected void compareJSONArrayOfJsonObjects(String key, org.json.JSONArray expected, org.json.JSONArray actual, JSONCompareResult result) -
compareJSONArrayOfSimpleValues
protected void compareJSONArrayOfSimpleValues(String key, org.json.JSONArray expected, org.json.JSONArray actual, JSONCompareResult result) -
compareJSONArrayWithStrictOrder
protected void compareJSONArrayWithStrictOrder(String key, org.json.JSONArray expected, org.json.JSONArray actual, JSONCompareResult result) -
recursivelyCompareJSONArray
protected void recursivelyCompareJSONArray(String key, org.json.JSONArray expected, org.json.JSONArray actual, JSONCompareResult result)
-