io.fabric8.openshift.api.model.miscellaneous.metal3.v1alpha1.HardwareRAIDVolumeFluent Maven / Gradle / Ivy
package io.fabric8.openshift.api.model.miscellaneous.metal3.v1alpha1;
import java.lang.SuppressWarnings;
import java.util.ArrayList;
import java.lang.String;
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("unchecked")
public class HardwareRAIDVolumeFluent> extends BaseFluent{
public HardwareRAIDVolumeFluent() {
}
public HardwareRAIDVolumeFluent(HardwareRAIDVolume instance) {
this.copyInstance(instance);
}
private String controller;
private String level;
private String name;
private Integer numberOfPhysicalDisks;
private List physicalDisks = new ArrayList();
private Boolean rotational;
private Integer sizeGibibytes;
private Map additionalProperties;
protected void copyInstance(HardwareRAIDVolume instance) {
instance = (instance != null ? instance : new HardwareRAIDVolume());
if (instance != null) {
this.withController(instance.getController());
this.withLevel(instance.getLevel());
this.withName(instance.getName());
this.withNumberOfPhysicalDisks(instance.getNumberOfPhysicalDisks());
this.withPhysicalDisks(instance.getPhysicalDisks());
this.withRotational(instance.getRotational());
this.withSizeGibibytes(instance.getSizeGibibytes());
this.withAdditionalProperties(instance.getAdditionalProperties());
}
}
public String getController() {
return this.controller;
}
public A withController(String controller) {
this.controller = controller;
return (A) this;
}
public boolean hasController() {
return this.controller != null;
}
public String getLevel() {
return this.level;
}
public A withLevel(String level) {
this.level = level;
return (A) this;
}
public boolean hasLevel() {
return this.level != null;
}
public String getName() {
return this.name;
}
public A withName(String name) {
this.name = name;
return (A) this;
}
public boolean hasName() {
return this.name != null;
}
public Integer getNumberOfPhysicalDisks() {
return this.numberOfPhysicalDisks;
}
public A withNumberOfPhysicalDisks(Integer numberOfPhysicalDisks) {
this.numberOfPhysicalDisks = numberOfPhysicalDisks;
return (A) this;
}
public boolean hasNumberOfPhysicalDisks() {
return this.numberOfPhysicalDisks != null;
}
public A addToPhysicalDisks(int index,String item) {
if (this.physicalDisks == null) {this.physicalDisks = new ArrayList();}
this.physicalDisks.add(index, item);
return (A)this;
}
public A setToPhysicalDisks(int index,String item) {
if (this.physicalDisks == null) {this.physicalDisks = new ArrayList();}
this.physicalDisks.set(index, item); return (A)this;
}
public A addToPhysicalDisks(java.lang.String... items) {
if (this.physicalDisks == null) {this.physicalDisks = new ArrayList();}
for (String item : items) {this.physicalDisks.add(item);} return (A)this;
}
public A addAllToPhysicalDisks(Collection items) {
if (this.physicalDisks == null) {this.physicalDisks = new ArrayList();}
for (String item : items) {this.physicalDisks.add(item);} return (A)this;
}
public A removeFromPhysicalDisks(java.lang.String... items) {
if (this.physicalDisks == null) return (A)this;
for (String item : items) { this.physicalDisks.remove(item);} return (A)this;
}
public A removeAllFromPhysicalDisks(Collection items) {
if (this.physicalDisks == null) return (A)this;
for (String item : items) { this.physicalDisks.remove(item);} return (A)this;
}
public List getPhysicalDisks() {
return this.physicalDisks;
}
public String getPhysicalDisk(int index) {
return this.physicalDisks.get(index);
}
public String getFirstPhysicalDisk() {
return this.physicalDisks.get(0);
}
public String getLastPhysicalDisk() {
return this.physicalDisks.get(physicalDisks.size() - 1);
}
public String getMatchingPhysicalDisk(Predicate predicate) {
for (String item : physicalDisks) {
if (predicate.test(item)) {
return item;
}
}
return null;
}
public boolean hasMatchingPhysicalDisk(Predicate predicate) {
for (String item : physicalDisks) {
if (predicate.test(item)) {
return true;
}
}
return false;
}
public A withPhysicalDisks(List physicalDisks) {
if (physicalDisks != null) {
this.physicalDisks = new ArrayList();
for (String item : physicalDisks) {
this.addToPhysicalDisks(item);
}
} else {
this.physicalDisks = null;
}
return (A) this;
}
public A withPhysicalDisks(java.lang.String... physicalDisks) {
if (this.physicalDisks != null) {
this.physicalDisks.clear();
_visitables.remove("physicalDisks");
}
if (physicalDisks != null) {
for (String item : physicalDisks) {
this.addToPhysicalDisks(item);
}
}
return (A) this;
}
public boolean hasPhysicalDisks() {
return this.physicalDisks != null && !this.physicalDisks.isEmpty();
}
public Boolean getRotational() {
return this.rotational;
}
public A withRotational(Boolean rotational) {
this.rotational = rotational;
return (A) this;
}
public boolean hasRotational() {
return this.rotational != null;
}
public Integer getSizeGibibytes() {
return this.sizeGibibytes;
}
public A withSizeGibibytes(Integer sizeGibibytes) {
this.sizeGibibytes = sizeGibibytes;
return (A) this;
}
public boolean hasSizeGibibytes() {
return this.sizeGibibytes != 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;
if (!super.equals(o)) return false;
HardwareRAIDVolumeFluent that = (HardwareRAIDVolumeFluent) o;
if (!java.util.Objects.equals(controller, that.controller)) return false;
if (!java.util.Objects.equals(level, that.level)) return false;
if (!java.util.Objects.equals(name, that.name)) return false;
if (!java.util.Objects.equals(numberOfPhysicalDisks, that.numberOfPhysicalDisks)) return false;
if (!java.util.Objects.equals(physicalDisks, that.physicalDisks)) return false;
if (!java.util.Objects.equals(rotational, that.rotational)) return false;
if (!java.util.Objects.equals(sizeGibibytes, that.sizeGibibytes)) return false;
if (!java.util.Objects.equals(additionalProperties, that.additionalProperties)) return false;
return true;
}
public int hashCode() {
return java.util.Objects.hash(controller, level, name, numberOfPhysicalDisks, physicalDisks, rotational, sizeGibibytes, additionalProperties, super.hashCode());
}
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (controller != null) { sb.append("controller:"); sb.append(controller + ","); }
if (level != null) { sb.append("level:"); sb.append(level + ","); }
if (name != null) { sb.append("name:"); sb.append(name + ","); }
if (numberOfPhysicalDisks != null) { sb.append("numberOfPhysicalDisks:"); sb.append(numberOfPhysicalDisks + ","); }
if (physicalDisks != null && !physicalDisks.isEmpty()) { sb.append("physicalDisks:"); sb.append(physicalDisks + ","); }
if (rotational != null) { sb.append("rotational:"); sb.append(rotational + ","); }
if (sizeGibibytes != null) { sb.append("sizeGibibytes:"); sb.append(sizeGibibytes + ","); }
if (additionalProperties != null && !additionalProperties.isEmpty()) { sb.append("additionalProperties:"); sb.append(additionalProperties); }
sb.append("}");
return sb.toString();
}
public A withRotational() {
return withRotational(true);
}
}