io.kubernetes.client.openapi.models.V1beta1SubjectRulesReviewStatusFluentImpl Maven / Gradle / Ivy
package io.kubernetes.client.openapi.models;
import io.kubernetes.client.fluent.VisitableBuilder;
import java.lang.StringBuilder;
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.lang.Deprecated;
import io.kubernetes.client.fluent.BaseFluent;
import java.util.Iterator;
import java.util.List;
import java.lang.Boolean;
import java.lang.StringBuffer;
import java.util.Collection;
import java.lang.Object;
public class V1beta1SubjectRulesReviewStatusFluentImpl> extends io.kubernetes.client.fluent.BaseFluent implements V1beta1SubjectRulesReviewStatusFluent {
private String evaluationError;
private Boolean incomplete;
private List nonResourceRules;
private List resourceRules;
public V1beta1SubjectRulesReviewStatusFluentImpl() {
}
public V1beta1SubjectRulesReviewStatusFluentImpl(V1beta1SubjectRulesReviewStatus instance) {
this.withEvaluationError(instance.getEvaluationError());
this.withIncomplete(instance.getIncomplete());
this.withNonResourceRules(instance.getNonResourceRules());
this.withResourceRules(instance.getResourceRules());
}
public String getEvaluationError() {
return this.evaluationError;
}
public A withEvaluationError(String evaluationError) {
this.evaluationError=evaluationError; return (A) this;
}
public Boolean hasEvaluationError() {
return this.evaluationError != null;
}
public A withNewEvaluationError(String arg1) {
return (A)withEvaluationError(new String(arg1));
}
public A withNewEvaluationError(StringBuilder arg1) {
return (A)withEvaluationError(new String(arg1));
}
public A withNewEvaluationError(StringBuffer arg1) {
return (A)withEvaluationError(new String(arg1));
}
public Boolean isIncomplete() {
return this.incomplete;
}
public A withIncomplete(Boolean incomplete) {
this.incomplete=incomplete; return (A) this;
}
public Boolean hasIncomplete() {
return this.incomplete != null;
}
public A withNewIncomplete(String arg1) {
return (A)withIncomplete(new Boolean(arg1));
}
public A withNewIncomplete(boolean arg1) {
return (A)withIncomplete(new Boolean(arg1));
}
public A addToNonResourceRules(int index,V1beta1NonResourceRule item) {
if (this.nonResourceRules == null) {this.nonResourceRules = new ArrayList();}
V1beta1NonResourceRuleBuilder builder = new V1beta1NonResourceRuleBuilder(item);_visitables.get("nonResourceRules").add(index >= 0 ? index : _visitables.get("nonResourceRules").size(), builder);this.nonResourceRules.add(index >= 0 ? index : nonResourceRules.size(), builder); return (A)this;
}
public A setToNonResourceRules(int index,V1beta1NonResourceRule item) {
if (this.nonResourceRules == null) {this.nonResourceRules = new ArrayList();}
V1beta1NonResourceRuleBuilder builder = new V1beta1NonResourceRuleBuilder(item);
if (index < 0 || index >= _visitables.get("nonResourceRules").size()) { _visitables.get("nonResourceRules").add(builder); } else { _visitables.get("nonResourceRules").set(index, builder);}
if (index < 0 || index >= nonResourceRules.size()) { nonResourceRules.add(builder); } else { nonResourceRules.set(index, builder);}
return (A)this;
}
public A addToNonResourceRules(V1beta1NonResourceRule... items) {
if (this.nonResourceRules == null) {this.nonResourceRules = new ArrayList();}
for (V1beta1NonResourceRule item : items) {V1beta1NonResourceRuleBuilder builder = new V1beta1NonResourceRuleBuilder(item);_visitables.get("nonResourceRules").add(builder);this.nonResourceRules.add(builder);} return (A)this;
}
public A addAllToNonResourceRules(Collection items) {
if (this.nonResourceRules == null) {this.nonResourceRules = new ArrayList();}
for (V1beta1NonResourceRule item : items) {V1beta1NonResourceRuleBuilder builder = new V1beta1NonResourceRuleBuilder(item);_visitables.get("nonResourceRules").add(builder);this.nonResourceRules.add(builder);} return (A)this;
}
public A removeFromNonResourceRules(V1beta1NonResourceRule... items) {
for (V1beta1NonResourceRule item : items) {V1beta1NonResourceRuleBuilder builder = new V1beta1NonResourceRuleBuilder(item);_visitables.get("nonResourceRules").remove(builder);if (this.nonResourceRules != null) {this.nonResourceRules.remove(builder);}} return (A)this;
}
public A removeAllFromNonResourceRules(Collection items) {
for (V1beta1NonResourceRule item : items) {V1beta1NonResourceRuleBuilder builder = new V1beta1NonResourceRuleBuilder(item);_visitables.get("nonResourceRules").remove(builder);if (this.nonResourceRules != null) {this.nonResourceRules.remove(builder);}} return (A)this;
}
public A removeMatchingFromNonResourceRules(io.kubernetes.client.fluent.Predicate predicate) {
if (nonResourceRules == null) return (A) this;
final Iterator each = nonResourceRules.iterator();
final List visitables = _visitables.get("nonResourceRules");
while (each.hasNext()) {
V1beta1NonResourceRuleBuilder builder = each.next();
if (predicate.apply(builder)) {
visitables.remove(builder);
each.remove();
}
}
return (A)this;
}
/**
* This method has been deprecated, please use method buildNonResourceRules instead.
* @return The buildable object.
*/
@Deprecated public List getNonResourceRules() {
return build(nonResourceRules);
}
public List buildNonResourceRules() {
return build(nonResourceRules);
}
public V1beta1NonResourceRule buildNonResourceRule(int index) {
return this.nonResourceRules.get(index).build();
}
public V1beta1NonResourceRule buildFirstNonResourceRule() {
return this.nonResourceRules.get(0).build();
}
public V1beta1NonResourceRule buildLastNonResourceRule() {
return this.nonResourceRules.get(nonResourceRules.size() - 1).build();
}
public V1beta1NonResourceRule buildMatchingNonResourceRule(io.kubernetes.client.fluent.Predicate predicate) {
for (V1beta1NonResourceRuleBuilder item: nonResourceRules) { if(predicate.apply(item)){ return item.build();} } return null;
}
public Boolean hasMatchingNonResourceRule(io.kubernetes.client.fluent.Predicate predicate) {
for (V1beta1NonResourceRuleBuilder item: nonResourceRules) { if(predicate.apply(item)){ return true;} } return false;
}
public A withNonResourceRules(List nonResourceRules) {
if (this.nonResourceRules != null) { _visitables.get("nonResourceRules").removeAll(this.nonResourceRules);}
if (nonResourceRules != null) {this.nonResourceRules = new ArrayList(); for (V1beta1NonResourceRule item : nonResourceRules){this.addToNonResourceRules(item);}} else { this.nonResourceRules = null;} return (A) this;
}
public A withNonResourceRules(V1beta1NonResourceRule... nonResourceRules) {
if (this.nonResourceRules != null) {this.nonResourceRules.clear();}
if (nonResourceRules != null) {for (V1beta1NonResourceRule item :nonResourceRules){ this.addToNonResourceRules(item);}} return (A) this;
}
public Boolean hasNonResourceRules() {
return nonResourceRules != null && !nonResourceRules.isEmpty();
}
public V1beta1SubjectRulesReviewStatusFluent.NonResourceRulesNested addNewNonResourceRule() {
return new NonResourceRulesNestedImpl();
}
public V1beta1SubjectRulesReviewStatusFluent.NonResourceRulesNested addNewNonResourceRuleLike(V1beta1NonResourceRule item) {
return new NonResourceRulesNestedImpl(-1, item);
}
public V1beta1SubjectRulesReviewStatusFluent.NonResourceRulesNested setNewNonResourceRuleLike(int index,V1beta1NonResourceRule item) {
return new NonResourceRulesNestedImpl(index, item);
}
public V1beta1SubjectRulesReviewStatusFluent.NonResourceRulesNested editNonResourceRule(int index) {
if (nonResourceRules.size() <= index) throw new RuntimeException("Can't edit nonResourceRules. Index exceeds size.");
return setNewNonResourceRuleLike(index, buildNonResourceRule(index));
}
public V1beta1SubjectRulesReviewStatusFluent.NonResourceRulesNested editFirstNonResourceRule() {
if (nonResourceRules.size() == 0) throw new RuntimeException("Can't edit first nonResourceRules. The list is empty.");
return setNewNonResourceRuleLike(0, buildNonResourceRule(0));
}
public V1beta1SubjectRulesReviewStatusFluent.NonResourceRulesNested editLastNonResourceRule() {
int index = nonResourceRules.size() - 1;
if (index < 0) throw new RuntimeException("Can't edit last nonResourceRules. The list is empty.");
return setNewNonResourceRuleLike(index, buildNonResourceRule(index));
}
public V1beta1SubjectRulesReviewStatusFluent.NonResourceRulesNested editMatchingNonResourceRule(io.kubernetes.client.fluent.Predicate predicate) {
int index = -1;
for (int i=0;i();}
V1beta1ResourceRuleBuilder builder = new V1beta1ResourceRuleBuilder(item);_visitables.get("resourceRules").add(index >= 0 ? index : _visitables.get("resourceRules").size(), builder);this.resourceRules.add(index >= 0 ? index : resourceRules.size(), builder); return (A)this;
}
public A setToResourceRules(int index,V1beta1ResourceRule item) {
if (this.resourceRules == null) {this.resourceRules = new ArrayList();}
V1beta1ResourceRuleBuilder builder = new V1beta1ResourceRuleBuilder(item);
if (index < 0 || index >= _visitables.get("resourceRules").size()) { _visitables.get("resourceRules").add(builder); } else { _visitables.get("resourceRules").set(index, builder);}
if (index < 0 || index >= resourceRules.size()) { resourceRules.add(builder); } else { resourceRules.set(index, builder);}
return (A)this;
}
public A addToResourceRules(V1beta1ResourceRule... items) {
if (this.resourceRules == null) {this.resourceRules = new ArrayList();}
for (V1beta1ResourceRule item : items) {V1beta1ResourceRuleBuilder builder = new V1beta1ResourceRuleBuilder(item);_visitables.get("resourceRules").add(builder);this.resourceRules.add(builder);} return (A)this;
}
public A addAllToResourceRules(Collection items) {
if (this.resourceRules == null) {this.resourceRules = new ArrayList();}
for (V1beta1ResourceRule item : items) {V1beta1ResourceRuleBuilder builder = new V1beta1ResourceRuleBuilder(item);_visitables.get("resourceRules").add(builder);this.resourceRules.add(builder);} return (A)this;
}
public A removeFromResourceRules(V1beta1ResourceRule... items) {
for (V1beta1ResourceRule item : items) {V1beta1ResourceRuleBuilder builder = new V1beta1ResourceRuleBuilder(item);_visitables.get("resourceRules").remove(builder);if (this.resourceRules != null) {this.resourceRules.remove(builder);}} return (A)this;
}
public A removeAllFromResourceRules(Collection items) {
for (V1beta1ResourceRule item : items) {V1beta1ResourceRuleBuilder builder = new V1beta1ResourceRuleBuilder(item);_visitables.get("resourceRules").remove(builder);if (this.resourceRules != null) {this.resourceRules.remove(builder);}} return (A)this;
}
public A removeMatchingFromResourceRules(io.kubernetes.client.fluent.Predicate predicate) {
if (resourceRules == null) return (A) this;
final Iterator each = resourceRules.iterator();
final List visitables = _visitables.get("resourceRules");
while (each.hasNext()) {
V1beta1ResourceRuleBuilder builder = each.next();
if (predicate.apply(builder)) {
visitables.remove(builder);
each.remove();
}
}
return (A)this;
}
/**
* This method has been deprecated, please use method buildResourceRules instead.
* @return The buildable object.
*/
@Deprecated public List getResourceRules() {
return build(resourceRules);
}
public List buildResourceRules() {
return build(resourceRules);
}
public V1beta1ResourceRule buildResourceRule(int index) {
return this.resourceRules.get(index).build();
}
public V1beta1ResourceRule buildFirstResourceRule() {
return this.resourceRules.get(0).build();
}
public V1beta1ResourceRule buildLastResourceRule() {
return this.resourceRules.get(resourceRules.size() - 1).build();
}
public V1beta1ResourceRule buildMatchingResourceRule(io.kubernetes.client.fluent.Predicate predicate) {
for (V1beta1ResourceRuleBuilder item: resourceRules) { if(predicate.apply(item)){ return item.build();} } return null;
}
public Boolean hasMatchingResourceRule(io.kubernetes.client.fluent.Predicate predicate) {
for (V1beta1ResourceRuleBuilder item: resourceRules) { if(predicate.apply(item)){ return true;} } return false;
}
public A withResourceRules(List resourceRules) {
if (this.resourceRules != null) { _visitables.get("resourceRules").removeAll(this.resourceRules);}
if (resourceRules != null) {this.resourceRules = new ArrayList(); for (V1beta1ResourceRule item : resourceRules){this.addToResourceRules(item);}} else { this.resourceRules = null;} return (A) this;
}
public A withResourceRules(V1beta1ResourceRule... resourceRules) {
if (this.resourceRules != null) {this.resourceRules.clear();}
if (resourceRules != null) {for (V1beta1ResourceRule item :resourceRules){ this.addToResourceRules(item);}} return (A) this;
}
public Boolean hasResourceRules() {
return resourceRules != null && !resourceRules.isEmpty();
}
public V1beta1SubjectRulesReviewStatusFluent.ResourceRulesNested addNewResourceRule() {
return new ResourceRulesNestedImpl();
}
public V1beta1SubjectRulesReviewStatusFluent.ResourceRulesNested addNewResourceRuleLike(V1beta1ResourceRule item) {
return new ResourceRulesNestedImpl(-1, item);
}
public V1beta1SubjectRulesReviewStatusFluent.ResourceRulesNested setNewResourceRuleLike(int index,V1beta1ResourceRule item) {
return new ResourceRulesNestedImpl(index, item);
}
public V1beta1SubjectRulesReviewStatusFluent.ResourceRulesNested editResourceRule(int index) {
if (resourceRules.size() <= index) throw new RuntimeException("Can't edit resourceRules. Index exceeds size.");
return setNewResourceRuleLike(index, buildResourceRule(index));
}
public V1beta1SubjectRulesReviewStatusFluent.ResourceRulesNested editFirstResourceRule() {
if (resourceRules.size() == 0) throw new RuntimeException("Can't edit first resourceRules. The list is empty.");
return setNewResourceRuleLike(0, buildResourceRule(0));
}
public V1beta1SubjectRulesReviewStatusFluent.ResourceRulesNested editLastResourceRule() {
int index = resourceRules.size() - 1;
if (index < 0) throw new RuntimeException("Can't edit last resourceRules. The list is empty.");
return setNewResourceRuleLike(index, buildResourceRule(index));
}
public V1beta1SubjectRulesReviewStatusFluent.ResourceRulesNested editMatchingResourceRule(io.kubernetes.client.fluent.Predicate predicate) {
int index = -1;
for (int i=0;i extends V1beta1NonResourceRuleFluentImpl> implements V1beta1SubjectRulesReviewStatusFluent.NonResourceRulesNested,io.kubernetes.client.fluent.Nested {
private final V1beta1NonResourceRuleBuilder builder;
private final int index;
NonResourceRulesNestedImpl(int index,V1beta1NonResourceRule item) {
this.index = index;
this.builder = new V1beta1NonResourceRuleBuilder(this, item);
}
NonResourceRulesNestedImpl() {
this.index = -1;
this.builder = new V1beta1NonResourceRuleBuilder(this);
}
public N and() {
return (N) V1beta1SubjectRulesReviewStatusFluentImpl.this.setToNonResourceRules(index,builder.build());
}
public N endNonResourceRule() {
return and();
}
}
public class ResourceRulesNestedImpl extends V1beta1ResourceRuleFluentImpl> implements V1beta1SubjectRulesReviewStatusFluent.ResourceRulesNested,io.kubernetes.client.fluent.Nested {
private final V1beta1ResourceRuleBuilder builder;
private final int index;
ResourceRulesNestedImpl(int index,V1beta1ResourceRule item) {
this.index = index;
this.builder = new V1beta1ResourceRuleBuilder(this, item);
}
ResourceRulesNestedImpl() {
this.index = -1;
this.builder = new V1beta1ResourceRuleBuilder(this);
}
public N and() {
return (N) V1beta1SubjectRulesReviewStatusFluentImpl.this.setToResourceRules(index,builder.build());
}
public N endResourceRule() {
return and();
}
}
}