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

io.fabric8.certmanager.api.model.acme.v1.ACMEChallengeSolverHTTP01Fluent Maven / Gradle / Ivy

The newest version!
package io.fabric8.certmanager.api.model.acme.v1;

import java.lang.SuppressWarnings;
import io.fabric8.kubernetes.api.builder.Nested;
import java.lang.String;
import java.util.LinkedHashMap;
import io.fabric8.kubernetes.api.builder.BaseFluent;
import java.lang.Object;
import java.util.Map;

/**
 * Generated
 */
@SuppressWarnings("unchecked")
public class ACMEChallengeSolverHTTP01Fluent> extends BaseFluent{
  public ACMEChallengeSolverHTTP01Fluent() {
  }
  
  public ACMEChallengeSolverHTTP01Fluent(ACMEChallengeSolverHTTP01 instance) {
    this.copyInstance(instance);
  }
  private ACMEChallengeSolverHTTP01GatewayHTTPRouteBuilder gatewayHTTPRoute;
  private ACMEChallengeSolverHTTP01IngressBuilder ingress;
  private Map additionalProperties;
  
  protected void copyInstance(ACMEChallengeSolverHTTP01 instance) {
    instance = (instance != null ? instance : new ACMEChallengeSolverHTTP01());
    if (instance != null) {
          this.withGatewayHTTPRoute(instance.getGatewayHTTPRoute());
          this.withIngress(instance.getIngress());
          this.withAdditionalProperties(instance.getAdditionalProperties());
        }
  }
  
  public ACMEChallengeSolverHTTP01GatewayHTTPRoute buildGatewayHTTPRoute() {
    return this.gatewayHTTPRoute != null ? this.gatewayHTTPRoute.build() : null;
  }
  
  public A withGatewayHTTPRoute(ACMEChallengeSolverHTTP01GatewayHTTPRoute gatewayHTTPRoute) {
    this._visitables.remove("gatewayHTTPRoute");
    if (gatewayHTTPRoute != null) {
        this.gatewayHTTPRoute = new ACMEChallengeSolverHTTP01GatewayHTTPRouteBuilder(gatewayHTTPRoute);
        this._visitables.get("gatewayHTTPRoute").add(this.gatewayHTTPRoute);
    } else {
        this.gatewayHTTPRoute = null;
        this._visitables.get("gatewayHTTPRoute").remove(this.gatewayHTTPRoute);
    }
    return (A) this;
  }
  
  public boolean hasGatewayHTTPRoute() {
    return this.gatewayHTTPRoute != null;
  }
  
  public GatewayHTTPRouteNested withNewGatewayHTTPRoute() {
    return new GatewayHTTPRouteNested(null);
  }
  
  public GatewayHTTPRouteNested withNewGatewayHTTPRouteLike(ACMEChallengeSolverHTTP01GatewayHTTPRoute item) {
    return new GatewayHTTPRouteNested(item);
  }
  
  public GatewayHTTPRouteNested editGatewayHTTPRoute() {
    return withNewGatewayHTTPRouteLike(java.util.Optional.ofNullable(buildGatewayHTTPRoute()).orElse(null));
  }
  
  public GatewayHTTPRouteNested editOrNewGatewayHTTPRoute() {
    return withNewGatewayHTTPRouteLike(java.util.Optional.ofNullable(buildGatewayHTTPRoute()).orElse(new ACMEChallengeSolverHTTP01GatewayHTTPRouteBuilder().build()));
  }
  
  public GatewayHTTPRouteNested editOrNewGatewayHTTPRouteLike(ACMEChallengeSolverHTTP01GatewayHTTPRoute item) {
    return withNewGatewayHTTPRouteLike(java.util.Optional.ofNullable(buildGatewayHTTPRoute()).orElse(item));
  }
  
  public ACMEChallengeSolverHTTP01Ingress buildIngress() {
    return this.ingress != null ? this.ingress.build() : null;
  }
  
  public A withIngress(ACMEChallengeSolverHTTP01Ingress ingress) {
    this._visitables.remove("ingress");
    if (ingress != null) {
        this.ingress = new ACMEChallengeSolverHTTP01IngressBuilder(ingress);
        this._visitables.get("ingress").add(this.ingress);
    } else {
        this.ingress = null;
        this._visitables.get("ingress").remove(this.ingress);
    }
    return (A) this;
  }
  
  public boolean hasIngress() {
    return this.ingress != null;
  }
  
  public IngressNested withNewIngress() {
    return new IngressNested(null);
  }
  
  public IngressNested withNewIngressLike(ACMEChallengeSolverHTTP01Ingress item) {
    return new IngressNested(item);
  }
  
  public IngressNested editIngress() {
    return withNewIngressLike(java.util.Optional.ofNullable(buildIngress()).orElse(null));
  }
  
  public IngressNested editOrNewIngress() {
    return withNewIngressLike(java.util.Optional.ofNullable(buildIngress()).orElse(new ACMEChallengeSolverHTTP01IngressBuilder().build()));
  }
  
  public IngressNested editOrNewIngressLike(ACMEChallengeSolverHTTP01Ingress item) {
    return withNewIngressLike(java.util.Optional.ofNullable(buildIngress()).orElse(item));
  }
  
  public A addToAdditionalProperties(String key,Object value) {
    if(this.additionalProperties == null && key != null && value != null) { this.additionalProperties = new LinkedHashMap(); }
    if(key != null && value != null) {this.additionalProperties.put(key, value);} return (A)this;
  }
  
  public A addToAdditionalProperties(Map map) {
    if(this.additionalProperties == null && map != null) { this.additionalProperties = new LinkedHashMap(); }
    if(map != null) { this.additionalProperties.putAll(map);} return (A)this;
  }
  
  public A removeFromAdditionalProperties(String key) {
    if(this.additionalProperties == null) { return (A) this; }
    if(key != null && this.additionalProperties != null) {this.additionalProperties.remove(key);} return (A)this;
  }
  
  public A removeFromAdditionalProperties(Map map) {
    if(this.additionalProperties == null) { return (A) this; }
    if(map != null) { for(Object key : map.keySet()) {if (this.additionalProperties != null){this.additionalProperties.remove(key);}}} return (A)this;
  }
  
  public Map getAdditionalProperties() {
    return this.additionalProperties;
  }
  
  public A withAdditionalProperties(Map additionalProperties) {
    if (additionalProperties == null) {
      this.additionalProperties = null;
    } else {
      this.additionalProperties = new LinkedHashMap(additionalProperties);
    }
    return (A) this;
  }
  
  public boolean hasAdditionalProperties() {
    return this.additionalProperties != null;
  }
  
  public boolean equals(Object o) {
    if (this == o) return true;
    if (o == null || getClass() != o.getClass()) return false;
    if (!super.equals(o)) return false;
    ACMEChallengeSolverHTTP01Fluent that = (ACMEChallengeSolverHTTP01Fluent) o;
    if (!java.util.Objects.equals(gatewayHTTPRoute, that.gatewayHTTPRoute)) return false;
    if (!java.util.Objects.equals(ingress, that.ingress)) return false;
    if (!java.util.Objects.equals(additionalProperties, that.additionalProperties)) return false;
    return true;
  }
  
  public int hashCode() {
    return java.util.Objects.hash(gatewayHTTPRoute,  ingress,  additionalProperties,  super.hashCode());
  }
  
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("{");
    if (gatewayHTTPRoute != null) { sb.append("gatewayHTTPRoute:"); sb.append(gatewayHTTPRoute + ","); }
    if (ingress != null) { sb.append("ingress:"); sb.append(ingress + ","); }
    if (additionalProperties != null && !additionalProperties.isEmpty()) { sb.append("additionalProperties:"); sb.append(additionalProperties); }
    sb.append("}");
    return sb.toString();
  }
  public class GatewayHTTPRouteNested extends ACMEChallengeSolverHTTP01GatewayHTTPRouteFluent> implements Nested{
    GatewayHTTPRouteNested(ACMEChallengeSolverHTTP01GatewayHTTPRoute item) {
      this.builder = new ACMEChallengeSolverHTTP01GatewayHTTPRouteBuilder(this, item);
    }
    ACMEChallengeSolverHTTP01GatewayHTTPRouteBuilder builder;
    
    public N and() {
      return (N) ACMEChallengeSolverHTTP01Fluent.this.withGatewayHTTPRoute(builder.build());
    }
    
    public N endGatewayHTTPRoute() {
      return and();
    }
    
  
  }
  public class IngressNested extends ACMEChallengeSolverHTTP01IngressFluent> implements Nested{
    IngressNested(ACMEChallengeSolverHTTP01Ingress item) {
      this.builder = new ACMEChallengeSolverHTTP01IngressBuilder(this, item);
    }
    ACMEChallengeSolverHTTP01IngressBuilder builder;
    
    public N and() {
      return (N) ACMEChallengeSolverHTTP01Fluent.this.withIngress(builder.build());
    }
    
    public N endIngress() {
      return and();
    }
    
  
  }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy