org.openstack4j.openstack.senlin.domain.SenlinClusterActionCreate Maven / Gradle / Ivy
package org.openstack4j.openstack.senlin.domain;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.openstack4j.model.senlin.ClusterActionCreate;
import org.openstack4j.model.senlin.ClusterCreate;
import org.openstack4j.model.senlin.builder.ClusterActionCreateBuilder;
import java.util.ArrayList;
import java.util.Map;
/**
* This class contains all elements required for the creation of a SenlinClusterAction. It
* uses Jackson annotation for (de)serialization into JSON
*
* @author lion
*
*/
public class SenlinClusterActionCreate implements ClusterActionCreate {
private static final long serialVersionUID = 8159175788259631363L;
@JsonProperty("add_nodes")
private Map> addNodes;
@JsonProperty("del_nodes")
private Map> delNodes;
@JsonProperty("scale_out")
private Map scaleOut;
@JsonProperty("scale_in")
private Map scaleIn;
@JsonProperty("resize")
private Map resize;
@JsonProperty("check")
private Map check;
@JsonProperty("recover")
private Map recover;
@JsonProperty("policy_attach")
private Map policyAttach;
@JsonProperty("policy_detach")
private Map policyDetach;
@JsonProperty("policy_update")
private Map policyUpdate;
/**
* Returnes a {@link SenlinClusterActionCreateConcreteBuilder} for configuration and
* creation of a {@link SenlinClusterActionCreate} object.
*
* @return a {@link SenlinClusterActionCreateConcreteBuilder}
*/
public static SenlinClusterActionCreateConcreteBuilder build() {
return new SenlinClusterActionCreateConcreteBuilder();
}
@Override
public ClusterActionCreateBuilder toBuilder() {
return new SenlinClusterActionCreateConcreteBuilder(this);
}
/**
* A Builder to create a SenlinClusterAction. Use {@link #build()} to receive the
* {@link ClusterCreate} object.
*
* @author lion
*
*/
public static class SenlinClusterActionCreateConcreteBuilder implements
ClusterActionCreateBuilder {
private SenlinClusterActionCreate model;
/**
* Constructor to create a {@link SenlinClusterActionCreateConcreteBuilder} object
* with a new, empty {@link SenlinClusterActionCreate} object.
*/
public SenlinClusterActionCreateConcreteBuilder() {
this(new SenlinClusterActionCreate());
}
/**
* Constructor for manipulation of an existing {@link SenlinClusterActionCreate}
* object.
*
* @param model
* the {@link SenlinClusterActionCreate} object which is to be
* modified.
*/
public SenlinClusterActionCreateConcreteBuilder(SenlinClusterActionCreate model) {
this.model = model;
}
@Override
public ClusterActionCreate build() {
return model;
}
@Override
public ClusterActionCreateBuilder from(ClusterActionCreate in) {
model = (SenlinClusterActionCreate) in;
return this;
}
@Override
public ClusterActionCreateBuilder addNodes(Map> addNodes) {
model.addNodes = addNodes;
return this;
}
@Override
public ClusterActionCreateBuilder delNodes(Map> delNodes) {
model.delNodes = delNodes;
return this;
}
@Override
public ClusterActionCreateBuilder scaleOut(Map scaleOut) {
model.scaleOut = scaleOut;
return this;
}
@Override
public ClusterActionCreateBuilder scaleIn(Map scaleIn) {
model.scaleIn = scaleIn;
return this;
}
@Override
public ClusterActionCreateBuilder resize(Map resize) {
model.resize = resize;
return this;
}
@Override
public ClusterActionCreateBuilder check(Map check) {
model.check = check;
return this;
}
@Override
public ClusterActionCreateBuilder recover(Map recover) {
model.recover = recover;
return this;
}
@Override
public ClusterActionCreateBuilder policyAttach(Map policyAttach) {
model.policyAttach = policyAttach;
return this;
}
@Override
public ClusterActionCreateBuilder policyDetach(Map policyDetach) {
model.policyDetach = policyDetach;
return this;
}
@Override
public ClusterActionCreateBuilder policyUpdate(Map policyUpdate) {
model.policyUpdate = policyUpdate;
return this;
}
}
}