annotations.me.snowdrop.istio.api.model.v1.broker.ServicePlanBuilder Maven / Gradle / Ivy
package me.snowdrop.istio.api.model.v1.broker;
import me.snowdrop.istio.api.builder.VisitableBuilder;
import java.lang.Object;
import java.lang.Boolean;
public class ServicePlanBuilder extends ServicePlanFluentImpl implements me.snowdrop.istio.api.builder.VisitableBuilder{
ServicePlanFluent> fluent;
Boolean validationEnabled;
public ServicePlanBuilder(){
this(true);
}
public ServicePlanBuilder(Boolean validationEnabled){
this(new ServicePlan(), validationEnabled);
}
public ServicePlanBuilder(ServicePlanFluent> fluent){
this(fluent, true);
}
public ServicePlanBuilder(ServicePlanFluent> fluent,Boolean validationEnabled){
this(fluent, new ServicePlan(), validationEnabled);
}
public ServicePlanBuilder(ServicePlanFluent> fluent,ServicePlan instance){
this(fluent, instance, true);
}
public ServicePlanBuilder(ServicePlanFluent> fluent,ServicePlan instance,Boolean validationEnabled){
this.fluent = fluent;
fluent.withPlan(instance.getPlan());
fluent.withServices(instance.getServices());
this.validationEnabled = validationEnabled;
}
public ServicePlanBuilder(ServicePlan instance){
this(instance,true);
}
public ServicePlanBuilder(ServicePlan instance,Boolean validationEnabled){
this.fluent = this;
this.withPlan(instance.getPlan());
this.withServices(instance.getServices());
this.validationEnabled = validationEnabled;
}
public ServicePlan build(){
ServicePlan buildable = new ServicePlan(fluent.getPlan(),fluent.getServices());
me.snowdrop.istio.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;
ServicePlanBuilder that = (ServicePlanBuilder) 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