Package de.kosmos_lab.utils
Class JSONChecker
- java.lang.Object
-
- de.kosmos_lab.utils.JSONChecker
-
public class JSONChecker extends Object
-
-
Constructor Summary
Constructors Constructor Description JSONChecker()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleancheckValue(org.json.JSONObject device, String key, Object expected)static booleancompare(org.json.JSONObject a, org.json.JSONObject b)static booleancompare(org.json.JSONObject a, org.json.JSONObject b, String[] skippedKeys)static booleancompare(org.json.JSONObject a, org.json.JSONObject b, Set<String> skippedKeys)static booleanequals(Object value, Object expected)checks if both inputs are comparable, checks based of the type of expectedstatic booleanequals(Object value, Object expected, String path)
-
-
-
Method Detail
-
checkValue
public static boolean checkValue(org.json.JSONObject device, String key, Object expected) throws Exception- Throws:
Exception
-
compare
public static boolean compare(@CheckForNull org.json.JSONObject a, @CheckForNull org.json.JSONObject b, @Nonnull Set<String> skippedKeys) throws CompareException- Throws:
CompareException
-
compare
public static boolean compare(@CheckForNull org.json.JSONObject a, @CheckForNull org.json.JSONObject b, @Nonnull String[] skippedKeys) throws CompareException- Throws:
CompareException
-
compare
public static boolean compare(@CheckForNull org.json.JSONObject a, @CheckForNull org.json.JSONObject b) throws CompareException- Throws:
CompareException
-
equals
public static boolean equals(@CheckForNull Object value, @CheckForNull Object expected) throws CompareExceptionchecks if both inputs are comparable, checks based of the type of expectedSupports: int,double,float,boolean,String, JSONObject,JSONArray
- Parameters:
value-expected-- Returns:
- Throws:
CompareException- throws exception if both of them mismatche, with a reason why it mismatched
-
equals
public static boolean equals(@CheckForNull Object value, @CheckForNull Object expected, @Nonnull String path) throws CompareException- Throws:
CompareException
-
-