io.kubernetes.client.openapi.models.V1NamespaceSpecFluentImpl Maven / Gradle / Ivy
package io.kubernetes.client.openapi.models;
import java.lang.SuppressWarnings;
import io.kubernetes.client.fluent.BaseFluent;
import java.util.ArrayList;
import java.util.Collection;
import java.lang.Object;
import java.util.List;
import java.lang.String;
import java.lang.Boolean;
import java.util.function.Predicate;
/**
* Generated
*/
@SuppressWarnings(value = "unchecked")
public class V1NamespaceSpecFluentImpl> extends BaseFluent implements V1NamespaceSpecFluent{
public V1NamespaceSpecFluentImpl() {
}
public V1NamespaceSpecFluentImpl(V1NamespaceSpec instance) {
if (instance != null) {
this.withFinalizers(instance.getFinalizers());
}
}
private List finalizers;
public A addToFinalizers(int index,String item) {
if (this.finalizers == null) {this.finalizers = new ArrayList();}
this.finalizers.add(index, item);
return (A)this;
}
public A setToFinalizers(int index,String item) {
if (this.finalizers == null) {this.finalizers = new ArrayList();}
this.finalizers.set(index, item); return (A)this;
}
public A addToFinalizers(java.lang.String... items) {
if (this.finalizers == null) {this.finalizers = new ArrayList();}
for (String item : items) {this.finalizers.add(item);} return (A)this;
}
public A addAllToFinalizers(Collection items) {
if (this.finalizers == null) {this.finalizers = new ArrayList();}
for (String item : items) {this.finalizers.add(item);} return (A)this;
}
public A removeFromFinalizers(java.lang.String... items) {
for (String item : items) {if (this.finalizers!= null){ this.finalizers.remove(item);}} return (A)this;
}
public A removeAllFromFinalizers(Collection items) {
for (String item : items) {if (this.finalizers!= null){ this.finalizers.remove(item);}} return (A)this;
}
public List getFinalizers() {
return this.finalizers;
}
public String getFinalizer(int index) {
return this.finalizers.get(index);
}
public String getFirstFinalizer() {
return this.finalizers.get(0);
}
public String getLastFinalizer() {
return this.finalizers.get(finalizers.size() - 1);
}
public String getMatchingFinalizer(Predicate predicate) {
for (String item: finalizers) { if(predicate.test(item)){ return item;} } return null;
}
public Boolean hasMatchingFinalizer(Predicate predicate) {
for (String item: finalizers) { if(predicate.test(item)){ return true;} } return false;
}
public A withFinalizers(List finalizers) {
if (finalizers != null) {this.finalizers = new ArrayList(); for (String item : finalizers){this.addToFinalizers(item);}} else { this.finalizers = null;} return (A) this;
}
public A withFinalizers(java.lang.String... finalizers) {
if (this.finalizers != null) {this.finalizers.clear(); _visitables.remove("finalizers"); }
if (finalizers != null) {for (String item :finalizers){ this.addToFinalizers(item);}} return (A) this;
}
public Boolean hasFinalizers() {
return finalizers != null && !finalizers.isEmpty();
}
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
V1NamespaceSpecFluentImpl that = (V1NamespaceSpecFluentImpl) o;
if (!java.util.Objects.equals(finalizers, that.finalizers)) return false;
return true;
}
public int hashCode() {
return java.util.Objects.hash(finalizers, super.hashCode());
}
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (finalizers != null && !finalizers.isEmpty()) { sb.append("finalizers:"); sb.append(finalizers); }
sb.append("}");
return sb.toString();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy