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

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

package io.fabric8.kubernetes.api.model;

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 TopologySelectorLabelRequirementFluentImpl> extends io.fabric8.kubernetes.api.builder.BaseFluent implements io.fabric8.kubernetes.api.model.TopologySelectorLabelRequirementFluent{
  public TopologySelectorLabelRequirementFluentImpl() {
  }
  public TopologySelectorLabelRequirementFluentImpl(io.fabric8.kubernetes.api.model.TopologySelectorLabelRequirement instance) {
    this.withKey(instance.getKey()); 
    this.withValues(instance.getValues()); 
    this.withAdditionalProperties(instance.getAdditionalProperties());

  }
  private java.lang.String key;
  private java.util.List values = new java.util.ArrayList();
  private java.util.Map additionalProperties;
  public java.lang.String getKey() {
    return this.key;
  }
  public A withKey(java.lang.String key) {
    this.key=key; return (A) this;
  }
  public java.lang.Boolean hasKey() {
    return this.key != null;
  }
  
  /**
   * Method is deprecated. use withKey instead.
   */
  @java.lang.Deprecated
  public A withNewKey(java.lang.String arg0) {
    return (A)withKey(new String(arg0));
  }
  public A addToValues(java.lang.Integer index,java.lang.String item) {
    if (this.values == null) {this.values = new java.util.ArrayList();}
    this.values.add(index, item);
    return (A)this;
  }
  public A setToValues(java.lang.Integer index,java.lang.String item) {
    if (this.values == null) {this.values = new java.util.ArrayList();}
    this.values.set(index, item); return (A)this;
  }
  public A addToValues(java.lang.String... items) {
    if (this.values == null) {this.values = new java.util.ArrayList();}
    for (java.lang.String item : items) {this.values.add(item);} return (A)this;
  }
  public A addAllToValues(java.util.Collection items) {
    if (this.values == null) {this.values = new java.util.ArrayList();}
    for (java.lang.String item : items) {this.values.add(item);} return (A)this;
  }
  public A removeFromValues(java.lang.String... items) {
    for (java.lang.String item : items) {if (this.values!= null){ this.values.remove(item);}} return (A)this;
  }
  public A removeAllFromValues(java.util.Collection items) {
    for (java.lang.String item : items) {if (this.values!= null){ this.values.remove(item);}} return (A)this;
  }
  public java.util.List getValues() {
    return this.values;
  }
  public java.lang.String getValue(java.lang.Integer index) {
    return this.values.get(index);
  }
  public java.lang.String getFirstValue() {
    return this.values.get(0);
  }
  public java.lang.String getLastValue() {
    return this.values.get(values.size() - 1);
  }
  public java.lang.String getMatchingValue(java.util.function.Predicate predicate) {
    for (java.lang.String item: values) { if(predicate.test(item)){ return item;} } return null;
  }
  public java.lang.Boolean hasMatchingValue(java.util.function.Predicate predicate) {
    for (java.lang.String item: values) { if(predicate.test(item)){ return true;} } return false;
  }
  public A withValues(java.util.List values) {
    if (values != null) {this.values = new java.util.ArrayList(); for (java.lang.String item : values){this.addToValues(item);}} else { this.values = null;} return (A) this;
  }
  public A withValues(java.lang.String... values) {
    if (this.values != null) {this.values.clear();}
    if (values != null) {for (java.lang.String item :values){ this.addToValues(item);}} return (A) this;
  }
  public java.lang.Boolean hasValues() {
    return values != null && !values.isEmpty();
  }
  public A addNewValue(java.lang.String arg0) {
    return (A)addToValues(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;
    TopologySelectorLabelRequirementFluentImpl that = (TopologySelectorLabelRequirementFluentImpl) o;
    if (key != null ? !key.equals(that.key) :that.key != null) return false;
    if (values != null ? !values.equals(that.values) :that.values != 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(key,  values,  additionalProperties,  super.hashCode());
  }
  
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy