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

io.fabric8.kubernetes.api.model.SecurityContextFluentImpl Maven / Gradle / Ivy

package io.fabric8.kubernetes.api.model;

import io.fabric8.kubernetes.api.builder.Nested;
import java.lang.String;
import java.util.LinkedHashMap;
import java.lang.Deprecated;
import io.fabric8.kubernetes.api.builder.BaseFluent;
import java.lang.Boolean;
import java.lang.Long;
import java.lang.Object;
import java.util.Map;

 /**
  * Generated
  */
public class SecurityContextFluentImpl> extends io.fabric8.kubernetes.api.builder.BaseFluent implements io.fabric8.kubernetes.api.model.SecurityContextFluent{
  public SecurityContextFluentImpl() {
  }
  public SecurityContextFluentImpl(io.fabric8.kubernetes.api.model.SecurityContext instance) {
    this.withAllowPrivilegeEscalation(instance.getAllowPrivilegeEscalation()); 
    this.withCapabilities(instance.getCapabilities()); 
    this.withPrivileged(instance.getPrivileged()); 
    this.withProcMount(instance.getProcMount()); 
    this.withReadOnlyRootFilesystem(instance.getReadOnlyRootFilesystem()); 
    this.withRunAsGroup(instance.getRunAsGroup()); 
    this.withRunAsNonRoot(instance.getRunAsNonRoot()); 
    this.withRunAsUser(instance.getRunAsUser()); 
    this.withSeLinuxOptions(instance.getSeLinuxOptions()); 
    this.withSeccompProfile(instance.getSeccompProfile()); 
    this.withWindowsOptions(instance.getWindowsOptions()); 
    this.withAdditionalProperties(instance.getAdditionalProperties());

  }
  private java.lang.Boolean allowPrivilegeEscalation;
  private io.fabric8.kubernetes.api.model.CapabilitiesBuilder capabilities;
  private java.lang.Boolean privileged;
  private java.lang.String procMount;
  private java.lang.Boolean readOnlyRootFilesystem;
  private java.lang.Long runAsGroup;
  private java.lang.Boolean runAsNonRoot;
  private java.lang.Long runAsUser;
  private io.fabric8.kubernetes.api.model.SELinuxOptionsBuilder seLinuxOptions;
  private io.fabric8.kubernetes.api.model.SeccompProfileBuilder seccompProfile;
  private io.fabric8.kubernetes.api.model.WindowsSecurityContextOptionsBuilder windowsOptions;
  private java.util.Map additionalProperties;
  public java.lang.Boolean getAllowPrivilegeEscalation() {
    return this.allowPrivilegeEscalation;
  }
  public A withAllowPrivilegeEscalation(java.lang.Boolean allowPrivilegeEscalation) {
    this.allowPrivilegeEscalation=allowPrivilegeEscalation; return (A) this;
  }
  public java.lang.Boolean hasAllowPrivilegeEscalation() {
    return this.allowPrivilegeEscalation != null;
  }
  
  /**
   * This method has been deprecated, please use method buildCapabilities instead.
   * @return The buildable object.
   */
  @java.lang.Deprecated
  public io.fabric8.kubernetes.api.model.Capabilities getCapabilities() {
    return this.capabilities!=null?this.capabilities.build():null;
  }
  public io.fabric8.kubernetes.api.model.Capabilities buildCapabilities() {
    return this.capabilities!=null?this.capabilities.build():null;
  }
  public A withCapabilities(io.fabric8.kubernetes.api.model.Capabilities capabilities) {
    _visitables.get("capabilities").remove(this.capabilities);
    if (capabilities!=null){ this.capabilities= new io.fabric8.kubernetes.api.model.CapabilitiesBuilder(capabilities); _visitables.get("capabilities").add(this.capabilities);} return (A) this;
  }
  public java.lang.Boolean hasCapabilities() {
    return this.capabilities != null;
  }
  public io.fabric8.kubernetes.api.model.SecurityContextFluent.CapabilitiesNested withNewCapabilities() {
    return new io.fabric8.kubernetes.api.model.SecurityContextFluentImpl.CapabilitiesNestedImpl();
  }
  public io.fabric8.kubernetes.api.model.SecurityContextFluent.CapabilitiesNested withNewCapabilitiesLike(io.fabric8.kubernetes.api.model.Capabilities item) {
    return new io.fabric8.kubernetes.api.model.SecurityContextFluentImpl.CapabilitiesNestedImpl(item);
  }
  public io.fabric8.kubernetes.api.model.SecurityContextFluent.CapabilitiesNested editCapabilities() {
    return withNewCapabilitiesLike(getCapabilities());
  }
  public io.fabric8.kubernetes.api.model.SecurityContextFluent.CapabilitiesNested editOrNewCapabilities() {
    return withNewCapabilitiesLike(getCapabilities() != null ? getCapabilities(): new io.fabric8.kubernetes.api.model.CapabilitiesBuilder().build());
  }
  public io.fabric8.kubernetes.api.model.SecurityContextFluent.CapabilitiesNested editOrNewCapabilitiesLike(io.fabric8.kubernetes.api.model.Capabilities item) {
    return withNewCapabilitiesLike(getCapabilities() != null ? getCapabilities(): item);
  }
  public java.lang.Boolean getPrivileged() {
    return this.privileged;
  }
  public A withPrivileged(java.lang.Boolean privileged) {
    this.privileged=privileged; return (A) this;
  }
  public java.lang.Boolean hasPrivileged() {
    return this.privileged != null;
  }
  public java.lang.String getProcMount() {
    return this.procMount;
  }
  public A withProcMount(java.lang.String procMount) {
    this.procMount=procMount; return (A) this;
  }
  public java.lang.Boolean hasProcMount() {
    return this.procMount != null;
  }
  
  /**
   * Method is deprecated. use withProcMount instead.
   */
  @java.lang.Deprecated
  public A withNewProcMount(java.lang.String arg0) {
    return (A)withProcMount(new String(arg0));
  }
  public java.lang.Boolean getReadOnlyRootFilesystem() {
    return this.readOnlyRootFilesystem;
  }
  public A withReadOnlyRootFilesystem(java.lang.Boolean readOnlyRootFilesystem) {
    this.readOnlyRootFilesystem=readOnlyRootFilesystem; return (A) this;
  }
  public java.lang.Boolean hasReadOnlyRootFilesystem() {
    return this.readOnlyRootFilesystem != null;
  }
  public java.lang.Long getRunAsGroup() {
    return this.runAsGroup;
  }
  public A withRunAsGroup(java.lang.Long runAsGroup) {
    this.runAsGroup=runAsGroup; return (A) this;
  }
  public java.lang.Boolean hasRunAsGroup() {
    return this.runAsGroup != null;
  }
  public java.lang.Boolean getRunAsNonRoot() {
    return this.runAsNonRoot;
  }
  public A withRunAsNonRoot(java.lang.Boolean runAsNonRoot) {
    this.runAsNonRoot=runAsNonRoot; return (A) this;
  }
  public java.lang.Boolean hasRunAsNonRoot() {
    return this.runAsNonRoot != null;
  }
  public java.lang.Long getRunAsUser() {
    return this.runAsUser;
  }
  public A withRunAsUser(java.lang.Long runAsUser) {
    this.runAsUser=runAsUser; return (A) this;
  }
  public java.lang.Boolean hasRunAsUser() {
    return this.runAsUser != null;
  }
  
  /**
   * This method has been deprecated, please use method buildSeLinuxOptions instead.
   * @return The buildable object.
   */
  @java.lang.Deprecated
  public io.fabric8.kubernetes.api.model.SELinuxOptions getSeLinuxOptions() {
    return this.seLinuxOptions!=null?this.seLinuxOptions.build():null;
  }
  public io.fabric8.kubernetes.api.model.SELinuxOptions buildSeLinuxOptions() {
    return this.seLinuxOptions!=null?this.seLinuxOptions.build():null;
  }
  public A withSeLinuxOptions(io.fabric8.kubernetes.api.model.SELinuxOptions seLinuxOptions) {
    _visitables.get("seLinuxOptions").remove(this.seLinuxOptions);
    if (seLinuxOptions!=null){ this.seLinuxOptions= new io.fabric8.kubernetes.api.model.SELinuxOptionsBuilder(seLinuxOptions); _visitables.get("seLinuxOptions").add(this.seLinuxOptions);} return (A) this;
  }
  public java.lang.Boolean hasSeLinuxOptions() {
    return this.seLinuxOptions != null;
  }
  public A withNewSeLinuxOptions(java.lang.String level,java.lang.String role,java.lang.String type,java.lang.String user) {
    return (A)withSeLinuxOptions(new SELinuxOptions(level, role, type, user));
  }
  public io.fabric8.kubernetes.api.model.SecurityContextFluent.SeLinuxOptionsNested withNewSeLinuxOptions() {
    return new io.fabric8.kubernetes.api.model.SecurityContextFluentImpl.SeLinuxOptionsNestedImpl();
  }
  public io.fabric8.kubernetes.api.model.SecurityContextFluent.SeLinuxOptionsNested withNewSeLinuxOptionsLike(io.fabric8.kubernetes.api.model.SELinuxOptions item) {
    return new io.fabric8.kubernetes.api.model.SecurityContextFluentImpl.SeLinuxOptionsNestedImpl(item);
  }
  public io.fabric8.kubernetes.api.model.SecurityContextFluent.SeLinuxOptionsNested editSeLinuxOptions() {
    return withNewSeLinuxOptionsLike(getSeLinuxOptions());
  }
  public io.fabric8.kubernetes.api.model.SecurityContextFluent.SeLinuxOptionsNested editOrNewSeLinuxOptions() {
    return withNewSeLinuxOptionsLike(getSeLinuxOptions() != null ? getSeLinuxOptions(): new io.fabric8.kubernetes.api.model.SELinuxOptionsBuilder().build());
  }
  public io.fabric8.kubernetes.api.model.SecurityContextFluent.SeLinuxOptionsNested editOrNewSeLinuxOptionsLike(io.fabric8.kubernetes.api.model.SELinuxOptions item) {
    return withNewSeLinuxOptionsLike(getSeLinuxOptions() != null ? getSeLinuxOptions(): item);
  }
  
  /**
   * This method has been deprecated, please use method buildSeccompProfile instead.
   * @return The buildable object.
   */
  @java.lang.Deprecated
  public io.fabric8.kubernetes.api.model.SeccompProfile getSeccompProfile() {
    return this.seccompProfile!=null?this.seccompProfile.build():null;
  }
  public io.fabric8.kubernetes.api.model.SeccompProfile buildSeccompProfile() {
    return this.seccompProfile!=null?this.seccompProfile.build():null;
  }
  public A withSeccompProfile(io.fabric8.kubernetes.api.model.SeccompProfile seccompProfile) {
    _visitables.get("seccompProfile").remove(this.seccompProfile);
    if (seccompProfile!=null){ this.seccompProfile= new io.fabric8.kubernetes.api.model.SeccompProfileBuilder(seccompProfile); _visitables.get("seccompProfile").add(this.seccompProfile);} return (A) this;
  }
  public java.lang.Boolean hasSeccompProfile() {
    return this.seccompProfile != null;
  }
  public A withNewSeccompProfile(java.lang.String localhostProfile,java.lang.String type) {
    return (A)withSeccompProfile(new SeccompProfile(localhostProfile, type));
  }
  public io.fabric8.kubernetes.api.model.SecurityContextFluent.SeccompProfileNested withNewSeccompProfile() {
    return new io.fabric8.kubernetes.api.model.SecurityContextFluentImpl.SeccompProfileNestedImpl();
  }
  public io.fabric8.kubernetes.api.model.SecurityContextFluent.SeccompProfileNested withNewSeccompProfileLike(io.fabric8.kubernetes.api.model.SeccompProfile item) {
    return new io.fabric8.kubernetes.api.model.SecurityContextFluentImpl.SeccompProfileNestedImpl(item);
  }
  public io.fabric8.kubernetes.api.model.SecurityContextFluent.SeccompProfileNested editSeccompProfile() {
    return withNewSeccompProfileLike(getSeccompProfile());
  }
  public io.fabric8.kubernetes.api.model.SecurityContextFluent.SeccompProfileNested editOrNewSeccompProfile() {
    return withNewSeccompProfileLike(getSeccompProfile() != null ? getSeccompProfile(): new io.fabric8.kubernetes.api.model.SeccompProfileBuilder().build());
  }
  public io.fabric8.kubernetes.api.model.SecurityContextFluent.SeccompProfileNested editOrNewSeccompProfileLike(io.fabric8.kubernetes.api.model.SeccompProfile item) {
    return withNewSeccompProfileLike(getSeccompProfile() != null ? getSeccompProfile(): item);
  }
  
  /**
   * This method has been deprecated, please use method buildWindowsOptions instead.
   * @return The buildable object.
   */
  @java.lang.Deprecated
  public io.fabric8.kubernetes.api.model.WindowsSecurityContextOptions getWindowsOptions() {
    return this.windowsOptions!=null?this.windowsOptions.build():null;
  }
  public io.fabric8.kubernetes.api.model.WindowsSecurityContextOptions buildWindowsOptions() {
    return this.windowsOptions!=null?this.windowsOptions.build():null;
  }
  public A withWindowsOptions(io.fabric8.kubernetes.api.model.WindowsSecurityContextOptions windowsOptions) {
    _visitables.get("windowsOptions").remove(this.windowsOptions);
    if (windowsOptions!=null){ this.windowsOptions= new io.fabric8.kubernetes.api.model.WindowsSecurityContextOptionsBuilder(windowsOptions); _visitables.get("windowsOptions").add(this.windowsOptions);} return (A) this;
  }
  public java.lang.Boolean hasWindowsOptions() {
    return this.windowsOptions != null;
  }
  public A withNewWindowsOptions(java.lang.String gmsaCredentialSpec,java.lang.String gmsaCredentialSpecName,java.lang.Boolean hostProcess,java.lang.String runAsUserName) {
    return (A)withWindowsOptions(new WindowsSecurityContextOptions(gmsaCredentialSpec, gmsaCredentialSpecName, hostProcess, runAsUserName));
  }
  public io.fabric8.kubernetes.api.model.SecurityContextFluent.WindowsOptionsNested withNewWindowsOptions() {
    return new io.fabric8.kubernetes.api.model.SecurityContextFluentImpl.WindowsOptionsNestedImpl();
  }
  public io.fabric8.kubernetes.api.model.SecurityContextFluent.WindowsOptionsNested withNewWindowsOptionsLike(io.fabric8.kubernetes.api.model.WindowsSecurityContextOptions item) {
    return new io.fabric8.kubernetes.api.model.SecurityContextFluentImpl.WindowsOptionsNestedImpl(item);
  }
  public io.fabric8.kubernetes.api.model.SecurityContextFluent.WindowsOptionsNested editWindowsOptions() {
    return withNewWindowsOptionsLike(getWindowsOptions());
  }
  public io.fabric8.kubernetes.api.model.SecurityContextFluent.WindowsOptionsNested editOrNewWindowsOptions() {
    return withNewWindowsOptionsLike(getWindowsOptions() != null ? getWindowsOptions(): new io.fabric8.kubernetes.api.model.WindowsSecurityContextOptionsBuilder().build());
  }
  public io.fabric8.kubernetes.api.model.SecurityContextFluent.WindowsOptionsNested editOrNewWindowsOptionsLike(io.fabric8.kubernetes.api.model.WindowsSecurityContextOptions item) {
    return withNewWindowsOptionsLike(getWindowsOptions() != null ? getWindowsOptions(): item);
  }
  public A addToAdditionalProperties(java.lang.String key,java.lang.Object value) {
    if(this.additionalProperties == null && key != null && value != null) { this.additionalProperties = new java.util.LinkedHashMap(); }
    if(key != null && value != null) {this.additionalProperties.put(key, value);} return (A)this;
  }
  public A addToAdditionalProperties(java.util.Map map) {
    if(this.additionalProperties == null && map != null) { this.additionalProperties = new java.util.LinkedHashMap(); }
    if(map != null) { this.additionalProperties.putAll(map);} return (A)this;
  }
  public A removeFromAdditionalProperties(java.lang.String key) {
    if(this.additionalProperties == null) { return (A) this; }
    if(key != null && this.additionalProperties != null) {this.additionalProperties.remove(key);} return (A)this;
  }
  public A removeFromAdditionalProperties(java.util.Map map) {
    if(this.additionalProperties == null) { return (A) this; }
    if(map != null) { for(Object key : map.keySet()) {if (this.additionalProperties != null){this.additionalProperties.remove(key);}}} return (A)this;
  }
  public java.util.Map getAdditionalProperties() {
    return this.additionalProperties;
  }
  public A withAdditionalProperties(java.util.Map additionalProperties) {
    if (additionalProperties == null) { this.additionalProperties =  null;} else {this.additionalProperties = new java.util.LinkedHashMap(additionalProperties);} return (A) this;
  }
  public java.lang.Boolean hasAdditionalProperties() {
    return this.additionalProperties != null;
  }
  public boolean equals(java.lang.Object o) {
    if (this == o) return true;
    if (o == null || getClass() != o.getClass()) return false;
    SecurityContextFluentImpl that = (SecurityContextFluentImpl) o;
    if (allowPrivilegeEscalation != null ? !allowPrivilegeEscalation.equals(that.allowPrivilegeEscalation) :that.allowPrivilegeEscalation != null) return false;
    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 (procMount != null ? !procMount.equals(that.procMount) :that.procMount != null) return false;
    if (readOnlyRootFilesystem != null ? !readOnlyRootFilesystem.equals(that.readOnlyRootFilesystem) :that.readOnlyRootFilesystem != null) return false;
    if (runAsGroup != null ? !runAsGroup.equals(that.runAsGroup) :that.runAsGroup != 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 (seccompProfile != null ? !seccompProfile.equals(that.seccompProfile) :that.seccompProfile != null) return false;
    if (windowsOptions != null ? !windowsOptions.equals(that.windowsOptions) :that.windowsOptions != null) return false;
    if (additionalProperties != null ? !additionalProperties.equals(that.additionalProperties) :that.additionalProperties != null) return false;
    return true;
  }
  public int hashCode() {
    return java.util.Objects.hash(allowPrivilegeEscalation,  capabilities,  privileged,  procMount,  readOnlyRootFilesystem,  runAsGroup,  runAsNonRoot,  runAsUser,  seLinuxOptions,  seccompProfile,  windowsOptions,  additionalProperties,  super.hashCode());
  }
  public class CapabilitiesNestedImpl extends io.fabric8.kubernetes.api.model.CapabilitiesFluentImpl> implements io.fabric8.kubernetes.api.model.SecurityContextFluent.CapabilitiesNested,io.fabric8.kubernetes.api.builder.Nested{
    CapabilitiesNestedImpl(io.fabric8.kubernetes.api.model.Capabilities item) {
      this.builder = new io.fabric8.kubernetes.api.model.CapabilitiesBuilder(this, item);
    }
    CapabilitiesNestedImpl() {
      this.builder = new io.fabric8.kubernetes.api.model.CapabilitiesBuilder(this);
    }
    io.fabric8.kubernetes.api.model.CapabilitiesBuilder builder;
    public N and() {
      return (N) SecurityContextFluentImpl.this.withCapabilities(builder.build());
    }
    public N endCapabilities() {
      return and();
    }
    
  }
  public class SeLinuxOptionsNestedImpl extends io.fabric8.kubernetes.api.model.SELinuxOptionsFluentImpl> implements io.fabric8.kubernetes.api.model.SecurityContextFluent.SeLinuxOptionsNested,io.fabric8.kubernetes.api.builder.Nested{
    SeLinuxOptionsNestedImpl(io.fabric8.kubernetes.api.model.SELinuxOptions item) {
      this.builder = new io.fabric8.kubernetes.api.model.SELinuxOptionsBuilder(this, item);
    }
    SeLinuxOptionsNestedImpl() {
      this.builder = new io.fabric8.kubernetes.api.model.SELinuxOptionsBuilder(this);
    }
    io.fabric8.kubernetes.api.model.SELinuxOptionsBuilder builder;
    public N and() {
      return (N) SecurityContextFluentImpl.this.withSeLinuxOptions(builder.build());
    }
    public N endSeLinuxOptions() {
      return and();
    }
    
  }
  public class SeccompProfileNestedImpl extends io.fabric8.kubernetes.api.model.SeccompProfileFluentImpl> implements io.fabric8.kubernetes.api.model.SecurityContextFluent.SeccompProfileNested,io.fabric8.kubernetes.api.builder.Nested{
    SeccompProfileNestedImpl(io.fabric8.kubernetes.api.model.SeccompProfile item) {
      this.builder = new io.fabric8.kubernetes.api.model.SeccompProfileBuilder(this, item);
    }
    SeccompProfileNestedImpl() {
      this.builder = new io.fabric8.kubernetes.api.model.SeccompProfileBuilder(this);
    }
    io.fabric8.kubernetes.api.model.SeccompProfileBuilder builder;
    public N and() {
      return (N) SecurityContextFluentImpl.this.withSeccompProfile(builder.build());
    }
    public N endSeccompProfile() {
      return and();
    }
    
  }
  public class WindowsOptionsNestedImpl extends io.fabric8.kubernetes.api.model.WindowsSecurityContextOptionsFluentImpl> implements io.fabric8.kubernetes.api.model.SecurityContextFluent.WindowsOptionsNested,io.fabric8.kubernetes.api.builder.Nested{
    WindowsOptionsNestedImpl(io.fabric8.kubernetes.api.model.WindowsSecurityContextOptions item) {
      this.builder = new io.fabric8.kubernetes.api.model.WindowsSecurityContextOptionsBuilder(this, item);
    }
    WindowsOptionsNestedImpl() {
      this.builder = new io.fabric8.kubernetes.api.model.WindowsSecurityContextOptionsBuilder(this);
    }
    io.fabric8.kubernetes.api.model.WindowsSecurityContextOptionsBuilder builder;
    public N and() {
      return (N) SecurityContextFluentImpl.this.withWindowsOptions(builder.build());
    }
    public N endWindowsOptions() {
      return and();
    }
    
  }
  
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy