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

io.kubernetes.client.models.V1beta1RuleWithOperationsFluentImpl Maven / Gradle / Ivy

package io.kubernetes.client.models;

import com.google.gson.annotations.SerializedName;
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 io.kubernetes.client.fluent.Predicate;

public class V1beta1RuleWithOperationsFluentImpl> extends io.kubernetes.client.fluent.BaseFluent implements V1beta1RuleWithOperationsFluent{

    private List apiGroups;
    private List apiVersions;
    private List operations;
    private List resources;

    public V1beta1RuleWithOperationsFluentImpl(){
    }
    public V1beta1RuleWithOperationsFluentImpl(V1beta1RuleWithOperations instance){
            this.withApiGroups(instance.getApiGroups());

            this.withApiVersions(instance.getApiVersions());

            this.withOperations(instance.getOperations());

            this.withResources(instance.getResources());

    }

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

    public A setToApiGroups(int index,String item){
            this.apiGroups.set(index, item); return (A)this;
    }

    public A addToApiGroups(String... items){
            for (String item : items) {this.apiGroups.add(item);} return (A)this;
    }

    public A addAllToApiGroups(Collection items){
            for (String item : items) {this.apiGroups.add(item);} return (A)this;
    }

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

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

    public List getApiGroups(){
            return this.apiGroups;
    }

    public String getApiGroup(int index){
            return this.apiGroups.get(index);
    }

    public String getFirstApiGroup(){
            return this.apiGroups.get(0);
    }

    public String getLastApiGroup(){
            return this.apiGroups.get(apiGroups.size() - 1);
    }

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

    public A withApiGroups(List apiGroups){
            if (this.apiGroups != null) { _visitables.removeAll(this.apiGroups);}
            if (apiGroups != null) {this.apiGroups = new ArrayList(); for (String item : apiGroups){this.addToApiGroups(item);}} else { this.apiGroups = null;} return (A) this;
    }

    public A withApiGroups(String... apiGroups){
            this.apiGroups.clear(); if (apiGroups != null) {for (String item :apiGroups){ this.addToApiGroups(item);}} return (A) this;
    }

    public Boolean hasApiGroups(){
            return apiGroups != null && !apiGroups.isEmpty();
    }

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

    public A setToApiVersions(int index,String item){
            this.apiVersions.set(index, item); return (A)this;
    }

    public A addToApiVersions(String... items){
            for (String item : items) {this.apiVersions.add(item);} return (A)this;
    }

    public A addAllToApiVersions(Collection items){
            for (String item : items) {this.apiVersions.add(item);} return (A)this;
    }

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

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

    public List getApiVersions(){
            return this.apiVersions;
    }

    public String getApiVersion(int index){
            return this.apiVersions.get(index);
    }

    public String getFirstApiVersion(){
            return this.apiVersions.get(0);
    }

    public String getLastApiVersion(){
            return this.apiVersions.get(apiVersions.size() - 1);
    }

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

    public A withApiVersions(List apiVersions){
            if (this.apiVersions != null) { _visitables.removeAll(this.apiVersions);}
            if (apiVersions != null) {this.apiVersions = new ArrayList(); for (String item : apiVersions){this.addToApiVersions(item);}} else { this.apiVersions = null;} return (A) this;
    }

    public A withApiVersions(String... apiVersions){
            this.apiVersions.clear(); if (apiVersions != null) {for (String item :apiVersions){ this.addToApiVersions(item);}} return (A) this;
    }

    public Boolean hasApiVersions(){
            return apiVersions != null && !apiVersions.isEmpty();
    }

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

    public A setToOperations(int index,String item){
            this.operations.set(index, item); return (A)this;
    }

    public A addToOperations(String... items){
            for (String item : items) {this.operations.add(item);} return (A)this;
    }

    public A addAllToOperations(Collection items){
            for (String item : items) {this.operations.add(item);} return (A)this;
    }

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

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

    public List getOperations(){
            return this.operations;
    }

    public String getOperation(int index){
            return this.operations.get(index);
    }

    public String getFirstOperation(){
            return this.operations.get(0);
    }

    public String getLastOperation(){
            return this.operations.get(operations.size() - 1);
    }

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

    public A withOperations(List operations){
            if (this.operations != null) { _visitables.removeAll(this.operations);}
            if (operations != null) {this.operations = new ArrayList(); for (String item : operations){this.addToOperations(item);}} else { this.operations = null;} return (A) this;
    }

    public A withOperations(String... operations){
            this.operations.clear(); if (operations != null) {for (String item :operations){ this.addToOperations(item);}} return (A) this;
    }

    public Boolean hasOperations(){
            return operations != null && !operations.isEmpty();
    }

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

    public A setToResources(int index,String item){
            this.resources.set(index, item); return (A)this;
    }

    public A addToResources(String... items){
            for (String item : items) {this.resources.add(item);} return (A)this;
    }

    public A addAllToResources(Collection items){
            for (String item : items) {this.resources.add(item);} return (A)this;
    }

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

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

    public List getResources(){
            return this.resources;
    }

    public String getResource(int index){
            return this.resources.get(index);
    }

    public String getFirstResource(){
            return this.resources.get(0);
    }

    public String getLastResource(){
            return this.resources.get(resources.size() - 1);
    }

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

    public A withResources(List resources){
            if (this.resources != null) { _visitables.removeAll(this.resources);}
            if (resources != null) {this.resources = new ArrayList(); for (String item : resources){this.addToResources(item);}} else { this.resources = null;} return (A) this;
    }

    public A withResources(String... resources){
            this.resources.clear(); if (resources != null) {for (String item :resources){ this.addToResources(item);}} return (A) this;
    }

    public Boolean hasResources(){
            return resources != null && !resources.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;
            V1beta1RuleWithOperationsFluentImpl that = (V1beta1RuleWithOperationsFluentImpl) o;
            if (apiGroups != null ? !apiGroups.equals(that.apiGroups) :that.apiGroups != null) return false;
            if (apiVersions != null ? !apiVersions.equals(that.apiVersions) :that.apiVersions != null) return false;
            if (operations != null ? !operations.equals(that.operations) :that.operations != null) return false;
            if (resources != null ? !resources.equals(that.resources) :that.resources != null) return false;
            return true;
    }




}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy