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

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

package io.kubernetes.client.models;

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

public class V1beta1UserInfoFluentImpl> extends io.kubernetes.client.fluent.BaseFluent implements V1beta1UserInfoFluent{

    private Map> extra;
    private List groups;
    private String uid;
    private String username;

    public V1beta1UserInfoFluentImpl(){
    }
    public V1beta1UserInfoFluentImpl(V1beta1UserInfo instance){
            this.withExtra(instance.getExtra());

            this.withGroups(instance.getGroups());

            this.withUid(instance.getUid());

            this.withUsername(instance.getUsername());

    }

    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 addToGroups(int index,String item){
            if (this.groups == null) {this.groups = new ArrayList();}
            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) {if (this.groups!= null){ this.groups.remove(item);}} return (A)this;
    }

    public A removeAllFromGroups(Collection items){
            for (String item : items) {if (this.groups!= null){ 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.kubernetes.client.fluent.Predicate predicate){
            for (String item: groups) { if(predicate.apply(item)){return item;} } return null;
    }

    public A withGroups(List groups){
            if (this.groups != null) { _visitables.removeAll(this.groups);}
            if (groups != null) {this.groups = new ArrayList(); for (String item : groups){this.addToGroups(item);}} else { this.groups = null;} 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 getUid(){
            return this.uid;
    }

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

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

    public String getUsername(){
            return this.username;
    }

    public A withUsername(String username){
            this.username=username; return (A) this;
    }

    public Boolean hasUsername(){
            return this.username != 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;
            V1beta1UserInfoFluentImpl that = (V1beta1UserInfoFluentImpl) o;
            if (extra != null ? !extra.equals(that.extra) :that.extra != null) return false;
            if (groups != null ? !groups.equals(that.groups) :that.groups != null) return false;
            if (uid != null ? !uid.equals(that.uid) :that.uid != null) return false;
            if (username != null ? !username.equals(that.username) :that.username != null) return false;
            return true;
    }




}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy