Back to project page growthpush-android.
The source code is released under:
Apache License
If you think the Android project growthpush-android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.growthpush.model; /* ww w .j a v a 2 s . c o m*/ import org.json.JSONException; import org.json.JSONObject; public class Error { private int code; private String message; public Error() { super(); } public Error(int code, String message) { this(); setCode(code); setMessage(message); } public Error(JSONObject jsonObject) { this(); setJsonObject(jsonObject); } public int getCode() { return code; } public void setCode(int code) { this.code = code; } public String getMessage() { return message; } public void setMessage(String message) { this.message = message; } public void setJsonObject(JSONObject jsonObject) { try { if (jsonObject.has("code")) setCode(jsonObject.getInt("code")); if (jsonObject.has("message")) setMessage(jsonObject.getString("message")); } catch (JSONException e) { throw new IllegalArgumentException("Failed to parse JSON."); } } }