io.fabric8.openshift.api.model.installer.gcp.v1.MachinePoolFluentImpl 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 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
*/
@SuppressWarnings(value = "unchecked")
public class MachinePoolFluentImpl> extends BaseFluent implements MachinePoolFluent{
public MachinePoolFluentImpl() {
}
public MachinePoolFluentImpl(io.fabric8.openshift.api.model.installer.gcp.v1.MachinePool instance) {
this.withOsDisk(instance.getOsDisk());
this.withType(instance.getType());
this.withZones(instance.getZones());
this.withAdditionalProperties(instance.getAdditionalProperties());
}
private OSDiskBuilder osDisk;
private String type;
private List zones = new ArrayList();
private Map additionalProperties;
/**
* This method has been deprecated, please use method buildOsDisk instead.
* @return The buildable object.
*/
@Deprecated
public io.fabric8.openshift.api.model.installer.gcp.v1.OSDisk getOsDisk() {
return this.osDisk!=null ?this.osDisk.build():null;
}
public io.fabric8.openshift.api.model.installer.gcp.v1.OSDisk buildOsDisk() {
return this.osDisk!=null ?this.osDisk.build():null;
}
public A withOsDisk(io.fabric8.openshift.api.model.installer.gcp.v1.OSDisk osDisk) {
_visitables.get("osDisk").remove(this.osDisk);
if (osDisk!=null){ this.osDisk= new OSDiskBuilder(osDisk); _visitables.get("osDisk").add(this.osDisk);} return (A) this;
}
public Boolean hasOsDisk() {
return this.osDisk != null;
}
public MachinePoolFluent.OsDiskNested withNewOsDisk() {
return new MachinePoolFluentImpl.OsDiskNestedImpl();
}
public io.fabric8.openshift.api.model.installer.gcp.v1.MachinePoolFluent.OsDiskNested withNewOsDiskLike(io.fabric8.openshift.api.model.installer.gcp.v1.OSDisk item) {
return new MachinePoolFluentImpl.OsDiskNestedImpl(item);
}
public io.fabric8.openshift.api.model.installer.gcp.v1.MachinePoolFluent.OsDiskNested editOsDisk() {
return withNewOsDiskLike(getOsDisk());
}
public io.fabric8.openshift.api.model.installer.gcp.v1.MachinePoolFluent.OsDiskNested editOrNewOsDisk() {
return withNewOsDiskLike(getOsDisk() != null ? getOsDisk(): new io.fabric8.openshift.api.model.installer.gcp.v1.OSDiskBuilder().build());
}
public io.fabric8.openshift.api.model.installer.gcp.v1.MachinePoolFluent.OsDiskNested editOrNewOsDiskLike(io.fabric8.openshift.api.model.installer.gcp.v1.OSDisk item) {
return withNewOsDiskLike(getOsDisk() != null ? getOsDisk(): item);
}
public java.lang.String getType() {
return this.type;
}
public A withType(java.lang.String type) {
this.type=type; return (A) this;
}
public java.lang.Boolean hasType() {
return this.type != null;
}
public A addToZones(Integer index,java.lang.String item) {
if (this.zones == null) {this.zones = new java.util.ArrayList();}
this.zones.add(index, item);
return (A)this;
}
public A setToZones(java.lang.Integer index,java.lang.String item) {
if (this.zones == null) {this.zones = new java.util.ArrayList();}
this.zones.set(index, item); return (A)this;
}
public A addToZones(java.lang.String... items) {
if (this.zones == null) {this.zones = new java.util.ArrayList();}
for (java.lang.String item : items) {this.zones.add(item);} return (A)this;
}
public A addAllToZones(Collection items) {
if (this.zones == null) {this.zones = new java.util.ArrayList();}
for (java.lang.String item : items) {this.zones.add(item);} return (A)this;
}
public A removeFromZones(java.lang.String... items) {
for (java.lang.String item : items) {if (this.zones!= null){ this.zones.remove(item);}} return (A)this;
}
public A removeAllFromZones(java.util.Collection items) {
for (java.lang.String item : items) {if (this.zones!= null){ this.zones.remove(item);}} return (A)this;
}
public java.util.List getZones() {
return this.zones;
}
public java.lang.String getZone(java.lang.Integer index) {
return this.zones.get(index);
}
public java.lang.String getFirstZone() {
return this.zones.get(0);
}
public java.lang.String getLastZone() {
return this.zones.get(zones.size() - 1);
}
public java.lang.String getMatchingZone(Predicate predicate) {
for (java.lang.String item: zones) { if(predicate.test(item)){ return item;} } return null;
}
public java.lang.Boolean hasMatchingZone(java.util.function.Predicate predicate) {
for (java.lang.String item: zones) { if(predicate.test(item)){ return true;} } return false;
}
public A withZones(java.util.List zones) {
if (zones != null) {this.zones = new java.util.ArrayList(); for (java.lang.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();}
if (zones != null) {for (java.lang.String item :zones){ this.addToZones(item);}} return (A) this;
}
public java.lang.Boolean hasZones() {
return zones != null && !zones.isEmpty();
}
public A addToAdditionalProperties(java.lang.String key,java.lang.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(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;
MachinePoolFluentImpl that = (MachinePoolFluentImpl) o;
if (osDisk != null ? !osDisk.equals(that.osDisk) :that.osDisk != null) return false;
if (type != null ? !type.equals(that.type) :that.type != null) return false;
if (zones != null ? !zones.equals(that.zones) :that.zones != 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(osDisk, type, zones, additionalProperties, super.hashCode());
}
public java.lang.String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (osDisk != null) { sb.append("osDisk:"); sb.append(osDisk + ","); }
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();
}
class OsDiskNestedImpl extends OSDiskFluentImpl> implements io.fabric8.openshift.api.model.installer.gcp.v1.MachinePoolFluent.OsDiskNested,Nested{
OsDiskNestedImpl(io.fabric8.openshift.api.model.installer.gcp.v1.OSDisk item) {
this.builder = new OSDiskBuilder(this, item);
}
OsDiskNestedImpl() {
this.builder = new io.fabric8.openshift.api.model.installer.gcp.v1.OSDiskBuilder(this);
}
io.fabric8.openshift.api.model.installer.gcp.v1.OSDiskBuilder builder;
public N and() {
return (N) MachinePoolFluentImpl.this.withOsDisk(builder.build());
}
public N endOsDisk() {
return and();
}
}
} © 2015 - 2025 Weber Informatics LLC | Privacy Policy