io.fabric8.knative.eventing.contrib.prometheus.v1alpha1.PrometheusSourceSpecFluentImpl Maven / Gradle / Ivy
package io.fabric8.knative.eventing.contrib.prometheus.v1alpha1;
import io.fabric8.knative.internal.pkg.apis.duck.v1.Destination;
import java.lang.SuppressWarnings;
import io.fabric8.kubernetes.api.builder.Nested;
import java.lang.String;
import java.lang.Deprecated;
import io.fabric8.knative.internal.pkg.apis.duck.v1.DestinationBuilder;
import io.fabric8.kubernetes.api.builder.BaseFluent;
import java.lang.Object;
import io.fabric8.knative.internal.pkg.apis.duck.v1.DestinationFluentImpl;
import java.lang.Boolean;
/**
* Generated
*/
@SuppressWarnings(value = "unchecked")
public class PrometheusSourceSpecFluentImpl> extends BaseFluent implements PrometheusSourceSpecFluent{
public PrometheusSourceSpecFluentImpl() {
}
public PrometheusSourceSpecFluentImpl(PrometheusSourceSpec instance) {
this.withAuthTokenFile(instance.getAuthTokenFile());
this.withCaCertConfigMap(instance.getCaCertConfigMap());
this.withPromQL(instance.getPromQL());
this.withSchedule(instance.getSchedule());
this.withServerURL(instance.getServerURL());
this.withServiceAccountName(instance.getServiceAccountName());
this.withSink(instance.getSink());
this.withStep(instance.getStep());
}
private String authTokenFile;
private String caCertConfigMap;
private String promQL;
private String schedule;
private String serverURL;
private String serviceAccountName;
private DestinationBuilder sink;
private String step;
public String getAuthTokenFile() {
return this.authTokenFile;
}
public A withAuthTokenFile(String authTokenFile) {
this.authTokenFile=authTokenFile; return (A) this;
}
public Boolean hasAuthTokenFile() {
return this.authTokenFile != null;
}
public String getCaCertConfigMap() {
return this.caCertConfigMap;
}
public A withCaCertConfigMap(String caCertConfigMap) {
this.caCertConfigMap=caCertConfigMap; return (A) this;
}
public Boolean hasCaCertConfigMap() {
return this.caCertConfigMap != null;
}
public String getPromQL() {
return this.promQL;
}
public A withPromQL(String promQL) {
this.promQL=promQL; return (A) this;
}
public Boolean hasPromQL() {
return this.promQL != null;
}
public String getSchedule() {
return this.schedule;
}
public A withSchedule(String schedule) {
this.schedule=schedule; return (A) this;
}
public Boolean hasSchedule() {
return this.schedule != null;
}
public String getServerURL() {
return this.serverURL;
}
public A withServerURL(String serverURL) {
this.serverURL=serverURL; return (A) this;
}
public Boolean hasServerURL() {
return this.serverURL != null;
}
public String getServiceAccountName() {
return this.serviceAccountName;
}
public A withServiceAccountName(String serviceAccountName) {
this.serviceAccountName=serviceAccountName; return (A) this;
}
public Boolean hasServiceAccountName() {
return this.serviceAccountName != null;
}
/**
* This method has been deprecated, please use method buildSink instead.
* @return The buildable object.
*/
@Deprecated
public Destination getSink() {
return this.sink!=null ?this.sink.build():null;
}
public Destination buildSink() {
return this.sink!=null ?this.sink.build():null;
}
public A withSink(Destination sink) {
_visitables.get("sink").remove(this.sink);
if (sink!=null){ this.sink= new DestinationBuilder(sink); _visitables.get("sink").add(this.sink);} else { this.sink = null; _visitables.get("sink").remove(this.sink); } return (A) this;
}
public Boolean hasSink() {
return this.sink != null;
}
public PrometheusSourceSpecFluent.SinkNested withNewSink() {
return new PrometheusSourceSpecFluentImpl.SinkNestedImpl();
}
public PrometheusSourceSpecFluent.SinkNested withNewSinkLike(Destination item) {
return new PrometheusSourceSpecFluentImpl.SinkNestedImpl(item);
}
public PrometheusSourceSpecFluent.SinkNested editSink() {
return withNewSinkLike(getSink());
}
public PrometheusSourceSpecFluent.SinkNested editOrNewSink() {
return withNewSinkLike(getSink() != null ? getSink(): new DestinationBuilder().build());
}
public PrometheusSourceSpecFluent.SinkNested editOrNewSinkLike(Destination item) {
return withNewSinkLike(getSink() != null ? getSink(): item);
}
public String getStep() {
return this.step;
}
public A withStep(String step) {
this.step=step; return (A) this;
}
public Boolean hasStep() {
return this.step != null;
}
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
PrometheusSourceSpecFluentImpl that = (PrometheusSourceSpecFluentImpl) o;
if (authTokenFile != null ? !authTokenFile.equals(that.authTokenFile) :that.authTokenFile != null) return false;
if (caCertConfigMap != null ? !caCertConfigMap.equals(that.caCertConfigMap) :that.caCertConfigMap != null) return false;
if (promQL != null ? !promQL.equals(that.promQL) :that.promQL != null) return false;
if (schedule != null ? !schedule.equals(that.schedule) :that.schedule != null) return false;
if (serverURL != null ? !serverURL.equals(that.serverURL) :that.serverURL != null) return false;
if (serviceAccountName != null ? !serviceAccountName.equals(that.serviceAccountName) :that.serviceAccountName != null) return false;
if (sink != null ? !sink.equals(that.sink) :that.sink != null) return false;
if (step != null ? !step.equals(that.step) :that.step != null) return false;
return true;
}
public int hashCode() {
return java.util.Objects.hash(authTokenFile, caCertConfigMap, promQL, schedule, serverURL, serviceAccountName, sink, step, super.hashCode());
}
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (authTokenFile != null) { sb.append("authTokenFile:"); sb.append(authTokenFile + ","); }
if (caCertConfigMap != null) { sb.append("caCertConfigMap:"); sb.append(caCertConfigMap + ","); }
if (promQL != null) { sb.append("promQL:"); sb.append(promQL + ","); }
if (schedule != null) { sb.append("schedule:"); sb.append(schedule + ","); }
if (serverURL != null) { sb.append("serverURL:"); sb.append(serverURL + ","); }
if (serviceAccountName != null) { sb.append("serviceAccountName:"); sb.append(serviceAccountName + ","); }
if (sink != null) { sb.append("sink:"); sb.append(sink + ","); }
if (step != null) { sb.append("step:"); sb.append(step); }
sb.append("}");
return sb.toString();
}
class SinkNestedImpl extends DestinationFluentImpl> implements PrometheusSourceSpecFluent.SinkNested,Nested{
SinkNestedImpl(Destination item) {
this.builder = new DestinationBuilder(this, item);
}
SinkNestedImpl() {
this.builder = new DestinationBuilder(this);
}
DestinationBuilder builder;
public N and() {
return (N) PrometheusSourceSpecFluentImpl.this.withSink(builder.build());
}
public N endSink() {
return and();
}
}
} © 2015 - 2025 Weber Informatics LLC | Privacy Policy