io.fabric8.openshift.api.model.installer.gcp.v1.MachinePoolFluent Maven / Gradle / Ivy
package io.fabric8.openshift.api.model.installer.gcp.v1;
import java.lang.SuppressWarnings;
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 io.fabric8.kubernetes.api.builder.BaseFluent;
import java.util.Collection;
import java.lang.Object;
import java.util.List;
import java.util.Map;
/**
* Generated
*/
@SuppressWarnings("unchecked")
public class MachinePoolFluent> extends BaseFluent{
public MachinePoolFluent() {
}
public MachinePoolFluent(MachinePool instance) {
this.copyInstance(instance);
}
private String confidentialCompute;
private String onHostMaintenance;
private OSDiskBuilder osDisk;
private String secureBoot;
private List tags = new ArrayList();
private String type;
private List zones = new ArrayList();
private Map additionalProperties;
protected void copyInstance(MachinePool instance) {
instance = (instance != null ? instance : new MachinePool());
if (instance != null) {
this.withConfidentialCompute(instance.getConfidentialCompute());
this.withOnHostMaintenance(instance.getOnHostMaintenance());
this.withOsDisk(instance.getOsDisk());
this.withSecureBoot(instance.getSecureBoot());
this.withTags(instance.getTags());
this.withType(instance.getType());
this.withZones(instance.getZones());
this.withConfidentialCompute(instance.getConfidentialCompute());
this.withOnHostMaintenance(instance.getOnHostMaintenance());
this.withOsDisk(instance.getOsDisk());
this.withSecureBoot(instance.getSecureBoot());
this.withTags(instance.getTags());
this.withType(instance.getType());
this.withZones(instance.getZones());
this.withAdditionalProperties(instance.getAdditionalProperties());
}
}
public String getConfidentialCompute() {
return this.confidentialCompute;
}
public A withConfidentialCompute(String confidentialCompute) {
this.confidentialCompute=confidentialCompute; return (A) this;
}
public boolean hasConfidentialCompute() {
return this.confidentialCompute != null;
}
public String getOnHostMaintenance() {
return this.onHostMaintenance;
}
public A withOnHostMaintenance(String onHostMaintenance) {
this.onHostMaintenance=onHostMaintenance; return (A) this;
}
public boolean hasOnHostMaintenance() {
return this.onHostMaintenance != null;
}
public OSDisk buildOsDisk() {
return this.osDisk!=null ?this.osDisk.build():null;
}
public A withOsDisk(OSDisk osDisk) {
_visitables.get("osDisk").remove(this.osDisk);
if (osDisk!=null){ this.osDisk= new OSDiskBuilder(osDisk); _visitables.get("osDisk").add(this.osDisk);} else { this.osDisk = null; _visitables.get("osDisk").remove(this.osDisk); } return (A) this;
}
public boolean hasOsDisk() {
return this.osDisk != null;
}
public OsDiskNested withNewOsDisk() {
return new OsDiskNested(null);
}
public OsDiskNested withNewOsDiskLike(OSDisk item) {
return new OsDiskNested(item);
}
public OsDiskNested editOsDisk() {
return withNewOsDiskLike(java.util.Optional.ofNullable(buildOsDisk()).orElse(null));
}
public OsDiskNested editOrNewOsDisk() {
return withNewOsDiskLike(java.util.Optional.ofNullable(buildOsDisk()).orElse(new OSDiskBuilder().build()));
}
public OsDiskNested editOrNewOsDiskLike(OSDisk item) {
return withNewOsDiskLike(java.util.Optional.ofNullable(buildOsDisk()).orElse(item));
}
public String getSecureBoot() {
return this.secureBoot;
}
public A withSecureBoot(String secureBoot) {
this.secureBoot=secureBoot; return (A) this;
}
public boolean hasSecureBoot() {
return this.secureBoot != null;
}
public A addToTags(int index,String item) {
if (this.tags == null) {this.tags = new ArrayList();}
this.tags.add(index, item);
return (A)this;
}
public A setToTags(int index,String item) {
if (this.tags == null) {this.tags = new ArrayList();}
this.tags.set(index, item); return (A)this;
}
public A addToTags(java.lang.String... items) {
if (this.tags == null) {this.tags = new ArrayList();}
for (String item : items) {this.tags.add(item);} return (A)this;
}
public A addAllToTags(Collection items) {
if (this.tags == null) {this.tags = new ArrayList();}
for (String item : items) {this.tags.add(item);} return (A)this;
}
public A removeFromTags(java.lang.String... items) {
if (this.tags == null) return (A)this;
for (String item : items) { this.tags.remove(item);} return (A)this;
}
public A removeAllFromTags(Collection items) {
if (this.tags == null) return (A)this;
for (String item : items) { this.tags.remove(item);} return (A)this;
}
public List getTags() {
return this.tags;
}
public String getTag(int index) {
return this.tags.get(index);
}
public String getFirstTag() {
return this.tags.get(0);
}
public String getLastTag() {
return this.tags.get(tags.size() - 1);
}
public String getMatchingTag(Predicate predicate) {
for (String item: tags) { if(predicate.test(item)){ return item;} } return null;
}
public boolean hasMatchingTag(Predicate predicate) {
for (String item: tags) { if(predicate.test(item)){ return true;} } return false;
}
public A withTags(List tags) {
if (tags != null) {this.tags = new ArrayList(); for (String item : tags){this.addToTags(item);}} else { this.tags = null;} return (A) this;
}
public A withTags(java.lang.String... tags) {
if (this.tags != null) {this.tags.clear(); _visitables.remove("tags"); }
if (tags != null) {for (String item :tags){ this.addToTags(item);}} return (A) this;
}
public boolean hasTags() {
return tags != null && !tags.isEmpty();
}
public String getType() {
return this.type;
}
public A withType(String type) {
this.type=type; return (A) this;
}
public boolean hasType() {
return this.type != null;
}
public A addToZones(int index,String item) {
if (this.zones == null) {this.zones = new ArrayList();}
this.zones.add(index, item);
return (A)this;
}
public A setToZones(int index,String item) {
if (this.zones == null) {this.zones = new ArrayList();}
this.zones.set(index, item); return (A)this;
}
public A addToZones(java.lang.String... items) {
if (this.zones == null) {this.zones = new ArrayList();}
for (String item : items) {this.zones.add(item);} return (A)this;
}
public A addAllToZones(Collection items) {
if (this.zones == null) {this.zones = new ArrayList();}
for (String item : items) {this.zones.add(item);} return (A)this;
}
public A removeFromZones(java.lang.String... items) {
if (this.zones == null) return (A)this;
for (String item : items) { this.zones.remove(item);} return (A)this;
}
public A removeAllFromZones(Collection items) {
if (this.zones == null) return (A)this;
for (String item : items) { this.zones.remove(item);} return (A)this;
}
public List getZones() {
return this.zones;
}
public String getZone(int index) {
return this.zones.get(index);
}
public String getFirstZone() {
return this.zones.get(0);
}
public String getLastZone() {
return this.zones.get(zones.size() - 1);
}
public String getMatchingZone(Predicate predicate) {
for (String item: zones) { if(predicate.test(item)){ return item;} } return null;
}
public boolean hasMatchingZone(Predicate predicate) {
for (String item: zones) { if(predicate.test(item)){ return true;} } return false;
}
public A withZones(List zones) {
if (zones != null) {this.zones = new ArrayList(); for (String item : zones){this.addToZones(item);}} else { this.zones = null;} return (A) this;
}
public A withZones(java.lang.String... zones) {
if (this.zones != null) {this.zones.clear(); _visitables.remove("zones"); }
if (zones != null) {for (String item :zones){ this.addToZones(item);}} return (A) this;
}
public boolean hasZones() {
return zones != null && !zones.isEmpty();
}
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;
MachinePoolFluent that = (MachinePoolFluent) o;
if (!java.util.Objects.equals(confidentialCompute, that.confidentialCompute)) return false;
if (!java.util.Objects.equals(onHostMaintenance, that.onHostMaintenance)) return false;
if (!java.util.Objects.equals(osDisk, that.osDisk)) return false;
if (!java.util.Objects.equals(secureBoot, that.secureBoot)) return false;
if (!java.util.Objects.equals(tags, that.tags)) return false;
if (!java.util.Objects.equals(type, that.type)) return false;
if (!java.util.Objects.equals(zones, that.zones)) return false;
if (!java.util.Objects.equals(additionalProperties, that.additionalProperties)) return false;
return true;
}
public int hashCode() {
return java.util.Objects.hash(confidentialCompute, onHostMaintenance, osDisk, secureBoot, tags, type, zones, additionalProperties, super.hashCode());
}
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (confidentialCompute != null) { sb.append("confidentialCompute:"); sb.append(confidentialCompute + ","); }
if (onHostMaintenance != null) { sb.append("onHostMaintenance:"); sb.append(onHostMaintenance + ","); }
if (osDisk != null) { sb.append("osDisk:"); sb.append(osDisk + ","); }
if (secureBoot != null) { sb.append("secureBoot:"); sb.append(secureBoot + ","); }
if (tags != null && !tags.isEmpty()) { sb.append("tags:"); sb.append(tags + ","); }
if (type != null) { sb.append("type:"); sb.append(type + ","); }
if (zones != null && !zones.isEmpty()) { sb.append("zones:"); sb.append(zones + ","); }
if (additionalProperties != null && !additionalProperties.isEmpty()) { sb.append("additionalProperties:"); sb.append(additionalProperties); }
sb.append("}");
return sb.toString();
}
public class OsDiskNested extends OSDiskFluent> implements Nested{
OsDiskNested(OSDisk item) {
this.builder = new OSDiskBuilder(this, item);
}
OSDiskBuilder builder;
public N and() {
return (N) MachinePoolFluent.this.withOsDisk(builder.build());
}
public N endOsDisk() {
return and();
}
}
} © 2015 - 2025 Weber Informatics LLC | Privacy Policy