io.kroxylicious.proxy.config.admin.EndpointsConfigurationFluent Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of kroxylicious-integration-test-support Show documentation
Show all versions of kroxylicious-integration-test-support Show documentation
Support code to simplify writing integration tests for filters
package io.kroxylicious.proxy.config.admin;
import java.lang.SuppressWarnings;
import io.kroxylicious.proxy.config.model.BaseFluent;
import io.kroxylicious.proxy.config.model.Nested;
import java.lang.Object;
import java.lang.String;
/**
* Generated
*/
@SuppressWarnings("unchecked")
public class EndpointsConfigurationFluent> extends BaseFluent{
public EndpointsConfigurationFluent() {
}
public EndpointsConfigurationFluent(EndpointsConfiguration instance) {
this.copyInstance(instance);
}
private PrometheusMetricsConfigBuilder prometheus;
protected void copyInstance(EndpointsConfiguration instance) {
if (instance != null) {
this.withPrometheus(instance.prometheus());
}
}
public PrometheusMetricsConfig buildPrometheus() {
return this.prometheus != null ? this.prometheus.build() : null;
}
public A withPrometheus(PrometheusMetricsConfig prometheus) {
this._visitables.remove("prometheus");
if (prometheus != null) {
this.prometheus = new PrometheusMetricsConfigBuilder(prometheus);
this._visitables.get("prometheus").add(this.prometheus);
} else {
this.prometheus = null;
this._visitables.get("prometheus").remove(this.prometheus);
}
return (A) this;
}
public boolean hasPrometheus() {
return this.prometheus != null;
}
public PrometheusNested withNewPrometheus() {
return new PrometheusNested(null);
}
public PrometheusNested withNewPrometheusLike(PrometheusMetricsConfig item) {
return new PrometheusNested(item);
}
public PrometheusNested editPrometheus() {
return withNewPrometheusLike(java.util.Optional.ofNullable(buildPrometheus()).orElse(null));
}
public PrometheusNested editOrNewPrometheus() {
return withNewPrometheusLike(java.util.Optional.ofNullable(buildPrometheus()).orElse(new PrometheusMetricsConfigBuilder().build()));
}
public PrometheusNested editOrNewPrometheusLike(PrometheusMetricsConfig item) {
return withNewPrometheusLike(java.util.Optional.ofNullable(buildPrometheus()).orElse(item));
}
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
EndpointsConfigurationFluent that = (EndpointsConfigurationFluent) o;
if (!java.util.Objects.equals(prometheus, that.prometheus)) return false;
return true;
}
public int hashCode() {
return java.util.Objects.hash(prometheus, super.hashCode());
}
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (prometheus != null) { sb.append("prometheus:"); sb.append(prometheus); }
sb.append("}");
return sb.toString();
}
public class PrometheusNested extends PrometheusMetricsConfigFluent> implements Nested{
PrometheusNested(PrometheusMetricsConfig item) {
this.builder = new PrometheusMetricsConfigBuilder(this, item);
}
PrometheusMetricsConfigBuilder builder;
public N and() {
return (N) EndpointsConfigurationFluent.this.withPrometheus(builder.build());
}
public N endPrometheus() {
return and();
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy