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

io.kroxylicious.proxy.config.admin.AdminHttpConfigurationFluent 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.Nested;
import java.lang.String;
import java.lang.Integer;
import io.kroxylicious.proxy.config.model.BaseFluent;
import java.lang.Object;

/**
 * Generated
 */
@SuppressWarnings("unchecked")
public class AdminHttpConfigurationFluent> extends BaseFluent{
  public AdminHttpConfigurationFluent() {
  }
  
  public AdminHttpConfigurationFluent(AdminHttpConfiguration instance) {
    this.copyInstance(instance);
  }
  private String host;
  private Integer port;
  private EndpointsConfigurationBuilder endpoints;
  
  protected void copyInstance(AdminHttpConfiguration instance) {
    if (instance != null) {
          this.withHost(instance.host());
          this.withPort(instance.port());
          this.withEndpoints(instance.endpoints());
        }
  }
  
  public String getHost() {
    return this.host;
  }
  
  public A withHost(String host) {
    this.host = host;
    return (A) this;
  }
  
  public boolean hasHost() {
    return this.host != null;
  }
  
  public Integer getPort() {
    return this.port;
  }
  
  public A withPort(Integer port) {
    this.port = port;
    return (A) this;
  }
  
  public boolean hasPort() {
    return this.port != null;
  }
  
  public EndpointsConfiguration buildEndpoints() {
    return this.endpoints != null ? this.endpoints.build() : null;
  }
  
  public A withEndpoints(EndpointsConfiguration endpoints) {
    this._visitables.remove("endpoints");
    if (endpoints != null) {
        this.endpoints = new EndpointsConfigurationBuilder(endpoints);
        this._visitables.get("endpoints").add(this.endpoints);
    } else {
        this.endpoints = null;
        this._visitables.get("endpoints").remove(this.endpoints);
    }
    return (A) this;
  }
  
  public boolean hasEndpoints() {
    return this.endpoints != null;
  }
  
  public EndpointsNested withNewEndpoints() {
    return new EndpointsNested(null);
  }
  
  public EndpointsNested withNewEndpointsLike(EndpointsConfiguration item) {
    return new EndpointsNested(item);
  }
  
  public EndpointsNested editEndpoints() {
    return withNewEndpointsLike(java.util.Optional.ofNullable(buildEndpoints()).orElse(null));
  }
  
  public EndpointsNested editOrNewEndpoints() {
    return withNewEndpointsLike(java.util.Optional.ofNullable(buildEndpoints()).orElse(new EndpointsConfigurationBuilder().build()));
  }
  
  public EndpointsNested editOrNewEndpointsLike(EndpointsConfiguration item) {
    return withNewEndpointsLike(java.util.Optional.ofNullable(buildEndpoints()).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;
    AdminHttpConfigurationFluent that = (AdminHttpConfigurationFluent) o;
    if (!java.util.Objects.equals(host, that.host)) return false;
    if (!java.util.Objects.equals(port, that.port)) return false;
    if (!java.util.Objects.equals(endpoints, that.endpoints)) return false;
    return true;
  }
  
  public int hashCode() {
    return java.util.Objects.hash(host,  port,  endpoints,  super.hashCode());
  }
  
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("{");
    if (host != null) { sb.append("host:"); sb.append(host + ","); }
    if (port != null) { sb.append("port:"); sb.append(port + ","); }
    if (endpoints != null) { sb.append("endpoints:"); sb.append(endpoints); }
    sb.append("}");
    return sb.toString();
  }
  public class EndpointsNested extends EndpointsConfigurationFluent> implements Nested{
    EndpointsNested(EndpointsConfiguration item) {
      this.builder = new EndpointsConfigurationBuilder(this, item);
    }
    EndpointsConfigurationBuilder builder;
    
    public N and() {
      return (N) AdminHttpConfigurationFluent.this.withEndpoints(builder.build());
    }
    
    public N endEndpoints() {
      return and();
    }
    
  
  }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy