All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.jelastic.api.development.response.ScriptBuildResponse Maven / Gradle / Ivy

The newest version!
package com.jelastic.api.development.response;

import com.jelastic.api.Response;
import org.json.JSONException;
import org.json.JSONObject;

/**
 *
 * @author Ruslan Sinitskiy
 */
public class ScriptBuildResponse extends Response {

    private int line = -1;

    public ScriptBuildResponse() {
        super(OK);
    }

    public ScriptBuildResponse(int result, String error) {
        super(result, error);
    }

    public int getLine() {
        return line;
    }

    public void setLine(int line) {
        this.line = line;
    }

    @Override
    public JSONObject toJSON() {
        JSONObject json = super.toJSON();
        try {
            if (line > -1) {
                json.put("line", line);
            }
        } catch (Exception ex) {
            ex.printStackTrace();
            try {
                json.put("result", Response.ERROR_UNKNOWN).put("error", ex.toString());
            } catch (JSONException exc) {
            }
        }
        return json;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy