annotations.me.snowdrop.servicecatalog.api.model.ServiceInstanceSpecBuilder Maven / Gradle / Ivy
The newest version!
package me.snowdrop.servicecatalog.api.model;
import io.fabric8.kubernetes.api.builder.VisitableBuilder;
import java.lang.Object;
import java.lang.Boolean;
import javax.validation.Validator;
public class ServiceInstanceSpecBuilder extends ServiceInstanceSpecFluentImpl implements VisitableBuilder{
ServiceInstanceSpecFluent> fluent;
Boolean validationEnabled;
Validator validator;
public ServiceInstanceSpecBuilder(){
this(true);
}
public ServiceInstanceSpecBuilder(Boolean validationEnabled){
this(new ServiceInstanceSpec(), validationEnabled);
}
public ServiceInstanceSpecBuilder(ServiceInstanceSpecFluent> fluent){
this(fluent, true);
}
public ServiceInstanceSpecBuilder(ServiceInstanceSpecFluent> fluent,Boolean validationEnabled){
this(fluent, new ServiceInstanceSpec(), validationEnabled);
}
public ServiceInstanceSpecBuilder(ServiceInstanceSpecFluent> fluent,ServiceInstanceSpec instance){
this(fluent, instance, true);
}
public ServiceInstanceSpecBuilder(ServiceInstanceSpecFluent> fluent,ServiceInstanceSpec instance,Boolean validationEnabled){
this.fluent = fluent;
fluent.withClusterServiceClassExternalID(instance.getClusterServiceClassExternalID());
fluent.withClusterServiceClassExternalName(instance.getClusterServiceClassExternalName());
fluent.withClusterServiceClassName(instance.getClusterServiceClassName());
fluent.withClusterServiceClassRef(instance.getClusterServiceClassRef());
fluent.withClusterServicePlanExternalID(instance.getClusterServicePlanExternalID());
fluent.withClusterServicePlanExternalName(instance.getClusterServicePlanExternalName());
fluent.withClusterServicePlanName(instance.getClusterServicePlanName());
fluent.withClusterServicePlanRef(instance.getClusterServicePlanRef());
fluent.withExternalID(instance.getExternalID());
fluent.withParameters(instance.getParameters());
fluent.withParametersFrom(instance.getParametersFrom());
fluent.withUpdateRequests(instance.getUpdateRequests());
fluent.withUserInfo(instance.getUserInfo());
this.validationEnabled = validationEnabled;
}
public ServiceInstanceSpecBuilder(ServiceInstanceSpec instance){
this(instance,true);
}
public ServiceInstanceSpecBuilder(ServiceInstanceSpec instance,Boolean validationEnabled){
this.fluent = this;
this.withClusterServiceClassExternalID(instance.getClusterServiceClassExternalID());
this.withClusterServiceClassExternalName(instance.getClusterServiceClassExternalName());
this.withClusterServiceClassName(instance.getClusterServiceClassName());
this.withClusterServiceClassRef(instance.getClusterServiceClassRef());
this.withClusterServicePlanExternalID(instance.getClusterServicePlanExternalID());
this.withClusterServicePlanExternalName(instance.getClusterServicePlanExternalName());
this.withClusterServicePlanName(instance.getClusterServicePlanName());
this.withClusterServicePlanRef(instance.getClusterServicePlanRef());
this.withExternalID(instance.getExternalID());
this.withParameters(instance.getParameters());
this.withParametersFrom(instance.getParametersFrom());
this.withUpdateRequests(instance.getUpdateRequests());
this.withUserInfo(instance.getUserInfo());
this.validationEnabled = validationEnabled;
}
public ServiceInstanceSpecBuilder(Validator validator){
this(new ServiceInstanceSpec(), true);
}
public ServiceInstanceSpecBuilder(ServiceInstanceSpecFluent> fluent,ServiceInstanceSpec instance,Validator validator){
this.fluent = fluent;
fluent.withClusterServiceClassExternalID(instance.getClusterServiceClassExternalID());
fluent.withClusterServiceClassExternalName(instance.getClusterServiceClassExternalName());
fluent.withClusterServiceClassName(instance.getClusterServiceClassName());
fluent.withClusterServiceClassRef(instance.getClusterServiceClassRef());
fluent.withClusterServicePlanExternalID(instance.getClusterServicePlanExternalID());
fluent.withClusterServicePlanExternalName(instance.getClusterServicePlanExternalName());
fluent.withClusterServicePlanName(instance.getClusterServicePlanName());
fluent.withClusterServicePlanRef(instance.getClusterServicePlanRef());
fluent.withExternalID(instance.getExternalID());
fluent.withParameters(instance.getParameters());
fluent.withParametersFrom(instance.getParametersFrom());
fluent.withUpdateRequests(instance.getUpdateRequests());
fluent.withUserInfo(instance.getUserInfo());
this.validator = validator;
this.validationEnabled = validator != null;
}
public ServiceInstanceSpecBuilder(ServiceInstanceSpec instance,Validator validator){
this.fluent = this;
this.withClusterServiceClassExternalID(instance.getClusterServiceClassExternalID());
this.withClusterServiceClassExternalName(instance.getClusterServiceClassExternalName());
this.withClusterServiceClassName(instance.getClusterServiceClassName());
this.withClusterServiceClassRef(instance.getClusterServiceClassRef());
this.withClusterServicePlanExternalID(instance.getClusterServicePlanExternalID());
this.withClusterServicePlanExternalName(instance.getClusterServicePlanExternalName());
this.withClusterServicePlanName(instance.getClusterServicePlanName());
this.withClusterServicePlanRef(instance.getClusterServicePlanRef());
this.withExternalID(instance.getExternalID());
this.withParameters(instance.getParameters());
this.withParametersFrom(instance.getParametersFrom());
this.withUpdateRequests(instance.getUpdateRequests());
this.withUserInfo(instance.getUserInfo());
this.validator = validator;
this.validationEnabled = validator != null;
}
public ServiceInstanceSpec build(){
ServiceInstanceSpec buildable = new ServiceInstanceSpec(fluent.getClusterServiceClassExternalID(),fluent.getClusterServiceClassExternalName(),fluent.getClusterServiceClassName(),fluent.getClusterServiceClassRef(),fluent.getClusterServicePlanExternalID(),fluent.getClusterServicePlanExternalName(),fluent.getClusterServicePlanName(),fluent.getClusterServicePlanRef(),fluent.getExternalID(),fluent.getParameters(),fluent.getParametersFrom(),fluent.getUpdateRequests(),fluent.getUserInfo());
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;
ServiceInstanceSpecBuilder that = (ServiceInstanceSpecBuilder) 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