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

io.fabric8.knative.eventing.v1.BrokerSpecFluentImpl Maven / Gradle / Ivy

package io.fabric8.knative.eventing.v1;

import com.fasterxml.jackson.annotation.JsonPropertyDescription;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.fabric8.knative.internal.eventing.pkg.apis.duck.v1.DeliverySpecFluentImpl;
import io.fabric8.kubernetes.api.builder.Nested;
import java.lang.String;
import io.fabric8.knative.internal.pkg.apis.duck.v1.KReference;
import io.fabric8.knative.internal.eventing.pkg.apis.duck.v1.DeliverySpecBuilder;
import java.lang.Deprecated;
import io.fabric8.knative.internal.pkg.apis.duck.v1.KReferenceBuilder;
import io.fabric8.kubernetes.api.builder.BaseFluent;
import java.lang.Object;
import java.lang.Boolean;
import io.fabric8.knative.internal.eventing.pkg.apis.duck.v1.DeliverySpec;
import io.fabric8.knative.internal.pkg.apis.duck.v1.KReferenceFluentImpl;

public class BrokerSpecFluentImpl> extends io.fabric8.kubernetes.api.builder.BaseFluent implements BrokerSpecFluent {

    private KReferenceBuilder config;
    private DeliverySpecBuilder delivery;

    public BrokerSpecFluentImpl() { 
    }


    public BrokerSpecFluentImpl(BrokerSpec instance) { 
        this.withConfig(instance.getConfig()); 
        this.withDelivery(instance.getDelivery()); 
    }


    
/**
 * This method has been deprecated, please use method buildConfig instead.
 * @return The buildable object.
 */
@Deprecated public KReference getConfig() {
        return this.config!=null?this.config.build():null;
    }

    public KReference buildConfig() {
        return this.config!=null?this.config.build():null;
    }

    public A withConfig(KReference config) {
        _visitables.get("config").remove(this.config);
        if (config!=null){ this.config= new KReferenceBuilder(config); _visitables.get("config").add(this.config);} return (A) this;
    }

    public Boolean hasConfig() {
        return this.config != null;
    }

    public A withNewConfig(String apiVersion,String kind,String name,String namespace) {
        return (A)withConfig(new KReference(apiVersion, kind, name, namespace));
    }

    public BrokerSpecFluent.ConfigNested withNewConfig() {
        return new ConfigNestedImpl();
    }

    public BrokerSpecFluent.ConfigNested withNewConfigLike(KReference item) {
        return new ConfigNestedImpl(item);
    }

    public BrokerSpecFluent.ConfigNested editConfig() {
        return withNewConfigLike(getConfig());
    }

    public BrokerSpecFluent.ConfigNested editOrNewConfig() {
        return withNewConfigLike(getConfig() != null ? getConfig(): new KReferenceBuilder().build());
    }

    public BrokerSpecFluent.ConfigNested editOrNewConfigLike(KReference item) {
        return withNewConfigLike(getConfig() != null ? getConfig(): item);
    }

    
/**
 * This method has been deprecated, please use method buildDelivery instead.
 * @return The buildable object.
 */
@Deprecated public DeliverySpec getDelivery() {
        return this.delivery!=null?this.delivery.build():null;
    }

    public DeliverySpec buildDelivery() {
        return this.delivery!=null?this.delivery.build():null;
    }

    public A withDelivery(DeliverySpec delivery) {
        _visitables.get("delivery").remove(this.delivery);
        if (delivery!=null){ this.delivery= new DeliverySpecBuilder(delivery); _visitables.get("delivery").add(this.delivery);} return (A) this;
    }

    public Boolean hasDelivery() {
        return this.delivery != null;
    }

    public BrokerSpecFluent.DeliveryNested withNewDelivery() {
        return new DeliveryNestedImpl();
    }

    public BrokerSpecFluent.DeliveryNested withNewDeliveryLike(DeliverySpec item) {
        return new DeliveryNestedImpl(item);
    }

    public BrokerSpecFluent.DeliveryNested editDelivery() {
        return withNewDeliveryLike(getDelivery());
    }

    public BrokerSpecFluent.DeliveryNested editOrNewDelivery() {
        return withNewDeliveryLike(getDelivery() != null ? getDelivery(): new DeliverySpecBuilder().build());
    }

    public BrokerSpecFluent.DeliveryNested editOrNewDeliveryLike(DeliverySpec item) {
        return withNewDeliveryLike(getDelivery() != null ? getDelivery(): item);
    }

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

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

    public class ConfigNestedImpl extends KReferenceFluentImpl> implements BrokerSpecFluent.ConfigNested,io.fabric8.kubernetes.api.builder.Nested {
        private final KReferenceBuilder builder;

        ConfigNestedImpl(KReference item) {
            this.builder = new KReferenceBuilder(this, item);
        }

        ConfigNestedImpl() {
            this.builder = new KReferenceBuilder(this);
        }

        public N and() {
             return (N) BrokerSpecFluentImpl.this.withConfig(builder.build());
        }

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


    public class DeliveryNestedImpl extends DeliverySpecFluentImpl> implements BrokerSpecFluent.DeliveryNested,io.fabric8.kubernetes.api.builder.Nested {
        private final DeliverySpecBuilder builder;

        DeliveryNestedImpl(DeliverySpec item) {
            this.builder = new DeliverySpecBuilder(this, item);
        }

        DeliveryNestedImpl() {
            this.builder = new DeliverySpecBuilder(this);
        }

        public N and() {
             return (N) BrokerSpecFluentImpl.this.withDelivery(builder.build());
        }

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


}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy