io.alauda.kubernetes.api.model.ComponentConditionBuilder 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 ComponentConditionBuilder extends ComponentConditionFluentImpl implements VisitableBuilder{
ComponentConditionFluent> fluent;
Boolean validationEnabled;
public ComponentConditionBuilder(){
this(true);
}
public ComponentConditionBuilder(Boolean validationEnabled){
this(new ComponentCondition(), validationEnabled);
}
public ComponentConditionBuilder(ComponentConditionFluent> fluent){
this(fluent, true);
}
public ComponentConditionBuilder(ComponentConditionFluent> fluent,Boolean validationEnabled){
this(fluent, new ComponentCondition(), validationEnabled);
}
public ComponentConditionBuilder(ComponentConditionFluent> fluent,ComponentCondition instance){
this(fluent, instance, true);
}
public ComponentConditionBuilder(ComponentConditionFluent> fluent,ComponentCondition instance,Boolean validationEnabled){
this.fluent = fluent;
fluent.withError(instance.getError());
fluent.withMessage(instance.getMessage());
fluent.withStatus(instance.getStatus());
fluent.withType(instance.getType());
this.validationEnabled = validationEnabled;
}
public ComponentConditionBuilder(ComponentCondition instance){
this(instance,true);
}
public ComponentConditionBuilder(ComponentCondition instance,Boolean validationEnabled){
this.fluent = this;
this.withError(instance.getError());
this.withMessage(instance.getMessage());
this.withStatus(instance.getStatus());
this.withType(instance.getType());
this.validationEnabled = validationEnabled;
}
public ComponentCondition build(){
ComponentCondition buildable = new ComponentCondition(fluent.getError(),fluent.getMessage(),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;
ComponentConditionBuilder that = (ComponentConditionBuilder) 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;
}
}