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

io.kubernetes.client.openapi.models.V1IngressBackendFluentImpl Maven / Gradle / Ivy

There is a newer version: 22.0.0
Show newest version
package io.kubernetes.client.openapi.models;

import java.lang.SuppressWarnings;
import io.kubernetes.client.fluent.Nested;
import java.lang.String;
import java.lang.Deprecated;
import io.kubernetes.client.fluent.BaseFluent;
import java.lang.Object;
import java.lang.Boolean;

 /**
  * Generated
  */
  @SuppressWarnings(value = "unchecked")
  public class V1IngressBackendFluentImpl> extends BaseFluent implements V1IngressBackendFluent{
  public V1IngressBackendFluentImpl() {
  }
  public V1IngressBackendFluentImpl(V1IngressBackend instance) {
    if (instance != null) {
      this.withResource(instance.getResource());
      this.withService(instance.getService());
    }
  }
  private V1TypedLocalObjectReferenceBuilder resource;
  private V1IngressServiceBackendBuilder service;
  
  /**
   * This method has been deprecated, please use method buildResource instead.
   * @return The buildable object.
   */
  @Deprecated
  public V1TypedLocalObjectReference getResource() {
    return this.resource!=null ?this.resource.build():null;
  }
  public V1TypedLocalObjectReference buildResource() {
    return this.resource!=null ?this.resource.build():null;
  }
  public A withResource(V1TypedLocalObjectReference resource) {
    _visitables.get("resource").remove(this.resource);
    if (resource!=null){ this.resource= new V1TypedLocalObjectReferenceBuilder(resource); _visitables.get("resource").add(this.resource);} else { this.resource = null; _visitables.get("resource").remove(this.resource); } return (A) this;
  }
  public Boolean hasResource() {
    return this.resource != null;
  }
  public V1IngressBackendFluentImpl.ResourceNested withNewResource() {
    return new V1IngressBackendFluentImpl.ResourceNestedImpl();
  }
  public V1IngressBackendFluentImpl.ResourceNested withNewResourceLike(V1TypedLocalObjectReference item) {
    return new V1IngressBackendFluentImpl.ResourceNestedImpl(item);
  }
  public V1IngressBackendFluentImpl.ResourceNested editResource() {
    return withNewResourceLike(getResource());
  }
  public V1IngressBackendFluentImpl.ResourceNested editOrNewResource() {
    return withNewResourceLike(getResource() != null ? getResource(): new V1TypedLocalObjectReferenceBuilder().build());
  }
  public V1IngressBackendFluentImpl.ResourceNested editOrNewResourceLike(V1TypedLocalObjectReference item) {
    return withNewResourceLike(getResource() != null ? getResource(): item);
  }
  
  /**
   * This method has been deprecated, please use method buildService instead.
   * @return The buildable object.
   */
  @Deprecated
  public V1IngressServiceBackend getService() {
    return this.service!=null ?this.service.build():null;
  }
  public V1IngressServiceBackend buildService() {
    return this.service!=null ?this.service.build():null;
  }
  public A withService(V1IngressServiceBackend service) {
    _visitables.get("service").remove(this.service);
    if (service!=null){ this.service= new V1IngressServiceBackendBuilder(service); _visitables.get("service").add(this.service);} else { this.service = null; _visitables.get("service").remove(this.service); } return (A) this;
  }
  public Boolean hasService() {
    return this.service != null;
  }
  public V1IngressBackendFluentImpl.ServiceNested withNewService() {
    return new V1IngressBackendFluentImpl.ServiceNestedImpl();
  }
  public V1IngressBackendFluentImpl.ServiceNested withNewServiceLike(V1IngressServiceBackend item) {
    return new V1IngressBackendFluentImpl.ServiceNestedImpl(item);
  }
  public V1IngressBackendFluentImpl.ServiceNested editService() {
    return withNewServiceLike(getService());
  }
  public V1IngressBackendFluentImpl.ServiceNested editOrNewService() {
    return withNewServiceLike(getService() != null ? getService(): new V1IngressServiceBackendBuilder().build());
  }
  public V1IngressBackendFluentImpl.ServiceNested editOrNewServiceLike(V1IngressServiceBackend item) {
    return withNewServiceLike(getService() != null ? getService(): 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;
    V1IngressBackendFluentImpl that = (V1IngressBackendFluentImpl) o;
    if (!java.util.Objects.equals(resource, that.resource)) return false;

    if (!java.util.Objects.equals(service, that.service)) return false;

    return true;
  }
  public int hashCode() {
    return java.util.Objects.hash(resource,  service,  super.hashCode());
  }
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("{");
    if (resource != null) { sb.append("resource:"); sb.append(resource + ","); }
    if (service != null) { sb.append("service:"); sb.append(service); }
    sb.append("}");
    return sb.toString();
  }
  class ResourceNestedImpl extends V1TypedLocalObjectReferenceFluentImpl> implements V1IngressBackendFluentImpl.ResourceNested,Nested{
    ResourceNestedImpl(V1TypedLocalObjectReference item) {
      this.builder = new V1TypedLocalObjectReferenceBuilder(this, item);
    }
    ResourceNestedImpl() {
      this.builder = new V1TypedLocalObjectReferenceBuilder(this);
    }
    V1TypedLocalObjectReferenceBuilder builder;
    public N and() {
      return (N) V1IngressBackendFluentImpl.this.withResource(builder.build());
    }
    public N endResource() {
      return and();
    }
    
  }
  class ServiceNestedImpl extends V1IngressServiceBackendFluentImpl> implements V1IngressBackendFluentImpl.ServiceNested,Nested{
    ServiceNestedImpl(V1IngressServiceBackend item) {
      this.builder = new V1IngressServiceBackendBuilder(this, item);
    }
    ServiceNestedImpl() {
      this.builder = new V1IngressServiceBackendBuilder(this);
    }
    V1IngressServiceBackendBuilder builder;
    public N and() {
      return (N) V1IngressBackendFluentImpl.this.withService(builder.build());
    }
    public N endService() {
      return and();
    }
    
  }
  
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy