All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.kroxylicious.proxy.config.admin.EndpointsConfigurationFluent Maven / Gradle / Ivy

There is a newer version: 0.9.0
Show newest version
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