public static JSONObject toJSON() throws JSONException { final JSONObject object = new JSONObject(); final JSONArray array = new JSONArray(); for (final TouchProfile p : profiles.values()) { array.put(p.toJSON()); } object.put("profiles", array); return object; }