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

io.kubernetes.client.models.V1beta1SubjectAccessReviewSpecFluentImpl Maven / Gradle / Ivy

package io.kubernetes.client.models;

import com.google.gson.annotations.SerializedName;
import io.kubernetes.client.fluent.Nested;
import java.util.ArrayList;
import java.lang.String;
import io.kubernetes.client.fluent.Predicate;
import java.util.LinkedHashMap;
import java.lang.Deprecated;
import io.kubernetes.client.fluent.BaseFluent;
import java.util.List;
import java.lang.Boolean;
import java.util.Collection;
import java.lang.Object;
import java.util.Map;

public class V1beta1SubjectAccessReviewSpecFluentImpl> extends io.kubernetes.client.fluent.BaseFluent implements V1beta1SubjectAccessReviewSpecFluent{

    private Map> extra;
    private List group;
    private V1beta1NonResourceAttributesBuilder nonResourceAttributes;
    private V1beta1ResourceAttributesBuilder resourceAttributes;
    private String uid;
    private String user;

    public V1beta1SubjectAccessReviewSpecFluentImpl(){
    }
    public V1beta1SubjectAccessReviewSpecFluentImpl(V1beta1SubjectAccessReviewSpec instance){
            this.withExtra(instance.getExtra());

            this.withGroup(instance.getGroup());

            this.withNonResourceAttributes(instance.getNonResourceAttributes());

            this.withResourceAttributes(instance.getResourceAttributes());

            this.withUid(instance.getUid());

            this.withUser(instance.getUser());

    }

    public A addToExtra(String key,List value){
            if(this.extra == null && key != null && value != null) { this.extra = new LinkedHashMap>(); }
            if(key != null && value != null) {this.extra.put(key, value);} return (A)this;
    }

    public A addToExtra(Map> map){
            if(this.extra == null && map != null) { this.extra = new LinkedHashMap>(); }
            if(map != null) { this.extra.putAll(map);} return (A)this;
    }

    public A removeFromExtra(String key){
            if(this.extra == null) { return (A) this; }
            if(key != null && this.extra != null) {this.extra.remove(key);} return (A)this;
    }

    public A removeFromExtra(Map> map){
            if(this.extra == null) { return (A) this; }
            if(map != null) { for(Object key : map.keySet()) {if (this.extra != null){this.extra.remove(key);}}} return (A)this;
    }

    public Map> getExtra(){
            return this.extra;
    }

    public A withExtra(Map> extra){
            if (extra == null) { this.extra =  null;} else {this.extra = new LinkedHashMap>(extra);} return (A) this;
    }

    public Boolean hasExtra(){
            return this.extra != null;
    }

    public A addToGroup(int index,String item){
            if (this.group == null) {this.group = new ArrayList();}
            this.group.add(index, item);
            return (A)this;
    }

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

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

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

    public A removeFromGroup(String... items){
            for (String item : items) {if (this.group!= null){ this.group.remove(item);}} return (A)this;
    }

    public A removeAllFromGroup(Collection items){
            for (String item : items) {if (this.group!= null){ this.group.remove(item);}} return (A)this;
    }

    public List getGroup(){
            return this.group;
    }

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

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

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

    public String getMatchingGroup(io.kubernetes.client.fluent.Predicate predicate){
            for (String item: group) { if(predicate.apply(item)){return item;} } return null;
    }

    public A withGroup(List group){
            if (this.group != null) { _visitables.removeAll(this.group);}
            if (group != null) {this.group = new ArrayList(); for (String item : group){this.addToGroup(item);}} else { this.group = null;} return (A) this;
    }

    public A withGroup(String... group){
            this.group.clear(); if (group != null) {for (String item :group){ this.addToGroup(item);}} return (A) this;
    }

    public Boolean hasGroup(){
            return group != null && !group.isEmpty();
    }

    
/**
 * This method has been deprecated, please use method buildNonResourceAttributes instead.
 */
@Deprecated public V1beta1NonResourceAttributes getNonResourceAttributes(){
            return this.nonResourceAttributes!=null?this.nonResourceAttributes.build():null;
    }

    public V1beta1NonResourceAttributes buildNonResourceAttributes(){
            return this.nonResourceAttributes!=null?this.nonResourceAttributes.build():null;
    }

    public A withNonResourceAttributes(V1beta1NonResourceAttributes nonResourceAttributes){
            _visitables.remove(this.nonResourceAttributes);
            if (nonResourceAttributes!=null){ this.nonResourceAttributes= new V1beta1NonResourceAttributesBuilder(nonResourceAttributes); _visitables.add(this.nonResourceAttributes);} return (A) this;
    }

    public Boolean hasNonResourceAttributes(){
            return this.nonResourceAttributes != null;
    }

    public V1beta1SubjectAccessReviewSpecFluent.NonResourceAttributesNested withNewNonResourceAttributes(){
            return new NonResourceAttributesNestedImpl();
    }

    public V1beta1SubjectAccessReviewSpecFluent.NonResourceAttributesNested withNewNonResourceAttributesLike(V1beta1NonResourceAttributes item){
            return new NonResourceAttributesNestedImpl(item);
    }

    public V1beta1SubjectAccessReviewSpecFluent.NonResourceAttributesNested editNonResourceAttributes(){
            return withNewNonResourceAttributesLike(getNonResourceAttributes());
    }

    public V1beta1SubjectAccessReviewSpecFluent.NonResourceAttributesNested editOrNewNonResourceAttributes(){
            return withNewNonResourceAttributesLike(getNonResourceAttributes() != null ? getNonResourceAttributes(): new V1beta1NonResourceAttributesBuilder().build());
    }

    public V1beta1SubjectAccessReviewSpecFluent.NonResourceAttributesNested editOrNewNonResourceAttributesLike(V1beta1NonResourceAttributes item){
            return withNewNonResourceAttributesLike(getNonResourceAttributes() != null ? getNonResourceAttributes(): item);
    }

    
/**
 * This method has been deprecated, please use method buildResourceAttributes instead.
 */
@Deprecated public V1beta1ResourceAttributes getResourceAttributes(){
            return this.resourceAttributes!=null?this.resourceAttributes.build():null;
    }

    public V1beta1ResourceAttributes buildResourceAttributes(){
            return this.resourceAttributes!=null?this.resourceAttributes.build():null;
    }

    public A withResourceAttributes(V1beta1ResourceAttributes resourceAttributes){
            _visitables.remove(this.resourceAttributes);
            if (resourceAttributes!=null){ this.resourceAttributes= new V1beta1ResourceAttributesBuilder(resourceAttributes); _visitables.add(this.resourceAttributes);} return (A) this;
    }

    public Boolean hasResourceAttributes(){
            return this.resourceAttributes != null;
    }

    public V1beta1SubjectAccessReviewSpecFluent.ResourceAttributesNested withNewResourceAttributes(){
            return new ResourceAttributesNestedImpl();
    }

    public V1beta1SubjectAccessReviewSpecFluent.ResourceAttributesNested withNewResourceAttributesLike(V1beta1ResourceAttributes item){
            return new ResourceAttributesNestedImpl(item);
    }

    public V1beta1SubjectAccessReviewSpecFluent.ResourceAttributesNested editResourceAttributes(){
            return withNewResourceAttributesLike(getResourceAttributes());
    }

    public V1beta1SubjectAccessReviewSpecFluent.ResourceAttributesNested editOrNewResourceAttributes(){
            return withNewResourceAttributesLike(getResourceAttributes() != null ? getResourceAttributes(): new V1beta1ResourceAttributesBuilder().build());
    }

    public V1beta1SubjectAccessReviewSpecFluent.ResourceAttributesNested editOrNewResourceAttributesLike(V1beta1ResourceAttributes item){
            return withNewResourceAttributesLike(getResourceAttributes() != null ? getResourceAttributes(): item);
    }

    public String getUid(){
            return this.uid;
    }

    public A withUid(String uid){
            this.uid=uid; return (A) this;
    }

    public Boolean hasUid(){
            return this.uid != null;
    }

    public String getUser(){
            return this.user;
    }

    public A withUser(String user){
            this.user=user; return (A) this;
    }

    public Boolean hasUser(){
            return this.user != null;
    }

    public boolean equals(Object o){
            if (this == o) return true;
            if (o == null || getClass() != o.getClass()) return false;
            if (!super.equals(o)) return false;
            V1beta1SubjectAccessReviewSpecFluentImpl that = (V1beta1SubjectAccessReviewSpecFluentImpl) o;
            if (extra != null ? !extra.equals(that.extra) :that.extra != null) return false;
            if (group != null ? !group.equals(that.group) :that.group != null) return false;
            if (nonResourceAttributes != null ? !nonResourceAttributes.equals(that.nonResourceAttributes) :that.nonResourceAttributes != null) return false;
            if (resourceAttributes != null ? !resourceAttributes.equals(that.resourceAttributes) :that.resourceAttributes != null) return false;
            if (uid != null ? !uid.equals(that.uid) :that.uid != null) return false;
            if (user != null ? !user.equals(that.user) :that.user != null) return false;
            return true;
    }


    public class NonResourceAttributesNestedImpl extends V1beta1NonResourceAttributesFluentImpl> implements V1beta1SubjectAccessReviewSpecFluent.NonResourceAttributesNested,io.kubernetes.client.fluent.Nested{

            private final V1beta1NonResourceAttributesBuilder builder;
    
            NonResourceAttributesNestedImpl(V1beta1NonResourceAttributes item){
                    this.builder = new V1beta1NonResourceAttributesBuilder(this, item);
            }
            NonResourceAttributesNestedImpl(){
                    this.builder = new V1beta1NonResourceAttributesBuilder(this);
            }
    
    public N and(){
            return (N) V1beta1SubjectAccessReviewSpecFluentImpl.this.withNonResourceAttributes(builder.build());
    }
    public N endNonResourceAttributes(){
            return and();
    }

}
    public class ResourceAttributesNestedImpl extends V1beta1ResourceAttributesFluentImpl> implements V1beta1SubjectAccessReviewSpecFluent.ResourceAttributesNested,io.kubernetes.client.fluent.Nested{

            private final V1beta1ResourceAttributesBuilder builder;
    
            ResourceAttributesNestedImpl(V1beta1ResourceAttributes item){
                    this.builder = new V1beta1ResourceAttributesBuilder(this, item);
            }
            ResourceAttributesNestedImpl(){
                    this.builder = new V1beta1ResourceAttributesBuilder(this);
            }
    
    public N and(){
            return (N) V1beta1SubjectAccessReviewSpecFluentImpl.this.withResourceAttributes(builder.build());
    }
    public N endResourceAttributes(){
            return and();
    }

}


}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy