Class JsonUtil

java.lang.Object
io.jans.as.model.util.JsonUtil

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

    Modifier and Type
    Method
    Description
    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.
    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • 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