package com.dataasync;

import org.json.JSONObject;

public class JSONResponse {
    public static final JSONResponse RESPONSE_STATUS_FAIL = new JSONResponse(false, "","");

    private boolean isSucceed;
    private String message;
    private String data;

    public JSONResponse(boolean isSucceed, String message,String data) {
        this.isSucceed = isSucceed;
        this.message = message;
        this.setData(data);
    }

    public boolean isSucceed() {
        return isSucceed;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

	public String getData() {
		return data;
	}

	public void setData(String data) {
		this.data = data;
	}
	
	public static JSONResponse getJSONResponse(String json) {
		if (json.equals("") || json == null) {
			return JSONResponse.RESPONSE_STATUS_FAIL;
		}
		try {
			JSONObject object = new JSONObject(json);
			String status = object.optString(Constants.KEY_STATUS);
			String message = object.optString(Constants.KEY_MESSAGE);
			String data = object.optString(Constants.KEY_DATA);
			boolean isSucceed = status.equals(Constants.KEY_SUCCEED);
			return new JSONResponse(isSucceed, message, data);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return JSONResponse.RESPONSE_STATUS_FAIL;
	}
}
@@ -78,100 +78,29 @@
 e %7B%0A
-    public static final JSONResponse RESPONSE_STATUS_FAIL = new JSONResponse(false, %22%22,%22%22);%0A
+%09private String data;
 %0A   
@@ -159,33 +159,97 @@
 ge;%0A
+%0A
     p
-rivate String data;%0A
+ublic static final JSONResponse NIL_RESPONSE = new JSONResponse(false, %22%22,%22%22);%0A    
 %0A   
@@ -861,32 +861,36 @@
 SONResponse.
+NIL_
 RESPONSE
 _STATUS_FAIL
@@ -877,28 +877,16 @@
 RESPONSE
-_STATUS_FAIL
 ;%0A%09%09%7D%0A%09%09
@@ -1256,32 +1256,8 @@
 ) %7B%0A
-%09%09%09e.printStackTrace();%0A
 %09%09%7D%0A
@@ -1278,24 +1278,28 @@
 esponse.
+NIL_
 RESPONSE
 _STATUS_
@@ -1294,22 +1294,11 @@
 ONSE
-_STATUS_FAIL
 ;%0A%09%7D%0A%7D
+%0A

Update JSONResponse.java