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

io.kubernetes.client.openapi.models.V1VolumeNodeAffinityFluent 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.BaseFluent;
import io.kubernetes.client.fluent.Nested;
import java.lang.Object;
import java.lang.String;

/**
 * Generated
 */
@SuppressWarnings("unchecked")
public class V1VolumeNodeAffinityFluent> extends BaseFluent{
  public V1VolumeNodeAffinityFluent() {
  }
  
  public V1VolumeNodeAffinityFluent(V1VolumeNodeAffinity instance) {
    this.copyInstance(instance);
  }
  private V1NodeSelectorBuilder required;
  
  protected void copyInstance(V1VolumeNodeAffinity instance) {
    instance = (instance != null ? instance : new V1VolumeNodeAffinity());
    if (instance != null) {
          this.withRequired(instance.getRequired());
        }
  }
  
  public V1NodeSelector buildRequired() {
    return this.required != null ? this.required.build() : null;
  }
  
  public A withRequired(V1NodeSelector required) {
    this._visitables.remove("required");
    if (required != null) {
        this.required = new V1NodeSelectorBuilder(required);
        this._visitables.get("required").add(this.required);
    } else {
        this.required = null;
        this._visitables.get("required").remove(this.required);
    }
    return (A) this;
  }
  
  public boolean hasRequired() {
    return this.required != null;
  }
  
  public RequiredNested withNewRequired() {
    return new RequiredNested(null);
  }
  
  public RequiredNested withNewRequiredLike(V1NodeSelector item) {
    return new RequiredNested(item);
  }
  
  public RequiredNested editRequired() {
    return withNewRequiredLike(java.util.Optional.ofNullable(buildRequired()).orElse(null));
  }
  
  public RequiredNested editOrNewRequired() {
    return withNewRequiredLike(java.util.Optional.ofNullable(buildRequired()).orElse(new V1NodeSelectorBuilder().build()));
  }
  
  public RequiredNested editOrNewRequiredLike(V1NodeSelector item) {
    return withNewRequiredLike(java.util.Optional.ofNullable(buildRequired()).orElse(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;
    V1VolumeNodeAffinityFluent that = (V1VolumeNodeAffinityFluent) o;
    if (!java.util.Objects.equals(required, that.required)) return false;
    return true;
  }
  
  public int hashCode() {
    return java.util.Objects.hash(required,  super.hashCode());
  }
  
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("{");
    if (required != null) { sb.append("required:"); sb.append(required); }
    sb.append("}");
    return sb.toString();
  }
  public class RequiredNested extends V1NodeSelectorFluent> implements Nested{
    RequiredNested(V1NodeSelector item) {
      this.builder = new V1NodeSelectorBuilder(this, item);
    }
    V1NodeSelectorBuilder builder;
    
    public N and() {
      return (N) V1VolumeNodeAffinityFluent.this.withRequired(builder.build());
    }
    
    public N endRequired() {
      return and();
    }
    
  
  }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy