annotations.io.alauda.devops.api.model.SourceBuildStrategyBuilder 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 SourceBuildStrategyBuilder extends SourceBuildStrategyFluentImpl implements VisitableBuilder{
SourceBuildStrategyFluent> fluent;
Boolean validationEnabled;
public SourceBuildStrategyBuilder(){
this(true);
}
public SourceBuildStrategyBuilder(Boolean validationEnabled){
this(new SourceBuildStrategy(), validationEnabled);
}
public SourceBuildStrategyBuilder(SourceBuildStrategyFluent> fluent){
this(fluent, true);
}
public SourceBuildStrategyBuilder(SourceBuildStrategyFluent> fluent,Boolean validationEnabled){
this(fluent, new SourceBuildStrategy(), validationEnabled);
}
public SourceBuildStrategyBuilder(SourceBuildStrategyFluent> fluent,SourceBuildStrategy instance){
this(fluent, instance, true);
}
public SourceBuildStrategyBuilder(SourceBuildStrategyFluent> fluent,SourceBuildStrategy instance,Boolean validationEnabled){
this.fluent = fluent;
fluent.withEnv(instance.getEnv());
fluent.withForcePull(instance.getForcePull());
fluent.withFrom(instance.getFrom());
fluent.withIncremental(instance.getIncremental());
fluent.withPullSecret(instance.getPullSecret());
fluent.withRuntimeArtifacts(instance.getRuntimeArtifacts());
fluent.withRuntimeImage(instance.getRuntimeImage());
fluent.withScripts(instance.getScripts());
this.validationEnabled = validationEnabled;
}
public SourceBuildStrategyBuilder(SourceBuildStrategy instance){
this(instance,true);
}
public SourceBuildStrategyBuilder(SourceBuildStrategy instance,Boolean validationEnabled){
this.fluent = this;
this.withEnv(instance.getEnv());
this.withForcePull(instance.getForcePull());
this.withFrom(instance.getFrom());
this.withIncremental(instance.getIncremental());
this.withPullSecret(instance.getPullSecret());
this.withRuntimeArtifacts(instance.getRuntimeArtifacts());
this.withRuntimeImage(instance.getRuntimeImage());
this.withScripts(instance.getScripts());
this.validationEnabled = validationEnabled;
}
public SourceBuildStrategy build(){
SourceBuildStrategy buildable = new SourceBuildStrategy(fluent.getEnv(),fluent.isForcePull(),fluent.getFrom(),fluent.isIncremental(),fluent.getPullSecret(),fluent.getRuntimeArtifacts(),fluent.getRuntimeImage(),fluent.getScripts());
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;
SourceBuildStrategyBuilder that = (SourceBuildStrategyBuilder) 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;
}
}