io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.NonResourcePolicyRuleFluentImpl Maven / Gradle / Ivy
package io.fabric8.kubernetes.api.model.flowcontrol.v1beta1;
import java.util.ArrayList;
import java.lang.String;
import java.util.LinkedHashMap;
import java.util.function.Predicate;
import java.lang.Integer;
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 NonResourcePolicyRuleFluentImpl> extends io.fabric8.kubernetes.api.builder.BaseFluent implements io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.NonResourcePolicyRuleFluent{
public NonResourcePolicyRuleFluentImpl() {
}
public NonResourcePolicyRuleFluentImpl(io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.NonResourcePolicyRule instance) {
this.withNonResourceURLs(instance.getNonResourceURLs());
this.withVerbs(instance.getVerbs());
this.withAdditionalProperties(instance.getAdditionalProperties());
}
private java.util.List nonResourceURLs = new java.util.ArrayList();
private java.util.List verbs = new java.util.ArrayList();
private java.util.Map additionalProperties;
public A addToNonResourceURLs(java.lang.Integer index,java.lang.String item) {
if (this.nonResourceURLs == null) {this.nonResourceURLs = new java.util.ArrayList();}
this.nonResourceURLs.add(index, item);
return (A)this;
}
public A setToNonResourceURLs(java.lang.Integer index,java.lang.String item) {
if (this.nonResourceURLs == null) {this.nonResourceURLs = new java.util.ArrayList();}
this.nonResourceURLs.set(index, item); return (A)this;
}
public A addToNonResourceURLs(java.lang.String... items) {
if (this.nonResourceURLs == null) {this.nonResourceURLs = new java.util.ArrayList();}
for (java.lang.String item : items) {this.nonResourceURLs.add(item);} return (A)this;
}
public A addAllToNonResourceURLs(java.util.Collection items) {
if (this.nonResourceURLs == null) {this.nonResourceURLs = new java.util.ArrayList();}
for (java.lang.String item : items) {this.nonResourceURLs.add(item);} return (A)this;
}
public A removeFromNonResourceURLs(java.lang.String... items) {
for (java.lang.String item : items) {if (this.nonResourceURLs!= null){ this.nonResourceURLs.remove(item);}} return (A)this;
}
public A removeAllFromNonResourceURLs(java.util.Collection items) {
for (java.lang.String item : items) {if (this.nonResourceURLs!= null){ this.nonResourceURLs.remove(item);}} return (A)this;
}
public java.util.List getNonResourceURLs() {
return this.nonResourceURLs;
}
public java.lang.String getNonResourceURL(java.lang.Integer index) {
return this.nonResourceURLs.get(index);
}
public java.lang.String getFirstNonResourceURL() {
return this.nonResourceURLs.get(0);
}
public java.lang.String getLastNonResourceURL() {
return this.nonResourceURLs.get(nonResourceURLs.size() - 1);
}
public java.lang.String getMatchingNonResourceURL(java.util.function.Predicate predicate) {
for (java.lang.String item: nonResourceURLs) { if(predicate.test(item)){ return item;} } return null;
}
public java.lang.Boolean hasMatchingNonResourceURL(java.util.function.Predicate predicate) {
for (java.lang.String item: nonResourceURLs) { if(predicate.test(item)){ return true;} } return false;
}
public A withNonResourceURLs(java.util.List nonResourceURLs) {
if (nonResourceURLs != null) {this.nonResourceURLs = new java.util.ArrayList(); for (java.lang.String item : nonResourceURLs){this.addToNonResourceURLs(item);}} else { this.nonResourceURLs = null;} return (A) this;
}
public A withNonResourceURLs(java.lang.String... nonResourceURLs) {
if (this.nonResourceURLs != null) {this.nonResourceURLs.clear();}
if (nonResourceURLs != null) {for (java.lang.String item :nonResourceURLs){ this.addToNonResourceURLs(item);}} return (A) this;
}
public java.lang.Boolean hasNonResourceURLs() {
return nonResourceURLs != null && !nonResourceURLs.isEmpty();
}
public A addNewNonResourceURL(java.lang.String arg0) {
return (A)addToNonResourceURLs(new String(arg0));
}
public A addToVerbs(java.lang.Integer index,java.lang.String item) {
if (this.verbs == null) {this.verbs = new java.util.ArrayList();}
this.verbs.add(index, item);
return (A)this;
}
public A setToVerbs(java.lang.Integer index,java.lang.String item) {
if (this.verbs == null) {this.verbs = new java.util.ArrayList();}
this.verbs.set(index, item); return (A)this;
}
public A addToVerbs(java.lang.String... items) {
if (this.verbs == null) {this.verbs = new java.util.ArrayList();}
for (java.lang.String item : items) {this.verbs.add(item);} return (A)this;
}
public A addAllToVerbs(java.util.Collection items) {
if (this.verbs == null) {this.verbs = new java.util.ArrayList();}
for (java.lang.String item : items) {this.verbs.add(item);} return (A)this;
}
public A removeFromVerbs(java.lang.String... items) {
for (java.lang.String item : items) {if (this.verbs!= null){ this.verbs.remove(item);}} return (A)this;
}
public A removeAllFromVerbs(java.util.Collection items) {
for (java.lang.String item : items) {if (this.verbs!= null){ this.verbs.remove(item);}} return (A)this;
}
public java.util.List getVerbs() {
return this.verbs;
}
public java.lang.String getVerb(java.lang.Integer index) {
return this.verbs.get(index);
}
public java.lang.String getFirstVerb() {
return this.verbs.get(0);
}
public java.lang.String getLastVerb() {
return this.verbs.get(verbs.size() - 1);
}
public java.lang.String getMatchingVerb(java.util.function.Predicate predicate) {
for (java.lang.String item: verbs) { if(predicate.test(item)){ return item;} } return null;
}
public java.lang.Boolean hasMatchingVerb(java.util.function.Predicate predicate) {
for (java.lang.String item: verbs) { if(predicate.test(item)){ return true;} } return false;
}
public A withVerbs(java.util.List verbs) {
if (verbs != null) {this.verbs = new java.util.ArrayList(); for (java.lang.String item : verbs){this.addToVerbs(item);}} else { this.verbs = null;} return (A) this;
}
public A withVerbs(java.lang.String... verbs) {
if (this.verbs != null) {this.verbs.clear();}
if (verbs != null) {for (java.lang.String item :verbs){ this.addToVerbs(item);}} return (A) this;
}
public java.lang.Boolean hasVerbs() {
return verbs != null && !verbs.isEmpty();
}
public A addNewVerb(java.lang.String arg0) {
return (A)addToVerbs(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;
NonResourcePolicyRuleFluentImpl that = (NonResourcePolicyRuleFluentImpl) o;
if (nonResourceURLs != null ? !nonResourceURLs.equals(that.nonResourceURLs) :that.nonResourceURLs != null) return false;
if (verbs != null ? !verbs.equals(that.verbs) :that.verbs != 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(nonResourceURLs, verbs, additionalProperties, super.hashCode());
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy