org.mule.common.metadata.parser.json
Class JSONUtils

java.lang.Object
  extended by org.mule.common.metadata.parser.json.JSONUtils

public abstract class JSONUtils
extends Object

Utilities for manipulating and comparing JSON objects and arrays.

Author:
Timothy Danford

Constructor Summary
JSONUtils()
           
 
Method Summary
static boolean isEqual(Object o1, Object o2)
          Determines whether two objects are equal, in a way that respects the isJSONObjectEqual() method for JSONObjects.
static boolean isJSONObjectEqual(org.json.JSONObject o1, org.json.JSONObject o2)
          Determines whether two JSONObjects are "equal," where equality is determined in a key-order-independent manner.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JSONUtils

public JSONUtils()
Method Detail

isEqual

public static boolean isEqual(Object o1,
                              Object o2)
Determines whether two objects are equal, in a way that respects the isJSONObjectEqual() method for JSONObjects. It operates in the following manner:

Parameters:
o1 - The first object to compare.
o2 - The second object to compare.
Returns:
True if the two objects satisfy the above conditions, false otherwise.

isJSONObjectEqual

public static boolean isJSONObjectEqual(org.json.JSONObject o1,
                                        org.json.JSONObject o2)
Determines whether two JSONObjects are "equal," where equality is determined in a key-order-independent manner.

Parameters:
o1 -
o2 -
Returns:
If either object has a key that the other lacks, or if one object's key value returns false when JSONUtils.isEqual() is called on that object, and given the other objects key value as the second argument.


Copyright © 2015 MuleSoft, Inc.. All rights reserved.