io.alauda.devops.api.model.ImageSourceBuilder 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 ImageSourceBuilder extends ImageSourceFluentImpl implements VisitableBuilder{
ImageSourceFluent> fluent;
Boolean validationEnabled;
public ImageSourceBuilder(){
this(true);
}
public ImageSourceBuilder(Boolean validationEnabled){
this(new ImageSource(), validationEnabled);
}
public ImageSourceBuilder(ImageSourceFluent> fluent){
this(fluent, true);
}
public ImageSourceBuilder(ImageSourceFluent> fluent,Boolean validationEnabled){
this(fluent, new ImageSource(), validationEnabled);
}
public ImageSourceBuilder(ImageSourceFluent> fluent,ImageSource instance){
this(fluent, instance, true);
}
public ImageSourceBuilder(ImageSourceFluent> fluent,ImageSource instance,Boolean validationEnabled){
this.fluent = fluent;
fluent.withFrom(instance.getFrom());
fluent.withPaths(instance.getPaths());
fluent.withPullSecret(instance.getPullSecret());
this.validationEnabled = validationEnabled;
}
public ImageSourceBuilder(ImageSource instance){
this(instance,true);
}
public ImageSourceBuilder(ImageSource instance,Boolean validationEnabled){
this.fluent = this;
this.withFrom(instance.getFrom());
this.withPaths(instance.getPaths());
this.withPullSecret(instance.getPullSecret());
this.validationEnabled = validationEnabled;
}
public ImageSource build(){
ImageSource buildable = new ImageSource(fluent.getFrom(),fluent.getPaths(),fluent.getPullSecret());
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;
ImageSourceBuilder that = (ImageSourceBuilder) 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;
}
}