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

io.fabric8.openshift.api.model.miscellaneous.metal3.v1alpha1.CPUFluentImpl Maven / Gradle / Ivy

There is a newer version: 6.13.4
Show newest version
package io.fabric8.openshift.api.model.miscellaneous.metal3.v1alpha1;

import java.lang.SuppressWarnings;
import java.util.ArrayList;
import java.lang.String;
import java.lang.Double;
import java.util.LinkedHashMap;
import java.util.function.Predicate;
import java.lang.Integer;
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
  */
  @SuppressWarnings(value = "unchecked")
  public class CPUFluentImpl> extends BaseFluent implements CPUFluent{
  public CPUFluentImpl() {
  }
  public CPUFluentImpl(CPU instance) {
    this.withArch(instance.getArch()); 
    this.withClockMegahertz(instance.getClockMegahertz()); 
    this.withCount(instance.getCount()); 
    this.withFlags(instance.getFlags()); 
    this.withModel(instance.getModel()); 
    this.withAdditionalProperties(instance.getAdditionalProperties());

  }
  private String arch;
  private Double clockMegahertz;
  private Integer count;
  private List flags = new ArrayList();
  private String model;
  private Map additionalProperties;
  public String getArch() {
    return this.arch;
  }
  public A withArch(String arch) {
    this.arch=arch; return (A) this;
  }
  public Boolean hasArch() {
    return this.arch != null;
  }
  public Double getClockMegahertz() {
    return this.clockMegahertz;
  }
  public A withClockMegahertz(Double clockMegahertz) {
    this.clockMegahertz=clockMegahertz; return (A) this;
  }
  public Boolean hasClockMegahertz() {
    return this.clockMegahertz != null;
  }
  public Integer getCount() {
    return this.count;
  }
  public A withCount(Integer count) {
    this.count=count; return (A) this;
  }
  public Boolean hasCount() {
    return this.count != null;
  }
  public A addToFlags(Integer index,String item) {
    if (this.flags == null) {this.flags = new ArrayList();}
    this.flags.add(index, item);
    return (A)this;
  }
  public A setToFlags(Integer index,String item) {
    if (this.flags == null) {this.flags = new ArrayList();}
    this.flags.set(index, item); return (A)this;
  }
  public A addToFlags(java.lang.String... items) {
    if (this.flags == null) {this.flags = new ArrayList();}
    for (String item : items) {this.flags.add(item);} return (A)this;
  }
  public A addAllToFlags(Collection items) {
    if (this.flags == null) {this.flags = new ArrayList();}
    for (String item : items) {this.flags.add(item);} return (A)this;
  }
  public A removeFromFlags(java.lang.String... items) {
    for (String item : items) {if (this.flags!= null){ this.flags.remove(item);}} return (A)this;
  }
  public A removeAllFromFlags(Collection items) {
    for (String item : items) {if (this.flags!= null){ this.flags.remove(item);}} return (A)this;
  }
  public List getFlags() {
    return this.flags;
  }
  public String getFlag(Integer index) {
    return this.flags.get(index);
  }
  public String getFirstFlag() {
    return this.flags.get(0);
  }
  public String getLastFlag() {
    return this.flags.get(flags.size() - 1);
  }
  public String getMatchingFlag(Predicate predicate) {
    for (String item: flags) { if(predicate.test(item)){ return item;} } return null;
  }
  public Boolean hasMatchingFlag(Predicate predicate) {
    for (String item: flags) { if(predicate.test(item)){ return true;} } return false;
  }
  public A withFlags(List flags) {
    if (flags != null) {this.flags = new ArrayList(); for (String item : flags){this.addToFlags(item);}} else { this.flags = null;} return (A) this;
  }
  public A withFlags(java.lang.String... flags) {
    if (this.flags != null) {this.flags.clear();}
    if (flags != null) {for (String item :flags){ this.addToFlags(item);}} return (A) this;
  }
  public Boolean hasFlags() {
    return flags != null && !flags.isEmpty();
  }
  public String getModel() {
    return this.model;
  }
  public A withModel(String model) {
    this.model=model; return (A) this;
  }
  public Boolean hasModel() {
    return this.model != null;
  }
  public A addToAdditionalProperties(String key,Object value) {
    if(this.additionalProperties == null && key != null && value != null) { this.additionalProperties = new LinkedHashMap(); }
    if(key != null && value != null) {this.additionalProperties.put(key, value);} return (A)this;
  }
  public A addToAdditionalProperties(Map map) {
    if(this.additionalProperties == null && map != null) { this.additionalProperties = new LinkedHashMap(); }
    if(map != null) { this.additionalProperties.putAll(map);} return (A)this;
  }
  public A removeFromAdditionalProperties(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(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 Map getAdditionalProperties() {
    return this.additionalProperties;
  }
  public A withAdditionalProperties(Map additionalProperties) {
    if (additionalProperties == null) { this.additionalProperties =  null;} else {this.additionalProperties = new LinkedHashMap(additionalProperties);} return (A) this;
  }
  public Boolean hasAdditionalProperties() {
    return this.additionalProperties != null;
  }
  public boolean equals(Object o) {
    if (this == o) return true;
    if (o == null || getClass() != o.getClass()) return false;
    CPUFluentImpl that = (CPUFluentImpl) o;
    if (arch != null ? !arch.equals(that.arch) :that.arch != null) return false;
    if (clockMegahertz != null ? !clockMegahertz.equals(that.clockMegahertz) :that.clockMegahertz != null) return false;
    if (count != null ? !count.equals(that.count) :that.count != null) return false;
    if (flags != null ? !flags.equals(that.flags) :that.flags != null) return false;
    if (model != null ? !model.equals(that.model) :that.model != 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(arch,  clockMegahertz,  count,  flags,  model,  additionalProperties,  super.hashCode());
  }
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("{");
    if (arch != null) { sb.append("arch:"); sb.append(arch + ","); }
    if (clockMegahertz != null) { sb.append("clockMegahertz:"); sb.append(clockMegahertz + ","); }
    if (count != null) { sb.append("count:"); sb.append(count + ","); }
    if (flags != null && !flags.isEmpty()) { sb.append("flags:"); sb.append(flags + ","); }
    if (model != null) { sb.append("model:"); sb.append(model + ","); }
    if (additionalProperties != null && !additionalProperties.isEmpty()) { sb.append("additionalProperties:"); sb.append(additionalProperties); }
    sb.append("}");
    return sb.toString();
  }
  
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy