
io.fabric8.kubernetes.api.model.storage.CSINodeDriverFluentImpl Maven / Gradle / Ivy
package io.fabric8.kubernetes.api.model.storage;
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
*/
public class CSINodeDriverFluentImpl> extends io.fabric8.kubernetes.api.builder.BaseFluent implements io.fabric8.kubernetes.api.model.storage.CSINodeDriverFluent{
public CSINodeDriverFluentImpl() {
}
public CSINodeDriverFluentImpl(io.fabric8.kubernetes.api.model.storage.CSINodeDriver instance) {
this.withAllocatable(instance.getAllocatable());
this.withName(instance.getName());
this.withNodeID(instance.getNodeID());
this.withTopologyKeys(instance.getTopologyKeys());
this.withAdditionalProperties(instance.getAdditionalProperties());
}
private io.fabric8.kubernetes.api.model.storage.VolumeNodeResourcesBuilder allocatable;
private java.lang.String name;
private java.lang.String nodeID;
private java.util.List topologyKeys = new java.util.ArrayList();
private java.util.Map additionalProperties;
/**
* This method has been deprecated, please use method buildAllocatable instead.
* @return The buildable object.
*/
@java.lang.Deprecated
public io.fabric8.kubernetes.api.model.storage.VolumeNodeResources getAllocatable() {
return this.allocatable!=null?this.allocatable.build():null;
}
public io.fabric8.kubernetes.api.model.storage.VolumeNodeResources buildAllocatable() {
return this.allocatable!=null?this.allocatable.build():null;
}
public A withAllocatable(io.fabric8.kubernetes.api.model.storage.VolumeNodeResources allocatable) {
_visitables.get("allocatable").remove(this.allocatable);
if (allocatable!=null){ this.allocatable= new io.fabric8.kubernetes.api.model.storage.VolumeNodeResourcesBuilder(allocatable); _visitables.get("allocatable").add(this.allocatable);} return (A) this;
}
public java.lang.Boolean hasAllocatable() {
return this.allocatable != null;
}
public A withNewAllocatable(java.lang.Integer count) {
return (A)withAllocatable(new VolumeNodeResources(count));
}
public io.fabric8.kubernetes.api.model.storage.CSINodeDriverFluent.AllocatableNested withNewAllocatable() {
return new io.fabric8.kubernetes.api.model.storage.CSINodeDriverFluentImpl.AllocatableNestedImpl();
}
public io.fabric8.kubernetes.api.model.storage.CSINodeDriverFluent.AllocatableNested withNewAllocatableLike(io.fabric8.kubernetes.api.model.storage.VolumeNodeResources item) {
return new io.fabric8.kubernetes.api.model.storage.CSINodeDriverFluentImpl.AllocatableNestedImpl(item);
}
public io.fabric8.kubernetes.api.model.storage.CSINodeDriverFluent.AllocatableNested editAllocatable() {
return withNewAllocatableLike(getAllocatable());
}
public io.fabric8.kubernetes.api.model.storage.CSINodeDriverFluent.AllocatableNested editOrNewAllocatable() {
return withNewAllocatableLike(getAllocatable() != null ? getAllocatable(): new io.fabric8.kubernetes.api.model.storage.VolumeNodeResourcesBuilder().build());
}
public io.fabric8.kubernetes.api.model.storage.CSINodeDriverFluent.AllocatableNested editOrNewAllocatableLike(io.fabric8.kubernetes.api.model.storage.VolumeNodeResources item) {
return withNewAllocatableLike(getAllocatable() != null ? getAllocatable(): item);
}
public java.lang.String getName() {
return this.name;
}
public A withName(java.lang.String name) {
this.name=name; return (A) this;
}
public java.lang.Boolean hasName() {
return this.name != null;
}
/**
* Method is deprecated. use withName instead.
*/
@java.lang.Deprecated
public A withNewName(java.lang.String arg0) {
return (A)withName(new String(arg0));
}
public java.lang.String getNodeID() {
return this.nodeID;
}
public A withNodeID(java.lang.String nodeID) {
this.nodeID=nodeID; return (A) this;
}
public java.lang.Boolean hasNodeID() {
return this.nodeID != null;
}
/**
* Method is deprecated. use withNodeID instead.
*/
@java.lang.Deprecated
public A withNewNodeID(java.lang.String arg0) {
return (A)withNodeID(new String(arg0));
}
public A addToTopologyKeys(java.lang.Integer index,java.lang.String item) {
if (this.topologyKeys == null) {this.topologyKeys = new java.util.ArrayList();}
this.topologyKeys.add(index, item);
return (A)this;
}
public A setToTopologyKeys(java.lang.Integer index,java.lang.String item) {
if (this.topologyKeys == null) {this.topologyKeys = new java.util.ArrayList();}
this.topologyKeys.set(index, item); return (A)this;
}
public A addToTopologyKeys(java.lang.String... items) {
if (this.topologyKeys == null) {this.topologyKeys = new java.util.ArrayList();}
for (java.lang.String item : items) {this.topologyKeys.add(item);} return (A)this;
}
public A addAllToTopologyKeys(java.util.Collection items) {
if (this.topologyKeys == null) {this.topologyKeys = new java.util.ArrayList();}
for (java.lang.String item : items) {this.topologyKeys.add(item);} return (A)this;
}
public A removeFromTopologyKeys(java.lang.String... items) {
for (java.lang.String item : items) {if (this.topologyKeys!= null){ this.topologyKeys.remove(item);}} return (A)this;
}
public A removeAllFromTopologyKeys(java.util.Collection items) {
for (java.lang.String item : items) {if (this.topologyKeys!= null){ this.topologyKeys.remove(item);}} return (A)this;
}
public java.util.List getTopologyKeys() {
return this.topologyKeys;
}
public java.lang.String getTopologyKey(java.lang.Integer index) {
return this.topologyKeys.get(index);
}
public java.lang.String getFirstTopologyKey() {
return this.topologyKeys.get(0);
}
public java.lang.String getLastTopologyKey() {
return this.topologyKeys.get(topologyKeys.size() - 1);
}
public java.lang.String getMatchingTopologyKey(java.util.function.Predicate predicate) {
for (java.lang.String item: topologyKeys) { if(predicate.test(item)){ return item;} } return null;
}
public java.lang.Boolean hasMatchingTopologyKey(java.util.function.Predicate predicate) {
for (java.lang.String item: topologyKeys) { if(predicate.test(item)){ return true;} } return false;
}
public A withTopologyKeys(java.util.List topologyKeys) {
if (topologyKeys != null) {this.topologyKeys = new java.util.ArrayList(); for (java.lang.String item : topologyKeys){this.addToTopologyKeys(item);}} else { this.topologyKeys = null;} return (A) this;
}
public A withTopologyKeys(java.lang.String... topologyKeys) {
if (this.topologyKeys != null) {this.topologyKeys.clear();}
if (topologyKeys != null) {for (java.lang.String item :topologyKeys){ this.addToTopologyKeys(item);}} return (A) this;
}
public java.lang.Boolean hasTopologyKeys() {
return topologyKeys != null && !topologyKeys.isEmpty();
}
public A addNewTopologyKey(java.lang.String arg0) {
return (A)addToTopologyKeys(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;
CSINodeDriverFluentImpl that = (CSINodeDriverFluentImpl) o;
if (allocatable != null ? !allocatable.equals(that.allocatable) :that.allocatable != null) return false;
if (name != null ? !name.equals(that.name) :that.name != null) return false;
if (nodeID != null ? !nodeID.equals(that.nodeID) :that.nodeID != null) return false;
if (topologyKeys != null ? !topologyKeys.equals(that.topologyKeys) :that.topologyKeys != 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(allocatable, name, nodeID, topologyKeys, additionalProperties, super.hashCode());
}
public class AllocatableNestedImpl extends io.fabric8.kubernetes.api.model.storage.VolumeNodeResourcesFluentImpl> implements io.fabric8.kubernetes.api.model.storage.CSINodeDriverFluent.AllocatableNested,io.fabric8.kubernetes.api.builder.Nested{
AllocatableNestedImpl(io.fabric8.kubernetes.api.model.storage.VolumeNodeResources item) {
this.builder = new io.fabric8.kubernetes.api.model.storage.VolumeNodeResourcesBuilder(this, item);
}
AllocatableNestedImpl() {
this.builder = new io.fabric8.kubernetes.api.model.storage.VolumeNodeResourcesBuilder(this);
}
io.fabric8.kubernetes.api.model.storage.VolumeNodeResourcesBuilder builder;
public N and() {
return (N) CSINodeDriverFluentImpl.this.withAllocatable(builder.build());
}
public N endAllocatable() {
return and();
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy