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

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

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

import io.kubernetes.client.fluent.VisitableBuilder;
import java.lang.Object;
import java.lang.Boolean;

public class V1SecurityContextBuilder extends V1SecurityContextFluentImpl implements VisitableBuilder {

    V1SecurityContextFluent fluent;
    Boolean validationEnabled;

    public V1SecurityContextBuilder() { 
        this(true);
    }


    public V1SecurityContextBuilder(Boolean validationEnabled) { 
        this(new V1SecurityContext(), validationEnabled);
    }


    public V1SecurityContextBuilder(V1SecurityContextFluent fluent) { 
        this(fluent, true);
    }


    public V1SecurityContextBuilder(V1SecurityContextFluent fluent,Boolean validationEnabled) { 
        this(fluent, new V1SecurityContext(), validationEnabled);
    }


    public V1SecurityContextBuilder(V1SecurityContextFluent fluent,V1SecurityContext instance) { 
        this(fluent, instance, true);
    }


    public V1SecurityContextBuilder(V1SecurityContextFluent fluent,V1SecurityContext instance,Boolean validationEnabled) { 
        this.fluent = fluent; 
        fluent.withAllowPrivilegeEscalation(instance.getAllowPrivilegeEscalation());

        fluent.withCapabilities(instance.getCapabilities());

        fluent.withPrivileged(instance.getPrivileged());

        fluent.withProcMount(instance.getProcMount());

        fluent.withReadOnlyRootFilesystem(instance.getReadOnlyRootFilesystem());

        fluent.withRunAsGroup(instance.getRunAsGroup());

        fluent.withRunAsNonRoot(instance.getRunAsNonRoot());

        fluent.withRunAsUser(instance.getRunAsUser());

        fluent.withSeLinuxOptions(instance.getSeLinuxOptions());

        fluent.withSeccompProfile(instance.getSeccompProfile());

        fluent.withWindowsOptions(instance.getWindowsOptions());

        this.validationEnabled = validationEnabled; 
    }


    public V1SecurityContextBuilder(V1SecurityContext instance) { 
        this(instance,true);
    }


    public V1SecurityContextBuilder(V1SecurityContext instance,Boolean validationEnabled) { 
        this.fluent = this; 
        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.validationEnabled = validationEnabled; 
    }


    public V1SecurityContext build() {
        V1SecurityContext buildable = new V1SecurityContext();
        buildable.setAllowPrivilegeEscalation(fluent.isAllowPrivilegeEscalation());
        buildable.setCapabilities(fluent.getCapabilities());
        buildable.setPrivileged(fluent.isPrivileged());
        buildable.setProcMount(fluent.getProcMount());
        buildable.setReadOnlyRootFilesystem(fluent.isReadOnlyRootFilesystem());
        buildable.setRunAsGroup(fluent.getRunAsGroup());
        buildable.setRunAsNonRoot(fluent.isRunAsNonRoot());
        buildable.setRunAsUser(fluent.getRunAsUser());
        buildable.setSeLinuxOptions(fluent.getSeLinuxOptions());
        buildable.setSeccompProfile(fluent.getSeccompProfile());
        buildable.setWindowsOptions(fluent.getWindowsOptions());
        return buildable;
    }

    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        if (!super.equals(o)) return false;
        V1SecurityContextBuilder that = (V1SecurityContextBuilder) o;
        if (fluent != null &&fluent != this ? !fluent.equals(that.fluent) :that.fluent != null &&fluent != this ) return false;

        if (validationEnabled != null ? !validationEnabled.equals(that.validationEnabled) :that.validationEnabled != null) return false;
        return true;
    }

    public int hashCode() {
        return java.util.Objects.hash(fluent,  validationEnabled,  super.hashCode());
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy