io.alauda.devops.api.model.RollingDeploymentStrategyParamsBuilder Maven / Gradle / Ivy
package io.alauda.devops.api.model;
import io.alauda.kubernetes.api.builder.VisitableBuilder;
import java.lang.Object;
import java.lang.Boolean;
public class RollingDeploymentStrategyParamsBuilder extends RollingDeploymentStrategyParamsFluentImpl implements VisitableBuilder{
RollingDeploymentStrategyParamsFluent> fluent;
Boolean validationEnabled;
public RollingDeploymentStrategyParamsBuilder(){
this(true);
}
public RollingDeploymentStrategyParamsBuilder(Boolean validationEnabled){
this(new RollingDeploymentStrategyParams(), validationEnabled);
}
public RollingDeploymentStrategyParamsBuilder(RollingDeploymentStrategyParamsFluent> fluent){
this(fluent, true);
}
public RollingDeploymentStrategyParamsBuilder(RollingDeploymentStrategyParamsFluent> fluent,Boolean validationEnabled){
this(fluent, new RollingDeploymentStrategyParams(), validationEnabled);
}
public RollingDeploymentStrategyParamsBuilder(RollingDeploymentStrategyParamsFluent> fluent,RollingDeploymentStrategyParams instance){
this(fluent, instance, true);
}
public RollingDeploymentStrategyParamsBuilder(RollingDeploymentStrategyParamsFluent> fluent,RollingDeploymentStrategyParams instance,Boolean validationEnabled){
this.fluent = fluent;
fluent.withIntervalSeconds(instance.getIntervalSeconds());
fluent.withMaxSurge(instance.getMaxSurge());
fluent.withMaxUnavailable(instance.getMaxUnavailable());
fluent.withPost(instance.getPost());
fluent.withPre(instance.getPre());
fluent.withTimeoutSeconds(instance.getTimeoutSeconds());
fluent.withUpdatePeriodSeconds(instance.getUpdatePeriodSeconds());
this.validationEnabled = validationEnabled;
}
public RollingDeploymentStrategyParamsBuilder(RollingDeploymentStrategyParams instance){
this(instance,true);
}
public RollingDeploymentStrategyParamsBuilder(RollingDeploymentStrategyParams instance,Boolean validationEnabled){
this.fluent = this;
this.withIntervalSeconds(instance.getIntervalSeconds());
this.withMaxSurge(instance.getMaxSurge());
this.withMaxUnavailable(instance.getMaxUnavailable());
this.withPost(instance.getPost());
this.withPre(instance.getPre());
this.withTimeoutSeconds(instance.getTimeoutSeconds());
this.withUpdatePeriodSeconds(instance.getUpdatePeriodSeconds());
this.validationEnabled = validationEnabled;
}
public RollingDeploymentStrategyParams build(){
RollingDeploymentStrategyParams buildable = new RollingDeploymentStrategyParams(fluent.getIntervalSeconds(),fluent.getMaxSurge(),fluent.getMaxUnavailable(),fluent.getPost(),fluent.getPre(),fluent.getTimeoutSeconds(),fluent.getUpdatePeriodSeconds());
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;
RollingDeploymentStrategyParamsBuilder that = (RollingDeploymentStrategyParamsBuilder) 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;
}
}