io.alauda.kubernetes.api.model.ConditionBuilder 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 ConditionBuilder extends ConditionFluentImpl implements VisitableBuilder{
ConditionFluent> fluent;
Boolean validationEnabled;
public ConditionBuilder(){
this(true);
}
public ConditionBuilder(Boolean validationEnabled){
this(new Condition(), validationEnabled);
}
public ConditionBuilder(ConditionFluent> fluent){
this(fluent, true);
}
public ConditionBuilder(ConditionFluent> fluent,Boolean validationEnabled){
this(fluent, new Condition(), validationEnabled);
}
public ConditionBuilder(ConditionFluent> fluent,Condition instance){
this(fluent, instance, true);
}
public ConditionBuilder(ConditionFluent> fluent,Condition instance,Boolean validationEnabled){
this.fluent = fluent;
fluent.withLastAttempt(instance.getLastAttempt());
fluent.withMessage(instance.getMessage());
fluent.withReason(instance.getReason());
fluent.withStatus(instance.getStatus());
fluent.withType(instance.getType());
this.validationEnabled = validationEnabled;
}
public ConditionBuilder(Condition instance){
this(instance,true);
}
public ConditionBuilder(Condition instance,Boolean validationEnabled){
this.fluent = this;
this.withLastAttempt(instance.getLastAttempt());
this.withMessage(instance.getMessage());
this.withReason(instance.getReason());
this.withStatus(instance.getStatus());
this.withType(instance.getType());
this.validationEnabled = validationEnabled;
}
public Condition build(){
Condition buildable = new Condition(fluent.getLastAttempt(),fluent.getMessage(),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;
ConditionBuilder that = (ConditionBuilder) 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;
}
}