package toolbox;

/**
 * Standardized JSON response. Use this class to construct a JSON response to a
 * client.
 * @author Glenn
 *
 */
public class JSONResponse
{
    /**
     * Indicate whether or not the requested operation has succeeded
     */
    public boolean success;
    /**
     * If the operation failed, this any error messages should be contained
     * here. 
     */
    public String error;
    /**
     * Data the operation returns, if any
     */
    public Object data;

    public JSONResponse(boolean success, String error, Object data)
    {
        super();
        this.success = success;
        this.error = error;
        this.data = data;
    }

    public JSONResponse(String error)
    {
        super();
        this.success = false;
        this.error = error;
    }
}

@@ -794,10 +794,136 @@
 ;%0A    %7D%0A
+    %0A    public JSONResponse(Object data)%0A    %7B%0A        super();%0A        this.success = true;%0A        this.data = data;%0A    %7D%0A
 %7D%0A

Add data-only constructor to JSONResponse