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

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

There is a newer version: 22.0.0
Show newest version
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 V1beta1CustomResourceDefinitionVersionFluentImpl> extends io.kubernetes.client.fluent.BaseFluent implements V1beta1CustomResourceDefinitionVersionFluent {

    private List additionalPrinterColumns;
    private Boolean deprecated;
    private String deprecationWarning;
    private String name;
    private V1beta1CustomResourceValidationBuilder schema;
    private Boolean served;
    private Boolean storage;
    private V1beta1CustomResourceSubresourcesBuilder subresources;

    public V1beta1CustomResourceDefinitionVersionFluentImpl() { 
    }


    public V1beta1CustomResourceDefinitionVersionFluentImpl(V1beta1CustomResourceDefinitionVersion instance) { 
        this.withAdditionalPrinterColumns(instance.getAdditionalPrinterColumns());

        this.withDeprecated(instance.getDeprecated());

        this.withDeprecationWarning(instance.getDeprecationWarning());

        this.withName(instance.getName());

        this.withSchema(instance.getSchema());

        this.withServed(instance.getServed());

        this.withStorage(instance.getStorage());

        this.withSubresources(instance.getSubresources());

    }


    public A addToAdditionalPrinterColumns(int index,V1beta1CustomResourceColumnDefinition item) {
        if (this.additionalPrinterColumns == null) {this.additionalPrinterColumns = new ArrayList();}
        V1beta1CustomResourceColumnDefinitionBuilder builder = new V1beta1CustomResourceColumnDefinitionBuilder(item);_visitables.get("additionalPrinterColumns").add(index >= 0 ? index : _visitables.get("additionalPrinterColumns").size(), builder);this.additionalPrinterColumns.add(index >= 0 ? index : additionalPrinterColumns.size(), builder); return (A)this;
    }

    public A setToAdditionalPrinterColumns(int index,V1beta1CustomResourceColumnDefinition item) {
        if (this.additionalPrinterColumns == null) {this.additionalPrinterColumns = new ArrayList();}
        V1beta1CustomResourceColumnDefinitionBuilder builder = new V1beta1CustomResourceColumnDefinitionBuilder(item);
        if (index < 0 || index >= _visitables.get("additionalPrinterColumns").size()) { _visitables.get("additionalPrinterColumns").add(builder); } else { _visitables.get("additionalPrinterColumns").set(index, builder);}
        if (index < 0 || index >= additionalPrinterColumns.size()) { additionalPrinterColumns.add(builder); } else { additionalPrinterColumns.set(index, builder);}
         return (A)this;
    }

    public A addToAdditionalPrinterColumns(V1beta1CustomResourceColumnDefinition... items) {
        if (this.additionalPrinterColumns == null) {this.additionalPrinterColumns = new ArrayList();}
        for (V1beta1CustomResourceColumnDefinition item : items) {V1beta1CustomResourceColumnDefinitionBuilder builder = new V1beta1CustomResourceColumnDefinitionBuilder(item);_visitables.get("additionalPrinterColumns").add(builder);this.additionalPrinterColumns.add(builder);} return (A)this;
    }

    public A addAllToAdditionalPrinterColumns(Collection items) {
        if (this.additionalPrinterColumns == null) {this.additionalPrinterColumns = new ArrayList();}
        for (V1beta1CustomResourceColumnDefinition item : items) {V1beta1CustomResourceColumnDefinitionBuilder builder = new V1beta1CustomResourceColumnDefinitionBuilder(item);_visitables.get("additionalPrinterColumns").add(builder);this.additionalPrinterColumns.add(builder);} return (A)this;
    }

    public A removeFromAdditionalPrinterColumns(V1beta1CustomResourceColumnDefinition... items) {
        for (V1beta1CustomResourceColumnDefinition item : items) {V1beta1CustomResourceColumnDefinitionBuilder builder = new V1beta1CustomResourceColumnDefinitionBuilder(item);_visitables.get("additionalPrinterColumns").remove(builder);if (this.additionalPrinterColumns != null) {this.additionalPrinterColumns.remove(builder);}} return (A)this;
    }

    public A removeAllFromAdditionalPrinterColumns(Collection items) {
        for (V1beta1CustomResourceColumnDefinition item : items) {V1beta1CustomResourceColumnDefinitionBuilder builder = new V1beta1CustomResourceColumnDefinitionBuilder(item);_visitables.get("additionalPrinterColumns").remove(builder);if (this.additionalPrinterColumns != null) {this.additionalPrinterColumns.remove(builder);}} return (A)this;
    }

    public A removeMatchingFromAdditionalPrinterColumns(io.kubernetes.client.fluent.Predicate predicate) {
        if (additionalPrinterColumns == null) return (A) this;
        final Iterator each = additionalPrinterColumns.iterator();
        final List visitables = _visitables.get("additionalPrinterColumns");
        while (each.hasNext()) {
          V1beta1CustomResourceColumnDefinitionBuilder builder = each.next();
          if (predicate.apply(builder)) {
            visitables.remove(builder);
            each.remove();
          }
        }
        return (A)this;
    }

    
/**
 * This method has been deprecated, please use method buildAdditionalPrinterColumns instead.
 * @return The buildable object.
 */
@Deprecated public List getAdditionalPrinterColumns() {
        return build(additionalPrinterColumns);
    }

    public List buildAdditionalPrinterColumns() {
        return build(additionalPrinterColumns);
    }

    public V1beta1CustomResourceColumnDefinition buildAdditionalPrinterColumn(int index) {
        return this.additionalPrinterColumns.get(index).build();
    }

    public V1beta1CustomResourceColumnDefinition buildFirstAdditionalPrinterColumn() {
        return this.additionalPrinterColumns.get(0).build();
    }

    public V1beta1CustomResourceColumnDefinition buildLastAdditionalPrinterColumn() {
        return this.additionalPrinterColumns.get(additionalPrinterColumns.size() - 1).build();
    }

    public V1beta1CustomResourceColumnDefinition buildMatchingAdditionalPrinterColumn(io.kubernetes.client.fluent.Predicate predicate) {
        for (V1beta1CustomResourceColumnDefinitionBuilder item: additionalPrinterColumns) { if(predicate.apply(item)){ return item.build();} } return null;
    }

    public Boolean hasMatchingAdditionalPrinterColumn(io.kubernetes.client.fluent.Predicate predicate) {
        for (V1beta1CustomResourceColumnDefinitionBuilder item: additionalPrinterColumns) { if(predicate.apply(item)){ return true;} } return false;
    }

    public A withAdditionalPrinterColumns(List additionalPrinterColumns) {
        if (this.additionalPrinterColumns != null) { _visitables.get("additionalPrinterColumns").removeAll(this.additionalPrinterColumns);}
        if (additionalPrinterColumns != null) {this.additionalPrinterColumns = new ArrayList(); for (V1beta1CustomResourceColumnDefinition item : additionalPrinterColumns){this.addToAdditionalPrinterColumns(item);}} else { this.additionalPrinterColumns = null;} return (A) this;
    }

    public A withAdditionalPrinterColumns(V1beta1CustomResourceColumnDefinition... additionalPrinterColumns) {
        if (this.additionalPrinterColumns != null) {this.additionalPrinterColumns.clear();}
        if (additionalPrinterColumns != null) {for (V1beta1CustomResourceColumnDefinition item :additionalPrinterColumns){ this.addToAdditionalPrinterColumns(item);}} return (A) this;
    }

    public Boolean hasAdditionalPrinterColumns() {
        return additionalPrinterColumns != null && !additionalPrinterColumns.isEmpty();
    }

    public V1beta1CustomResourceDefinitionVersionFluent.AdditionalPrinterColumnsNested addNewAdditionalPrinterColumn() {
        return new AdditionalPrinterColumnsNestedImpl();
    }

    public V1beta1CustomResourceDefinitionVersionFluent.AdditionalPrinterColumnsNested addNewAdditionalPrinterColumnLike(V1beta1CustomResourceColumnDefinition item) {
        return new AdditionalPrinterColumnsNestedImpl(-1, item);
    }

    public V1beta1CustomResourceDefinitionVersionFluent.AdditionalPrinterColumnsNested setNewAdditionalPrinterColumnLike(int index,V1beta1CustomResourceColumnDefinition item) {
        return new AdditionalPrinterColumnsNestedImpl(index, item);
    }

    public V1beta1CustomResourceDefinitionVersionFluent.AdditionalPrinterColumnsNested editAdditionalPrinterColumn(int index) {
        if (additionalPrinterColumns.size() <= index) throw new RuntimeException("Can't edit additionalPrinterColumns. Index exceeds size.");
        return setNewAdditionalPrinterColumnLike(index, buildAdditionalPrinterColumn(index));
    }

    public V1beta1CustomResourceDefinitionVersionFluent.AdditionalPrinterColumnsNested editFirstAdditionalPrinterColumn() {
        if (additionalPrinterColumns.size() == 0) throw new RuntimeException("Can't edit first additionalPrinterColumns. The list is empty.");
        return setNewAdditionalPrinterColumnLike(0, buildAdditionalPrinterColumn(0));
    }

    public V1beta1CustomResourceDefinitionVersionFluent.AdditionalPrinterColumnsNested editLastAdditionalPrinterColumn() {
        int index = additionalPrinterColumns.size() - 1;
        if (index < 0) throw new RuntimeException("Can't edit last additionalPrinterColumns. The list is empty.");
        return setNewAdditionalPrinterColumnLike(index, buildAdditionalPrinterColumn(index));
    }

    public V1beta1CustomResourceDefinitionVersionFluent.AdditionalPrinterColumnsNested editMatchingAdditionalPrinterColumn(io.kubernetes.client.fluent.Predicate predicate) {
        int index = -1;
        for (int i=0;i withNewSchema() {
        return new SchemaNestedImpl();
    }

    public V1beta1CustomResourceDefinitionVersionFluent.SchemaNested withNewSchemaLike(V1beta1CustomResourceValidation item) {
        return new SchemaNestedImpl(item);
    }

    public V1beta1CustomResourceDefinitionVersionFluent.SchemaNested editSchema() {
        return withNewSchemaLike(getSchema());
    }

    public V1beta1CustomResourceDefinitionVersionFluent.SchemaNested editOrNewSchema() {
        return withNewSchemaLike(getSchema() != null ? getSchema(): new V1beta1CustomResourceValidationBuilder().build());
    }

    public V1beta1CustomResourceDefinitionVersionFluent.SchemaNested editOrNewSchemaLike(V1beta1CustomResourceValidation item) {
        return withNewSchemaLike(getSchema() != null ? getSchema(): item);
    }

    public Boolean isServed() {
        return this.served;
    }

    public A withServed(Boolean served) {
        this.served=served; return (A) this;
    }

    public Boolean hasServed() {
        return this.served != null;
    }

    public A withNewServed(String arg1) {
        return (A)withServed(new Boolean(arg1));
    }

    public A withNewServed(boolean arg1) {
        return (A)withServed(new Boolean(arg1));
    }

    public Boolean isStorage() {
        return this.storage;
    }

    public A withStorage(Boolean storage) {
        this.storage=storage; return (A) this;
    }

    public Boolean hasStorage() {
        return this.storage != null;
    }

    public A withNewStorage(String arg1) {
        return (A)withStorage(new Boolean(arg1));
    }

    public A withNewStorage(boolean arg1) {
        return (A)withStorage(new Boolean(arg1));
    }

    
/**
 * This method has been deprecated, please use method buildSubresources instead.
 * @return The buildable object.
 */
@Deprecated public V1beta1CustomResourceSubresources getSubresources() {
        return this.subresources!=null?this.subresources.build():null;
    }

    public V1beta1CustomResourceSubresources buildSubresources() {
        return this.subresources!=null?this.subresources.build():null;
    }

    public A withSubresources(V1beta1CustomResourceSubresources subresources) {
        _visitables.get("subresources").remove(this.subresources);
        if (subresources!=null){ this.subresources= new V1beta1CustomResourceSubresourcesBuilder(subresources); _visitables.get("subresources").add(this.subresources);} return (A) this;
    }

    public Boolean hasSubresources() {
        return this.subresources != null;
    }

    public V1beta1CustomResourceDefinitionVersionFluent.SubresourcesNested withNewSubresources() {
        return new SubresourcesNestedImpl();
    }

    public V1beta1CustomResourceDefinitionVersionFluent.SubresourcesNested withNewSubresourcesLike(V1beta1CustomResourceSubresources item) {
        return new SubresourcesNestedImpl(item);
    }

    public V1beta1CustomResourceDefinitionVersionFluent.SubresourcesNested editSubresources() {
        return withNewSubresourcesLike(getSubresources());
    }

    public V1beta1CustomResourceDefinitionVersionFluent.SubresourcesNested editOrNewSubresources() {
        return withNewSubresourcesLike(getSubresources() != null ? getSubresources(): new V1beta1CustomResourceSubresourcesBuilder().build());
    }

    public V1beta1CustomResourceDefinitionVersionFluent.SubresourcesNested editOrNewSubresourcesLike(V1beta1CustomResourceSubresources item) {
        return withNewSubresourcesLike(getSubresources() != null ? getSubresources(): item);
    }

    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        V1beta1CustomResourceDefinitionVersionFluentImpl that = (V1beta1CustomResourceDefinitionVersionFluentImpl) o;
        if (additionalPrinterColumns != null ? !additionalPrinterColumns.equals(that.additionalPrinterColumns) :that.additionalPrinterColumns != null) return false;
        if (deprecated != null ? !deprecated.equals(that.deprecated) :that.deprecated != null) return false;
        if (deprecationWarning != null ? !deprecationWarning.equals(that.deprecationWarning) :that.deprecationWarning != null) return false;
        if (name != null ? !name.equals(that.name) :that.name != null) return false;
        if (schema != null ? !schema.equals(that.schema) :that.schema != null) return false;
        if (served != null ? !served.equals(that.served) :that.served != null) return false;
        if (storage != null ? !storage.equals(that.storage) :that.storage != null) return false;
        if (subresources != null ? !subresources.equals(that.subresources) :that.subresources != null) return false;
        return true;
    }

    public int hashCode() {
        return java.util.Objects.hash(additionalPrinterColumns,  deprecated,  deprecationWarning,  name,  schema,  served,  storage,  subresources,  super.hashCode());
    }

    public class AdditionalPrinterColumnsNestedImpl extends V1beta1CustomResourceColumnDefinitionFluentImpl> implements V1beta1CustomResourceDefinitionVersionFluent.AdditionalPrinterColumnsNested,io.kubernetes.client.fluent.Nested {
        private final V1beta1CustomResourceColumnDefinitionBuilder builder;
        private final int index;

        AdditionalPrinterColumnsNestedImpl(int index,V1beta1CustomResourceColumnDefinition item) {
            this.index = index;
            this.builder = new V1beta1CustomResourceColumnDefinitionBuilder(this, item);
        }

        AdditionalPrinterColumnsNestedImpl() {
            this.index = -1;
            this.builder = new V1beta1CustomResourceColumnDefinitionBuilder(this);
        }

        public N and() {
             return (N) V1beta1CustomResourceDefinitionVersionFluentImpl.this.setToAdditionalPrinterColumns(index,builder.build());
        }

        public N endAdditionalPrinterColumn() {
             return and();
        }
    }


    public class SchemaNestedImpl extends V1beta1CustomResourceValidationFluentImpl> implements V1beta1CustomResourceDefinitionVersionFluent.SchemaNested,io.kubernetes.client.fluent.Nested {
        private final V1beta1CustomResourceValidationBuilder builder;

        SchemaNestedImpl(V1beta1CustomResourceValidation item) {
            this.builder = new V1beta1CustomResourceValidationBuilder(this, item);
        }

        SchemaNestedImpl() {
            this.builder = new V1beta1CustomResourceValidationBuilder(this);
        }

        public N and() {
             return (N) V1beta1CustomResourceDefinitionVersionFluentImpl.this.withSchema(builder.build());
        }

        public N endSchema() {
             return and();
        }
    }


    public class SubresourcesNestedImpl extends V1beta1CustomResourceSubresourcesFluentImpl> implements V1beta1CustomResourceDefinitionVersionFluent.SubresourcesNested,io.kubernetes.client.fluent.Nested {
        private final V1beta1CustomResourceSubresourcesBuilder builder;

        SubresourcesNestedImpl(V1beta1CustomResourceSubresources item) {
            this.builder = new V1beta1CustomResourceSubresourcesBuilder(this, item);
        }

        SubresourcesNestedImpl() {
            this.builder = new V1beta1CustomResourceSubresourcesBuilder(this);
        }

        public N and() {
             return (N) V1beta1CustomResourceDefinitionVersionFluentImpl.this.withSubresources(builder.build());
        }

        public N endSubresources() {
             return and();
        }
    }


}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy