annotations.io.alauda.kubernetes.api.model.extensions.RollingUpdateDeploymentBuilder Maven / Gradle / Ivy
package io.alauda.kubernetes.api.model.extensions;
import io.alauda.kubernetes.api.builder.VisitableBuilder;
import java.lang.Object;
import java.lang.Boolean;
public class RollingUpdateDeploymentBuilder extends RollingUpdateDeploymentFluentImpl implements VisitableBuilder{
RollingUpdateDeploymentFluent> fluent;
Boolean validationEnabled;
public RollingUpdateDeploymentBuilder(){
this(true);
}
public RollingUpdateDeploymentBuilder(Boolean validationEnabled){
this(new RollingUpdateDeployment(), validationEnabled);
}
public RollingUpdateDeploymentBuilder(RollingUpdateDeploymentFluent> fluent){
this(fluent, true);
}
public RollingUpdateDeploymentBuilder(RollingUpdateDeploymentFluent> fluent,Boolean validationEnabled){
this(fluent, new RollingUpdateDeployment(), validationEnabled);
}
public RollingUpdateDeploymentBuilder(RollingUpdateDeploymentFluent> fluent,RollingUpdateDeployment instance){
this(fluent, instance, true);
}
public RollingUpdateDeploymentBuilder(RollingUpdateDeploymentFluent> fluent,RollingUpdateDeployment instance,Boolean validationEnabled){
this.fluent = fluent;
fluent.withMaxSurge(instance.getMaxSurge());
fluent.withMaxUnavailable(instance.getMaxUnavailable());
this.validationEnabled = validationEnabled;
}
public RollingUpdateDeploymentBuilder(RollingUpdateDeployment instance){
this(instance,true);
}
public RollingUpdateDeploymentBuilder(RollingUpdateDeployment instance,Boolean validationEnabled){
this.fluent = this;
this.withMaxSurge(instance.getMaxSurge());
this.withMaxUnavailable(instance.getMaxUnavailable());
this.validationEnabled = validationEnabled;
}
public RollingUpdateDeployment build(){
RollingUpdateDeployment buildable = new RollingUpdateDeployment(fluent.getMaxSurge(),fluent.getMaxUnavailable());
io.alauda.kubernetes.api.builder.ValidationUtils.validate(buildable);
return buildable;
}
public boolean equals(Object o){
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
RollingUpdateDeploymentBuilder that = (RollingUpdateDeploymentBuilder) o;
if (fluent != null &&fluent != this ? !fluent.equals(that.fluent) :that.fluent != null &&fluent != this ) return false;
if (validationEnabled != null ? !validationEnabled.equals(that.validationEnabled) :that.validationEnabled != null) return false;
return true;
}
}