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

io.kubernetes.client.openapi.models.V1SecurityContextFluentImpl Maven / Gradle / Ivy

There is a newer version: 22.0.0
Show newest version
package io.kubernetes.client.openapi.models;

import java.lang.StringBuilder;
import com.google.gson.annotations.SerializedName;
import io.kubernetes.client.fluent.Nested;
import java.lang.String;
import java.lang.Deprecated;
import io.kubernetes.client.fluent.BaseFluent;
import java.lang.Boolean;
import java.lang.StringBuffer;
import java.lang.Long;
import java.lang.Object;

public class V1SecurityContextFluentImpl> extends io.kubernetes.client.fluent.BaseFluent implements V1SecurityContextFluent {

    private Boolean allowPrivilegeEscalation;
    private V1CapabilitiesBuilder capabilities;
    private Boolean privileged;
    private String procMount;
    private Boolean readOnlyRootFilesystem;
    private Long runAsGroup;
    private Boolean runAsNonRoot;
    private Long runAsUser;
    private V1SELinuxOptionsBuilder seLinuxOptions;
    private V1SeccompProfileBuilder seccompProfile;
    private V1WindowsSecurityContextOptionsBuilder windowsOptions;

    public V1SecurityContextFluentImpl() { 
    }


    public V1SecurityContextFluentImpl(V1SecurityContext 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());

    }


    public Boolean isAllowPrivilegeEscalation() {
        return this.allowPrivilegeEscalation;
    }

    public A withAllowPrivilegeEscalation(Boolean allowPrivilegeEscalation) {
        this.allowPrivilegeEscalation=allowPrivilegeEscalation; return (A) this;
    }

    public Boolean hasAllowPrivilegeEscalation() {
        return this.allowPrivilegeEscalation != null;
    }

    public A withNewAllowPrivilegeEscalation(String arg1) {
        return (A)withAllowPrivilegeEscalation(new Boolean(arg1));
    }

    public A withNewAllowPrivilegeEscalation(boolean arg1) {
        return (A)withAllowPrivilegeEscalation(new Boolean(arg1));
    }

    
/**
 * This method has been deprecated, please use method buildCapabilities instead.
 * @return The buildable object.
 */
@Deprecated public V1Capabilities getCapabilities() {
        return this.capabilities!=null?this.capabilities.build():null;
    }

    public V1Capabilities buildCapabilities() {
        return this.capabilities!=null?this.capabilities.build():null;
    }

    public A withCapabilities(V1Capabilities capabilities) {
        _visitables.get("capabilities").remove(this.capabilities);
        if (capabilities!=null){ this.capabilities= new V1CapabilitiesBuilder(capabilities); _visitables.get("capabilities").add(this.capabilities);} return (A) this;
    }

    public Boolean hasCapabilities() {
        return this.capabilities != null;
    }

    public V1SecurityContextFluent.CapabilitiesNested withNewCapabilities() {
        return new CapabilitiesNestedImpl();
    }

    public V1SecurityContextFluent.CapabilitiesNested withNewCapabilitiesLike(V1Capabilities item) {
        return new CapabilitiesNestedImpl(item);
    }

    public V1SecurityContextFluent.CapabilitiesNested editCapabilities() {
        return withNewCapabilitiesLike(getCapabilities());
    }

    public V1SecurityContextFluent.CapabilitiesNested editOrNewCapabilities() {
        return withNewCapabilitiesLike(getCapabilities() != null ? getCapabilities(): new V1CapabilitiesBuilder().build());
    }

    public V1SecurityContextFluent.CapabilitiesNested editOrNewCapabilitiesLike(V1Capabilities item) {
        return withNewCapabilitiesLike(getCapabilities() != null ? getCapabilities(): item);
    }

    public Boolean isPrivileged() {
        return this.privileged;
    }

    public A withPrivileged(Boolean privileged) {
        this.privileged=privileged; return (A) this;
    }

    public Boolean hasPrivileged() {
        return this.privileged != null;
    }

    public A withNewPrivileged(String arg1) {
        return (A)withPrivileged(new Boolean(arg1));
    }

    public A withNewPrivileged(boolean arg1) {
        return (A)withPrivileged(new Boolean(arg1));
    }

    public String getProcMount() {
        return this.procMount;
    }

    public A withProcMount(String procMount) {
        this.procMount=procMount; return (A) this;
    }

    public Boolean hasProcMount() {
        return this.procMount != null;
    }

    public A withNewProcMount(String arg1) {
        return (A)withProcMount(new String(arg1));
    }

    public A withNewProcMount(StringBuilder arg1) {
        return (A)withProcMount(new String(arg1));
    }

    public A withNewProcMount(StringBuffer arg1) {
        return (A)withProcMount(new String(arg1));
    }

    public Boolean isReadOnlyRootFilesystem() {
        return this.readOnlyRootFilesystem;
    }

    public A withReadOnlyRootFilesystem(Boolean readOnlyRootFilesystem) {
        this.readOnlyRootFilesystem=readOnlyRootFilesystem; return (A) this;
    }

    public Boolean hasReadOnlyRootFilesystem() {
        return this.readOnlyRootFilesystem != null;
    }

    public A withNewReadOnlyRootFilesystem(String arg1) {
        return (A)withReadOnlyRootFilesystem(new Boolean(arg1));
    }

    public A withNewReadOnlyRootFilesystem(boolean arg1) {
        return (A)withReadOnlyRootFilesystem(new Boolean(arg1));
    }

    public Long getRunAsGroup() {
        return this.runAsGroup;
    }

    public A withRunAsGroup(Long runAsGroup) {
        this.runAsGroup=runAsGroup; return (A) this;
    }

    public Boolean hasRunAsGroup() {
        return this.runAsGroup != null;
    }

    public Boolean isRunAsNonRoot() {
        return this.runAsNonRoot;
    }

    public A withRunAsNonRoot(Boolean runAsNonRoot) {
        this.runAsNonRoot=runAsNonRoot; return (A) this;
    }

    public Boolean hasRunAsNonRoot() {
        return this.runAsNonRoot != null;
    }

    public A withNewRunAsNonRoot(String arg1) {
        return (A)withRunAsNonRoot(new Boolean(arg1));
    }

    public A withNewRunAsNonRoot(boolean arg1) {
        return (A)withRunAsNonRoot(new Boolean(arg1));
    }

    public Long getRunAsUser() {
        return this.runAsUser;
    }

    public A withRunAsUser(Long runAsUser) {
        this.runAsUser=runAsUser; return (A) this;
    }

    public Boolean hasRunAsUser() {
        return this.runAsUser != null;
    }

    
/**
 * This method has been deprecated, please use method buildSeLinuxOptions instead.
 * @return The buildable object.
 */
@Deprecated public V1SELinuxOptions getSeLinuxOptions() {
        return this.seLinuxOptions!=null?this.seLinuxOptions.build():null;
    }

    public V1SELinuxOptions buildSeLinuxOptions() {
        return this.seLinuxOptions!=null?this.seLinuxOptions.build():null;
    }

    public A withSeLinuxOptions(V1SELinuxOptions seLinuxOptions) {
        _visitables.get("seLinuxOptions").remove(this.seLinuxOptions);
        if (seLinuxOptions!=null){ this.seLinuxOptions= new V1SELinuxOptionsBuilder(seLinuxOptions); _visitables.get("seLinuxOptions").add(this.seLinuxOptions);} return (A) this;
    }

    public Boolean hasSeLinuxOptions() {
        return this.seLinuxOptions != null;
    }

    public V1SecurityContextFluent.SeLinuxOptionsNested withNewSeLinuxOptions() {
        return new SeLinuxOptionsNestedImpl();
    }

    public V1SecurityContextFluent.SeLinuxOptionsNested withNewSeLinuxOptionsLike(V1SELinuxOptions item) {
        return new SeLinuxOptionsNestedImpl(item);
    }

    public V1SecurityContextFluent.SeLinuxOptionsNested editSeLinuxOptions() {
        return withNewSeLinuxOptionsLike(getSeLinuxOptions());
    }

    public V1SecurityContextFluent.SeLinuxOptionsNested editOrNewSeLinuxOptions() {
        return withNewSeLinuxOptionsLike(getSeLinuxOptions() != null ? getSeLinuxOptions(): new V1SELinuxOptionsBuilder().build());
    }

    public V1SecurityContextFluent.SeLinuxOptionsNested editOrNewSeLinuxOptionsLike(V1SELinuxOptions item) {
        return withNewSeLinuxOptionsLike(getSeLinuxOptions() != null ? getSeLinuxOptions(): item);
    }

    
/**
 * This method has been deprecated, please use method buildSeccompProfile instead.
 * @return The buildable object.
 */
@Deprecated public V1SeccompProfile getSeccompProfile() {
        return this.seccompProfile!=null?this.seccompProfile.build():null;
    }

    public V1SeccompProfile buildSeccompProfile() {
        return this.seccompProfile!=null?this.seccompProfile.build():null;
    }

    public A withSeccompProfile(V1SeccompProfile seccompProfile) {
        _visitables.get("seccompProfile").remove(this.seccompProfile);
        if (seccompProfile!=null){ this.seccompProfile= new V1SeccompProfileBuilder(seccompProfile); _visitables.get("seccompProfile").add(this.seccompProfile);} return (A) this;
    }

    public Boolean hasSeccompProfile() {
        return this.seccompProfile != null;
    }

    public V1SecurityContextFluent.SeccompProfileNested withNewSeccompProfile() {
        return new SeccompProfileNestedImpl();
    }

    public V1SecurityContextFluent.SeccompProfileNested withNewSeccompProfileLike(V1SeccompProfile item) {
        return new SeccompProfileNestedImpl(item);
    }

    public V1SecurityContextFluent.SeccompProfileNested editSeccompProfile() {
        return withNewSeccompProfileLike(getSeccompProfile());
    }

    public V1SecurityContextFluent.SeccompProfileNested editOrNewSeccompProfile() {
        return withNewSeccompProfileLike(getSeccompProfile() != null ? getSeccompProfile(): new V1SeccompProfileBuilder().build());
    }

    public V1SecurityContextFluent.SeccompProfileNested editOrNewSeccompProfileLike(V1SeccompProfile item) {
        return withNewSeccompProfileLike(getSeccompProfile() != null ? getSeccompProfile(): item);
    }

    
/**
 * This method has been deprecated, please use method buildWindowsOptions instead.
 * @return The buildable object.
 */
@Deprecated public V1WindowsSecurityContextOptions getWindowsOptions() {
        return this.windowsOptions!=null?this.windowsOptions.build():null;
    }

    public V1WindowsSecurityContextOptions buildWindowsOptions() {
        return this.windowsOptions!=null?this.windowsOptions.build():null;
    }

    public A withWindowsOptions(V1WindowsSecurityContextOptions windowsOptions) {
        _visitables.get("windowsOptions").remove(this.windowsOptions);
        if (windowsOptions!=null){ this.windowsOptions= new V1WindowsSecurityContextOptionsBuilder(windowsOptions); _visitables.get("windowsOptions").add(this.windowsOptions);} return (A) this;
    }

    public Boolean hasWindowsOptions() {
        return this.windowsOptions != null;
    }

    public V1SecurityContextFluent.WindowsOptionsNested withNewWindowsOptions() {
        return new WindowsOptionsNestedImpl();
    }

    public V1SecurityContextFluent.WindowsOptionsNested withNewWindowsOptionsLike(V1WindowsSecurityContextOptions item) {
        return new WindowsOptionsNestedImpl(item);
    }

    public V1SecurityContextFluent.WindowsOptionsNested editWindowsOptions() {
        return withNewWindowsOptionsLike(getWindowsOptions());
    }

    public V1SecurityContextFluent.WindowsOptionsNested editOrNewWindowsOptions() {
        return withNewWindowsOptionsLike(getWindowsOptions() != null ? getWindowsOptions(): new V1WindowsSecurityContextOptionsBuilder().build());
    }

    public V1SecurityContextFluent.WindowsOptionsNested editOrNewWindowsOptionsLike(V1WindowsSecurityContextOptions item) {
        return withNewWindowsOptionsLike(getWindowsOptions() != null ? getWindowsOptions(): item);
    }

    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        V1SecurityContextFluentImpl that = (V1SecurityContextFluentImpl) 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;
        return true;
    }

    public int hashCode() {
        return java.util.Objects.hash(allowPrivilegeEscalation,  capabilities,  privileged,  procMount,  readOnlyRootFilesystem,  runAsGroup,  runAsNonRoot,  runAsUser,  seLinuxOptions,  seccompProfile,  windowsOptions,  super.hashCode());
    }

    public class CapabilitiesNestedImpl extends V1CapabilitiesFluentImpl> implements V1SecurityContextFluent.CapabilitiesNested,io.kubernetes.client.fluent.Nested {
        private final V1CapabilitiesBuilder builder;

        CapabilitiesNestedImpl(V1Capabilities item) {
            this.builder = new V1CapabilitiesBuilder(this, item);
        }

        CapabilitiesNestedImpl() {
            this.builder = new V1CapabilitiesBuilder(this);
        }

        public N and() {
             return (N) V1SecurityContextFluentImpl.this.withCapabilities(builder.build());
        }

        public N endCapabilities() {
             return and();
        }
    }


    public class SeLinuxOptionsNestedImpl extends V1SELinuxOptionsFluentImpl> implements V1SecurityContextFluent.SeLinuxOptionsNested,io.kubernetes.client.fluent.Nested {
        private final V1SELinuxOptionsBuilder builder;

        SeLinuxOptionsNestedImpl(V1SELinuxOptions item) {
            this.builder = new V1SELinuxOptionsBuilder(this, item);
        }

        SeLinuxOptionsNestedImpl() {
            this.builder = new V1SELinuxOptionsBuilder(this);
        }

        public N and() {
             return (N) V1SecurityContextFluentImpl.this.withSeLinuxOptions(builder.build());
        }

        public N endSeLinuxOptions() {
             return and();
        }
    }


    public class SeccompProfileNestedImpl extends V1SeccompProfileFluentImpl> implements V1SecurityContextFluent.SeccompProfileNested,io.kubernetes.client.fluent.Nested {
        private final V1SeccompProfileBuilder builder;

        SeccompProfileNestedImpl(V1SeccompProfile item) {
            this.builder = new V1SeccompProfileBuilder(this, item);
        }

        SeccompProfileNestedImpl() {
            this.builder = new V1SeccompProfileBuilder(this);
        }

        public N and() {
             return (N) V1SecurityContextFluentImpl.this.withSeccompProfile(builder.build());
        }

        public N endSeccompProfile() {
             return and();
        }
    }


    public class WindowsOptionsNestedImpl extends V1WindowsSecurityContextOptionsFluentImpl> implements V1SecurityContextFluent.WindowsOptionsNested,io.kubernetes.client.fluent.Nested {
        private final V1WindowsSecurityContextOptionsBuilder builder;

        WindowsOptionsNestedImpl(V1WindowsSecurityContextOptions item) {
            this.builder = new V1WindowsSecurityContextOptionsBuilder(this, item);
        }

        WindowsOptionsNestedImpl() {
            this.builder = new V1WindowsSecurityContextOptionsBuilder(this);
        }

        public N and() {
             return (N) V1SecurityContextFluentImpl.this.withWindowsOptions(builder.build());
        }

        public N endWindowsOptions() {
             return and();
        }
    }


}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy