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

com.jelastic.api.system.persistence.Addon Maven / Gradle / Ivy

The newest version!
/*Server class MD5: 65e3f338ad435bab3a4b18a0b8573f46*/
package com.jelastic.api.system.persistence;

import com.jelastic.api.development.response.interfaces.ArrayItem;
import org.json.JSONException;
import org.json.JSONObject;

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

    public static final String ID = "id";

    public static final String UNIQUE_NAME = "uniqueName";

    public static final String APP_TEMPLATE_ID = "appTemplateId";

    private String uniqueName;

    private String appTemplateId;

    public String getUniqueName() {
        return uniqueName;
    }

    public void setUniqueName(String uniqueName) {
        this.uniqueName = uniqueName;
    }

    public String getAppTemplateId() {
        return appTemplateId;
    }

    public void setAppTemplateId(String appTemplateId) {
        this.appTemplateId = appTemplateId;
    }

    public Addon() {
    }

    public Addon(String uniqueName) {
        this.uniqueName = uniqueName;
    }

    public Addon(String uniqueName, String appTemplateId) {
        this.uniqueName = uniqueName;
        this.appTemplateId = appTemplateId;
    }

    @Override
    public JSONObject _toJSON() throws JSONException {
        JSONObject json = new JSONObject();
        json.put(UNIQUE_NAME, uniqueName);
        json.put(APP_TEMPLATE_ID, appTemplateId);
        return json;
    }

    @Override
    public Addon _fromJSON(JSONObject json) throws JSONException {
        if (json.has(ID)) {
            this.id = json.getInt(ID);
        }
        if (json.has(UNIQUE_NAME)) {
            this.uniqueName = json.getString(UNIQUE_NAME);
        }
        if (json.has(APP_TEMPLATE_ID)) {
            this.appTemplateId = json.getString(APP_TEMPLATE_ID);
        }
        return this;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy