me.snowdrop.istio.api.authentication.v1alpha1.TriggerRuleFluentImpl Maven / Gradle / Ivy
package me.snowdrop.istio.api.authentication.v1alpha1;
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
import java.io.Serializable;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.fabric8.kubernetes.api.builder.Nested;
import java.util.ArrayList;
import io.fabric8.kubernetes.api.builder.Predicate;
import java.lang.Deprecated;
import javax.validation.Valid;
import io.fabric8.kubernetes.api.builder.BaseFluent;
import java.util.Collection;
import java.lang.Object;
import java.util.List;
import java.lang.Boolean;
public class TriggerRuleFluentImpl> extends io.fabric8.kubernetes.api.builder.BaseFluent implements TriggerRuleFluent{
private List excludedPaths;
private List includedPaths;
public TriggerRuleFluentImpl(){
}
public TriggerRuleFluentImpl(TriggerRule instance){
this.withExcludedPaths(instance.getExcludedPaths());
this.withIncludedPaths(instance.getIncludedPaths());
}
public A addToExcludedPaths(int index,StringMatch item){
if (this.excludedPaths == null) {this.excludedPaths = new ArrayList();}
StringMatchBuilder builder = new StringMatchBuilder(item);_visitables.add(index >= 0 ? index : _visitables.size(), builder);this.excludedPaths.add(index >= 0 ? index : excludedPaths.size(), builder); return (A)this;
}
public A setToExcludedPaths(int index,StringMatch item){
if (this.excludedPaths == null) {this.excludedPaths = new ArrayList();}
StringMatchBuilder builder = new StringMatchBuilder(item);
if (index < 0 || index >= _visitables.size()) { _visitables.add(builder); } else { _visitables.set(index, builder);}
if (index < 0 || index >= excludedPaths.size()) { excludedPaths.add(builder); } else { excludedPaths.set(index, builder);}
return (A)this;
}
public A addToExcludedPaths(StringMatch... items){
if (this.excludedPaths == null) {this.excludedPaths = new ArrayList();}
for (StringMatch item : items) {StringMatchBuilder builder = new StringMatchBuilder(item);_visitables.add(builder);this.excludedPaths.add(builder);} return (A)this;
}
public A addAllToExcludedPaths(Collection items){
if (this.excludedPaths == null) {this.excludedPaths = new ArrayList();}
for (StringMatch item : items) {StringMatchBuilder builder = new StringMatchBuilder(item);_visitables.add(builder);this.excludedPaths.add(builder);} return (A)this;
}
public A removeFromExcludedPaths(StringMatch... items){
for (StringMatch item : items) {StringMatchBuilder builder = new StringMatchBuilder(item);_visitables.remove(builder);if (this.excludedPaths != null) {this.excludedPaths.remove(builder);}} return (A)this;
}
public A removeAllFromExcludedPaths(Collection items){
for (StringMatch item : items) {StringMatchBuilder builder = new StringMatchBuilder(item);_visitables.remove(builder);if (this.excludedPaths != null) {this.excludedPaths.remove(builder);}} return (A)this;
}
/**
* This method has been deprecated, please use method buildExcludedPaths instead.
* @return The buildable object.
*/
@Deprecated public List getExcludedPaths(){
return build(excludedPaths);
}
public List buildExcludedPaths(){
return build(excludedPaths);
}
public StringMatch buildExcludedPath(int index){
return this.excludedPaths.get(index).build();
}
public StringMatch buildFirstExcludedPath(){
return this.excludedPaths.get(0).build();
}
public StringMatch buildLastExcludedPath(){
return this.excludedPaths.get(excludedPaths.size() - 1).build();
}
public StringMatch buildMatchingExcludedPath(io.fabric8.kubernetes.api.builder.Predicate predicate){
for (StringMatchBuilder item: excludedPaths) { if(predicate.apply(item)){return item.build();} } return null;
}
public A withExcludedPaths(List excludedPaths){
if (this.excludedPaths != null) { _visitables.removeAll(this.excludedPaths);}
if (excludedPaths != null) {this.excludedPaths = new ArrayList(); for (StringMatch item : excludedPaths){this.addToExcludedPaths(item);}} else { this.excludedPaths = null;} return (A) this;
}
public A withExcludedPaths(StringMatch... excludedPaths){
if (this.excludedPaths != null) {this.excludedPaths.clear();}
if (excludedPaths != null) {for (StringMatch item :excludedPaths){ this.addToExcludedPaths(item);}} return (A) this;
}
public Boolean hasExcludedPaths(){
return excludedPaths != null && !excludedPaths.isEmpty();
}
public TriggerRuleFluent.ExcludedPathsNested addNewExcludedPath(){
return new ExcludedPathsNestedImpl();
}
public TriggerRuleFluent.ExcludedPathsNested addNewExcludedPathLike(StringMatch item){
return new ExcludedPathsNestedImpl(-1, item);
}
public TriggerRuleFluent.ExcludedPathsNested setNewExcludedPathLike(int index,StringMatch item){
return new ExcludedPathsNestedImpl(index, item);
}
public TriggerRuleFluent.ExcludedPathsNested editExcludedPath(int index){
if (excludedPaths.size() <= index) throw new RuntimeException("Can't edit excludedPaths. Index exceeds size.");
return setNewExcludedPathLike(index, buildExcludedPath(index));
}
public TriggerRuleFluent.ExcludedPathsNested editFirstExcludedPath(){
if (excludedPaths.size() == 0) throw new RuntimeException("Can't edit first excludedPaths. The list is empty.");
return setNewExcludedPathLike(0, buildExcludedPath(0));
}
public TriggerRuleFluent.ExcludedPathsNested editLastExcludedPath(){
int index = excludedPaths.size() - 1;
if (index < 0) throw new RuntimeException("Can't edit last excludedPaths. The list is empty.");
return setNewExcludedPathLike(index, buildExcludedPath(index));
}
public TriggerRuleFluent.ExcludedPathsNested editMatchingExcludedPath(io.fabric8.kubernetes.api.builder.Predicate predicate){
int index = -1;
for (int i=0;i();}
StringMatchBuilder builder = new StringMatchBuilder(item);_visitables.add(index >= 0 ? index : _visitables.size(), builder);this.includedPaths.add(index >= 0 ? index : includedPaths.size(), builder); return (A)this;
}
public A setToIncludedPaths(int index,StringMatch item){
if (this.includedPaths == null) {this.includedPaths = new ArrayList();}
StringMatchBuilder builder = new StringMatchBuilder(item);
if (index < 0 || index >= _visitables.size()) { _visitables.add(builder); } else { _visitables.set(index, builder);}
if (index < 0 || index >= includedPaths.size()) { includedPaths.add(builder); } else { includedPaths.set(index, builder);}
return (A)this;
}
public A addToIncludedPaths(StringMatch... items){
if (this.includedPaths == null) {this.includedPaths = new ArrayList();}
for (StringMatch item : items) {StringMatchBuilder builder = new StringMatchBuilder(item);_visitables.add(builder);this.includedPaths.add(builder);} return (A)this;
}
public A addAllToIncludedPaths(Collection items){
if (this.includedPaths == null) {this.includedPaths = new ArrayList();}
for (StringMatch item : items) {StringMatchBuilder builder = new StringMatchBuilder(item);_visitables.add(builder);this.includedPaths.add(builder);} return (A)this;
}
public A removeFromIncludedPaths(StringMatch... items){
for (StringMatch item : items) {StringMatchBuilder builder = new StringMatchBuilder(item);_visitables.remove(builder);if (this.includedPaths != null) {this.includedPaths.remove(builder);}} return (A)this;
}
public A removeAllFromIncludedPaths(Collection items){
for (StringMatch item : items) {StringMatchBuilder builder = new StringMatchBuilder(item);_visitables.remove(builder);if (this.includedPaths != null) {this.includedPaths.remove(builder);}} return (A)this;
}
/**
* This method has been deprecated, please use method buildIncludedPaths instead.
* @return The buildable object.
*/
@Deprecated public List getIncludedPaths(){
return build(includedPaths);
}
public List buildIncludedPaths(){
return build(includedPaths);
}
public StringMatch buildIncludedPath(int index){
return this.includedPaths.get(index).build();
}
public StringMatch buildFirstIncludedPath(){
return this.includedPaths.get(0).build();
}
public StringMatch buildLastIncludedPath(){
return this.includedPaths.get(includedPaths.size() - 1).build();
}
public StringMatch buildMatchingIncludedPath(io.fabric8.kubernetes.api.builder.Predicate predicate){
for (StringMatchBuilder item: includedPaths) { if(predicate.apply(item)){return item.build();} } return null;
}
public A withIncludedPaths(List includedPaths){
if (this.includedPaths != null) { _visitables.removeAll(this.includedPaths);}
if (includedPaths != null) {this.includedPaths = new ArrayList(); for (StringMatch item : includedPaths){this.addToIncludedPaths(item);}} else { this.includedPaths = null;} return (A) this;
}
public A withIncludedPaths(StringMatch... includedPaths){
if (this.includedPaths != null) {this.includedPaths.clear();}
if (includedPaths != null) {for (StringMatch item :includedPaths){ this.addToIncludedPaths(item);}} return (A) this;
}
public Boolean hasIncludedPaths(){
return includedPaths != null && !includedPaths.isEmpty();
}
public TriggerRuleFluent.IncludedPathsNested addNewIncludedPath(){
return new IncludedPathsNestedImpl();
}
public TriggerRuleFluent.IncludedPathsNested addNewIncludedPathLike(StringMatch item){
return new IncludedPathsNestedImpl(-1, item);
}
public TriggerRuleFluent.IncludedPathsNested setNewIncludedPathLike(int index,StringMatch item){
return new IncludedPathsNestedImpl(index, item);
}
public TriggerRuleFluent.IncludedPathsNested editIncludedPath(int index){
if (includedPaths.size() <= index) throw new RuntimeException("Can't edit includedPaths. Index exceeds size.");
return setNewIncludedPathLike(index, buildIncludedPath(index));
}
public TriggerRuleFluent.IncludedPathsNested editFirstIncludedPath(){
if (includedPaths.size() == 0) throw new RuntimeException("Can't edit first includedPaths. The list is empty.");
return setNewIncludedPathLike(0, buildIncludedPath(0));
}
public TriggerRuleFluent.IncludedPathsNested editLastIncludedPath(){
int index = includedPaths.size() - 1;
if (index < 0) throw new RuntimeException("Can't edit last includedPaths. The list is empty.");
return setNewIncludedPathLike(index, buildIncludedPath(index));
}
public TriggerRuleFluent.IncludedPathsNested editMatchingIncludedPath(io.fabric8.kubernetes.api.builder.Predicate predicate){
int index = -1;
for (int i=0;i extends StringMatchFluentImpl> implements TriggerRuleFluent.ExcludedPathsNested,io.fabric8.kubernetes.api.builder.Nested{
private final StringMatchBuilder builder;
private final int index;
ExcludedPathsNestedImpl(int index,StringMatch item){
this.index = index;
this.builder = new StringMatchBuilder(this, item);
}
ExcludedPathsNestedImpl(){
this.index = -1;
this.builder = new StringMatchBuilder(this);
}
public N and(){
return (N) TriggerRuleFluentImpl.this.setToExcludedPaths(index, builder.build());
}
public N endExcludedPath(){
return and();
}
}
public class IncludedPathsNestedImpl extends StringMatchFluentImpl> implements TriggerRuleFluent.IncludedPathsNested,io.fabric8.kubernetes.api.builder.Nested{
private final StringMatchBuilder builder;
private final int index;
IncludedPathsNestedImpl(int index,StringMatch item){
this.index = index;
this.builder = new StringMatchBuilder(this, item);
}
IncludedPathsNestedImpl(){
this.index = -1;
this.builder = new StringMatchBuilder(this);
}
public N and(){
return (N) TriggerRuleFluentImpl.this.setToIncludedPaths(index, builder.build());
}
public N endIncludedPath(){
return and();
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy