Class JsonUtil


  • public class JsonUtil
    extends Object
    Author:
    Yuriy Z
    • Method Detail

      • filterOutNulls

        public static org.json.JSONObject filterOutNulls​(org.json.JSONObject json)
        Returns a json object representation of the given JSONObject, filtering out any keys whose value is null (i.e. JSONObject.NULL).
        Parameters:
        json - the original JSONObject
        Returns:
        filtered JSONObject
      • toStringWithoutNulls

        public static String toStringWithoutNulls​(org.json.JSONObject json)
        Returns a string representation of the given JSONObject, filtering out any keys whose value is null (i.e. JSONObject.NULL).
        Parameters:
        json - the original JSONObject
        Returns:
        the string representation of the filtered JSONObject