annotations.io.fabric8.kubernetes.api.model.ContainerFluentImpl Maven / Gradle / Ivy
package io.fabric8.kubernetes.api.model;
import java.util.List;
import java.util.ArrayList;
import java.util.RandomAccess;
import java.util.Map;
import java.util.Map;
import java.util.List;
import java.util.List;
import java.util.List;
import java.util.AbstractCollection;
import java.util.List;
import java.util.AbstractList;
import java.util.HashMap;
import java.io.Serializable;
import java.util.Collection;
import java.util.AbstractMap;
import io.fabric8.kubernetes.api.builder.VisitableBuilder;
import io.fabric8.kubernetes.api.builder.VisitableBuilder;
import io.fabric8.kubernetes.api.builder.Fluent;
import io.fabric8.kubernetes.api.builder.Visitable;
import io.fabric8.kubernetes.api.builder.Builder;
import io.fabric8.kubernetes.api.builder.VisitableBuilder;
import io.fabric8.kubernetes.api.builder.Visitable;
import io.fabric8.kubernetes.api.builder.BaseFluent;
import io.fabric8.kubernetes.api.builder.Nested;
import java.util.List;
import io.fabric8.kubernetes.api.builder.VisitableBuilder;
import io.fabric8.kubernetes.api.builder.VisitableBuilder;
import io.fabric8.kubernetes.api.builder.VisitableBuilder;
import java.util.List;
import java.util.List;
import io.fabric8.kubernetes.api.builder.VisitableBuilder;
public class ContainerFluentImpl> extends BaseFluent implements ContainerFluent{
List args = new ArrayList(); List command = new ArrayList(); List> env = new ArrayList(); String image; String imagePullPolicy; VisitableBuilder lifecycle; VisitableBuilder livenessProbe; String name; List> ports = new ArrayList(); VisitableBuilder readinessProbe; VisitableBuilder resources; VisitableBuilder securityContext; Boolean stdin; Boolean stdinOnce; String terminationMessagePath; Boolean tty; List> volumeMounts = new ArrayList(); String workingDir; Map additionalProperties = new HashMap();
public ContainerFluentImpl(){
}
public ContainerFluentImpl( Container instance ){
this.withArgs(instance.getArgs()); this.withCommand(instance.getCommand()); this.withEnv(instance.getEnv()); this.withImage(instance.getImage()); this.withImagePullPolicy(instance.getImagePullPolicy()); this.withLifecycle(instance.getLifecycle()); this.withLivenessProbe(instance.getLivenessProbe()); this.withName(instance.getName()); this.withPorts(instance.getPorts()); this.withReadinessProbe(instance.getReadinessProbe()); this.withResources(instance.getResources()); this.withSecurityContext(instance.getSecurityContext()); this.withStdin(instance.getStdin()); this.withStdinOnce(instance.getStdinOnce()); this.withTerminationMessagePath(instance.getTerminationMessagePath()); this.withTty(instance.getTty()); this.withVolumeMounts(instance.getVolumeMounts()); this.withWorkingDir(instance.getWorkingDir());
}
public T addToArgs( String ...items){
for (String item : items) {this.args.add(item);} return (T)this;
}
public T removeFromArgs( String ...items){
for (String item : items) {this.args.remove(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 T withArgs( String ...args){
this.args.clear(); if (args != null) {for (String item :args){ this.addToArgs(item);}} return (T) this;
}
public T addToCommand( String ...items){
for (String item : items) {this.command.add(item);} return (T)this;
}
public T removeFromCommand( String ...items){
for (String item : items) {this.command.remove(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 withCommand( String ...command){
this.command.clear(); if (command != null) {for (String item :command){ this.addToCommand(item);}} return (T) this;
}
public T addToEnv( EnvVar ...items){
for (EnvVar item : items) {EnvVarBuilder builder = new EnvVarBuilder(item);_visitables.add(builder);this.env.add(builder);} return (T)this;
}
public T removeFromEnv( EnvVar ...items){
for (EnvVar item : items) {EnvVarBuilder builder = new EnvVarBuilder(item);_visitables.remove(builder);this.env.remove(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 T withEnv( EnvVar ...env){
this.env.clear(); if (env != null) {for (EnvVar item :env){ this.addToEnv(item);}} return (T) this;
}
public EnvNested addNewEnv(){
return new EnvNestedImpl();
}
public EnvNested addNewEnvLike( EnvVar item){
return new EnvNestedImpl(item);
}
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 LifecycleNestedImpl();
}
public LifecycleNested withNewLifecycleLike( Lifecycle item){
return new LifecycleNestedImpl(item);
}
public LifecycleNested editLifecycle(){
return withNewLifecycleLike(getLifecycle());
}
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 LivenessProbeNestedImpl();
}
public LivenessProbeNested withNewLivenessProbeLike( Probe item){
return new LivenessProbeNestedImpl(item);
}
public LivenessProbeNested editLivenessProbe(){
return withNewLivenessProbeLike(getLivenessProbe());
}
public String getName(){
return this.name;
}
public T withName( String name){
this.name=name; return (T) this;
}
public T addToPorts( ContainerPort ...items){
for (ContainerPort item : items) {ContainerPortBuilder builder = new ContainerPortBuilder(item);_visitables.add(builder);this.ports.add(builder);} return (T)this;
}
public T removeFromPorts( ContainerPort ...items){
for (ContainerPort item : items) {ContainerPortBuilder builder = new ContainerPortBuilder(item);_visitables.remove(builder);this.ports.remove(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 T withPorts( ContainerPort ...ports){
this.ports.clear(); if (ports != null) {for (ContainerPort item :ports){ this.addToPorts(item);}} return (T) this;
}
public PortsNested addNewPort(){
return new PortsNestedImpl();
}
public PortsNested addNewPortLike( ContainerPort item){
return new PortsNestedImpl(item);
}
public T addNewPort( Integer containerPort, String hostIP, Integer hostPort, String name, String protocol){
return addToPorts(new ContainerPort(containerPort, hostIP, hostPort, name, protocol));
}
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 ReadinessProbeNestedImpl();
}
public ReadinessProbeNested withNewReadinessProbeLike( Probe item){
return new ReadinessProbeNestedImpl(item);
}
public ReadinessProbeNested editReadinessProbe(){
return withNewReadinessProbeLike(getReadinessProbe());
}
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 ResourcesNestedImpl();
}
public ResourcesNested withNewResourcesLike( ResourceRequirements item){
return new ResourcesNestedImpl(item);
}
public ResourcesNested editResources(){
return withNewResourcesLike(getResources());
}
public SecurityContext getSecurityContext(){
return this.securityContext!=null?this.securityContext.build():null;
}
public T withSecurityContext( SecurityContext securityContext){
if (securityContext!=null){ this.securityContext= new SecurityContextBuilder(securityContext); _visitables.add(this.securityContext);} return (T) this;
}
public SecurityContextNested withNewSecurityContext(){
return new SecurityContextNestedImpl();
}
public SecurityContextNested withNewSecurityContextLike( SecurityContext item){
return new SecurityContextNestedImpl(item);
}
public SecurityContextNested editSecurityContext(){
return withNewSecurityContextLike(getSecurityContext());
}
public Boolean isStdin(){
return this.stdin;
}
public T withStdin( Boolean stdin){
this.stdin=stdin; return (T) this;
}
public Boolean isStdinOnce(){
return this.stdinOnce;
}
public T withStdinOnce( Boolean stdinOnce){
this.stdinOnce=stdinOnce; return (T) this;
}
public String getTerminationMessagePath(){
return this.terminationMessagePath;
}
public T withTerminationMessagePath( String terminationMessagePath){
this.terminationMessagePath=terminationMessagePath; return (T) this;
}
public Boolean isTty(){
return this.tty;
}
public T withTty( Boolean tty){
this.tty=tty; return (T) this;
}
public T addToVolumeMounts( VolumeMount ...items){
for (VolumeMount item : items) {VolumeMountBuilder builder = new VolumeMountBuilder(item);_visitables.add(builder);this.volumeMounts.add(builder);} return (T)this;
}
public T removeFromVolumeMounts( VolumeMount ...items){
for (VolumeMount item : items) {VolumeMountBuilder builder = new VolumeMountBuilder(item);_visitables.remove(builder);this.volumeMounts.remove(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 T withVolumeMounts( VolumeMount ...volumeMounts){
this.volumeMounts.clear(); if (volumeMounts != null) {for (VolumeMount item :volumeMounts){ this.addToVolumeMounts(item);}} return (T) this;
}
public VolumeMountsNested addNewVolumeMount(){
return new VolumeMountsNestedImpl();
}
public VolumeMountsNested addNewVolumeMountLike( VolumeMount item){
return new VolumeMountsNestedImpl(item);
}
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 T addToAdditionalProperties( Map map){
if(map != null) { this.additionalProperties.putAll(map);} return (T)this;
}
public T removeFromAdditionalProperties( String key){
if(key != null) {this.additionalProperties.remove(key);} return (T)this;
}
public T removeFromAdditionalProperties( Map map){
if(map != null) { for(Object key : map.keySet()) {this.additionalProperties.remove(key);}} 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 boolean equals( Object o){
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
ContainerFluentImpl that = (ContainerFluentImpl) o;
if (args != null ? !args.equals(that.args) :that.args != null) return false;
if (command != null ? !command.equals(that.command) :that.command != null) return false;
if (env != null ? !env.equals(that.env) :that.env != null) return false;
if (image != null ? !image.equals(that.image) :that.image != null) return false;
if (imagePullPolicy != null ? !imagePullPolicy.equals(that.imagePullPolicy) :that.imagePullPolicy != null) return false;
if (lifecycle != null ? !lifecycle.equals(that.lifecycle) :that.lifecycle != null) return false;
if (livenessProbe != null ? !livenessProbe.equals(that.livenessProbe) :that.livenessProbe != null) return false;
if (name != null ? !name.equals(that.name) :that.name != null) return false;
if (ports != null ? !ports.equals(that.ports) :that.ports != null) return false;
if (readinessProbe != null ? !readinessProbe.equals(that.readinessProbe) :that.readinessProbe != null) return false;
if (resources != null ? !resources.equals(that.resources) :that.resources != null) return false;
if (securityContext != null ? !securityContext.equals(that.securityContext) :that.securityContext != null) return false;
if (stdin != null ? !stdin.equals(that.stdin) :that.stdin != null) return false;
if (stdinOnce != null ? !stdinOnce.equals(that.stdinOnce) :that.stdinOnce != null) return false;
if (terminationMessagePath != null ? !terminationMessagePath.equals(that.terminationMessagePath) :that.terminationMessagePath != null) return false;
if (tty != null ? !tty.equals(that.tty) :that.tty != null) return false;
if (volumeMounts != null ? !volumeMounts.equals(that.volumeMounts) :that.volumeMounts != null) return false;
if (workingDir != null ? !workingDir.equals(that.workingDir) :that.workingDir != null) return false;
if (additionalProperties != null ? !additionalProperties.equals(that.additionalProperties) :that.additionalProperties != null) return false;
return true;
}
public class EnvNestedImpl extends EnvVarFluentImpl> implements EnvNested{
private final EnvVarBuilder builder;
EnvNestedImpl (){
this.builder = new EnvVarBuilder(this);
}
EnvNestedImpl ( EnvVar item){
this.builder = new EnvVarBuilder(this, item);
}
public N endEnv(){
return and();
}
public N and(){
return (N) ContainerFluentImpl.this.addToEnv(builder.build());
}
}
public class LifecycleNestedImpl extends LifecycleFluentImpl> implements LifecycleNested{
private final LifecycleBuilder builder;
LifecycleNestedImpl (){
this.builder = new LifecycleBuilder(this);
}
LifecycleNestedImpl ( Lifecycle item){
this.builder = new LifecycleBuilder(this, item);
}
public N endLifecycle(){
return and();
}
public N and(){
return (N) ContainerFluentImpl.this.withLifecycle(builder.build());
}
}
public class LivenessProbeNestedImpl extends ProbeFluentImpl> implements LivenessProbeNested{
private final ProbeBuilder builder;
LivenessProbeNestedImpl (){
this.builder = new ProbeBuilder(this);
}
LivenessProbeNestedImpl ( Probe item){
this.builder = new ProbeBuilder(this, item);
}
public N endLivenessProbe(){
return and();
}
public N and(){
return (N) ContainerFluentImpl.this.withLivenessProbe(builder.build());
}
}
public class PortsNestedImpl extends ContainerPortFluentImpl> implements PortsNested{
private final ContainerPortBuilder builder;
PortsNestedImpl ( ContainerPort item){
this.builder = new ContainerPortBuilder(this, item);
}
PortsNestedImpl (){
this.builder = new ContainerPortBuilder(this);
}
public N endPort(){
return and();
}
public N and(){
return (N) ContainerFluentImpl.this.addToPorts(builder.build());
}
}
public class ReadinessProbeNestedImpl extends ProbeFluentImpl> implements ReadinessProbeNested{
private final ProbeBuilder builder;
ReadinessProbeNestedImpl (){
this.builder = new ProbeBuilder(this);
}
ReadinessProbeNestedImpl ( Probe item){
this.builder = new ProbeBuilder(this, item);
}
public N endReadinessProbe(){
return and();
}
public N and(){
return (N) ContainerFluentImpl.this.withReadinessProbe(builder.build());
}
}
public class ResourcesNestedImpl extends ResourceRequirementsFluentImpl> implements ResourcesNested{
private final ResourceRequirementsBuilder builder;
ResourcesNestedImpl (){
this.builder = new ResourceRequirementsBuilder(this);
}
ResourcesNestedImpl ( ResourceRequirements item){
this.builder = new ResourceRequirementsBuilder(this, item);
}
public N and(){
return (N) ContainerFluentImpl.this.withResources(builder.build());
}
public N endResources(){
return and();
}
}
public class SecurityContextNestedImpl extends SecurityContextFluentImpl> implements SecurityContextNested{
private final SecurityContextBuilder builder;
SecurityContextNestedImpl (){
this.builder = new SecurityContextBuilder(this);
}
SecurityContextNestedImpl ( SecurityContext item){
this.builder = new SecurityContextBuilder(this, item);
}
public N and(){
return (N) ContainerFluentImpl.this.withSecurityContext(builder.build());
}
public N endSecurityContext(){
return and();
}
}
public class VolumeMountsNestedImpl extends VolumeMountFluentImpl> implements VolumeMountsNested{
private final VolumeMountBuilder builder;
VolumeMountsNestedImpl (){
this.builder = new VolumeMountBuilder(this);
}
VolumeMountsNestedImpl ( VolumeMount item){
this.builder = new VolumeMountBuilder(this, item);
}
public N and(){
return (N) ContainerFluentImpl.this.addToVolumeMounts(builder.build());
}
public N endVolumeMount(){
return and();
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy