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

io.kubernetes.client.openapi.models.V1WebhookConversionFluentImpl 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 io.kubernetes.client.fluent.Nested;
import java.util.ArrayList;
import java.lang.String;
import io.kubernetes.client.fluent.Predicate;
import java.lang.StringBuffer;
import java.lang.Deprecated;
import io.kubernetes.client.fluent.BaseFluent;
import java.util.Collection;
import java.lang.Object;
import java.util.List;
import java.lang.Boolean;

public class V1WebhookConversionFluentImpl> extends io.kubernetes.client.fluent.BaseFluent implements V1WebhookConversionFluent {

    private ApiextensionsV1WebhookClientConfigBuilder clientConfig;
    private List conversionReviewVersions;

    public V1WebhookConversionFluentImpl() { 
    }


    public V1WebhookConversionFluentImpl(V1WebhookConversion instance) { 
        this.withClientConfig(instance.getClientConfig());

        this.withConversionReviewVersions(instance.getConversionReviewVersions());

    }


    
/**
 * This method has been deprecated, please use method buildClientConfig instead.
 * @return The buildable object.
 */
@Deprecated public ApiextensionsV1WebhookClientConfig getClientConfig() {
        return this.clientConfig!=null?this.clientConfig.build():null;
    }

    public ApiextensionsV1WebhookClientConfig buildClientConfig() {
        return this.clientConfig!=null?this.clientConfig.build():null;
    }

    public A withClientConfig(ApiextensionsV1WebhookClientConfig clientConfig) {
        _visitables.get("clientConfig").remove(this.clientConfig);
        if (clientConfig!=null){ this.clientConfig= new ApiextensionsV1WebhookClientConfigBuilder(clientConfig); _visitables.get("clientConfig").add(this.clientConfig);} return (A) this;
    }

    public Boolean hasClientConfig() {
        return this.clientConfig != null;
    }

    public V1WebhookConversionFluent.ClientConfigNested withNewClientConfig() {
        return new ClientConfigNestedImpl();
    }

    public V1WebhookConversionFluent.ClientConfigNested withNewClientConfigLike(ApiextensionsV1WebhookClientConfig item) {
        return new ClientConfigNestedImpl(item);
    }

    public V1WebhookConversionFluent.ClientConfigNested editClientConfig() {
        return withNewClientConfigLike(getClientConfig());
    }

    public V1WebhookConversionFluent.ClientConfigNested editOrNewClientConfig() {
        return withNewClientConfigLike(getClientConfig() != null ? getClientConfig(): new ApiextensionsV1WebhookClientConfigBuilder().build());
    }

    public V1WebhookConversionFluent.ClientConfigNested editOrNewClientConfigLike(ApiextensionsV1WebhookClientConfig item) {
        return withNewClientConfigLike(getClientConfig() != null ? getClientConfig(): item);
    }

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

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

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

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

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

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

    public List getConversionReviewVersions() {
        return this.conversionReviewVersions;
    }

    public String getConversionReviewVersion(int index) {
        return this.conversionReviewVersions.get(index);
    }

    public String getFirstConversionReviewVersion() {
        return this.conversionReviewVersions.get(0);
    }

    public String getLastConversionReviewVersion() {
        return this.conversionReviewVersions.get(conversionReviewVersions.size() - 1);
    }

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

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

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

    public A withConversionReviewVersions(String... conversionReviewVersions) {
        if (this.conversionReviewVersions != null) {this.conversionReviewVersions.clear();}
        if (conversionReviewVersions != null) {for (String item :conversionReviewVersions){ this.addToConversionReviewVersions(item);}} return (A) this;
    }

    public Boolean hasConversionReviewVersions() {
        return conversionReviewVersions != null && !conversionReviewVersions.isEmpty();
    }

    public A addNewConversionReviewVersion(String arg1) {
        return (A)addToConversionReviewVersions(new String(arg1));
    }

    public A addNewConversionReviewVersion(StringBuilder arg1) {
        return (A)addToConversionReviewVersions(new String(arg1));
    }

    public A addNewConversionReviewVersion(StringBuffer arg1) {
        return (A)addToConversionReviewVersions(new String(arg1));
    }

    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        V1WebhookConversionFluentImpl that = (V1WebhookConversionFluentImpl) o;
        if (clientConfig != null ? !clientConfig.equals(that.clientConfig) :that.clientConfig != null) return false;
        if (conversionReviewVersions != null ? !conversionReviewVersions.equals(that.conversionReviewVersions) :that.conversionReviewVersions != null) return false;
        return true;
    }

    public int hashCode() {
        return java.util.Objects.hash(clientConfig,  conversionReviewVersions,  super.hashCode());
    }

    public class ClientConfigNestedImpl extends ApiextensionsV1WebhookClientConfigFluentImpl> implements V1WebhookConversionFluent.ClientConfigNested,io.kubernetes.client.fluent.Nested {
        private final ApiextensionsV1WebhookClientConfigBuilder builder;

        ClientConfigNestedImpl(ApiextensionsV1WebhookClientConfig item) {
            this.builder = new ApiextensionsV1WebhookClientConfigBuilder(this, item);
        }

        ClientConfigNestedImpl() {
            this.builder = new ApiextensionsV1WebhookClientConfigBuilder(this);
        }

        public N and() {
             return (N) V1WebhookConversionFluentImpl.this.withClientConfig(builder.build());
        }

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


}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy