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

io.fabric8.kubernetes.api.model.extensions.IngressBackendFluentImpl Maven / Gradle / Ivy

package io.fabric8.kubernetes.api.model.extensions;

import io.fabric8.kubernetes.api.model.IntOrString;
import io.fabric8.kubernetes.api.builder.Nested;
import io.fabric8.kubernetes.api.model.TypedLocalObjectReference;
import java.lang.String;
import io.fabric8.kubernetes.api.model.IntOrStringBuilder;
import java.util.LinkedHashMap;
import java.lang.Integer;
import java.lang.Deprecated;
import io.fabric8.kubernetes.api.builder.BaseFluent;
import java.lang.Object;
import io.fabric8.kubernetes.api.model.IntOrStringFluentImpl;
import java.lang.Boolean;
import java.util.Map;

 /**
  * Generated
  */
public class IngressBackendFluentImpl> extends io.fabric8.kubernetes.api.builder.BaseFluent implements io.fabric8.kubernetes.api.model.extensions.IngressBackendFluent{
  public IngressBackendFluentImpl() {
  }
  public IngressBackendFluentImpl(io.fabric8.kubernetes.api.model.extensions.IngressBackend instance) {
    this.withResource(instance.getResource()); 
    this.withServiceName(instance.getServiceName()); 
    this.withServicePort(instance.getServicePort()); 
    this.withAdditionalProperties(instance.getAdditionalProperties());

  }
  private io.fabric8.kubernetes.api.model.TypedLocalObjectReference resource;
  private java.lang.String serviceName;
  private io.fabric8.kubernetes.api.model.IntOrStringBuilder servicePort;
  private java.util.Map additionalProperties;
  public io.fabric8.kubernetes.api.model.TypedLocalObjectReference getResource() {
    return this.resource;
  }
  public A withResource(io.fabric8.kubernetes.api.model.TypedLocalObjectReference resource) {
    this.resource=resource; return (A) this;
  }
  public java.lang.Boolean hasResource() {
    return this.resource != null;
  }
  public A withNewResource(java.lang.String apiGroup,java.lang.String kind,java.lang.String name) {
    return (A)withResource(new TypedLocalObjectReference(apiGroup, kind, name));
  }
  public java.lang.String getServiceName() {
    return this.serviceName;
  }
  public A withServiceName(java.lang.String serviceName) {
    this.serviceName=serviceName; return (A) this;
  }
  public java.lang.Boolean hasServiceName() {
    return this.serviceName != null;
  }
  
  /**
   * Method is deprecated. use withServiceName instead.
   */
  @java.lang.Deprecated
  public A withNewServiceName(java.lang.String arg0) {
    return (A)withServiceName(new String(arg0));
  }
  
  /**
   * This method has been deprecated, please use method buildServicePort instead.
   * @return The buildable object.
   */
  @java.lang.Deprecated
  public io.fabric8.kubernetes.api.model.IntOrString getServicePort() {
    return this.servicePort!=null?this.servicePort.build():null;
  }
  public io.fabric8.kubernetes.api.model.IntOrString buildServicePort() {
    return this.servicePort!=null?this.servicePort.build():null;
  }
  public A withServicePort(io.fabric8.kubernetes.api.model.IntOrString servicePort) {
    _visitables.get("servicePort").remove(this.servicePort);
    if (servicePort!=null){ this.servicePort= new io.fabric8.kubernetes.api.model.IntOrStringBuilder(servicePort); _visitables.get("servicePort").add(this.servicePort);} return (A) this;
  }
  public java.lang.Boolean hasServicePort() {
    return this.servicePort != null;
  }
  public A withNewServicePort(java.lang.Integer intVal) {
    return (A)withServicePort(new IntOrString(intVal));
  }
  public A withNewServicePort(java.lang.String strVal) {
    return (A)withServicePort(new IntOrString(strVal));
  }
  public io.fabric8.kubernetes.api.model.extensions.IngressBackendFluent.ServicePortNested withNewServicePort() {
    return new io.fabric8.kubernetes.api.model.extensions.IngressBackendFluentImpl.ServicePortNestedImpl();
  }
  public io.fabric8.kubernetes.api.model.extensions.IngressBackendFluent.ServicePortNested withNewServicePortLike(io.fabric8.kubernetes.api.model.IntOrString item) {
    return new io.fabric8.kubernetes.api.model.extensions.IngressBackendFluentImpl.ServicePortNestedImpl(item);
  }
  public io.fabric8.kubernetes.api.model.extensions.IngressBackendFluent.ServicePortNested editServicePort() {
    return withNewServicePortLike(getServicePort());
  }
  public io.fabric8.kubernetes.api.model.extensions.IngressBackendFluent.ServicePortNested editOrNewServicePort() {
    return withNewServicePortLike(getServicePort() != null ? getServicePort(): new io.fabric8.kubernetes.api.model.IntOrStringBuilder().build());
  }
  public io.fabric8.kubernetes.api.model.extensions.IngressBackendFluent.ServicePortNested editOrNewServicePortLike(io.fabric8.kubernetes.api.model.IntOrString item) {
    return withNewServicePortLike(getServicePort() != null ? getServicePort(): item);
  }
  public A addToAdditionalProperties(java.lang.String key,java.lang.Object value) {
    if(this.additionalProperties == null && key != null && value != null) { this.additionalProperties = new java.util.LinkedHashMap(); }
    if(key != null && value != null) {this.additionalProperties.put(key, value);} return (A)this;
  }
  public A addToAdditionalProperties(java.util.Map map) {
    if(this.additionalProperties == null && map != null) { this.additionalProperties = new java.util.LinkedHashMap(); }
    if(map != null) { this.additionalProperties.putAll(map);} return (A)this;
  }
  public A removeFromAdditionalProperties(java.lang.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(java.util.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 java.util.Map getAdditionalProperties() {
    return this.additionalProperties;
  }
  public A withAdditionalProperties(java.util.Map additionalProperties) {
    if (additionalProperties == null) { this.additionalProperties =  null;} else {this.additionalProperties = new java.util.LinkedHashMap(additionalProperties);} return (A) this;
  }
  public java.lang.Boolean hasAdditionalProperties() {
    return this.additionalProperties != null;
  }
  public boolean equals(java.lang.Object o) {
    if (this == o) return true;
    if (o == null || getClass() != o.getClass()) return false;
    IngressBackendFluentImpl that = (IngressBackendFluentImpl) o;
    if (resource != null ? !resource.equals(that.resource) :that.resource != null) return false;
    if (serviceName != null ? !serviceName.equals(that.serviceName) :that.serviceName != null) return false;
    if (servicePort != null ? !servicePort.equals(that.servicePort) :that.servicePort != null) return false;
    if (additionalProperties != null ? !additionalProperties.equals(that.additionalProperties) :that.additionalProperties != null) return false;
    return true;
  }
  public int hashCode() {
    return java.util.Objects.hash(resource,  serviceName,  servicePort,  additionalProperties,  super.hashCode());
  }
  public class ServicePortNestedImpl extends io.fabric8.kubernetes.api.model.IntOrStringFluentImpl> implements io.fabric8.kubernetes.api.model.extensions.IngressBackendFluent.ServicePortNested,io.fabric8.kubernetes.api.builder.Nested{
    ServicePortNestedImpl(io.fabric8.kubernetes.api.model.IntOrString item) {
      this.builder = new io.fabric8.kubernetes.api.model.IntOrStringBuilder(this, item);
    }
    ServicePortNestedImpl() {
      this.builder = new io.fabric8.kubernetes.api.model.IntOrStringBuilder(this);
    }
    io.fabric8.kubernetes.api.model.IntOrStringBuilder builder;
    public N and() {
      return (N) IngressBackendFluentImpl.this.withServicePort(builder.build());
    }
    public N endServicePort() {
      return and();
    }
    
  }
  
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy