annotations.io.fabric8.kubernetes.api.model.ContainerFluent 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.Fluent;
public class ContainerFluent> implements Fluent{
private List args = new ArrayList();
private Capabilities capabilities ;
private List command = new ArrayList();
private List env = new ArrayList();
private String image ;
private String imagePullPolicy ;
private Lifecycle lifecycle ;
private Probe livenessProbe ;
private String name ;
private List ports = new ArrayList();
private Boolean privileged ;
private Probe readinessProbe ;
private ResourceRequirements resources ;
private String terminationMessagePath ;
private List volumeMounts = new ArrayList();
private String workingDir ;
private Map additionalProperties = new HashMap();
public List getArgs(){
return this.args;
}
public T withArgs(List args){
this.args.clear();if (args != null) {this.args.addAll(args);} return (T) this;
}
public Capabilities getCapabilities(){
return this.capabilities;
}
public T withCapabilities(Capabilities capabilities){
this.capabilities=capabilities; return (T) this;
}
public List getCommand(){
return this.command;
}
public T withCommand(List command){
this.command.clear();if (command != null) {this.command.addAll(command);} return (T) this;
}
public List getEnv(){
return this.env;
}
public T withEnv(List env){
this.env.clear();if (env != null) {this.env.addAll(env);} return (T) this;
}
public String getImage(){
return this.image;
}
public T withImage(String image){
this.image=image; return (T) this;
}
public String getImagePullPolicy(){
return this.imagePullPolicy;
}
public T withImagePullPolicy(String imagePullPolicy){
this.imagePullPolicy=imagePullPolicy; return (T) this;
}
public Lifecycle getLifecycle(){
return this.lifecycle;
}
public T withLifecycle(Lifecycle lifecycle){
this.lifecycle=lifecycle; return (T) this;
}
public Probe getLivenessProbe(){
return this.livenessProbe;
}
public T withLivenessProbe(Probe livenessProbe){
this.livenessProbe=livenessProbe; return (T) this;
}
public String getName(){
return this.name;
}
public T withName(String name){
this.name=name; return (T) this;
}
public List getPorts(){
return this.ports;
}
public T withPorts(List ports){
this.ports.clear();if (ports != null) {this.ports.addAll(ports);} return (T) this;
}
public Boolean isPrivileged(){
return this.privileged;
}
public T withPrivileged(Boolean privileged){
this.privileged=privileged; return (T) this;
}
public Probe getReadinessProbe(){
return this.readinessProbe;
}
public T withReadinessProbe(Probe readinessProbe){
this.readinessProbe=readinessProbe; return (T) this;
}
public ResourceRequirements getResources(){
return this.resources;
}
public T withResources(ResourceRequirements resources){
this.resources=resources; return (T) this;
}
public String getTerminationMessagePath(){
return this.terminationMessagePath;
}
public T withTerminationMessagePath(String terminationMessagePath){
this.terminationMessagePath=terminationMessagePath; return (T) this;
}
public List getVolumeMounts(){
return this.volumeMounts;
}
public T withVolumeMounts(List volumeMounts){
this.volumeMounts.clear();if (volumeMounts != null) {this.volumeMounts.addAll(volumeMounts);} return (T) this;
}
public String getWorkingDir(){
return this.workingDir;
}
public T withWorkingDir(String workingDir){
this.workingDir=workingDir; 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 T addToArgs(String item){
if (item != null) {this.args.add(item);} return (T)this;
}
public CapabilitiesNested withNewCapabilities(){
return new CapabilitiesNested();
}
public T addToCommand(String item){
if (item != null) {this.command.add(item);} return (T)this;
}
public T addToEnv(EnvVar item){
if (item != null) {this.env.add(item);} return (T)this;
}
public EnvNested addNewEnv(){
return new EnvNested();
}
public T addNewEnv(String name, String value){
return addToEnv(new EnvVar(name, value));
}
public LifecycleNested withNewLifecycle(){
return new LifecycleNested();
}
public T addToPorts(ContainerPort item){
if (item != null) {this.ports.add(item);} return (T)this;
}
public PortsNested addNewPort(){
return new PortsNested();
}
public T addNewPort(Integer containerPort, String hostIP, Integer hostPort, String name, String protocol){
return addToPorts(new ContainerPort(containerPort, hostIP, hostPort, name, protocol));
}
public ResourcesNested withNewResources(){
return new ResourcesNested();
}
public T addToVolumeMounts(VolumeMount item){
if (item != null) {this.volumeMounts.add(item);} return (T)this;
}
public VolumeMountsNested addNewVolumeMount(){
return new VolumeMountsNested();
}
public T addNewVolumeMount(String mountPath, String name, Boolean readOnly){
return addToVolumeMounts(new VolumeMount(mountPath, name, readOnly));
}
public T addToAdditionalProperties(String key, Object value){
if(key != null && value != null) {this.additionalProperties.put(key, value);} return (T)this;
}
public class CapabilitiesNested extends CapabilitiesFluent> implements Nested{
private final CapabilitiesBuilder builder = new CapabilitiesBuilder(this);
public N and(){
return (N) ContainerFluent.this.withCapabilities(builder.build());
}
public N endCapabilities(){
return and();
}
}
public class EnvNested extends EnvVarFluent> implements Nested{
private final EnvVarBuilder builder = new EnvVarBuilder(this);
public N and(){
return (N) ContainerFluent.this.addToEnv(builder.build());
}
public N endEnv(){
return and();
}
}
public class LifecycleNested extends LifecycleFluent> implements Nested{
private final LifecycleBuilder builder = new LifecycleBuilder(this);
public N and(){
return (N) ContainerFluent.this.withLifecycle(builder.build());
}
public N endLifecycle(){
return and();
}
}
public class PortsNested extends ContainerPortFluent> implements Nested{
private final ContainerPortBuilder builder = new ContainerPortBuilder(this);
public N and(){
return (N) ContainerFluent.this.addToPorts(builder.build());
}
public N endPort(){
return and();
}
}
public class ResourcesNested extends ResourceRequirementsFluent> implements Nested{
private final ResourceRequirementsBuilder builder = new ResourceRequirementsBuilder(this);
public N endResources(){
return and();
}
public N and(){
return (N) ContainerFluent.this.withResources(builder.build());
}
}
public class VolumeMountsNested extends VolumeMountFluent> implements Nested{
private final VolumeMountBuilder builder = new VolumeMountBuilder(this);
public N endVolumeMount(){
return and();
}
public N and(){
return (N) ContainerFluent.this.addToVolumeMounts(builder.build());
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy