Class JSONChecker


  • public class JSONChecker
    extends Object
    • Constructor Detail

      • JSONChecker

        public JSONChecker()
    • Method Detail

      • 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 CompareException
        checks if both inputs are comparable, checks based of the type of expected

        Supports: 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