annotations.io.fabric8.kubernetes.api.model.PodSpecFluent Maven / Gradle / Ivy
package io.fabric8.kubernetes.api.model;
import java.util.HashMap;
import java.util.Map;
import java.util.List;
import java.util.ArrayList;
import io.fabric8.common.Nested;
import io.fabric8.common.Builder;
import io.fabric8.common.Fluent;
import io.fabric8.common.Visitable;
import io.fabric8.common.BaseFluent;
public class PodSpecFluent> extends BaseFluent implements Fluent{
List containers = new ArrayList(); String dnsPolicy; String host; Boolean hostNetwork; Map nodeSelector = new HashMap(); String restartPolicy; Long terminationGracePeriodSeconds; List volumes = new ArrayList(); Map additionalProperties = new HashMap();
public T addToContainers( Container item){
if (item != null) {ContainerBuilder builder = new ContainerBuilder(item);_visitables.add(builder);this.containers.add(builder);} return (T)this;
}
public List getContainers(){
return build(containers);
}
public T withContainers( List containers){
this.containers.clear();if (containers != null) {for (Container item : containers){this.addToContainers(item);}} return (T) this;
}
public ContainersNested addNewContainer(){
return new ContainersNested();
}
public String getDnsPolicy(){
return this.dnsPolicy;
}
public T withDnsPolicy( String dnsPolicy){
this.dnsPolicy=dnsPolicy; return (T) this;
}
public String getHost(){
return this.host;
}
public T withHost( String host){
this.host=host; return (T) this;
}
public Boolean isHostNetwork(){
return this.hostNetwork;
}
public T withHostNetwork( Boolean hostNetwork){
this.hostNetwork=hostNetwork; return (T) this;
}
public T addToNodeSelector( String key, String value){
if(key != null && value != null) {this.nodeSelector.put(key, value);} return (T)this;
}
public Map getNodeSelector(){
return this.nodeSelector;
}
public T withNodeSelector( Map nodeSelector){
this.nodeSelector.clear();if (nodeSelector != null) {this.nodeSelector.putAll(nodeSelector);} return (T) this;
}
public String getRestartPolicy(){
return this.restartPolicy;
}
public T withRestartPolicy( String restartPolicy){
this.restartPolicy=restartPolicy; return (T) this;
}
public Long getTerminationGracePeriodSeconds(){
return this.terminationGracePeriodSeconds;
}
public T withTerminationGracePeriodSeconds( Long terminationGracePeriodSeconds){
this.terminationGracePeriodSeconds=terminationGracePeriodSeconds; return (T) this;
}
public T addToVolumes( Volume item){
if (item != null) {VolumeBuilder builder = new VolumeBuilder(item);_visitables.add(builder);this.volumes.add(builder);} return (T)this;
}
public List getVolumes(){
return build(volumes);
}
public T withVolumes( List volumes){
this.volumes.clear();if (volumes != null) {for (Volume item : volumes){this.addToVolumes(item);}} return (T) this;
}
public VolumesNested addNewVolume(){
return new VolumesNested();
}
public T addToAdditionalProperties( String key, Object value){
if(key != null && value != null) {this.additionalProperties.put(key, value);} return (T)this;
}
public Map getAdditionalProperties(){
return this.additionalProperties;
}
public T withAdditionalProperties( Map additionalProperties){
this.additionalProperties.clear();if (additionalProperties != null) {this.additionalProperties.putAll(additionalProperties);} return (T) this;
}
public class ContainersNested extends ContainerFluent> implements Nested{
private final ContainerBuilder builder = new ContainerBuilder(this);
public N endContainer(){
return and();
}
public N and(){
return (N) PodSpecFluent.this.addToContainers(builder.build());
}
}
public class VolumesNested extends VolumeFluent> implements Nested{
private final VolumeBuilder builder = new VolumeBuilder(this);
public N endVolume(){
return and();
}
public N and(){
return (N) PodSpecFluent.this.addToVolumes(builder.build());
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy