annotations.me.snowdrop.applicationcrd.api.model.SchemaBuilder Maven / Gradle / Ivy
package me.snowdrop.applicationcrd.api.model;
import io.fabric8.kubernetes.api.builder.VisitableBuilder;
import java.lang.Object;
import java.lang.Boolean;
import javax.validation.Validator;
public class SchemaBuilder extends SchemaFluentImpl implements VisitableBuilder{
SchemaFluent> fluent;
Boolean validationEnabled;
Validator validator;
public SchemaBuilder(){
this(true);
}
public SchemaBuilder(Boolean validationEnabled){
this(new Schema(), validationEnabled);
}
public SchemaBuilder(SchemaFluent> fluent){
this(fluent, true);
}
public SchemaBuilder(SchemaFluent> fluent,Boolean validationEnabled){
this(fluent, new Schema(), validationEnabled);
}
public SchemaBuilder(SchemaFluent> fluent,Schema instance){
this(fluent, instance, true);
}
public SchemaBuilder(SchemaFluent> fluent,Schema instance,Boolean validationEnabled){
this.fluent = fluent;
fluent.withApplication(instance.getApplication());
fluent.withApplicationList(instance.getApplicationList());
this.validationEnabled = validationEnabled;
}
public SchemaBuilder(Schema instance){
this(instance,true);
}
public SchemaBuilder(Schema instance,Boolean validationEnabled){
this.fluent = this;
this.withApplication(instance.getApplication());
this.withApplicationList(instance.getApplicationList());
this.validationEnabled = validationEnabled;
}
public SchemaBuilder(Validator validator){
this(new Schema(), true);
}
public SchemaBuilder(SchemaFluent> fluent,Schema instance,Validator validator){
this.fluent = fluent;
fluent.withApplication(instance.getApplication());
fluent.withApplicationList(instance.getApplicationList());
this.validator = validator;
this.validationEnabled = validator != null;
}
public SchemaBuilder(Schema instance,Validator validator){
this.fluent = this;
this.withApplication(instance.getApplication());
this.withApplicationList(instance.getApplicationList());
this.validator = validator;
this.validationEnabled = validator != null;
}
public Schema build(){
Schema buildable = new Schema(fluent.getApplication(),fluent.getApplicationList());
if (validationEnabled) {io.fabric8.kubernetes.api.builder.ValidationUtils.validate(buildable, validator);}
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;
SchemaBuilder that = (SchemaBuilder) 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;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy