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

annotations.io.alauda.devops.api.model.SecurityContextConstraintsFluentImpl Maven / Gradle / Ivy

There is a newer version: 0.2.12
Show newest version
package io.alauda.devops.api.model;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.alauda.kubernetes.api.builder.Nested;
import java.util.ArrayList;
import io.alauda.kubernetes.api.model.validators.CheckObjectMeta;
import java.lang.String;
import javax.validation.constraints.NotNull;
import io.alauda.kubernetes.api.builder.Predicate;
import java.lang.Deprecated;
import io.alauda.kubernetes.api.builder.BaseFluent;
import java.util.List;
import java.lang.Boolean;
import io.alauda.kubernetes.api.model.ObjectMeta;
import io.alauda.kubernetes.api.model.ObjectMetaFluentImpl;
import io.alauda.kubernetes.api.model.ObjectMetaBuilder;
import java.lang.Integer;
import javax.validation.Valid;
import java.lang.Long;
import java.util.Collection;
import java.lang.Object;

public class SecurityContextConstraintsFluentImpl> extends io.alauda.kubernetes.api.builder.BaseFluent implements SecurityContextConstraintsFluent{

    private Boolean allowHostDirVolumePlugin;
    private Boolean allowHostIPC;
    private Boolean allowHostNetwork;
    private Boolean allowHostPID;
    private Boolean allowHostPorts;
    private Boolean allowPrivilegedContainer;
    private List allowedCapabilities = new ArrayList();
    private String apiVersion;
    private List defaultAddCapabilities = new ArrayList();
    private FSGroupStrategyOptionsBuilder fsGroup;
    private List groups = new ArrayList();
    private String kind;
    private ObjectMetaBuilder metadata;
    private Integer priority;
    private Boolean readOnlyRootFilesystem;
    private List requiredDropCapabilities = new ArrayList();
    private RunAsUserStrategyOptionsBuilder runAsUser;
    private SELinuxContextStrategyOptionsBuilder seLinuxContext;
    private List seccompProfiles = new ArrayList();
    private SupplementalGroupsStrategyOptionsBuilder supplementalGroups;
    private List users = new ArrayList();
    private List volumes = new ArrayList();

    public SecurityContextConstraintsFluentImpl(){
    }
    public SecurityContextConstraintsFluentImpl(SecurityContextConstraints instance){
            this.withAllowHostDirVolumePlugin(instance.getAllowHostDirVolumePlugin()); 
            this.withAllowHostIPC(instance.getAllowHostIPC()); 
            this.withAllowHostNetwork(instance.getAllowHostNetwork()); 
            this.withAllowHostPID(instance.getAllowHostPID()); 
            this.withAllowHostPorts(instance.getAllowHostPorts()); 
            this.withAllowPrivilegedContainer(instance.getAllowPrivilegedContainer()); 
            this.withAllowedCapabilities(instance.getAllowedCapabilities()); 
            this.withApiVersion(instance.getApiVersion()); 
            this.withDefaultAddCapabilities(instance.getDefaultAddCapabilities()); 
            this.withFsGroup(instance.getFsGroup()); 
            this.withGroups(instance.getGroups()); 
            this.withKind(instance.getKind()); 
            this.withMetadata(instance.getMetadata()); 
            this.withPriority(instance.getPriority()); 
            this.withReadOnlyRootFilesystem(instance.getReadOnlyRootFilesystem()); 
            this.withRequiredDropCapabilities(instance.getRequiredDropCapabilities()); 
            this.withRunAsUser(instance.getRunAsUser()); 
            this.withSeLinuxContext(instance.getSeLinuxContext()); 
            this.withSeccompProfiles(instance.getSeccompProfiles()); 
            this.withSupplementalGroups(instance.getSupplementalGroups()); 
            this.withUsers(instance.getUsers()); 
            this.withVolumes(instance.getVolumes()); 
    }

    public Boolean isAllowHostDirVolumePlugin(){
            return this.allowHostDirVolumePlugin;
    }

    public A withAllowHostDirVolumePlugin(Boolean allowHostDirVolumePlugin){
            this.allowHostDirVolumePlugin=allowHostDirVolumePlugin; return (A) this;
    }

    public Boolean hasAllowHostDirVolumePlugin(){
            return this.allowHostDirVolumePlugin!=null;
    }

    public Boolean isAllowHostIPC(){
            return this.allowHostIPC;
    }

    public A withAllowHostIPC(Boolean allowHostIPC){
            this.allowHostIPC=allowHostIPC; return (A) this;
    }

    public Boolean hasAllowHostIPC(){
            return this.allowHostIPC!=null;
    }

    public Boolean isAllowHostNetwork(){
            return this.allowHostNetwork;
    }

    public A withAllowHostNetwork(Boolean allowHostNetwork){
            this.allowHostNetwork=allowHostNetwork; return (A) this;
    }

    public Boolean hasAllowHostNetwork(){
            return this.allowHostNetwork!=null;
    }

    public Boolean isAllowHostPID(){
            return this.allowHostPID;
    }

    public A withAllowHostPID(Boolean allowHostPID){
            this.allowHostPID=allowHostPID; return (A) this;
    }

    public Boolean hasAllowHostPID(){
            return this.allowHostPID!=null;
    }

    public Boolean isAllowHostPorts(){
            return this.allowHostPorts;
    }

    public A withAllowHostPorts(Boolean allowHostPorts){
            this.allowHostPorts=allowHostPorts; return (A) this;
    }

    public Boolean hasAllowHostPorts(){
            return this.allowHostPorts!=null;
    }

    public Boolean isAllowPrivilegedContainer(){
            return this.allowPrivilegedContainer;
    }

    public A withAllowPrivilegedContainer(Boolean allowPrivilegedContainer){
            this.allowPrivilegedContainer=allowPrivilegedContainer; return (A) this;
    }

    public Boolean hasAllowPrivilegedContainer(){
            return this.allowPrivilegedContainer!=null;
    }

    public A addToAllowedCapabilities(int index,String item){
            this.allowedCapabilities.add(index, item); return (A)this;
    }

    public A setToAllowedCapabilities(int index,String item){
            this.allowedCapabilities.set(index, item); return (A)this;
    }

    public A addToAllowedCapabilities(String... items){
            for (String item : items) {this.allowedCapabilities.add(item);} return (A)this;
    }

    public A addAllToAllowedCapabilities(Collection items){
            for (String item : items) {this.allowedCapabilities.add(item);} return (A)this;
    }

    public A removeFromAllowedCapabilities(String... items){
            for (String item : items) {this.allowedCapabilities.remove(item);} return (A)this;
    }

    public A removeAllFromAllowedCapabilities(Collection items){
            for (String item : items) {this.allowedCapabilities.remove(item);} return (A)this;
    }

    public List getAllowedCapabilities(){
            return this.allowedCapabilities;
    }

    public String getAllowedCapability(int index){
            return this.allowedCapabilities.get(index);
    }

    public String getFirstAllowedCapability(){
            return this.allowedCapabilities.get(0);
    }

    public String getLastAllowedCapability(){
            return this.allowedCapabilities.get(allowedCapabilities.size() - 1);
    }

    public String getMatchingAllowedCapability(io.alauda.kubernetes.api.builder.Predicate predicate){
            for (String item: allowedCapabilities) { if(predicate.apply(item)){return item;} } return null;
    }

    public A withAllowedCapabilities(List allowedCapabilities){
            this.allowedCapabilities.clear();
            if (allowedCapabilities != null) {for (String item : allowedCapabilities){this.addToAllowedCapabilities(item);}} return (A) this;
    }

    public A withAllowedCapabilities(String... allowedCapabilities){
            this.allowedCapabilities.clear(); if (allowedCapabilities != null) {for (String item :allowedCapabilities){ this.addToAllowedCapabilities(item);}} return (A) this;
    }

    public Boolean hasAllowedCapabilities(){
            return allowedCapabilities!= null && !allowedCapabilities.isEmpty();
    }

    public String getApiVersion(){
            return this.apiVersion;
    }

    public A withApiVersion(String apiVersion){
            this.apiVersion=apiVersion; return (A) this;
    }

    public Boolean hasApiVersion(){
            return this.apiVersion!=null;
    }

    public A addToDefaultAddCapabilities(int index,String item){
            this.defaultAddCapabilities.add(index, item); return (A)this;
    }

    public A setToDefaultAddCapabilities(int index,String item){
            this.defaultAddCapabilities.set(index, item); return (A)this;
    }

    public A addToDefaultAddCapabilities(String... items){
            for (String item : items) {this.defaultAddCapabilities.add(item);} return (A)this;
    }

    public A addAllToDefaultAddCapabilities(Collection items){
            for (String item : items) {this.defaultAddCapabilities.add(item);} return (A)this;
    }

    public A removeFromDefaultAddCapabilities(String... items){
            for (String item : items) {this.defaultAddCapabilities.remove(item);} return (A)this;
    }

    public A removeAllFromDefaultAddCapabilities(Collection items){
            for (String item : items) {this.defaultAddCapabilities.remove(item);} return (A)this;
    }

    public List getDefaultAddCapabilities(){
            return this.defaultAddCapabilities;
    }

    public String getDefaultAddCapability(int index){
            return this.defaultAddCapabilities.get(index);
    }

    public String getFirstDefaultAddCapability(){
            return this.defaultAddCapabilities.get(0);
    }

    public String getLastDefaultAddCapability(){
            return this.defaultAddCapabilities.get(defaultAddCapabilities.size() - 1);
    }

    public String getMatchingDefaultAddCapability(io.alauda.kubernetes.api.builder.Predicate predicate){
            for (String item: defaultAddCapabilities) { if(predicate.apply(item)){return item;} } return null;
    }

    public A withDefaultAddCapabilities(List defaultAddCapabilities){
            this.defaultAddCapabilities.clear();
            if (defaultAddCapabilities != null) {for (String item : defaultAddCapabilities){this.addToDefaultAddCapabilities(item);}} return (A) this;
    }

    public A withDefaultAddCapabilities(String... defaultAddCapabilities){
            this.defaultAddCapabilities.clear(); if (defaultAddCapabilities != null) {for (String item :defaultAddCapabilities){ this.addToDefaultAddCapabilities(item);}} return (A) this;
    }

    public Boolean hasDefaultAddCapabilities(){
            return defaultAddCapabilities!= null && !defaultAddCapabilities.isEmpty();
    }

    
/**
 * This method has been deprecated, please use method buildFsGroup instead.
 */
@Deprecated public FSGroupStrategyOptions getFsGroup(){
            return this.fsGroup!=null?this.fsGroup.build():null;
    }

    public FSGroupStrategyOptions buildFsGroup(){
            return this.fsGroup!=null?this.fsGroup.build():null;
    }

    public A withFsGroup(FSGroupStrategyOptions fsGroup){
            _visitables.remove(this.fsGroup);
            if (fsGroup!=null){ this.fsGroup= new FSGroupStrategyOptionsBuilder(fsGroup); _visitables.add(this.fsGroup);} return (A) this;
    }

    public Boolean hasFsGroup(){
            return this.fsGroup!=null;
    }

    public SecurityContextConstraintsFluent.FsGroupNested withNewFsGroup(){
            return new FsGroupNestedImpl();
    }

    public SecurityContextConstraintsFluent.FsGroupNested withNewFsGroupLike(FSGroupStrategyOptions item){
            return new FsGroupNestedImpl(item);
    }

    public SecurityContextConstraintsFluent.FsGroupNested editFsGroup(){
            return withNewFsGroupLike(getFsGroup());
    }

    public SecurityContextConstraintsFluent.FsGroupNested editOrNewFsGroup(){
            return withNewFsGroupLike(getFsGroup() != null ? getFsGroup(): new FSGroupStrategyOptionsBuilder().build());
    }

    public SecurityContextConstraintsFluent.FsGroupNested editOrNewFsGroupLike(FSGroupStrategyOptions item){
            return withNewFsGroupLike(getFsGroup() != null ? getFsGroup(): item);
    }

    public A addToGroups(int index,String item){
            this.groups.add(index, item); return (A)this;
    }

    public A setToGroups(int index,String item){
            this.groups.set(index, item); return (A)this;
    }

    public A addToGroups(String... items){
            for (String item : items) {this.groups.add(item);} return (A)this;
    }

    public A addAllToGroups(Collection items){
            for (String item : items) {this.groups.add(item);} return (A)this;
    }

    public A removeFromGroups(String... items){
            for (String item : items) {this.groups.remove(item);} return (A)this;
    }

    public A removeAllFromGroups(Collection items){
            for (String item : items) {this.groups.remove(item);} return (A)this;
    }

    public List getGroups(){
            return this.groups;
    }

    public String getGroup(int index){
            return this.groups.get(index);
    }

    public String getFirstGroup(){
            return this.groups.get(0);
    }

    public String getLastGroup(){
            return this.groups.get(groups.size() - 1);
    }

    public String getMatchingGroup(io.alauda.kubernetes.api.builder.Predicate predicate){
            for (String item: groups) { if(predicate.apply(item)){return item;} } return null;
    }

    public A withGroups(List groups){
            this.groups.clear();
            if (groups != null) {for (String item : groups){this.addToGroups(item);}} return (A) this;
    }

    public A withGroups(String... groups){
            this.groups.clear(); if (groups != null) {for (String item :groups){ this.addToGroups(item);}} return (A) this;
    }

    public Boolean hasGroups(){
            return groups!= null && !groups.isEmpty();
    }

    public String getKind(){
            return this.kind;
    }

    public A withKind(String kind){
            this.kind=kind; return (A) this;
    }

    public Boolean hasKind(){
            return this.kind!=null;
    }

    
/**
 * This method has been deprecated, please use method buildMetadata instead.
 */
@Deprecated public ObjectMeta getMetadata(){
            return this.metadata!=null?this.metadata.build():null;
    }

    public ObjectMeta buildMetadata(){
            return this.metadata!=null?this.metadata.build():null;
    }

    public A withMetadata(ObjectMeta metadata){
            _visitables.remove(this.metadata);
            if (metadata!=null){ this.metadata= new ObjectMetaBuilder(metadata); _visitables.add(this.metadata);} return (A) this;
    }

    public Boolean hasMetadata(){
            return this.metadata!=null;
    }

    public SecurityContextConstraintsFluent.MetadataNested withNewMetadata(){
            return new MetadataNestedImpl();
    }

    public SecurityContextConstraintsFluent.MetadataNested withNewMetadataLike(ObjectMeta item){
            return new MetadataNestedImpl(item);
    }

    public SecurityContextConstraintsFluent.MetadataNested editMetadata(){
            return withNewMetadataLike(getMetadata());
    }

    public SecurityContextConstraintsFluent.MetadataNested editOrNewMetadata(){
            return withNewMetadataLike(getMetadata() != null ? getMetadata(): new ObjectMetaBuilder().build());
    }

    public SecurityContextConstraintsFluent.MetadataNested editOrNewMetadataLike(ObjectMeta item){
            return withNewMetadataLike(getMetadata() != null ? getMetadata(): item);
    }

    public Integer getPriority(){
            return this.priority;
    }

    public A withPriority(Integer priority){
            this.priority=priority; return (A) this;
    }

    public Boolean hasPriority(){
            return this.priority!=null;
    }

    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 addToRequiredDropCapabilities(int index,String item){
            this.requiredDropCapabilities.add(index, item); return (A)this;
    }

    public A setToRequiredDropCapabilities(int index,String item){
            this.requiredDropCapabilities.set(index, item); return (A)this;
    }

    public A addToRequiredDropCapabilities(String... items){
            for (String item : items) {this.requiredDropCapabilities.add(item);} return (A)this;
    }

    public A addAllToRequiredDropCapabilities(Collection items){
            for (String item : items) {this.requiredDropCapabilities.add(item);} return (A)this;
    }

    public A removeFromRequiredDropCapabilities(String... items){
            for (String item : items) {this.requiredDropCapabilities.remove(item);} return (A)this;
    }

    public A removeAllFromRequiredDropCapabilities(Collection items){
            for (String item : items) {this.requiredDropCapabilities.remove(item);} return (A)this;
    }

    public List getRequiredDropCapabilities(){
            return this.requiredDropCapabilities;
    }

    public String getRequiredDropCapability(int index){
            return this.requiredDropCapabilities.get(index);
    }

    public String getFirstRequiredDropCapability(){
            return this.requiredDropCapabilities.get(0);
    }

    public String getLastRequiredDropCapability(){
            return this.requiredDropCapabilities.get(requiredDropCapabilities.size() - 1);
    }

    public String getMatchingRequiredDropCapability(io.alauda.kubernetes.api.builder.Predicate predicate){
            for (String item: requiredDropCapabilities) { if(predicate.apply(item)){return item;} } return null;
    }

    public A withRequiredDropCapabilities(List requiredDropCapabilities){
            this.requiredDropCapabilities.clear();
            if (requiredDropCapabilities != null) {for (String item : requiredDropCapabilities){this.addToRequiredDropCapabilities(item);}} return (A) this;
    }

    public A withRequiredDropCapabilities(String... requiredDropCapabilities){
            this.requiredDropCapabilities.clear(); if (requiredDropCapabilities != null) {for (String item :requiredDropCapabilities){ this.addToRequiredDropCapabilities(item);}} return (A) this;
    }

    public Boolean hasRequiredDropCapabilities(){
            return requiredDropCapabilities!= null && !requiredDropCapabilities.isEmpty();
    }

    
/**
 * This method has been deprecated, please use method buildRunAsUser instead.
 */
@Deprecated public RunAsUserStrategyOptions getRunAsUser(){
            return this.runAsUser!=null?this.runAsUser.build():null;
    }

    public RunAsUserStrategyOptions buildRunAsUser(){
            return this.runAsUser!=null?this.runAsUser.build():null;
    }

    public A withRunAsUser(RunAsUserStrategyOptions runAsUser){
            _visitables.remove(this.runAsUser);
            if (runAsUser!=null){ this.runAsUser= new RunAsUserStrategyOptionsBuilder(runAsUser); _visitables.add(this.runAsUser);} return (A) this;
    }

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

    public SecurityContextConstraintsFluent.RunAsUserNested withNewRunAsUser(){
            return new RunAsUserNestedImpl();
    }

    public SecurityContextConstraintsFluent.RunAsUserNested withNewRunAsUserLike(RunAsUserStrategyOptions item){
            return new RunAsUserNestedImpl(item);
    }

    public SecurityContextConstraintsFluent.RunAsUserNested editRunAsUser(){
            return withNewRunAsUserLike(getRunAsUser());
    }

    public SecurityContextConstraintsFluent.RunAsUserNested editOrNewRunAsUser(){
            return withNewRunAsUserLike(getRunAsUser() != null ? getRunAsUser(): new RunAsUserStrategyOptionsBuilder().build());
    }

    public SecurityContextConstraintsFluent.RunAsUserNested editOrNewRunAsUserLike(RunAsUserStrategyOptions item){
            return withNewRunAsUserLike(getRunAsUser() != null ? getRunAsUser(): item);
    }

    public A withNewRunAsUser(String type,Long uid,Long uidRangeMax,Long uidRangeMin){
            return (A)withRunAsUser(new RunAsUserStrategyOptions(type, uid, uidRangeMax, uidRangeMin));
    }

    
/**
 * This method has been deprecated, please use method buildSeLinuxContext instead.
 */
@Deprecated public SELinuxContextStrategyOptions getSeLinuxContext(){
            return this.seLinuxContext!=null?this.seLinuxContext.build():null;
    }

    public SELinuxContextStrategyOptions buildSeLinuxContext(){
            return this.seLinuxContext!=null?this.seLinuxContext.build():null;
    }

    public A withSeLinuxContext(SELinuxContextStrategyOptions seLinuxContext){
            _visitables.remove(this.seLinuxContext);
            if (seLinuxContext!=null){ this.seLinuxContext= new SELinuxContextStrategyOptionsBuilder(seLinuxContext); _visitables.add(this.seLinuxContext);} return (A) this;
    }

    public Boolean hasSeLinuxContext(){
            return this.seLinuxContext!=null;
    }

    public SecurityContextConstraintsFluent.SeLinuxContextNested withNewSeLinuxContext(){
            return new SeLinuxContextNestedImpl();
    }

    public SecurityContextConstraintsFluent.SeLinuxContextNested withNewSeLinuxContextLike(SELinuxContextStrategyOptions item){
            return new SeLinuxContextNestedImpl(item);
    }

    public SecurityContextConstraintsFluent.SeLinuxContextNested editSeLinuxContext(){
            return withNewSeLinuxContextLike(getSeLinuxContext());
    }

    public SecurityContextConstraintsFluent.SeLinuxContextNested editOrNewSeLinuxContext(){
            return withNewSeLinuxContextLike(getSeLinuxContext() != null ? getSeLinuxContext(): new SELinuxContextStrategyOptionsBuilder().build());
    }

    public SecurityContextConstraintsFluent.SeLinuxContextNested editOrNewSeLinuxContextLike(SELinuxContextStrategyOptions item){
            return withNewSeLinuxContextLike(getSeLinuxContext() != null ? getSeLinuxContext(): item);
    }

    public A addToSeccompProfiles(int index,String item){
            this.seccompProfiles.add(index, item); return (A)this;
    }

    public A setToSeccompProfiles(int index,String item){
            this.seccompProfiles.set(index, item); return (A)this;
    }

    public A addToSeccompProfiles(String... items){
            for (String item : items) {this.seccompProfiles.add(item);} return (A)this;
    }

    public A addAllToSeccompProfiles(Collection items){
            for (String item : items) {this.seccompProfiles.add(item);} return (A)this;
    }

    public A removeFromSeccompProfiles(String... items){
            for (String item : items) {this.seccompProfiles.remove(item);} return (A)this;
    }

    public A removeAllFromSeccompProfiles(Collection items){
            for (String item : items) {this.seccompProfiles.remove(item);} return (A)this;
    }

    public List getSeccompProfiles(){
            return this.seccompProfiles;
    }

    public String getSeccompProfile(int index){
            return this.seccompProfiles.get(index);
    }

    public String getFirstSeccompProfile(){
            return this.seccompProfiles.get(0);
    }

    public String getLastSeccompProfile(){
            return this.seccompProfiles.get(seccompProfiles.size() - 1);
    }

    public String getMatchingSeccompProfile(io.alauda.kubernetes.api.builder.Predicate predicate){
            for (String item: seccompProfiles) { if(predicate.apply(item)){return item;} } return null;
    }

    public A withSeccompProfiles(List seccompProfiles){
            this.seccompProfiles.clear();
            if (seccompProfiles != null) {for (String item : seccompProfiles){this.addToSeccompProfiles(item);}} return (A) this;
    }

    public A withSeccompProfiles(String... seccompProfiles){
            this.seccompProfiles.clear(); if (seccompProfiles != null) {for (String item :seccompProfiles){ this.addToSeccompProfiles(item);}} return (A) this;
    }

    public Boolean hasSeccompProfiles(){
            return seccompProfiles!= null && !seccompProfiles.isEmpty();
    }

    
/**
 * This method has been deprecated, please use method buildSupplementalGroups instead.
 */
@Deprecated public SupplementalGroupsStrategyOptions getSupplementalGroups(){
            return this.supplementalGroups!=null?this.supplementalGroups.build():null;
    }

    public SupplementalGroupsStrategyOptions buildSupplementalGroups(){
            return this.supplementalGroups!=null?this.supplementalGroups.build():null;
    }

    public A withSupplementalGroups(SupplementalGroupsStrategyOptions supplementalGroups){
            _visitables.remove(this.supplementalGroups);
            if (supplementalGroups!=null){ this.supplementalGroups= new SupplementalGroupsStrategyOptionsBuilder(supplementalGroups); _visitables.add(this.supplementalGroups);} return (A) this;
    }

    public Boolean hasSupplementalGroups(){
            return this.supplementalGroups!=null;
    }

    public SecurityContextConstraintsFluent.SupplementalGroupsNested withNewSupplementalGroups(){
            return new SupplementalGroupsNestedImpl();
    }

    public SecurityContextConstraintsFluent.SupplementalGroupsNested withNewSupplementalGroupsLike(SupplementalGroupsStrategyOptions item){
            return new SupplementalGroupsNestedImpl(item);
    }

    public SecurityContextConstraintsFluent.SupplementalGroupsNested editSupplementalGroups(){
            return withNewSupplementalGroupsLike(getSupplementalGroups());
    }

    public SecurityContextConstraintsFluent.SupplementalGroupsNested editOrNewSupplementalGroups(){
            return withNewSupplementalGroupsLike(getSupplementalGroups() != null ? getSupplementalGroups(): new SupplementalGroupsStrategyOptionsBuilder().build());
    }

    public SecurityContextConstraintsFluent.SupplementalGroupsNested editOrNewSupplementalGroupsLike(SupplementalGroupsStrategyOptions item){
            return withNewSupplementalGroupsLike(getSupplementalGroups() != null ? getSupplementalGroups(): item);
    }

    public A addToUsers(int index,String item){
            this.users.add(index, item); return (A)this;
    }

    public A setToUsers(int index,String item){
            this.users.set(index, item); return (A)this;
    }

    public A addToUsers(String... items){
            for (String item : items) {this.users.add(item);} return (A)this;
    }

    public A addAllToUsers(Collection items){
            for (String item : items) {this.users.add(item);} return (A)this;
    }

    public A removeFromUsers(String... items){
            for (String item : items) {this.users.remove(item);} return (A)this;
    }

    public A removeAllFromUsers(Collection items){
            for (String item : items) {this.users.remove(item);} return (A)this;
    }

    public List getUsers(){
            return this.users;
    }

    public String getUser(int index){
            return this.users.get(index);
    }

    public String getFirstUser(){
            return this.users.get(0);
    }

    public String getLastUser(){
            return this.users.get(users.size() - 1);
    }

    public String getMatchingUser(io.alauda.kubernetes.api.builder.Predicate predicate){
            for (String item: users) { if(predicate.apply(item)){return item;} } return null;
    }

    public A withUsers(List users){
            this.users.clear();
            if (users != null) {for (String item : users){this.addToUsers(item);}} return (A) this;
    }

    public A withUsers(String... users){
            this.users.clear(); if (users != null) {for (String item :users){ this.addToUsers(item);}} return (A) this;
    }

    public Boolean hasUsers(){
            return users!= null && !users.isEmpty();
    }

    public A addToVolumes(int index,String item){
            this.volumes.add(index, item); return (A)this;
    }

    public A setToVolumes(int index,String item){
            this.volumes.set(index, item); return (A)this;
    }

    public A addToVolumes(String... items){
            for (String item : items) {this.volumes.add(item);} return (A)this;
    }

    public A addAllToVolumes(Collection items){
            for (String item : items) {this.volumes.add(item);} return (A)this;
    }

    public A removeFromVolumes(String... items){
            for (String item : items) {this.volumes.remove(item);} return (A)this;
    }

    public A removeAllFromVolumes(Collection items){
            for (String item : items) {this.volumes.remove(item);} return (A)this;
    }

    public List getVolumes(){
            return this.volumes;
    }

    public String getVolume(int index){
            return this.volumes.get(index);
    }

    public String getFirstVolume(){
            return this.volumes.get(0);
    }

    public String getLastVolume(){
            return this.volumes.get(volumes.size() - 1);
    }

    public String getMatchingVolume(io.alauda.kubernetes.api.builder.Predicate predicate){
            for (String item: volumes) { if(predicate.apply(item)){return item;} } return null;
    }

    public A withVolumes(List volumes){
            this.volumes.clear();
            if (volumes != null) {for (String item : volumes){this.addToVolumes(item);}} return (A) this;
    }

    public A withVolumes(String... volumes){
            this.volumes.clear(); if (volumes != null) {for (String item :volumes){ this.addToVolumes(item);}} return (A) this;
    }

    public Boolean hasVolumes(){
            return volumes!= null && !volumes.isEmpty();
    }

    public boolean equals(Object o){
            if (this == o) return true;
            if (o == null || getClass() != o.getClass()) return false;
            if (!super.equals(o)) return false;
            SecurityContextConstraintsFluentImpl that = (SecurityContextConstraintsFluentImpl) o;
            if (allowHostDirVolumePlugin != null ? !allowHostDirVolumePlugin.equals(that.allowHostDirVolumePlugin) :that.allowHostDirVolumePlugin != null) return false;
            if (allowHostIPC != null ? !allowHostIPC.equals(that.allowHostIPC) :that.allowHostIPC != null) return false;
            if (allowHostNetwork != null ? !allowHostNetwork.equals(that.allowHostNetwork) :that.allowHostNetwork != null) return false;
            if (allowHostPID != null ? !allowHostPID.equals(that.allowHostPID) :that.allowHostPID != null) return false;
            if (allowHostPorts != null ? !allowHostPorts.equals(that.allowHostPorts) :that.allowHostPorts != null) return false;
            if (allowPrivilegedContainer != null ? !allowPrivilegedContainer.equals(that.allowPrivilegedContainer) :that.allowPrivilegedContainer != null) return false;
            if (allowedCapabilities != null ? !allowedCapabilities.equals(that.allowedCapabilities) :that.allowedCapabilities != null) return false;
            if (apiVersion != null ? !apiVersion.equals(that.apiVersion) :that.apiVersion != null) return false;
            if (defaultAddCapabilities != null ? !defaultAddCapabilities.equals(that.defaultAddCapabilities) :that.defaultAddCapabilities != null) return false;
            if (fsGroup != null ? !fsGroup.equals(that.fsGroup) :that.fsGroup != null) return false;
            if (groups != null ? !groups.equals(that.groups) :that.groups != null) return false;
            if (kind != null ? !kind.equals(that.kind) :that.kind != null) return false;
            if (metadata != null ? !metadata.equals(that.metadata) :that.metadata != null) return false;
            if (priority != null ? !priority.equals(that.priority) :that.priority != null) return false;
            if (readOnlyRootFilesystem != null ? !readOnlyRootFilesystem.equals(that.readOnlyRootFilesystem) :that.readOnlyRootFilesystem != null) return false;
            if (requiredDropCapabilities != null ? !requiredDropCapabilities.equals(that.requiredDropCapabilities) :that.requiredDropCapabilities != null) return false;
            if (runAsUser != null ? !runAsUser.equals(that.runAsUser) :that.runAsUser != null) return false;
            if (seLinuxContext != null ? !seLinuxContext.equals(that.seLinuxContext) :that.seLinuxContext != null) return false;
            if (seccompProfiles != null ? !seccompProfiles.equals(that.seccompProfiles) :that.seccompProfiles != null) return false;
            if (supplementalGroups != null ? !supplementalGroups.equals(that.supplementalGroups) :that.supplementalGroups != null) return false;
            if (users != null ? !users.equals(that.users) :that.users != null) return false;
            if (volumes != null ? !volumes.equals(that.volumes) :that.volumes != null) return false;
            return true;
    }


    public class FsGroupNestedImpl extends FSGroupStrategyOptionsFluentImpl> implements SecurityContextConstraintsFluent.FsGroupNested,io.alauda.kubernetes.api.builder.Nested{

            private final FSGroupStrategyOptionsBuilder builder;
    
            FsGroupNestedImpl(FSGroupStrategyOptions item){
                    this.builder = new FSGroupStrategyOptionsBuilder(this, item);
            }
            FsGroupNestedImpl(){
                    this.builder = new FSGroupStrategyOptionsBuilder(this);
            }
    
    public N and(){
            return (N) SecurityContextConstraintsFluentImpl.this.withFsGroup(builder.build());
    }
    public N endFsGroup(){
            return and();
    }

}
    public class MetadataNestedImpl extends ObjectMetaFluentImpl> implements SecurityContextConstraintsFluent.MetadataNested,io.alauda.kubernetes.api.builder.Nested{

            private final ObjectMetaBuilder builder;
    
            MetadataNestedImpl(ObjectMeta item){
                    this.builder = new ObjectMetaBuilder(this, item);
            }
            MetadataNestedImpl(){
                    this.builder = new ObjectMetaBuilder(this);
            }
    
    public N and(){
            return (N) SecurityContextConstraintsFluentImpl.this.withMetadata(builder.build());
    }
    public N endMetadata(){
            return and();
    }

}
    public class RunAsUserNestedImpl extends RunAsUserStrategyOptionsFluentImpl> implements SecurityContextConstraintsFluent.RunAsUserNested,io.alauda.kubernetes.api.builder.Nested{

            private final RunAsUserStrategyOptionsBuilder builder;
    
            RunAsUserNestedImpl(RunAsUserStrategyOptions item){
                    this.builder = new RunAsUserStrategyOptionsBuilder(this, item);
            }
            RunAsUserNestedImpl(){
                    this.builder = new RunAsUserStrategyOptionsBuilder(this);
            }
    
    public N and(){
            return (N) SecurityContextConstraintsFluentImpl.this.withRunAsUser(builder.build());
    }
    public N endRunAsUser(){
            return and();
    }

}
    public class SeLinuxContextNestedImpl extends SELinuxContextStrategyOptionsFluentImpl> implements SecurityContextConstraintsFluent.SeLinuxContextNested,io.alauda.kubernetes.api.builder.Nested{

            private final SELinuxContextStrategyOptionsBuilder builder;
    
            SeLinuxContextNestedImpl(SELinuxContextStrategyOptions item){
                    this.builder = new SELinuxContextStrategyOptionsBuilder(this, item);
            }
            SeLinuxContextNestedImpl(){
                    this.builder = new SELinuxContextStrategyOptionsBuilder(this);
            }
    
    public N and(){
            return (N) SecurityContextConstraintsFluentImpl.this.withSeLinuxContext(builder.build());
    }
    public N endSeLinuxContext(){
            return and();
    }

}
    public class SupplementalGroupsNestedImpl extends SupplementalGroupsStrategyOptionsFluentImpl> implements SecurityContextConstraintsFluent.SupplementalGroupsNested,io.alauda.kubernetes.api.builder.Nested{

            private final SupplementalGroupsStrategyOptionsBuilder builder;
    
            SupplementalGroupsNestedImpl(SupplementalGroupsStrategyOptions item){
                    this.builder = new SupplementalGroupsStrategyOptionsBuilder(this, item);
            }
            SupplementalGroupsNestedImpl(){
                    this.builder = new SupplementalGroupsStrategyOptionsBuilder(this);
            }
    
    public N and(){
            return (N) SecurityContextConstraintsFluentImpl.this.withSupplementalGroups(builder.build());
    }
    public N endSupplementalGroups(){
            return and();
    }

}


}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy