io.alauda.kubernetes.api.model.MultiBranchBehavioursBuilder Maven / Gradle / Ivy
package io.alauda.kubernetes.api.model;
import io.alauda.kubernetes.api.builder.VisitableBuilder;
import java.lang.Object;
import java.lang.Boolean;
public class MultiBranchBehavioursBuilder extends MultiBranchBehavioursFluentImpl implements VisitableBuilder{
MultiBranchBehavioursFluent> fluent;
Boolean validationEnabled;
public MultiBranchBehavioursBuilder(){
this(true);
}
public MultiBranchBehavioursBuilder(Boolean validationEnabled){
this(new MultiBranchBehaviours(), validationEnabled);
}
public MultiBranchBehavioursBuilder(MultiBranchBehavioursFluent> fluent){
this(fluent, true);
}
public MultiBranchBehavioursBuilder(MultiBranchBehavioursFluent> fluent,Boolean validationEnabled){
this(fluent, new MultiBranchBehaviours(), validationEnabled);
}
public MultiBranchBehavioursBuilder(MultiBranchBehavioursFluent> fluent,MultiBranchBehaviours instance){
this(fluent, instance, true);
}
public MultiBranchBehavioursBuilder(MultiBranchBehavioursFluent> fluent,MultiBranchBehaviours instance,Boolean validationEnabled){
this.fluent = fluent;
fluent.withDiscoverBranches(instance.getDiscoverBranches());
fluent.withDiscoverPRFromForks(instance.getDiscoverPRFromForks());
fluent.withDiscoverPRFromOrigin(instance.getDiscoverPRFromOrigin());
fluent.withDiscoverTags(instance.getDiscoverTags());
fluent.withFilterExpression(instance.getFilterExpression());
fluent.withForksTrust(instance.getForksTrust());
this.validationEnabled = validationEnabled;
}
public MultiBranchBehavioursBuilder(MultiBranchBehaviours instance){
this(instance,true);
}
public MultiBranchBehavioursBuilder(MultiBranchBehaviours instance,Boolean validationEnabled){
this.fluent = this;
this.withDiscoverBranches(instance.getDiscoverBranches());
this.withDiscoverPRFromForks(instance.getDiscoverPRFromForks());
this.withDiscoverPRFromOrigin(instance.getDiscoverPRFromOrigin());
this.withDiscoverTags(instance.getDiscoverTags());
this.withFilterExpression(instance.getFilterExpression());
this.withForksTrust(instance.getForksTrust());
this.validationEnabled = validationEnabled;
}
public MultiBranchBehaviours build(){
MultiBranchBehaviours buildable = new MultiBranchBehaviours(fluent.getDiscoverBranches(),fluent.getDiscoverPRFromForks(),fluent.getDiscoverPRFromOrigin(),fluent.isDiscoverTags(),fluent.getFilterExpression(),fluent.getForksTrust());
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;
MultiBranchBehavioursBuilder that = (MultiBranchBehavioursBuilder) 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;
}
}