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

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

There is a newer version: 8.12-1
Show newest version
/*Server class MD5: 211f75594ccac22cbe51f33c3becac5c*/
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 GetEngineVersionResponse extends ScriptEvalProxyResponse {

    private String version = null;

    public GetEngineVersionResponse() {
    }

    public GetEngineVersionResponse(String version) {
        this.version = version;
    }

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

    public String getVersion() {
        return version;
    }

    public void setVersion(String version) {
        this.version = version;
    }

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy