io.alauda.kubernetes.api.model.BindingConditionBuilder 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 BindingConditionBuilder extends BindingConditionFluentImpl implements VisitableBuilder{
BindingConditionFluent> fluent;
Boolean validationEnabled;
public BindingConditionBuilder(){
this(true);
}
public BindingConditionBuilder(Boolean validationEnabled){
this(new BindingCondition(), validationEnabled);
}
public BindingConditionBuilder(BindingConditionFluent> fluent){
this(fluent, true);
}
public BindingConditionBuilder(BindingConditionFluent> fluent,Boolean validationEnabled){
this(fluent, new BindingCondition(), validationEnabled);
}
public BindingConditionBuilder(BindingConditionFluent> fluent,BindingCondition instance){
this(fluent, instance, true);
}
public BindingConditionBuilder(BindingConditionFluent> fluent,BindingCondition instance,Boolean validationEnabled){
this.fluent = fluent;
fluent.withLastAttempt(instance.getLastAttempt());
fluent.withMessage(instance.getMessage());
fluent.withName(instance.getName());
fluent.withNamespace(instance.getNamespace());
fluent.withReason(instance.getReason());
fluent.withStatus(instance.getStatus());
fluent.withType(instance.getType());
this.validationEnabled = validationEnabled;
}
public BindingConditionBuilder(BindingCondition instance){
this(instance,true);
}
public BindingConditionBuilder(BindingCondition instance,Boolean validationEnabled){
this.fluent = this;
this.withLastAttempt(instance.getLastAttempt());
this.withMessage(instance.getMessage());
this.withName(instance.getName());
this.withNamespace(instance.getNamespace());
this.withReason(instance.getReason());
this.withStatus(instance.getStatus());
this.withType(instance.getType());
this.validationEnabled = validationEnabled;
}
public BindingCondition build(){
BindingCondition buildable = new BindingCondition(fluent.getLastAttempt(),fluent.getMessage(),fluent.getName(),fluent.getNamespace(),fluent.getReason(),fluent.getStatus(),fluent.getType());
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;
BindingConditionBuilder that = (BindingConditionBuilder) 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;
}
}