java.lang.Object
ch.software_atelier.simpleflex.rest.auth.utils.JSONHelper

public class JSONHelper extends Object
  • Constructor Details

    • JSONHelper

      public JSONHelper()
  • Method Details

    • jsonToHashmap

      public static HashMap jsonToHashmap(org.json.JSONObject obj)
    • hashMapToJSON

      public static org.json.JSONObject hashMapToJSON(HashMap hm)
    • stringList2JSONArr

      public static org.json.JSONArray stringList2JSONArr(List<String> list) throws org.json.JSONException
      Throws:
      org.json.JSONException
    • deepMerge

      public static void deepMerge(org.json.JSONObject first, org.json.JSONObject second)
      Merges the first object to the second.
    • getAtPath

      public static Object getAtPath(org.json.JSONObject o, String path)
    • getAtPath

      public static Object getAtPath(org.json.JSONObject o, String separator, String path)
    • toStringList

      public static List<String> toStringList(org.json.JSONArray arr)
    • jsonToMap

      public static Map<String,Object> jsonToMap(org.json.JSONObject object) throws org.json.JSONException
      Throws:
      org.json.JSONException
    • jsonToList

      public static List<Object> jsonToList(org.json.JSONArray array) throws org.json.JSONException
      Throws:
      org.json.JSONException
    • mapToJSON

      public static org.json.JSONObject mapToJSON(Map<String,Object> data)
    • listToJSON

      public static org.json.JSONArray listToJSON(List list)