annotations.io.alauda.devops.api.model.DeploymentTriggerImageChangeParamsBuilder 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 DeploymentTriggerImageChangeParamsBuilder extends DeploymentTriggerImageChangeParamsFluentImpl implements VisitableBuilder{
DeploymentTriggerImageChangeParamsFluent> fluent;
Boolean validationEnabled;
public DeploymentTriggerImageChangeParamsBuilder(){
this(true);
}
public DeploymentTriggerImageChangeParamsBuilder(Boolean validationEnabled){
this(new DeploymentTriggerImageChangeParams(), validationEnabled);
}
public DeploymentTriggerImageChangeParamsBuilder(DeploymentTriggerImageChangeParamsFluent> fluent){
this(fluent, true);
}
public DeploymentTriggerImageChangeParamsBuilder(DeploymentTriggerImageChangeParamsFluent> fluent,Boolean validationEnabled){
this(fluent, new DeploymentTriggerImageChangeParams(), validationEnabled);
}
public DeploymentTriggerImageChangeParamsBuilder(DeploymentTriggerImageChangeParamsFluent> fluent,DeploymentTriggerImageChangeParams instance){
this(fluent, instance, true);
}
public DeploymentTriggerImageChangeParamsBuilder(DeploymentTriggerImageChangeParamsFluent> fluent,DeploymentTriggerImageChangeParams instance,Boolean validationEnabled){
this.fluent = fluent;
fluent.withAutomatic(instance.getAutomatic());
fluent.withContainerNames(instance.getContainerNames());
fluent.withFrom(instance.getFrom());
fluent.withLastTriggeredImage(instance.getLastTriggeredImage());
this.validationEnabled = validationEnabled;
}
public DeploymentTriggerImageChangeParamsBuilder(DeploymentTriggerImageChangeParams instance){
this(instance,true);
}
public DeploymentTriggerImageChangeParamsBuilder(DeploymentTriggerImageChangeParams instance,Boolean validationEnabled){
this.fluent = this;
this.withAutomatic(instance.getAutomatic());
this.withContainerNames(instance.getContainerNames());
this.withFrom(instance.getFrom());
this.withLastTriggeredImage(instance.getLastTriggeredImage());
this.validationEnabled = validationEnabled;
}
public DeploymentTriggerImageChangeParams build(){
DeploymentTriggerImageChangeParams buildable = new DeploymentTriggerImageChangeParams(fluent.isAutomatic(),fluent.getContainerNames(),fluent.getFrom(),fluent.getLastTriggeredImage());
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;
DeploymentTriggerImageChangeParamsBuilder that = (DeploymentTriggerImageChangeParamsBuilder) 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;
}
}