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

io.fabric8.kubernetes.api.model.ResourceQuotaSpecFluentImpl 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.util.Collection;
import java.lang.Object;
import java.util.List;
import java.lang.Boolean;
import java.util.Map;

 /**
  * Generated
  */
public class ResourceQuotaSpecFluentImpl> extends io.fabric8.kubernetes.api.builder.BaseFluent implements io.fabric8.kubernetes.api.model.ResourceQuotaSpecFluent{
  public ResourceQuotaSpecFluentImpl() {
  }
  public ResourceQuotaSpecFluentImpl(io.fabric8.kubernetes.api.model.ResourceQuotaSpec instance) {
    this.withHard(instance.getHard()); 
    this.withScopeSelector(instance.getScopeSelector()); 
    this.withScopes(instance.getScopes()); 
    this.withAdditionalProperties(instance.getAdditionalProperties());

  }
  private java.util.Map hard;
  private io.fabric8.kubernetes.api.model.ScopeSelectorBuilder scopeSelector;
  private java.util.List scopes = new java.util.ArrayList();
  private java.util.Map additionalProperties;
  public A addToHard(java.lang.String key,io.fabric8.kubernetes.api.model.Quantity value) {
    if(this.hard == null && key != null && value != null) { this.hard = new java.util.LinkedHashMap(); }
    if(key != null && value != null) {this.hard.put(key, value);} return (A)this;
  }
  public A addToHard(java.util.Map map) {
    if(this.hard == null && map != null) { this.hard = new java.util.LinkedHashMap(); }
    if(map != null) { this.hard.putAll(map);} return (A)this;
  }
  public A removeFromHard(java.lang.String key) {
    if(this.hard == null) { return (A) this; }
    if(key != null && this.hard != null) {this.hard.remove(key);} return (A)this;
  }
  public A removeFromHard(java.util.Map map) {
    if(this.hard == null) { return (A) this; }
    if(map != null) { for(Object key : map.keySet()) {if (this.hard != null){this.hard.remove(key);}}} return (A)this;
  }
  public java.util.Map getHard() {
    return this.hard;
  }
  public A withHard(java.util.Map hard) {
    if (hard == null) { this.hard =  null;} else {this.hard = new java.util.LinkedHashMap(hard);} return (A) this;
  }
  public java.lang.Boolean hasHard() {
    return this.hard != null;
  }
  
  /**
   * This method has been deprecated, please use method buildScopeSelector instead.
   * @return The buildable object.
   */
  @java.lang.Deprecated
  public io.fabric8.kubernetes.api.model.ScopeSelector getScopeSelector() {
    return this.scopeSelector!=null?this.scopeSelector.build():null;
  }
  public io.fabric8.kubernetes.api.model.ScopeSelector buildScopeSelector() {
    return this.scopeSelector!=null?this.scopeSelector.build():null;
  }
  public A withScopeSelector(io.fabric8.kubernetes.api.model.ScopeSelector scopeSelector) {
    _visitables.get("scopeSelector").remove(this.scopeSelector);
    if (scopeSelector!=null){ this.scopeSelector= new io.fabric8.kubernetes.api.model.ScopeSelectorBuilder(scopeSelector); _visitables.get("scopeSelector").add(this.scopeSelector);} return (A) this;
  }
  public java.lang.Boolean hasScopeSelector() {
    return this.scopeSelector != null;
  }
  public io.fabric8.kubernetes.api.model.ResourceQuotaSpecFluent.ScopeSelectorNested withNewScopeSelector() {
    return new io.fabric8.kubernetes.api.model.ResourceQuotaSpecFluentImpl.ScopeSelectorNestedImpl();
  }
  public io.fabric8.kubernetes.api.model.ResourceQuotaSpecFluent.ScopeSelectorNested withNewScopeSelectorLike(io.fabric8.kubernetes.api.model.ScopeSelector item) {
    return new io.fabric8.kubernetes.api.model.ResourceQuotaSpecFluentImpl.ScopeSelectorNestedImpl(item);
  }
  public io.fabric8.kubernetes.api.model.ResourceQuotaSpecFluent.ScopeSelectorNested editScopeSelector() {
    return withNewScopeSelectorLike(getScopeSelector());
  }
  public io.fabric8.kubernetes.api.model.ResourceQuotaSpecFluent.ScopeSelectorNested editOrNewScopeSelector() {
    return withNewScopeSelectorLike(getScopeSelector() != null ? getScopeSelector(): new io.fabric8.kubernetes.api.model.ScopeSelectorBuilder().build());
  }
  public io.fabric8.kubernetes.api.model.ResourceQuotaSpecFluent.ScopeSelectorNested editOrNewScopeSelectorLike(io.fabric8.kubernetes.api.model.ScopeSelector item) {
    return withNewScopeSelectorLike(getScopeSelector() != null ? getScopeSelector(): item);
  }
  public A addToScopes(java.lang.Integer index,java.lang.String item) {
    if (this.scopes == null) {this.scopes = new java.util.ArrayList();}
    this.scopes.add(index, item);
    return (A)this;
  }
  public A setToScopes(java.lang.Integer index,java.lang.String item) {
    if (this.scopes == null) {this.scopes = new java.util.ArrayList();}
    this.scopes.set(index, item); return (A)this;
  }
  public A addToScopes(java.lang.String... items) {
    if (this.scopes == null) {this.scopes = new java.util.ArrayList();}
    for (java.lang.String item : items) {this.scopes.add(item);} return (A)this;
  }
  public A addAllToScopes(java.util.Collection items) {
    if (this.scopes == null) {this.scopes = new java.util.ArrayList();}
    for (java.lang.String item : items) {this.scopes.add(item);} return (A)this;
  }
  public A removeFromScopes(java.lang.String... items) {
    for (java.lang.String item : items) {if (this.scopes!= null){ this.scopes.remove(item);}} return (A)this;
  }
  public A removeAllFromScopes(java.util.Collection items) {
    for (java.lang.String item : items) {if (this.scopes!= null){ this.scopes.remove(item);}} return (A)this;
  }
  public java.util.List getScopes() {
    return this.scopes;
  }
  public java.lang.String getScope(java.lang.Integer index) {
    return this.scopes.get(index);
  }
  public java.lang.String getFirstScope() {
    return this.scopes.get(0);
  }
  public java.lang.String getLastScope() {
    return this.scopes.get(scopes.size() - 1);
  }
  public java.lang.String getMatchingScope(java.util.function.Predicate predicate) {
    for (java.lang.String item: scopes) { if(predicate.test(item)){ return item;} } return null;
  }
  public java.lang.Boolean hasMatchingScope(java.util.function.Predicate predicate) {
    for (java.lang.String item: scopes) { if(predicate.test(item)){ return true;} } return false;
  }
  public A withScopes(java.util.List scopes) {
    if (scopes != null) {this.scopes = new java.util.ArrayList(); for (java.lang.String item : scopes){this.addToScopes(item);}} else { this.scopes = null;} return (A) this;
  }
  public A withScopes(java.lang.String... scopes) {
    if (this.scopes != null) {this.scopes.clear();}
    if (scopes != null) {for (java.lang.String item :scopes){ this.addToScopes(item);}} return (A) this;
  }
  public java.lang.Boolean hasScopes() {
    return scopes != null && !scopes.isEmpty();
  }
  public A addNewScope(java.lang.String arg0) {
    return (A)addToScopes(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;
    ResourceQuotaSpecFluentImpl that = (ResourceQuotaSpecFluentImpl) o;
    if (hard != null ? !hard.equals(that.hard) :that.hard != null) return false;
    if (scopeSelector != null ? !scopeSelector.equals(that.scopeSelector) :that.scopeSelector != null) return false;
    if (scopes != null ? !scopes.equals(that.scopes) :that.scopes != 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(hard,  scopeSelector,  scopes,  additionalProperties,  super.hashCode());
  }
  public class ScopeSelectorNestedImpl extends io.fabric8.kubernetes.api.model.ScopeSelectorFluentImpl> implements io.fabric8.kubernetes.api.model.ResourceQuotaSpecFluent.ScopeSelectorNested,io.fabric8.kubernetes.api.builder.Nested{
    ScopeSelectorNestedImpl(io.fabric8.kubernetes.api.model.ScopeSelector item) {
      this.builder = new io.fabric8.kubernetes.api.model.ScopeSelectorBuilder(this, item);
    }
    ScopeSelectorNestedImpl() {
      this.builder = new io.fabric8.kubernetes.api.model.ScopeSelectorBuilder(this);
    }
    io.fabric8.kubernetes.api.model.ScopeSelectorBuilder builder;
    public N and() {
      return (N) ResourceQuotaSpecFluentImpl.this.withScopeSelector(builder.build());
    }
    public N endScopeSelector() {
      return and();
    }
    
  }
  
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy