All Downloads are FREE. Search and download functionalities are using the official Maven repository.

annotations.io.fabric8.kubernetes.api.model.ContainerFluent Maven / Gradle / Ivy

There is a newer version: 0.0.54
Show newest version
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 ContainerFluent> extends BaseFluent implements Fluent{

     List args = new ArrayList();     CapabilitiesBuilder capabilities;     List command = new ArrayList();     List env = new ArrayList();     String image;     String imagePullPolicy;     LifecycleBuilder lifecycle;     ProbeBuilder livenessProbe;     String name;     List ports = new ArrayList();     Boolean privileged;     ProbeBuilder readinessProbe;     ResourceRequirementsBuilder resources;     String terminationMessagePath;     List volumeMounts = new ArrayList();     String workingDir;     Map additionalProperties = new HashMap();

    public T addToArgs( String item){
    if (item != null) {this.args.add(item);} return (T)this;
    }
    public List getArgs(){
    return this.args;
    }
    public T withArgs( List args){
    this.args.clear();if (args != null) {for (String item : args){this.addToArgs(item);}} return (T) this;
    }
    public Capabilities getCapabilities(){
    return this.capabilities!=null?this.capabilities.build():null;
    }
    public T withCapabilities( Capabilities capabilities){
    if (capabilities!=null){ this.capabilities= new CapabilitiesBuilder(capabilities); _visitables.add(this.capabilities);} 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 List getCommand(){
    return this.command;
    }
    public T withCommand( List command){
    this.command.clear();if (command != null) {for (String item : command){this.addToCommand(item);}} return (T) this;
    }
    public T addToEnv( EnvVar item){
    if (item != null) {EnvVarBuilder builder = new EnvVarBuilder(item);_visitables.add(builder);this.env.add(builder);} return (T)this;
    }
    public List getEnv(){
    return build(env);
    }
    public T withEnv( List env){
    this.env.clear();if (env != null) {for (EnvVar item : env){this.addToEnv(item);}} return (T) this;
    }
    public EnvNested addNewEnv(){
    return new EnvNested();
    }
    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!=null?this.lifecycle.build():null;
    }
    public T withLifecycle( Lifecycle lifecycle){
    if (lifecycle!=null){ this.lifecycle= new LifecycleBuilder(lifecycle); _visitables.add(this.lifecycle);} return (T) this;
    }
    public LifecycleNested withNewLifecycle(){
    return new LifecycleNested();
    }
    public Probe getLivenessProbe(){
    return this.livenessProbe!=null?this.livenessProbe.build():null;
    }
    public T withLivenessProbe( Probe livenessProbe){
    if (livenessProbe!=null){ this.livenessProbe= new ProbeBuilder(livenessProbe); _visitables.add(this.livenessProbe);} return (T) this;
    }
    public LivenessProbeNested withNewLivenessProbe(){
    return new LivenessProbeNested();
    }
    public String getName(){
    return this.name;
    }
    public T withName( String name){
    this.name=name; return (T) this;
    }
    public T addToPorts( ContainerPort item){
    if (item != null) {ContainerPortBuilder builder = new ContainerPortBuilder(item);_visitables.add(builder);this.ports.add(builder);} return (T)this;
    }
    public List getPorts(){
    return build(ports);
    }
    public T withPorts( List ports){
    this.ports.clear();if (ports != null) {for (ContainerPort item : ports){this.addToPorts(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 Boolean isPrivileged(){
    return this.privileged;
    }
    public T withPrivileged( Boolean privileged){
    this.privileged=privileged; return (T) this;
    }
    public Probe getReadinessProbe(){
    return this.readinessProbe!=null?this.readinessProbe.build():null;
    }
    public T withReadinessProbe( Probe readinessProbe){
    if (readinessProbe!=null){ this.readinessProbe= new ProbeBuilder(readinessProbe); _visitables.add(this.readinessProbe);} return (T) this;
    }
    public ReadinessProbeNested withNewReadinessProbe(){
    return new ReadinessProbeNested();
    }
    public ResourceRequirements getResources(){
    return this.resources!=null?this.resources.build():null;
    }
    public T withResources( ResourceRequirements resources){
    if (resources!=null){ this.resources= new ResourceRequirementsBuilder(resources); _visitables.add(this.resources);} return (T) this;
    }
    public ResourcesNested withNewResources(){
    return new ResourcesNested();
    }
    public String getTerminationMessagePath(){
    return this.terminationMessagePath;
    }
    public T withTerminationMessagePath( String terminationMessagePath){
    this.terminationMessagePath=terminationMessagePath; return (T) this;
    }
    public T addToVolumeMounts( VolumeMount item){
    if (item != null) {VolumeMountBuilder builder = new VolumeMountBuilder(item);_visitables.add(builder);this.volumeMounts.add(builder);} return (T)this;
    }
    public List getVolumeMounts(){
    return build(volumeMounts);
    }
    public T withVolumeMounts( List volumeMounts){
    this.volumeMounts.clear();if (volumeMounts != null) {for (VolumeMount item : volumeMounts){this.addToVolumeMounts(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 String getWorkingDir(){
    return this.workingDir;
    }
    public T withWorkingDir( String workingDir){
    this.workingDir=workingDir; return (T) this;
    }
    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 CapabilitiesNested extends CapabilitiesFluent> implements Nested{

        private final CapabilitiesBuilder builder = new CapabilitiesBuilder(this);
    
            public N endCapabilities(){
            return and();
        }
            public N and(){
            return (N) ContainerFluent.this.withCapabilities(builder.build());
        }
    
}
    public class EnvNested extends EnvVarFluent> implements Nested{

        private final EnvVarBuilder builder = new EnvVarBuilder(this);
    
            public N endEnv(){
            return and();
        }
            public N and(){
            return (N) ContainerFluent.this.addToEnv(builder.build());
        }
    
}
    public class LifecycleNested extends LifecycleFluent> implements Nested{

        private final LifecycleBuilder builder = new LifecycleBuilder(this);
    
            public N endLifecycle(){
            return and();
        }
            public N and(){
            return (N) ContainerFluent.this.withLifecycle(builder.build());
        }
    
}
    public class LivenessProbeNested extends ProbeFluent> implements Nested{

        private final ProbeBuilder builder = new ProbeBuilder(this);
    
            public N and(){
            return (N) ContainerFluent.this.withLivenessProbe(builder.build());
        }
            public N endLivenessProbe(){
            return and();
        }
    
}
    public class PortsNested extends ContainerPortFluent> implements Nested{

        private final ContainerPortBuilder builder = new ContainerPortBuilder(this);
    
            public N endPort(){
            return and();
        }
            public N and(){
            return (N) ContainerFluent.this.addToPorts(builder.build());
        }
    
}
    public class ReadinessProbeNested extends ProbeFluent> implements Nested{

        private final ProbeBuilder builder = new ProbeBuilder(this);
    
            public N and(){
            return (N) ContainerFluent.this.withReadinessProbe(builder.build());
        }
            public N endReadinessProbe(){
            return and();
        }
    
}
    public class ResourcesNested extends ResourceRequirementsFluent> implements Nested{

        private final ResourceRequirementsBuilder builder = new ResourceRequirementsBuilder(this);
    
            public N and(){
            return (N) ContainerFluent.this.withResources(builder.build());
        }
            public N endResources(){
            return and();
        }
    
}
    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 - 2024 Weber Informatics LLC | Privacy Policy