io.fabric8.kubernetes.api.model.SecurityContextFluentImpl Maven / Gradle / Ivy
package io.fabric8.kubernetes.api.model;
import java.util.Map;
import java.util.Map;
import java.util.HashMap;
import java.io.Serializable;
import java.util.AbstractMap;
import io.fabric8.kubernetes.api.builder.VisitableBuilder;
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.Fluent;
import io.fabric8.kubernetes.api.builder.Nested;
import io.fabric8.kubernetes.api.builder.Visitable;
import io.fabric8.kubernetes.api.builder.Builder;
public class SecurityContextFluentImpl> extends BaseFluent implements SecurityContextFluent{
VisitableBuilder capabilities; Boolean privileged; Boolean readOnlyRootFilesystem; Boolean runAsNonRoot; Long runAsUser; VisitableBuilder seLinuxOptions; Map additionalProperties = new HashMap();
public SecurityContextFluentImpl(){
}
public SecurityContextFluentImpl( SecurityContext instance ){
this.withCapabilities(instance.getCapabilities()); this.withPrivileged(instance.getPrivileged()); this.withReadOnlyRootFilesystem(instance.getReadOnlyRootFilesystem()); this.withRunAsNonRoot(instance.getRunAsNonRoot()); this.withRunAsUser(instance.getRunAsUser()); this.withSeLinuxOptions(instance.getSeLinuxOptions());
}
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 CapabilitiesNestedImpl();
}
public CapabilitiesNested withNewCapabilitiesLike( Capabilities item){
return new CapabilitiesNestedImpl(item);
}
public CapabilitiesNested editCapabilities(){
return withNewCapabilitiesLike(getCapabilities());
}
public Boolean isPrivileged(){
return this.privileged;
}
public T withPrivileged( Boolean privileged){
this.privileged=privileged; return (T) this;
}
public Boolean isReadOnlyRootFilesystem(){
return this.readOnlyRootFilesystem;
}
public T withReadOnlyRootFilesystem( Boolean readOnlyRootFilesystem){
this.readOnlyRootFilesystem=readOnlyRootFilesystem; return (T) this;
}
public Boolean isRunAsNonRoot(){
return this.runAsNonRoot;
}
public T withRunAsNonRoot( Boolean runAsNonRoot){
this.runAsNonRoot=runAsNonRoot; return (T) this;
}
public Long getRunAsUser(){
return this.runAsUser;
}
public T withRunAsUser( Long runAsUser){
this.runAsUser=runAsUser; return (T) this;
}
public SELinuxOptions getSeLinuxOptions(){
return this.seLinuxOptions!=null?this.seLinuxOptions.build():null;
}
public T withSeLinuxOptions( SELinuxOptions seLinuxOptions){
if (seLinuxOptions!=null){ this.seLinuxOptions= new SELinuxOptionsBuilder(seLinuxOptions); _visitables.add(this.seLinuxOptions);} return (T) this;
}
public SeLinuxOptionsNested withNewSeLinuxOptions(){
return new SeLinuxOptionsNestedImpl();
}
public SeLinuxOptionsNested withNewSeLinuxOptionsLike( SELinuxOptions item){
return new SeLinuxOptionsNestedImpl(item);
}
public SeLinuxOptionsNested editSeLinuxOptions(){
return withNewSeLinuxOptionsLike(getSeLinuxOptions());
}
public T withNewSeLinuxOptions( String level, String role, String type, String user){
return withSeLinuxOptions(new SELinuxOptions(level, role, type, user));
}
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;
SecurityContextFluentImpl that = (SecurityContextFluentImpl) o;
if (capabilities != null ? !capabilities.equals(that.capabilities) :that.capabilities != null) return false;
if (privileged != null ? !privileged.equals(that.privileged) :that.privileged != null) return false;
if (readOnlyRootFilesystem != null ? !readOnlyRootFilesystem.equals(that.readOnlyRootFilesystem) :that.readOnlyRootFilesystem != null) return false;
if (runAsNonRoot != null ? !runAsNonRoot.equals(that.runAsNonRoot) :that.runAsNonRoot != null) return false;
if (runAsUser != null ? !runAsUser.equals(that.runAsUser) :that.runAsUser != null) return false;
if (seLinuxOptions != null ? !seLinuxOptions.equals(that.seLinuxOptions) :that.seLinuxOptions != null) return false;
if (additionalProperties != null ? !additionalProperties.equals(that.additionalProperties) :that.additionalProperties != null) return false;
return true;
}
public class CapabilitiesNestedImpl extends CapabilitiesFluentImpl> implements CapabilitiesNested{
private final CapabilitiesBuilder builder;
CapabilitiesNestedImpl (){
this.builder = new CapabilitiesBuilder(this);
}
CapabilitiesNestedImpl ( Capabilities item){
this.builder = new CapabilitiesBuilder(this, item);
}
public N endCapabilities(){
return and();
}
public N and(){
return (N) SecurityContextFluentImpl.this.withCapabilities(builder.build());
}
}
public class SeLinuxOptionsNestedImpl extends SELinuxOptionsFluentImpl> implements SeLinuxOptionsNested{
private final SELinuxOptionsBuilder builder;
SeLinuxOptionsNestedImpl (){
this.builder = new SELinuxOptionsBuilder(this);
}
SeLinuxOptionsNestedImpl ( SELinuxOptions item){
this.builder = new SELinuxOptionsBuilder(this, item);
}
public N endSeLinuxOptions(){
return and();
}
public N and(){
return (N) SecurityContextFluentImpl.this.withSeLinuxOptions(builder.build());
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy