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

io.kubernetes.client.openapi.models.V1NetworkPolicyPeerFluentImpl 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 V1NetworkPolicyPeerFluentImpl> extends BaseFluent implements V1NetworkPolicyPeerFluent{
  public V1NetworkPolicyPeerFluentImpl() {
  }
  public V1NetworkPolicyPeerFluentImpl(V1NetworkPolicyPeer instance) {
    if (instance != null) {
      this.withIpBlock(instance.getIpBlock());
      this.withNamespaceSelector(instance.getNamespaceSelector());
      this.withPodSelector(instance.getPodSelector());
    }
  }
  private V1IPBlockBuilder ipBlock;
  private V1LabelSelectorBuilder namespaceSelector;
  private V1LabelSelectorBuilder podSelector;
  
  /**
   * This method has been deprecated, please use method buildIpBlock instead.
   * @return The buildable object.
   */
  @Deprecated
  public V1IPBlock getIpBlock() {
    return this.ipBlock!=null ?this.ipBlock.build():null;
  }
  public V1IPBlock buildIpBlock() {
    return this.ipBlock!=null ?this.ipBlock.build():null;
  }
  public A withIpBlock(V1IPBlock ipBlock) {
    _visitables.get("ipBlock").remove(this.ipBlock);
    if (ipBlock!=null){ this.ipBlock= new V1IPBlockBuilder(ipBlock); _visitables.get("ipBlock").add(this.ipBlock);} else { this.ipBlock = null; _visitables.get("ipBlock").remove(this.ipBlock); } return (A) this;
  }
  public Boolean hasIpBlock() {
    return this.ipBlock != null;
  }
  public V1NetworkPolicyPeerFluentImpl.IpBlockNested withNewIpBlock() {
    return new V1NetworkPolicyPeerFluentImpl.IpBlockNestedImpl();
  }
  public V1NetworkPolicyPeerFluentImpl.IpBlockNested withNewIpBlockLike(V1IPBlock item) {
    return new V1NetworkPolicyPeerFluentImpl.IpBlockNestedImpl(item);
  }
  public V1NetworkPolicyPeerFluentImpl.IpBlockNested editIpBlock() {
    return withNewIpBlockLike(getIpBlock());
  }
  public V1NetworkPolicyPeerFluentImpl.IpBlockNested editOrNewIpBlock() {
    return withNewIpBlockLike(getIpBlock() != null ? getIpBlock(): new V1IPBlockBuilder().build());
  }
  public V1NetworkPolicyPeerFluentImpl.IpBlockNested editOrNewIpBlockLike(V1IPBlock item) {
    return withNewIpBlockLike(getIpBlock() != null ? getIpBlock(): item);
  }
  
  /**
   * This method has been deprecated, please use method buildNamespaceSelector instead.
   * @return The buildable object.
   */
  @Deprecated
  public V1LabelSelector getNamespaceSelector() {
    return this.namespaceSelector!=null ?this.namespaceSelector.build():null;
  }
  public V1LabelSelector buildNamespaceSelector() {
    return this.namespaceSelector!=null ?this.namespaceSelector.build():null;
  }
  public A withNamespaceSelector(V1LabelSelector namespaceSelector) {
    _visitables.get("namespaceSelector").remove(this.namespaceSelector);
    if (namespaceSelector!=null){ this.namespaceSelector= new V1LabelSelectorBuilder(namespaceSelector); _visitables.get("namespaceSelector").add(this.namespaceSelector);} else { this.namespaceSelector = null; _visitables.get("namespaceSelector").remove(this.namespaceSelector); } return (A) this;
  }
  public Boolean hasNamespaceSelector() {
    return this.namespaceSelector != null;
  }
  public V1NetworkPolicyPeerFluentImpl.NamespaceSelectorNested withNewNamespaceSelector() {
    return new V1NetworkPolicyPeerFluentImpl.NamespaceSelectorNestedImpl();
  }
  public V1NetworkPolicyPeerFluentImpl.NamespaceSelectorNested withNewNamespaceSelectorLike(V1LabelSelector item) {
    return new V1NetworkPolicyPeerFluentImpl.NamespaceSelectorNestedImpl(item);
  }
  public V1NetworkPolicyPeerFluentImpl.NamespaceSelectorNested editNamespaceSelector() {
    return withNewNamespaceSelectorLike(getNamespaceSelector());
  }
  public V1NetworkPolicyPeerFluentImpl.NamespaceSelectorNested editOrNewNamespaceSelector() {
    return withNewNamespaceSelectorLike(getNamespaceSelector() != null ? getNamespaceSelector(): new V1LabelSelectorBuilder().build());
  }
  public V1NetworkPolicyPeerFluentImpl.NamespaceSelectorNested editOrNewNamespaceSelectorLike(V1LabelSelector item) {
    return withNewNamespaceSelectorLike(getNamespaceSelector() != null ? getNamespaceSelector(): item);
  }
  
  /**
   * This method has been deprecated, please use method buildPodSelector instead.
   * @return The buildable object.
   */
  @Deprecated
  public V1LabelSelector getPodSelector() {
    return this.podSelector!=null ?this.podSelector.build():null;
  }
  public V1LabelSelector buildPodSelector() {
    return this.podSelector!=null ?this.podSelector.build():null;
  }
  public A withPodSelector(V1LabelSelector podSelector) {
    _visitables.get("podSelector").remove(this.podSelector);
    if (podSelector!=null){ this.podSelector= new V1LabelSelectorBuilder(podSelector); _visitables.get("podSelector").add(this.podSelector);} else { this.podSelector = null; _visitables.get("podSelector").remove(this.podSelector); } return (A) this;
  }
  public Boolean hasPodSelector() {
    return this.podSelector != null;
  }
  public V1NetworkPolicyPeerFluentImpl.PodSelectorNested withNewPodSelector() {
    return new V1NetworkPolicyPeerFluentImpl.PodSelectorNestedImpl();
  }
  public V1NetworkPolicyPeerFluentImpl.PodSelectorNested withNewPodSelectorLike(V1LabelSelector item) {
    return new V1NetworkPolicyPeerFluentImpl.PodSelectorNestedImpl(item);
  }
  public V1NetworkPolicyPeerFluentImpl.PodSelectorNested editPodSelector() {
    return withNewPodSelectorLike(getPodSelector());
  }
  public V1NetworkPolicyPeerFluentImpl.PodSelectorNested editOrNewPodSelector() {
    return withNewPodSelectorLike(getPodSelector() != null ? getPodSelector(): new V1LabelSelectorBuilder().build());
  }
  public V1NetworkPolicyPeerFluentImpl.PodSelectorNested editOrNewPodSelectorLike(V1LabelSelector item) {
    return withNewPodSelectorLike(getPodSelector() != null ? getPodSelector(): 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;
    V1NetworkPolicyPeerFluentImpl that = (V1NetworkPolicyPeerFluentImpl) o;
    if (!java.util.Objects.equals(ipBlock, that.ipBlock)) return false;

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

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

    return true;
  }
  public int hashCode() {
    return java.util.Objects.hash(ipBlock,  namespaceSelector,  podSelector,  super.hashCode());
  }
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("{");
    if (ipBlock != null) { sb.append("ipBlock:"); sb.append(ipBlock + ","); }
    if (namespaceSelector != null) { sb.append("namespaceSelector:"); sb.append(namespaceSelector + ","); }
    if (podSelector != null) { sb.append("podSelector:"); sb.append(podSelector); }
    sb.append("}");
    return sb.toString();
  }
  class IpBlockNestedImpl extends V1IPBlockFluentImpl> implements V1NetworkPolicyPeerFluentImpl.IpBlockNested,Nested{
    IpBlockNestedImpl(V1IPBlock item) {
      this.builder = new V1IPBlockBuilder(this, item);
    }
    IpBlockNestedImpl() {
      this.builder = new V1IPBlockBuilder(this);
    }
    V1IPBlockBuilder builder;
    public N and() {
      return (N) V1NetworkPolicyPeerFluentImpl.this.withIpBlock(builder.build());
    }
    public N endIpBlock() {
      return and();
    }
    
  }
  class NamespaceSelectorNestedImpl extends V1LabelSelectorFluentImpl> implements V1NetworkPolicyPeerFluentImpl.NamespaceSelectorNested,Nested{
    NamespaceSelectorNestedImpl(V1LabelSelector item) {
      this.builder = new V1LabelSelectorBuilder(this, item);
    }
    NamespaceSelectorNestedImpl() {
      this.builder = new V1LabelSelectorBuilder(this);
    }
    V1LabelSelectorBuilder builder;
    public N and() {
      return (N) V1NetworkPolicyPeerFluentImpl.this.withNamespaceSelector(builder.build());
    }
    public N endNamespaceSelector() {
      return and();
    }
    
  }
  class PodSelectorNestedImpl extends V1LabelSelectorFluentImpl> implements V1NetworkPolicyPeerFluentImpl.PodSelectorNested,Nested{
    PodSelectorNestedImpl(V1LabelSelector item) {
      this.builder = new V1LabelSelectorBuilder(this, item);
    }
    PodSelectorNestedImpl() {
      this.builder = new V1LabelSelectorBuilder(this);
    }
    V1LabelSelectorBuilder builder;
    public N and() {
      return (N) V1NetworkPolicyPeerFluentImpl.this.withPodSelector(builder.build());
    }
    public N endPodSelector() {
      return and();
    }
    
  }
  
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy