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

io.fabric8.kubernetes.api.model.DeleteOptionsFluentImpl Maven / Gradle / Ivy

package io.fabric8.kubernetes.api.model;

import io.fabric8.kubernetes.api.builder.Nested;
import java.util.ArrayList;
import java.lang.String;
import java.util.LinkedHashMap;
import java.util.function.Predicate;
import java.lang.Integer;
import java.lang.Deprecated;
import io.fabric8.kubernetes.api.builder.BaseFluent;
import java.lang.Long;
import java.util.Collection;
import java.lang.Object;
import java.util.List;
import java.lang.Boolean;
import java.util.Map;

 /**
  * Generated
  */
public class DeleteOptionsFluentImpl> extends io.fabric8.kubernetes.api.builder.BaseFluent implements io.fabric8.kubernetes.api.model.DeleteOptionsFluent{
  public DeleteOptionsFluentImpl() {
  }
  public DeleteOptionsFluentImpl(io.fabric8.kubernetes.api.model.DeleteOptions instance) {
    this.withApiVersion(instance.getApiVersion()); 
    this.withDryRun(instance.getDryRun()); 
    this.withGracePeriodSeconds(instance.getGracePeriodSeconds()); 
    this.withKind(instance.getKind()); 
    this.withOrphanDependents(instance.getOrphanDependents()); 
    this.withPreconditions(instance.getPreconditions()); 
    this.withPropagationPolicy(instance.getPropagationPolicy()); 
    this.withAdditionalProperties(instance.getAdditionalProperties());

  }
  private java.lang.String apiVersion;
  private java.util.List dryRun = new java.util.ArrayList();
  private java.lang.Long gracePeriodSeconds;
  private java.lang.String kind;
  private java.lang.Boolean orphanDependents;
  private io.fabric8.kubernetes.api.model.PreconditionsBuilder preconditions;
  private java.lang.String propagationPolicy;
  private java.util.Map additionalProperties;
  public java.lang.String getApiVersion() {
    return this.apiVersion;
  }
  public A withApiVersion(java.lang.String apiVersion) {
    this.apiVersion=apiVersion; return (A) this;
  }
  public java.lang.Boolean hasApiVersion() {
    return this.apiVersion != null;
  }
  
  /**
   * Method is deprecated. use withApiVersion instead.
   */
  @java.lang.Deprecated
  public A withNewApiVersion(java.lang.String arg0) {
    return (A)withApiVersion(new String(arg0));
  }
  public A addToDryRun(java.lang.Integer index,java.lang.String item) {
    if (this.dryRun == null) {this.dryRun = new java.util.ArrayList();}
    this.dryRun.add(index, item);
    return (A)this;
  }
  public A setToDryRun(java.lang.Integer index,java.lang.String item) {
    if (this.dryRun == null) {this.dryRun = new java.util.ArrayList();}
    this.dryRun.set(index, item); return (A)this;
  }
  public A addToDryRun(java.lang.String... items) {
    if (this.dryRun == null) {this.dryRun = new java.util.ArrayList();}
    for (java.lang.String item : items) {this.dryRun.add(item);} return (A)this;
  }
  public A addAllToDryRun(java.util.Collection items) {
    if (this.dryRun == null) {this.dryRun = new java.util.ArrayList();}
    for (java.lang.String item : items) {this.dryRun.add(item);} return (A)this;
  }
  public A removeFromDryRun(java.lang.String... items) {
    for (java.lang.String item : items) {if (this.dryRun!= null){ this.dryRun.remove(item);}} return (A)this;
  }
  public A removeAllFromDryRun(java.util.Collection items) {
    for (java.lang.String item : items) {if (this.dryRun!= null){ this.dryRun.remove(item);}} return (A)this;
  }
  public java.util.List getDryRun() {
    return this.dryRun;
  }
  public java.lang.String getDryRun(java.lang.Integer index) {
    return this.dryRun.get(index);
  }
  public java.lang.String getFirstDryRun() {
    return this.dryRun.get(0);
  }
  public java.lang.String getLastDryRun() {
    return this.dryRun.get(dryRun.size() - 1);
  }
  public java.lang.String getMatchingDryRun(java.util.function.Predicate predicate) {
    for (java.lang.String item: dryRun) { if(predicate.test(item)){ return item;} } return null;
  }
  public java.lang.Boolean hasMatchingDryRun(java.util.function.Predicate predicate) {
    for (java.lang.String item: dryRun) { if(predicate.test(item)){ return true;} } return false;
  }
  public A withDryRun(java.util.List dryRun) {
    if (dryRun != null) {this.dryRun = new java.util.ArrayList(); for (java.lang.String item : dryRun){this.addToDryRun(item);}} else { this.dryRun = null;} return (A) this;
  }
  public A withDryRun(java.lang.String... dryRun) {
    if (this.dryRun != null) {this.dryRun.clear();}
    if (dryRun != null) {for (java.lang.String item :dryRun){ this.addToDryRun(item);}} return (A) this;
  }
  public java.lang.Boolean hasDryRun() {
    return dryRun != null && !dryRun.isEmpty();
  }
  public A addNewDryRun(java.lang.String arg0) {
    return (A)addToDryRun(new String(arg0));
  }
  public java.lang.Long getGracePeriodSeconds() {
    return this.gracePeriodSeconds;
  }
  public A withGracePeriodSeconds(java.lang.Long gracePeriodSeconds) {
    this.gracePeriodSeconds=gracePeriodSeconds; return (A) this;
  }
  public java.lang.Boolean hasGracePeriodSeconds() {
    return this.gracePeriodSeconds != null;
  }
  public java.lang.String getKind() {
    return this.kind;
  }
  public A withKind(java.lang.String kind) {
    this.kind=kind; return (A) this;
  }
  public java.lang.Boolean hasKind() {
    return this.kind != null;
  }
  
  /**
   * Method is deprecated. use withKind instead.
   */
  @java.lang.Deprecated
  public A withNewKind(java.lang.String arg0) {
    return (A)withKind(new String(arg0));
  }
  public java.lang.Boolean getOrphanDependents() {
    return this.orphanDependents;
  }
  public A withOrphanDependents(java.lang.Boolean orphanDependents) {
    this.orphanDependents=orphanDependents; return (A) this;
  }
  public java.lang.Boolean hasOrphanDependents() {
    return this.orphanDependents != null;
  }
  
  /**
   * This method has been deprecated, please use method buildPreconditions instead.
   * @return The buildable object.
   */
  @java.lang.Deprecated
  public io.fabric8.kubernetes.api.model.Preconditions getPreconditions() {
    return this.preconditions!=null?this.preconditions.build():null;
  }
  public io.fabric8.kubernetes.api.model.Preconditions buildPreconditions() {
    return this.preconditions!=null?this.preconditions.build():null;
  }
  public A withPreconditions(io.fabric8.kubernetes.api.model.Preconditions preconditions) {
    _visitables.get("preconditions").remove(this.preconditions);
    if (preconditions!=null){ this.preconditions= new io.fabric8.kubernetes.api.model.PreconditionsBuilder(preconditions); _visitables.get("preconditions").add(this.preconditions);} return (A) this;
  }
  public java.lang.Boolean hasPreconditions() {
    return this.preconditions != null;
  }
  public A withNewPreconditions(java.lang.String resourceVersion,java.lang.String uid) {
    return (A)withPreconditions(new Preconditions(resourceVersion, uid));
  }
  public io.fabric8.kubernetes.api.model.DeleteOptionsFluent.PreconditionsNested withNewPreconditions() {
    return new io.fabric8.kubernetes.api.model.DeleteOptionsFluentImpl.PreconditionsNestedImpl();
  }
  public io.fabric8.kubernetes.api.model.DeleteOptionsFluent.PreconditionsNested withNewPreconditionsLike(io.fabric8.kubernetes.api.model.Preconditions item) {
    return new io.fabric8.kubernetes.api.model.DeleteOptionsFluentImpl.PreconditionsNestedImpl(item);
  }
  public io.fabric8.kubernetes.api.model.DeleteOptionsFluent.PreconditionsNested editPreconditions() {
    return withNewPreconditionsLike(getPreconditions());
  }
  public io.fabric8.kubernetes.api.model.DeleteOptionsFluent.PreconditionsNested editOrNewPreconditions() {
    return withNewPreconditionsLike(getPreconditions() != null ? getPreconditions(): new io.fabric8.kubernetes.api.model.PreconditionsBuilder().build());
  }
  public io.fabric8.kubernetes.api.model.DeleteOptionsFluent.PreconditionsNested editOrNewPreconditionsLike(io.fabric8.kubernetes.api.model.Preconditions item) {
    return withNewPreconditionsLike(getPreconditions() != null ? getPreconditions(): item);
  }
  public java.lang.String getPropagationPolicy() {
    return this.propagationPolicy;
  }
  public A withPropagationPolicy(java.lang.String propagationPolicy) {
    this.propagationPolicy=propagationPolicy; return (A) this;
  }
  public java.lang.Boolean hasPropagationPolicy() {
    return this.propagationPolicy != null;
  }
  
  /**
   * Method is deprecated. use withPropagationPolicy instead.
   */
  @java.lang.Deprecated
  public A withNewPropagationPolicy(java.lang.String arg0) {
    return (A)withPropagationPolicy(new String(arg0));
  }
  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;
    DeleteOptionsFluentImpl that = (DeleteOptionsFluentImpl) o;
    if (apiVersion != null ? !apiVersion.equals(that.apiVersion) :that.apiVersion != null) return false;
    if (dryRun != null ? !dryRun.equals(that.dryRun) :that.dryRun != null) return false;
    if (gracePeriodSeconds != null ? !gracePeriodSeconds.equals(that.gracePeriodSeconds) :that.gracePeriodSeconds != null) return false;
    if (kind != null ? !kind.equals(that.kind) :that.kind != null) return false;
    if (orphanDependents != null ? !orphanDependents.equals(that.orphanDependents) :that.orphanDependents != null) return false;
    if (preconditions != null ? !preconditions.equals(that.preconditions) :that.preconditions != null) return false;
    if (propagationPolicy != null ? !propagationPolicy.equals(that.propagationPolicy) :that.propagationPolicy != 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(apiVersion,  dryRun,  gracePeriodSeconds,  kind,  orphanDependents,  preconditions,  propagationPolicy,  additionalProperties,  super.hashCode());
  }
  public class PreconditionsNestedImpl extends io.fabric8.kubernetes.api.model.PreconditionsFluentImpl> implements io.fabric8.kubernetes.api.model.DeleteOptionsFluent.PreconditionsNested,io.fabric8.kubernetes.api.builder.Nested{
    PreconditionsNestedImpl(io.fabric8.kubernetes.api.model.Preconditions item) {
      this.builder = new io.fabric8.kubernetes.api.model.PreconditionsBuilder(this, item);
    }
    PreconditionsNestedImpl() {
      this.builder = new io.fabric8.kubernetes.api.model.PreconditionsBuilder(this);
    }
    io.fabric8.kubernetes.api.model.PreconditionsBuilder builder;
    public N and() {
      return (N) DeleteOptionsFluentImpl.this.withPreconditions(builder.build());
    }
    public N endPreconditions() {
      return and();
    }
    
  }
  
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy