
io.fabric8.kubernetes.api.model.authentication.UserInfoFluentImpl Maven / Gradle / Ivy
package io.fabric8.kubernetes.api.model.authentication;
import java.util.ArrayList;
import java.lang.String;
import java.util.LinkedHashMap;
import java.util.function.Predicate;
import java.lang.Integer;
import java.lang.Deprecated;
import io.fabric8.kubernetes.api.builder.BaseFluent;
import java.util.Collection;
import java.lang.Object;
import java.util.List;
import java.lang.Boolean;
import java.util.Map;
/**
* Generated
*/
public class UserInfoFluentImpl> extends io.fabric8.kubernetes.api.builder.BaseFluent implements io.fabric8.kubernetes.api.model.authentication.UserInfoFluent{
public UserInfoFluentImpl() {
}
public UserInfoFluentImpl(io.fabric8.kubernetes.api.model.authentication.UserInfo instance) {
this.withExtra(instance.getExtra());
this.withGroups(instance.getGroups());
this.withUid(instance.getUid());
this.withUsername(instance.getUsername());
this.withAdditionalProperties(instance.getAdditionalProperties());
}
private java.util.Map> extra;
private java.util.List groups = new java.util.ArrayList();
private java.lang.String uid;
private java.lang.String username;
private java.util.Map additionalProperties;
public A addToExtra(java.lang.String key,java.util.ArrayList value) {
if(this.extra == null && key != null && value != null) { this.extra = new java.util.LinkedHashMap(); }
if(key != null && value != null) {this.extra.put(key, value);} return (A)this;
}
public A addToExtra(java.util.Map> map) {
if(this.extra == null && map != null) { this.extra = new java.util.LinkedHashMap(); }
if(map != null) { this.extra.putAll(map);} return (A)this;
}
public A removeFromExtra(java.lang.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(java.util.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 java.util.Map> getExtra() {
return this.extra;
}
public A withExtra(java.util.Map> extra) {
if (extra == null) { this.extra = null;} else {this.extra = new java.util.LinkedHashMap(extra);} return (A) this;
}
public java.lang.Boolean hasExtra() {
return this.extra != null;
}
public A addToGroups(java.lang.Integer index,java.lang.String item) {
if (this.groups == null) {this.groups = new java.util.ArrayList();}
this.groups.add(index, item);
return (A)this;
}
public A setToGroups(java.lang.Integer index,java.lang.String item) {
if (this.groups == null) {this.groups = new java.util.ArrayList();}
this.groups.set(index, item); return (A)this;
}
public A addToGroups(java.lang.String... items) {
if (this.groups == null) {this.groups = new java.util.ArrayList();}
for (java.lang.String item : items) {this.groups.add(item);} return (A)this;
}
public A addAllToGroups(java.util.Collection items) {
if (this.groups == null) {this.groups = new java.util.ArrayList();}
for (java.lang.String item : items) {this.groups.add(item);} return (A)this;
}
public A removeFromGroups(java.lang.String... items) {
for (java.lang.String item : items) {if (this.groups!= null){ this.groups.remove(item);}} return (A)this;
}
public A removeAllFromGroups(java.util.Collection items) {
for (java.lang.String item : items) {if (this.groups!= null){ this.groups.remove(item);}} return (A)this;
}
public java.util.List getGroups() {
return this.groups;
}
public java.lang.String getGroup(java.lang.Integer index) {
return this.groups.get(index);
}
public java.lang.String getFirstGroup() {
return this.groups.get(0);
}
public java.lang.String getLastGroup() {
return this.groups.get(groups.size() - 1);
}
public java.lang.String getMatchingGroup(java.util.function.Predicate predicate) {
for (java.lang.String item: groups) { if(predicate.test(item)){ return item;} } return null;
}
public java.lang.Boolean hasMatchingGroup(java.util.function.Predicate predicate) {
for (java.lang.String item: groups) { if(predicate.test(item)){ return true;} } return false;
}
public A withGroups(java.util.List groups) {
if (groups != null) {this.groups = new java.util.ArrayList(); for (java.lang.String item : groups){this.addToGroups(item);}} else { this.groups = null;} return (A) this;
}
public A withGroups(java.lang.String... groups) {
if (this.groups != null) {this.groups.clear();}
if (groups != null) {for (java.lang.String item :groups){ this.addToGroups(item);}} return (A) this;
}
public java.lang.Boolean hasGroups() {
return groups != null && !groups.isEmpty();
}
public A addNewGroup(java.lang.String arg0) {
return (A)addToGroups(new String(arg0));
}
public java.lang.String getUid() {
return this.uid;
}
public A withUid(java.lang.String uid) {
this.uid=uid; return (A) this;
}
public java.lang.Boolean hasUid() {
return this.uid != null;
}
/**
* Method is deprecated. use withUid instead.
*/
@java.lang.Deprecated
public A withNewUid(java.lang.String arg0) {
return (A)withUid(new String(arg0));
}
public java.lang.String getUsername() {
return this.username;
}
public A withUsername(java.lang.String username) {
this.username=username; return (A) this;
}
public java.lang.Boolean hasUsername() {
return this.username != null;
}
/**
* Method is deprecated. use withUsername instead.
*/
@java.lang.Deprecated
public A withNewUsername(java.lang.String arg0) {
return (A)withUsername(new String(arg0));
}
public A addToAdditionalProperties(java.lang.String key,java.lang.Object value) {
if(this.additionalProperties == null && key != null && value != null) { this.additionalProperties = new java.util.LinkedHashMap(); }
if(key != null && value != null) {this.additionalProperties.put(key, value);} return (A)this;
}
public A addToAdditionalProperties(java.util.Map map) {
if(this.additionalProperties == null && map != null) { this.additionalProperties = new java.util.LinkedHashMap(); }
if(map != null) { this.additionalProperties.putAll(map);} return (A)this;
}
public A removeFromAdditionalProperties(java.lang.String key) {
if(this.additionalProperties == null) { return (A) this; }
if(key != null && this.additionalProperties != null) {this.additionalProperties.remove(key);} return (A)this;
}
public A removeFromAdditionalProperties(java.util.Map map) {
if(this.additionalProperties == null) { return (A) this; }
if(map != null) { for(Object key : map.keySet()) {if (this.additionalProperties != null){this.additionalProperties.remove(key);}}} return (A)this;
}
public java.util.Map getAdditionalProperties() {
return this.additionalProperties;
}
public A withAdditionalProperties(java.util.Map additionalProperties) {
if (additionalProperties == null) { this.additionalProperties = null;} else {this.additionalProperties = new java.util.LinkedHashMap(additionalProperties);} return (A) this;
}
public java.lang.Boolean hasAdditionalProperties() {
return this.additionalProperties != null;
}
public boolean equals(java.lang.Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
UserInfoFluentImpl that = (UserInfoFluentImpl) 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;
if (additionalProperties != null ? !additionalProperties.equals(that.additionalProperties) :that.additionalProperties != null) return false;
return true;
}
public int hashCode() {
return java.util.Objects.hash(extra, groups, uid, username, additionalProperties, super.hashCode());
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy