
com.jelastic.api.system.persistence.HardwareNodePcsCluster Maven / Gradle / Ivy
The newest version!
/*Server class MD5: 889ef8e83b9eef6ac62a4321fe038277*/
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 HardwareNodePcsCluster extends ArrayItem {
private PcsCluster cluster;
private HardwareNode hardwareNode;
private boolean isMDS;
private boolean isClient;
private boolean isChunk;
public PcsCluster getCluster() {
return cluster;
}
public void setCluster(PcsCluster cluster) {
this.cluster = cluster;
}
public boolean isMDS() {
return isMDS;
}
public void setMDS(boolean isMDS) {
this.isMDS = isMDS;
}
public boolean isClient() {
return isClient;
}
public void setClient(boolean isClient) {
this.isClient = isClient;
}
public boolean isChunk() {
return isChunk;
}
public void setChunk(boolean isChunk) {
this.isChunk = isChunk;
}
public HardwareNode getHardwareNode() {
return hardwareNode;
}
public void setHardwareNode(HardwareNode hardwareNode) {
this.hardwareNode = hardwareNode;
}
@Override
public HardwareNodePcsCluster _fromJSON(JSONObject json) throws JSONException {
if (json.has("isMDS")) {
this.isMDS = json.getBoolean("isMDS");
}
if (json.has("isClient")) {
this.isClient = json.getBoolean("isClient");
}
if (json.has("isChunk")) {
this.isChunk = json.getBoolean("isChunk");
}
if (json.has("cluster")) {
this.cluster = new PcsCluster()._fromJSON(json.getJSONObject("cluster"));
}
return this;
}
@Override
public JSONObject _toJSON() throws JSONException {
JSONObject json = new JSONObject();
json.put("isMDS", this.isMDS);
json.put("isClient", this.isClient);
json.put("isChunk", this.isChunk);
if (this.cluster != null) {
json.put("cluster", cluster._toJSON());
}
return json;
}
@Override
public String toString() {
try {
return this._toJSON().toString();
} catch (JSONException e) {
e.printStackTrace();
return null;
}
}
}