me.snowdrop.istio.api.networking.v1alpha3.EndpointBuilder Maven / Gradle / Ivy
package me.snowdrop.istio.api.networking.v1alpha3;
import io.fabric8.kubernetes.api.builder.VisitableBuilder;
import java.lang.Object;
import java.lang.Boolean;
import javax.validation.Validator;
public class EndpointBuilder extends EndpointFluentImpl implements VisitableBuilder{
EndpointFluent> fluent;
Boolean validationEnabled;
Validator validator;
public EndpointBuilder(){
this(true);
}
public EndpointBuilder(Boolean validationEnabled){
this(new Endpoint(), validationEnabled);
}
public EndpointBuilder(EndpointFluent> fluent){
this(fluent, true);
}
public EndpointBuilder(EndpointFluent> fluent,Boolean validationEnabled){
this(fluent, new Endpoint(), validationEnabled);
}
public EndpointBuilder(EndpointFluent> fluent,Endpoint instance){
this(fluent, instance, true);
}
public EndpointBuilder(EndpointFluent> fluent,Endpoint instance,Boolean validationEnabled){
this.fluent = fluent;
fluent.withAddress(instance.getAddress());
fluent.withLabels(instance.getLabels());
fluent.withLocality(instance.getLocality());
fluent.withNetwork(instance.getNetwork());
fluent.withPorts(instance.getPorts());
fluent.withWeight(instance.getWeight());
this.validationEnabled = validationEnabled;
}
public EndpointBuilder(Endpoint instance){
this(instance,true);
}
public EndpointBuilder(Endpoint instance,Boolean validationEnabled){
this.fluent = this;
this.withAddress(instance.getAddress());
this.withLabels(instance.getLabels());
this.withLocality(instance.getLocality());
this.withNetwork(instance.getNetwork());
this.withPorts(instance.getPorts());
this.withWeight(instance.getWeight());
this.validationEnabled = validationEnabled;
}
public EndpointBuilder(Validator validator){
this(new Endpoint(), true);
}
public EndpointBuilder(EndpointFluent> fluent,Endpoint instance,Validator validator){
this.fluent = fluent;
fluent.withAddress(instance.getAddress());
fluent.withLabels(instance.getLabels());
fluent.withLocality(instance.getLocality());
fluent.withNetwork(instance.getNetwork());
fluent.withPorts(instance.getPorts());
fluent.withWeight(instance.getWeight());
this.validator = validator;
this.validationEnabled = validator != null;
}
public EndpointBuilder(Endpoint instance,Validator validator){
this.fluent = this;
this.withAddress(instance.getAddress());
this.withLabels(instance.getLabels());
this.withLocality(instance.getLocality());
this.withNetwork(instance.getNetwork());
this.withPorts(instance.getPorts());
this.withWeight(instance.getWeight());
this.validator = validator;
this.validationEnabled = validator != null;
}
public Endpoint build(){
Endpoint buildable = new Endpoint(fluent.getAddress(),fluent.getLabels(),fluent.getLocality(),fluent.getNetwork(),fluent.getPorts(),fluent.getWeight());
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;
EndpointBuilder that = (EndpointBuilder) 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