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

io.kubernetes.client.openapi.models.V1LifecycleHandlerFluentImpl 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.Boolean;
import java.lang.Object;

 /**
  * Generated
  */
  @SuppressWarnings(value = "unchecked")
  public class V1LifecycleHandlerFluentImpl> extends BaseFluent implements V1LifecycleHandlerFluent{
  public V1LifecycleHandlerFluentImpl() {
  }
  public V1LifecycleHandlerFluentImpl(V1LifecycleHandler instance) {
    this.withExec(instance.getExec());

    this.withHttpGet(instance.getHttpGet());

    this.withTcpSocket(instance.getTcpSocket());

  }
  private V1ExecActionBuilder exec;
  private V1HTTPGetActionBuilder httpGet;
  private V1TCPSocketActionBuilder tcpSocket;
  
  /**
   * This method has been deprecated, please use method buildExec instead.
   * @return The buildable object.
   */
  @Deprecated
  public V1ExecAction getExec() {
    return this.exec!=null ?this.exec.build():null;
  }
  public V1ExecAction buildExec() {
    return this.exec!=null ?this.exec.build():null;
  }
  public A withExec(V1ExecAction exec) {
    _visitables.get("exec").remove(this.exec);
    if (exec!=null){ this.exec= new V1ExecActionBuilder(exec); _visitables.get("exec").add(this.exec);} else { this.exec = null; _visitables.get("exec").remove(this.exec); } return (A) this;
  }
  public Boolean hasExec() {
    return this.exec != null;
  }
  public V1LifecycleHandlerFluent.ExecNested withNewExec() {
    return new V1LifecycleHandlerFluentImpl.ExecNestedImpl();
  }
  public V1LifecycleHandlerFluent.ExecNested withNewExecLike(V1ExecAction item) {
    return new V1LifecycleHandlerFluentImpl.ExecNestedImpl(item);
  }
  public V1LifecycleHandlerFluent.ExecNested editExec() {
    return withNewExecLike(getExec());
  }
  public V1LifecycleHandlerFluent.ExecNested editOrNewExec() {
    return withNewExecLike(getExec() != null ? getExec(): new V1ExecActionBuilder().build());
  }
  public V1LifecycleHandlerFluent.ExecNested editOrNewExecLike(V1ExecAction item) {
    return withNewExecLike(getExec() != null ? getExec(): item);
  }
  
  /**
   * This method has been deprecated, please use method buildHttpGet instead.
   * @return The buildable object.
   */
  @Deprecated
  public V1HTTPGetAction getHttpGet() {
    return this.httpGet!=null ?this.httpGet.build():null;
  }
  public V1HTTPGetAction buildHttpGet() {
    return this.httpGet!=null ?this.httpGet.build():null;
  }
  public A withHttpGet(V1HTTPGetAction httpGet) {
    _visitables.get("httpGet").remove(this.httpGet);
    if (httpGet!=null){ this.httpGet= new V1HTTPGetActionBuilder(httpGet); _visitables.get("httpGet").add(this.httpGet);} else { this.httpGet = null; _visitables.get("httpGet").remove(this.httpGet); } return (A) this;
  }
  public Boolean hasHttpGet() {
    return this.httpGet != null;
  }
  public V1LifecycleHandlerFluent.HttpGetNested withNewHttpGet() {
    return new V1LifecycleHandlerFluentImpl.HttpGetNestedImpl();
  }
  public V1LifecycleHandlerFluent.HttpGetNested withNewHttpGetLike(V1HTTPGetAction item) {
    return new V1LifecycleHandlerFluentImpl.HttpGetNestedImpl(item);
  }
  public V1LifecycleHandlerFluent.HttpGetNested editHttpGet() {
    return withNewHttpGetLike(getHttpGet());
  }
  public V1LifecycleHandlerFluent.HttpGetNested editOrNewHttpGet() {
    return withNewHttpGetLike(getHttpGet() != null ? getHttpGet(): new V1HTTPGetActionBuilder().build());
  }
  public V1LifecycleHandlerFluent.HttpGetNested editOrNewHttpGetLike(V1HTTPGetAction item) {
    return withNewHttpGetLike(getHttpGet() != null ? getHttpGet(): item);
  }
  
  /**
   * This method has been deprecated, please use method buildTcpSocket instead.
   * @return The buildable object.
   */
  @Deprecated
  public V1TCPSocketAction getTcpSocket() {
    return this.tcpSocket!=null ?this.tcpSocket.build():null;
  }
  public V1TCPSocketAction buildTcpSocket() {
    return this.tcpSocket!=null ?this.tcpSocket.build():null;
  }
  public A withTcpSocket(V1TCPSocketAction tcpSocket) {
    _visitables.get("tcpSocket").remove(this.tcpSocket);
    if (tcpSocket!=null){ this.tcpSocket= new V1TCPSocketActionBuilder(tcpSocket); _visitables.get("tcpSocket").add(this.tcpSocket);} else { this.tcpSocket = null; _visitables.get("tcpSocket").remove(this.tcpSocket); } return (A) this;
  }
  public Boolean hasTcpSocket() {
    return this.tcpSocket != null;
  }
  public V1LifecycleHandlerFluent.TcpSocketNested withNewTcpSocket() {
    return new V1LifecycleHandlerFluentImpl.TcpSocketNestedImpl();
  }
  public V1LifecycleHandlerFluent.TcpSocketNested withNewTcpSocketLike(V1TCPSocketAction item) {
    return new V1LifecycleHandlerFluentImpl.TcpSocketNestedImpl(item);
  }
  public V1LifecycleHandlerFluent.TcpSocketNested editTcpSocket() {
    return withNewTcpSocketLike(getTcpSocket());
  }
  public V1LifecycleHandlerFluent.TcpSocketNested editOrNewTcpSocket() {
    return withNewTcpSocketLike(getTcpSocket() != null ? getTcpSocket(): new V1TCPSocketActionBuilder().build());
  }
  public V1LifecycleHandlerFluent.TcpSocketNested editOrNewTcpSocketLike(V1TCPSocketAction item) {
    return withNewTcpSocketLike(getTcpSocket() != null ? getTcpSocket(): item);
  }
  public boolean equals(Object o) {
    if (this == o) return true;
    if (o == null || getClass() != o.getClass()) return false;
    V1LifecycleHandlerFluentImpl that = (V1LifecycleHandlerFluentImpl) o;
    if (exec != null ? !exec.equals(that.exec) :that.exec != null) return false;
    if (httpGet != null ? !httpGet.equals(that.httpGet) :that.httpGet != null) return false;
    if (tcpSocket != null ? !tcpSocket.equals(that.tcpSocket) :that.tcpSocket != null) return false;
    return true;
  }
  public int hashCode() {
    return java.util.Objects.hash(exec,  httpGet,  tcpSocket,  super.hashCode());
  }
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("{");
    if (exec != null) { sb.append("exec:"); sb.append(exec + ","); }
    if (httpGet != null) { sb.append("httpGet:"); sb.append(httpGet + ","); }
    if (tcpSocket != null) { sb.append("tcpSocket:"); sb.append(tcpSocket); }
    sb.append("}");
    return sb.toString();
  }
  class ExecNestedImpl extends V1ExecActionFluentImpl> implements V1LifecycleHandlerFluent.ExecNested,Nested{
    ExecNestedImpl(V1ExecAction item) {
      this.builder = new V1ExecActionBuilder(this, item);
    }
    ExecNestedImpl() {
      this.builder = new V1ExecActionBuilder(this);
    }
    V1ExecActionBuilder builder;
    public N and() {
      return (N) V1LifecycleHandlerFluentImpl.this.withExec(builder.build());
    }
    public N endExec() {
      return and();
    }
    
  }
  class HttpGetNestedImpl extends V1HTTPGetActionFluentImpl> implements V1LifecycleHandlerFluent.HttpGetNested,Nested{
    HttpGetNestedImpl(V1HTTPGetAction item) {
      this.builder = new V1HTTPGetActionBuilder(this, item);
    }
    HttpGetNestedImpl() {
      this.builder = new V1HTTPGetActionBuilder(this);
    }
    V1HTTPGetActionBuilder builder;
    public N and() {
      return (N) V1LifecycleHandlerFluentImpl.this.withHttpGet(builder.build());
    }
    public N endHttpGet() {
      return and();
    }
    
  }
  class TcpSocketNestedImpl extends V1TCPSocketActionFluentImpl> implements V1LifecycleHandlerFluent.TcpSocketNested,Nested{
    TcpSocketNestedImpl(V1TCPSocketAction item) {
      this.builder = new V1TCPSocketActionBuilder(this, item);
    }
    TcpSocketNestedImpl() {
      this.builder = new V1TCPSocketActionBuilder(this);
    }
    V1TCPSocketActionBuilder builder;
    public N and() {
      return (N) V1LifecycleHandlerFluentImpl.this.withTcpSocket(builder.build());
    }
    public N endTcpSocket() {
      return and();
    }
    
  }
  
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy