me.snowdrop.istio.adapter.prometheus.PrometheusListBuilder Maven / Gradle / Ivy
package me.snowdrop.istio.adapter.prometheus;
import io.fabric8.kubernetes.api.builder.VisitableBuilder;
import java.lang.Object;
import java.lang.Boolean;
import javax.validation.Validator;
public class PrometheusListBuilder extends PrometheusListFluentImpl implements VisitableBuilder{
PrometheusListFluent> fluent;
Boolean validationEnabled;
Validator validator;
public PrometheusListBuilder(){
this(true);
}
public PrometheusListBuilder(Boolean validationEnabled){
this(new PrometheusList(), validationEnabled);
}
public PrometheusListBuilder(PrometheusListFluent> fluent){
this(fluent, true);
}
public PrometheusListBuilder(PrometheusListFluent> fluent,Boolean validationEnabled){
this(fluent, new PrometheusList(), validationEnabled);
}
public PrometheusListBuilder(PrometheusListFluent> fluent,PrometheusList instance){
this(fluent, instance, true);
}
public PrometheusListBuilder(PrometheusListFluent> fluent,PrometheusList instance,Boolean validationEnabled){
this.fluent = fluent;
fluent.withApiVersion(instance.getApiVersion());
fluent.withItems(instance.getItems());
fluent.withKind(instance.getKind());
fluent.withMetadata(instance.getMetadata());
this.validationEnabled = validationEnabled;
}
public PrometheusListBuilder(PrometheusList instance){
this(instance,true);
}
public PrometheusListBuilder(PrometheusList instance,Boolean validationEnabled){
this.fluent = this;
this.withApiVersion(instance.getApiVersion());
this.withItems(instance.getItems());
this.withKind(instance.getKind());
this.withMetadata(instance.getMetadata());
this.validationEnabled = validationEnabled;
}
public PrometheusListBuilder(Validator validator){
this(new PrometheusList(), true);
}
public PrometheusListBuilder(PrometheusListFluent> fluent,PrometheusList instance,Validator validator){
this.fluent = fluent;
fluent.withApiVersion(instance.getApiVersion());
fluent.withItems(instance.getItems());
fluent.withKind(instance.getKind());
fluent.withMetadata(instance.getMetadata());
this.validator = validator;
this.validationEnabled = validator != null;
}
public PrometheusListBuilder(PrometheusList instance,Validator validator){
this.fluent = this;
this.withApiVersion(instance.getApiVersion());
this.withItems(instance.getItems());
this.withKind(instance.getKind());
this.withMetadata(instance.getMetadata());
this.validator = validator;
this.validationEnabled = validator != null;
}
public PrometheusList build(){
PrometheusList buildable = new PrometheusList(fluent.getApiVersion(),fluent.getItems(),fluent.getKind(),fluent.getMetadata());
if (validationEnabled) {io.fabric8.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;
PrometheusListBuilder that = (PrometheusListBuilder) 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 - 2025 Weber Informatics LLC | Privacy Policy