annotations.io.alauda.kubernetes.api.model.PreconditionsBuilder 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 PreconditionsBuilder extends PreconditionsFluentImpl implements VisitableBuilder{
PreconditionsFluent> fluent;
Boolean validationEnabled;
public PreconditionsBuilder(){
this(true);
}
public PreconditionsBuilder(Boolean validationEnabled){
this(new Preconditions(), validationEnabled);
}
public PreconditionsBuilder(PreconditionsFluent> fluent){
this(fluent, true);
}
public PreconditionsBuilder(PreconditionsFluent> fluent,Boolean validationEnabled){
this(fluent, new Preconditions(), validationEnabled);
}
public PreconditionsBuilder(PreconditionsFluent> fluent,Preconditions instance){
this(fluent, instance, true);
}
public PreconditionsBuilder(PreconditionsFluent> fluent,Preconditions instance,Boolean validationEnabled){
this.fluent = fluent;
fluent.withUid(instance.getUid());
this.validationEnabled = validationEnabled;
}
public PreconditionsBuilder(Preconditions instance){
this(instance,true);
}
public PreconditionsBuilder(Preconditions instance,Boolean validationEnabled){
this.fluent = this;
this.withUid(instance.getUid());
this.validationEnabled = validationEnabled;
}
public Preconditions build(){
Preconditions buildable = new Preconditions(fluent.getUid());
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;
PreconditionsBuilder that = (PreconditionsBuilder) 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;
}
}