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

com.jelastic.api.marketplace.response.SettingsResponse Maven / Gradle / Ivy

The newest version!
/*Server class MD5: d5846e65c8ca0f7d7fddb42898d4fcbd*/
package com.jelastic.api.marketplace.response;

import com.jelastic.api.response.ScriptEvalProxyResponse;
import org.json.JSONException;
import org.json.JSONObject;

/**
 * @name Jelastic API Client
 * @version 8.11.2
 * @copyright Jelastic, Inc.
 */
public class SettingsResponse extends ScriptEvalProxyResponse {

    private JSONObject settings = null;

    public SettingsResponse() {
        super();
    }

    public SettingsResponse(JSONObject settings) {
        this.settings = settings;
    }

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

    public JSONObject getSettings() {
        return settings;
    }

    public void setSettings(JSONObject settings) {
        this.settings = settings;
    }

    @Override
    public JSONObject _toJSON(JSONObject json) throws JSONException {
        if (settings != null) {
            json.put("settings", settings);
        }
        return json;
    }

    @Override
    public SettingsResponse _fromJSON(JSONObject json) throws JSONException {
        super._fromJSON(json);
        if (!(getResponse() instanceof JSONObject)) {
            return this;
        }
        JSONObject responseJson = (JSONObject) getResponse();
        if (responseJson.has("settings")) {
            this.settings = responseJson.getJSONObject("settings");
        }
        return this;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy