All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.kubernetes.client.openapi.models.V1APIResourceFluentImpl Maven / Gradle / Ivy

There is a newer version: 22.0.0
Show newest version
package io.kubernetes.client.openapi.models;

import java.lang.StringBuilder;
import com.google.gson.annotations.SerializedName;
import java.util.ArrayList;
import java.lang.String;
import io.kubernetes.client.fluent.Predicate;
import java.lang.StringBuffer;
import io.kubernetes.client.fluent.BaseFluent;
import java.util.Collection;
import java.lang.Object;
import java.util.List;
import java.lang.Boolean;

public class V1APIResourceFluentImpl> extends io.kubernetes.client.fluent.BaseFluent implements V1APIResourceFluent {

    private List categories;
    private String group;
    private String kind;
    private String name;
    private Boolean namespaced;
    private List shortNames;
    private String singularName;
    private String storageVersionHash;
    private List verbs;
    private String version;

    public V1APIResourceFluentImpl() { 
    }


    public V1APIResourceFluentImpl(V1APIResource instance) { 
        this.withCategories(instance.getCategories());

        this.withGroup(instance.getGroup());

        this.withKind(instance.getKind());

        this.withName(instance.getName());

        this.withNamespaced(instance.getNamespaced());

        this.withShortNames(instance.getShortNames());

        this.withSingularName(instance.getSingularName());

        this.withStorageVersionHash(instance.getStorageVersionHash());

        this.withVerbs(instance.getVerbs());

        this.withVersion(instance.getVersion());

    }


    public A addToCategories(int index,String item) {
        if (this.categories == null) {this.categories = new ArrayList();}
        this.categories.add(index, item);
        return (A)this;
    }

    public A setToCategories(int index,String item) {
        if (this.categories == null) {this.categories = new ArrayList();}
        this.categories.set(index, item); return (A)this;
    }

    public A addToCategories(String... items) {
        if (this.categories == null) {this.categories = new ArrayList();}
        for (String item : items) {this.categories.add(item);} return (A)this;
    }

    public A addAllToCategories(Collection items) {
        if (this.categories == null) {this.categories = new ArrayList();}
        for (String item : items) {this.categories.add(item);} return (A)this;
    }

    public A removeFromCategories(String... items) {
        for (String item : items) {if (this.categories!= null){ this.categories.remove(item);}} return (A)this;
    }

    public A removeAllFromCategories(Collection items) {
        for (String item : items) {if (this.categories!= null){ this.categories.remove(item);}} return (A)this;
    }

    public List getCategories() {
        return this.categories;
    }

    public String getCategory(int index) {
        return this.categories.get(index);
    }

    public String getFirstCategory() {
        return this.categories.get(0);
    }

    public String getLastCategory() {
        return this.categories.get(categories.size() - 1);
    }

    public String getMatchingCategory(io.kubernetes.client.fluent.Predicate predicate) {
        for (String item: categories) { if(predicate.apply(item)){ return item;} } return null;
    }

    public Boolean hasMatchingCategory(io.kubernetes.client.fluent.Predicate predicate) {
        for (String item: categories) { if(predicate.apply(item)){ return true;} } return false;
    }

    public A withCategories(List categories) {
        if (this.categories != null) { _visitables.get("categories").removeAll(this.categories);}
        if (categories != null) {this.categories = new ArrayList(); for (String item : categories){this.addToCategories(item);}} else { this.categories = null;} return (A) this;
    }

    public A withCategories(String... categories) {
        if (this.categories != null) {this.categories.clear();}
        if (categories != null) {for (String item :categories){ this.addToCategories(item);}} return (A) this;
    }

    public Boolean hasCategories() {
        return categories != null && !categories.isEmpty();
    }

    public A addNewCategory(String arg1) {
        return (A)addToCategories(new String(arg1));
    }

    public A addNewCategory(StringBuilder arg1) {
        return (A)addToCategories(new String(arg1));
    }

    public A addNewCategory(StringBuffer arg1) {
        return (A)addToCategories(new String(arg1));
    }

    public String getGroup() {
        return this.group;
    }

    public A withGroup(String group) {
        this.group=group; return (A) this;
    }

    public Boolean hasGroup() {
        return this.group != null;
    }

    public A withNewGroup(String arg1) {
        return (A)withGroup(new String(arg1));
    }

    public A withNewGroup(StringBuilder arg1) {
        return (A)withGroup(new String(arg1));
    }

    public A withNewGroup(StringBuffer arg1) {
        return (A)withGroup(new String(arg1));
    }

    public String getKind() {
        return this.kind;
    }

    public A withKind(String kind) {
        this.kind=kind; return (A) this;
    }

    public Boolean hasKind() {
        return this.kind != null;
    }

    public A withNewKind(String arg1) {
        return (A)withKind(new String(arg1));
    }

    public A withNewKind(StringBuilder arg1) {
        return (A)withKind(new String(arg1));
    }

    public A withNewKind(StringBuffer arg1) {
        return (A)withKind(new String(arg1));
    }

    public String getName() {
        return this.name;
    }

    public A withName(String name) {
        this.name=name; return (A) this;
    }

    public Boolean hasName() {
        return this.name != null;
    }

    public A withNewName(String arg1) {
        return (A)withName(new String(arg1));
    }

    public A withNewName(StringBuilder arg1) {
        return (A)withName(new String(arg1));
    }

    public A withNewName(StringBuffer arg1) {
        return (A)withName(new String(arg1));
    }

    public Boolean isNamespaced() {
        return this.namespaced;
    }

    public A withNamespaced(Boolean namespaced) {
        this.namespaced=namespaced; return (A) this;
    }

    public Boolean hasNamespaced() {
        return this.namespaced != null;
    }

    public A withNewNamespaced(String arg1) {
        return (A)withNamespaced(new Boolean(arg1));
    }

    public A withNewNamespaced(boolean arg1) {
        return (A)withNamespaced(new Boolean(arg1));
    }

    public A addToShortNames(int index,String item) {
        if (this.shortNames == null) {this.shortNames = new ArrayList();}
        this.shortNames.add(index, item);
        return (A)this;
    }

    public A setToShortNames(int index,String item) {
        if (this.shortNames == null) {this.shortNames = new ArrayList();}
        this.shortNames.set(index, item); return (A)this;
    }

    public A addToShortNames(String... items) {
        if (this.shortNames == null) {this.shortNames = new ArrayList();}
        for (String item : items) {this.shortNames.add(item);} return (A)this;
    }

    public A addAllToShortNames(Collection items) {
        if (this.shortNames == null) {this.shortNames = new ArrayList();}
        for (String item : items) {this.shortNames.add(item);} return (A)this;
    }

    public A removeFromShortNames(String... items) {
        for (String item : items) {if (this.shortNames!= null){ this.shortNames.remove(item);}} return (A)this;
    }

    public A removeAllFromShortNames(Collection items) {
        for (String item : items) {if (this.shortNames!= null){ this.shortNames.remove(item);}} return (A)this;
    }

    public List getShortNames() {
        return this.shortNames;
    }

    public String getShortName(int index) {
        return this.shortNames.get(index);
    }

    public String getFirstShortName() {
        return this.shortNames.get(0);
    }

    public String getLastShortName() {
        return this.shortNames.get(shortNames.size() - 1);
    }

    public String getMatchingShortName(io.kubernetes.client.fluent.Predicate predicate) {
        for (String item: shortNames) { if(predicate.apply(item)){ return item;} } return null;
    }

    public Boolean hasMatchingShortName(io.kubernetes.client.fluent.Predicate predicate) {
        for (String item: shortNames) { if(predicate.apply(item)){ return true;} } return false;
    }

    public A withShortNames(List shortNames) {
        if (this.shortNames != null) { _visitables.get("shortNames").removeAll(this.shortNames);}
        if (shortNames != null) {this.shortNames = new ArrayList(); for (String item : shortNames){this.addToShortNames(item);}} else { this.shortNames = null;} return (A) this;
    }

    public A withShortNames(String... shortNames) {
        if (this.shortNames != null) {this.shortNames.clear();}
        if (shortNames != null) {for (String item :shortNames){ this.addToShortNames(item);}} return (A) this;
    }

    public Boolean hasShortNames() {
        return shortNames != null && !shortNames.isEmpty();
    }

    public A addNewShortName(String arg1) {
        return (A)addToShortNames(new String(arg1));
    }

    public A addNewShortName(StringBuilder arg1) {
        return (A)addToShortNames(new String(arg1));
    }

    public A addNewShortName(StringBuffer arg1) {
        return (A)addToShortNames(new String(arg1));
    }

    public String getSingularName() {
        return this.singularName;
    }

    public A withSingularName(String singularName) {
        this.singularName=singularName; return (A) this;
    }

    public Boolean hasSingularName() {
        return this.singularName != null;
    }

    public A withNewSingularName(String arg1) {
        return (A)withSingularName(new String(arg1));
    }

    public A withNewSingularName(StringBuilder arg1) {
        return (A)withSingularName(new String(arg1));
    }

    public A withNewSingularName(StringBuffer arg1) {
        return (A)withSingularName(new String(arg1));
    }

    public String getStorageVersionHash() {
        return this.storageVersionHash;
    }

    public A withStorageVersionHash(String storageVersionHash) {
        this.storageVersionHash=storageVersionHash; return (A) this;
    }

    public Boolean hasStorageVersionHash() {
        return this.storageVersionHash != null;
    }

    public A withNewStorageVersionHash(String arg1) {
        return (A)withStorageVersionHash(new String(arg1));
    }

    public A withNewStorageVersionHash(StringBuilder arg1) {
        return (A)withStorageVersionHash(new String(arg1));
    }

    public A withNewStorageVersionHash(StringBuffer arg1) {
        return (A)withStorageVersionHash(new String(arg1));
    }

    public A addToVerbs(int index,String item) {
        if (this.verbs == null) {this.verbs = new ArrayList();}
        this.verbs.add(index, item);
        return (A)this;
    }

    public A setToVerbs(int index,String item) {
        if (this.verbs == null) {this.verbs = new ArrayList();}
        this.verbs.set(index, item); return (A)this;
    }

    public A addToVerbs(String... items) {
        if (this.verbs == null) {this.verbs = new ArrayList();}
        for (String item : items) {this.verbs.add(item);} return (A)this;
    }

    public A addAllToVerbs(Collection items) {
        if (this.verbs == null) {this.verbs = new ArrayList();}
        for (String item : items) {this.verbs.add(item);} return (A)this;
    }

    public A removeFromVerbs(String... items) {
        for (String item : items) {if (this.verbs!= null){ this.verbs.remove(item);}} return (A)this;
    }

    public A removeAllFromVerbs(Collection items) {
        for (String item : items) {if (this.verbs!= null){ this.verbs.remove(item);}} return (A)this;
    }

    public List getVerbs() {
        return this.verbs;
    }

    public String getVerb(int index) {
        return this.verbs.get(index);
    }

    public String getFirstVerb() {
        return this.verbs.get(0);
    }

    public String getLastVerb() {
        return this.verbs.get(verbs.size() - 1);
    }

    public String getMatchingVerb(io.kubernetes.client.fluent.Predicate predicate) {
        for (String item: verbs) { if(predicate.apply(item)){ return item;} } return null;
    }

    public Boolean hasMatchingVerb(io.kubernetes.client.fluent.Predicate predicate) {
        for (String item: verbs) { if(predicate.apply(item)){ return true;} } return false;
    }

    public A withVerbs(List verbs) {
        if (this.verbs != null) { _visitables.get("verbs").removeAll(this.verbs);}
        if (verbs != null) {this.verbs = new ArrayList(); for (String item : verbs){this.addToVerbs(item);}} else { this.verbs = null;} return (A) this;
    }

    public A withVerbs(String... verbs) {
        if (this.verbs != null) {this.verbs.clear();}
        if (verbs != null) {for (String item :verbs){ this.addToVerbs(item);}} return (A) this;
    }

    public Boolean hasVerbs() {
        return verbs != null && !verbs.isEmpty();
    }

    public A addNewVerb(String arg1) {
        return (A)addToVerbs(new String(arg1));
    }

    public A addNewVerb(StringBuilder arg1) {
        return (A)addToVerbs(new String(arg1));
    }

    public A addNewVerb(StringBuffer arg1) {
        return (A)addToVerbs(new String(arg1));
    }

    public String getVersion() {
        return this.version;
    }

    public A withVersion(String version) {
        this.version=version; return (A) this;
    }

    public Boolean hasVersion() {
        return this.version != null;
    }

    public A withNewVersion(String arg1) {
        return (A)withVersion(new String(arg1));
    }

    public A withNewVersion(StringBuilder arg1) {
        return (A)withVersion(new String(arg1));
    }

    public A withNewVersion(StringBuffer arg1) {
        return (A)withVersion(new String(arg1));
    }

    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        V1APIResourceFluentImpl that = (V1APIResourceFluentImpl) o;
        if (categories != null ? !categories.equals(that.categories) :that.categories != null) return false;
        if (group != null ? !group.equals(that.group) :that.group != null) return false;
        if (kind != null ? !kind.equals(that.kind) :that.kind != null) return false;
        if (name != null ? !name.equals(that.name) :that.name != null) return false;
        if (namespaced != null ? !namespaced.equals(that.namespaced) :that.namespaced != null) return false;
        if (shortNames != null ? !shortNames.equals(that.shortNames) :that.shortNames != null) return false;
        if (singularName != null ? !singularName.equals(that.singularName) :that.singularName != null) return false;
        if (storageVersionHash != null ? !storageVersionHash.equals(that.storageVersionHash) :that.storageVersionHash != null) return false;
        if (verbs != null ? !verbs.equals(that.verbs) :that.verbs != null) return false;
        if (version != null ? !version.equals(that.version) :that.version != null) return false;
        return true;
    }

    public int hashCode() {
        return java.util.Objects.hash(categories,  group,  kind,  name,  namespaced,  shortNames,  singularName,  storageVersionHash,  verbs,  version,  super.hashCode());
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy