Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- JSONObject obj1=null,obj2=null;
- obj1=new JSONObject(actual);
- obj2=new JSONObject(required);
- Iterator<?> keys = obj2.keys();
- while( keys.hasNext() ) {
- String key = (String)keys.next();
- if(obj2.get(key) instanceof JSONArray)
- {
- if(!compareJSONArray(obj2.getString(key),obj1.getString(key)))
- {return false;}
- status=true;
- }else if(obj2.get(key) instanceof JSONObject)
- {
- if(!compareJSON(obj2.getString(key),obj1.getString(key)))
- {return false;}
- status=true;
- }else{
- if(obj2.getString(key).equalsIgnoreCase(obj1.getString(key)))
- {
- status=true;
- }
- else{
- return false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement