@Test public void jsonSerializeWorks() { JSONAssert.assertEquals(mPwsResult1.jsonSerialize(), jsonObject1, true); }
public JSONObject jsonSerialize() { JSONObject jsonObject = new JSONObject(); jsonObject.put(REQUESTURL_KEY, mRequestUrl); jsonObject.put(SITEURL_KEY, mSiteUrl); if (mTitle != null) { jsonObject.put(TITLE_KEY, mTitle); } if (mDescription != null) { jsonObject.put(DESCRIPTION_KEY, mDescription); } if (mIconUrl != null) { jsonObject.put(ICONURL_KEY, mIconUrl); } if (mGroupId != null) { jsonObject.put(GROUPID_KEY, mGroupId); } if (mExtraData.length() > 0) { jsonObject.put(EXTRA_KEY, mExtraData); } return jsonObject; }
PwsResult { public JSONObject jsonSerialize() { JSONObject jsonObject = new JSONObject(); jsonObject.put(REQUESTURL_KEY, mRequestUrl); jsonObject.put(SITEURL_KEY, mSiteUrl); if (mTitle != null) { jsonObject.put(TITLE_KEY, mTitle); } if (mDescription != null) { jsonObject.put(DESCRIPTION_KEY, mDescription); } if (mIconUrl != null) { jsonObject.put(ICONURL_KEY, mIconUrl); } if (mGroupId != null) { jsonObject.put(GROUPID_KEY, mGroupId); } if (mExtraData.length() > 0) { jsonObject.put(EXTRA_KEY, mExtraData); } return jsonObject; } }
PwsResult { public JSONObject jsonSerialize() { JSONObject jsonObject = new JSONObject(); jsonObject.put(REQUESTURL_KEY, mRequestUrl); jsonObject.put(SITEURL_KEY, mSiteUrl); if (mTitle != null) { jsonObject.put(TITLE_KEY, mTitle); } if (mDescription != null) { jsonObject.put(DESCRIPTION_KEY, mDescription); } if (mIconUrl != null) { jsonObject.put(ICONURL_KEY, mIconUrl); } if (mGroupId != null) { jsonObject.put(GROUPID_KEY, mGroupId); } if (mExtraData.length() > 0) { jsonObject.put(EXTRA_KEY, mExtraData); } return jsonObject; } PwsResult(
      String requestUrl, String siteUrl, String title, String description, String iconUrl,
      String groupId, JSONObject extraData);  PwsResult(String requestUrl, String siteUrl); }
PwsResult { public JSONObject jsonSerialize() { JSONObject jsonObject = new JSONObject(); jsonObject.put(REQUESTURL_KEY, mRequestUrl); jsonObject.put(SITEURL_KEY, mSiteUrl); if (mTitle != null) { jsonObject.put(TITLE_KEY, mTitle); } if (mDescription != null) { jsonObject.put(DESCRIPTION_KEY, mDescription); } if (mIconUrl != null) { jsonObject.put(ICONURL_KEY, mIconUrl); } if (mGroupId != null) { jsonObject.put(GROUPID_KEY, mGroupId); } if (mExtraData.length() > 0) { jsonObject.put(EXTRA_KEY, mExtraData); } return jsonObject; } PwsResult(
      String requestUrl, String siteUrl, String title, String description, String iconUrl,
      String groupId, JSONObject extraData);  PwsResult(String requestUrl, String siteUrl); String getRequestUrl(); String getSiteUrl(); boolean hasTitle(); String getTitle(); boolean hasDescription(); String getDescription(); boolean hasIconUrl(); String getIconUrl(); boolean hasGroupId(); String getGroupId(); boolean getExtraBoolean(String key); boolean optExtraBoolean(String key); boolean optExtraBoolean(String key, boolean defaultValue); int getExtraInt(String key); int optExtraInt(String key); int optExtraInt(String key, int defaultValue); long getExtraLong(String key); long optExtraLong(String key); long optExtraLong(String key, long defaultValue); double getExtraDouble(String key); double optExtraDouble(String key); double optExtraDouble(String key, double defaultValue); String getExtraString(String key); String optExtraString(String key); String optExtraString(String key, String defaultValue); JSONArray getExtraJSONArray(String key); JSONArray optExtraJSONArray(String key); JSONObject getExtraJSONObject(String key); JSONObject optExtraJSONObject(String key); JSONObject jsonSerialize(); static PwsResult jsonDeserialize(JSONObject jsonObject); }
PwsResult { public JSONObject jsonSerialize() { JSONObject jsonObject = new JSONObject(); jsonObject.put(REQUESTURL_KEY, mRequestUrl); jsonObject.put(SITEURL_KEY, mSiteUrl); if (mTitle != null) { jsonObject.put(TITLE_KEY, mTitle); } if (mDescription != null) { jsonObject.put(DESCRIPTION_KEY, mDescription); } if (mIconUrl != null) { jsonObject.put(ICONURL_KEY, mIconUrl); } if (mGroupId != null) { jsonObject.put(GROUPID_KEY, mGroupId); } if (mExtraData.length() > 0) { jsonObject.put(EXTRA_KEY, mExtraData); } return jsonObject; } PwsResult(
      String requestUrl, String siteUrl, String title, String description, String iconUrl,
      String groupId, JSONObject extraData);  PwsResult(String requestUrl, String siteUrl); String getRequestUrl(); String getSiteUrl(); boolean hasTitle(); String getTitle(); boolean hasDescription(); String getDescription(); boolean hasIconUrl(); String getIconUrl(); boolean hasGroupId(); String getGroupId(); boolean getExtraBoolean(String key); boolean optExtraBoolean(String key); boolean optExtraBoolean(String key, boolean defaultValue); int getExtraInt(String key); int optExtraInt(String key); int optExtraInt(String key, int defaultValue); long getExtraLong(String key); long optExtraLong(String key); long optExtraLong(String key, long defaultValue); double getExtraDouble(String key); double optExtraDouble(String key); double optExtraDouble(String key, double defaultValue); String getExtraString(String key); String optExtraString(String key); String optExtraString(String key, String defaultValue); JSONArray getExtraJSONArray(String key); JSONArray optExtraJSONArray(String key); JSONObject getExtraJSONObject(String key); JSONObject optExtraJSONObject(String key); JSONObject jsonSerialize(); static PwsResult jsonDeserialize(JSONObject jsonObject);  }