annotations.io.alauda.kubernetes.api.model.PodAffinityBuilder 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 PodAffinityBuilder extends PodAffinityFluentImpl implements VisitableBuilder{
PodAffinityFluent> fluent;
Boolean validationEnabled;
public PodAffinityBuilder(){
this(true);
}
public PodAffinityBuilder(Boolean validationEnabled){
this(new PodAffinity(), validationEnabled);
}
public PodAffinityBuilder(PodAffinityFluent> fluent){
this(fluent, true);
}
public PodAffinityBuilder(PodAffinityFluent> fluent,Boolean validationEnabled){
this(fluent, new PodAffinity(), validationEnabled);
}
public PodAffinityBuilder(PodAffinityFluent> fluent,PodAffinity instance){
this(fluent, instance, true);
}
public PodAffinityBuilder(PodAffinityFluent> fluent,PodAffinity instance,Boolean validationEnabled){
this.fluent = fluent;
fluent.withPreferredDuringSchedulingIgnoredDuringExecution(instance.getPreferredDuringSchedulingIgnoredDuringExecution());
fluent.withRequiredDuringSchedulingIgnoredDuringExecution(instance.getRequiredDuringSchedulingIgnoredDuringExecution());
this.validationEnabled = validationEnabled;
}
public PodAffinityBuilder(PodAffinity instance){
this(instance,true);
}
public PodAffinityBuilder(PodAffinity instance,Boolean validationEnabled){
this.fluent = this;
this.withPreferredDuringSchedulingIgnoredDuringExecution(instance.getPreferredDuringSchedulingIgnoredDuringExecution());
this.withRequiredDuringSchedulingIgnoredDuringExecution(instance.getRequiredDuringSchedulingIgnoredDuringExecution());
this.validationEnabled = validationEnabled;
}
public PodAffinity build(){
PodAffinity buildable = new PodAffinity(fluent.getPreferredDuringSchedulingIgnoredDuringExecution(),fluent.getRequiredDuringSchedulingIgnoredDuringExecution());
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;
PodAffinityBuilder that = (PodAffinityBuilder) 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;
}
}