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

io.fabric8.knative.messaging.v1.SubscriptionSpecFluentImpl Maven / Gradle / Ivy

package io.fabric8.knative.messaging.v1;

import io.fabric8.knative.internal.pkg.apis.duck.v1.Destination;
import java.lang.SuppressWarnings;
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 java.lang.Deprecated;
import io.fabric8.kubernetes.api.builder.BaseFluent;
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;
import io.fabric8.knative.internal.eventing.pkg.apis.duck.v1.DeliverySpecBuilder;
import io.fabric8.knative.internal.pkg.apis.duck.v1.KReferenceBuilder;
import io.fabric8.knative.internal.pkg.apis.duck.v1.DestinationBuilder;
import java.lang.Object;
import io.fabric8.knative.internal.pkg.apis.duck.v1.DestinationFluentImpl;

 /**
  * Generated
  */
  @SuppressWarnings(value = "unchecked")
  public class SubscriptionSpecFluentImpl> extends BaseFluent implements SubscriptionSpecFluent{
  public SubscriptionSpecFluentImpl() {
  }
  public SubscriptionSpecFluentImpl(SubscriptionSpec instance) {
    this.withChannel(instance.getChannel()); 
    this.withDelivery(instance.getDelivery()); 
    this.withReply(instance.getReply()); 
    this.withSubscriber(instance.getSubscriber()); 
  }
  private KReferenceBuilder channel;
  private DeliverySpecBuilder delivery;
  private DestinationBuilder reply;
  private DestinationBuilder subscriber;
  
  /**
   * This method has been deprecated, please use method buildChannel instead.
   * @return The buildable object.
   */
  @Deprecated
  public KReference getChannel() {
    return this.channel!=null ?this.channel.build():null;
  }
  public KReference buildChannel() {
    return this.channel!=null ?this.channel.build():null;
  }
  public A withChannel(KReference channel) {
    _visitables.get("channel").remove(this.channel);
    if (channel!=null){ this.channel= new KReferenceBuilder(channel); _visitables.get("channel").add(this.channel);} else { this.channel = null; _visitables.get("channel").remove(this.channel); } return (A) this;
  }
  public Boolean hasChannel() {
    return this.channel != null;
  }
  public A withNewChannel(String apiVersion,String group,String kind,String name,String namespace) {
    return (A)withChannel(new KReference(apiVersion, group, kind, name, namespace));
  }
  public SubscriptionSpecFluent.ChannelNested withNewChannel() {
    return new SubscriptionSpecFluentImpl.ChannelNestedImpl();
  }
  public SubscriptionSpecFluent.ChannelNested withNewChannelLike(KReference item) {
    return new SubscriptionSpecFluentImpl.ChannelNestedImpl(item);
  }
  public SubscriptionSpecFluent.ChannelNested editChannel() {
    return withNewChannelLike(getChannel());
  }
  public SubscriptionSpecFluent.ChannelNested editOrNewChannel() {
    return withNewChannelLike(getChannel() != null ? getChannel(): new KReferenceBuilder().build());
  }
  public SubscriptionSpecFluent.ChannelNested editOrNewChannelLike(KReference item) {
    return withNewChannelLike(getChannel() != null ? getChannel(): 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);} else { this.delivery = null; _visitables.get("delivery").remove(this.delivery); } return (A) this;
  }
  public Boolean hasDelivery() {
    return this.delivery != null;
  }
  public SubscriptionSpecFluent.DeliveryNested withNewDelivery() {
    return new SubscriptionSpecFluentImpl.DeliveryNestedImpl();
  }
  public SubscriptionSpecFluent.DeliveryNested withNewDeliveryLike(DeliverySpec item) {
    return new SubscriptionSpecFluentImpl.DeliveryNestedImpl(item);
  }
  public SubscriptionSpecFluent.DeliveryNested editDelivery() {
    return withNewDeliveryLike(getDelivery());
  }
  public SubscriptionSpecFluent.DeliveryNested editOrNewDelivery() {
    return withNewDeliveryLike(getDelivery() != null ? getDelivery(): new DeliverySpecBuilder().build());
  }
  public SubscriptionSpecFluent.DeliveryNested editOrNewDeliveryLike(DeliverySpec item) {
    return withNewDeliveryLike(getDelivery() != null ? getDelivery(): item);
  }
  
  /**
   * This method has been deprecated, please use method buildReply instead.
   * @return The buildable object.
   */
  @Deprecated
  public Destination getReply() {
    return this.reply!=null ?this.reply.build():null;
  }
  public Destination buildReply() {
    return this.reply!=null ?this.reply.build():null;
  }
  public A withReply(Destination reply) {
    _visitables.get("reply").remove(this.reply);
    if (reply!=null){ this.reply= new DestinationBuilder(reply); _visitables.get("reply").add(this.reply);} else { this.reply = null; _visitables.get("reply").remove(this.reply); } return (A) this;
  }
  public Boolean hasReply() {
    return this.reply != null;
  }
  public SubscriptionSpecFluent.ReplyNested withNewReply() {
    return new SubscriptionSpecFluentImpl.ReplyNestedImpl();
  }
  public SubscriptionSpecFluent.ReplyNested withNewReplyLike(Destination item) {
    return new SubscriptionSpecFluentImpl.ReplyNestedImpl(item);
  }
  public SubscriptionSpecFluent.ReplyNested editReply() {
    return withNewReplyLike(getReply());
  }
  public SubscriptionSpecFluent.ReplyNested editOrNewReply() {
    return withNewReplyLike(getReply() != null ? getReply(): new DestinationBuilder().build());
  }
  public SubscriptionSpecFluent.ReplyNested editOrNewReplyLike(Destination item) {
    return withNewReplyLike(getReply() != null ? getReply(): item);
  }
  
  /**
   * This method has been deprecated, please use method buildSubscriber instead.
   * @return The buildable object.
   */
  @Deprecated
  public Destination getSubscriber() {
    return this.subscriber!=null ?this.subscriber.build():null;
  }
  public Destination buildSubscriber() {
    return this.subscriber!=null ?this.subscriber.build():null;
  }
  public A withSubscriber(Destination subscriber) {
    _visitables.get("subscriber").remove(this.subscriber);
    if (subscriber!=null){ this.subscriber= new DestinationBuilder(subscriber); _visitables.get("subscriber").add(this.subscriber);} else { this.subscriber = null; _visitables.get("subscriber").remove(this.subscriber); } return (A) this;
  }
  public Boolean hasSubscriber() {
    return this.subscriber != null;
  }
  public SubscriptionSpecFluent.SubscriberNested withNewSubscriber() {
    return new SubscriptionSpecFluentImpl.SubscriberNestedImpl();
  }
  public SubscriptionSpecFluent.SubscriberNested withNewSubscriberLike(Destination item) {
    return new SubscriptionSpecFluentImpl.SubscriberNestedImpl(item);
  }
  public SubscriptionSpecFluent.SubscriberNested editSubscriber() {
    return withNewSubscriberLike(getSubscriber());
  }
  public SubscriptionSpecFluent.SubscriberNested editOrNewSubscriber() {
    return withNewSubscriberLike(getSubscriber() != null ? getSubscriber(): new DestinationBuilder().build());
  }
  public SubscriptionSpecFluent.SubscriberNested editOrNewSubscriberLike(Destination item) {
    return withNewSubscriberLike(getSubscriber() != null ? getSubscriber(): item);
  }
  public boolean equals(Object o) {
    if (this == o) return true;
    if (o == null || getClass() != o.getClass()) return false;
    SubscriptionSpecFluentImpl that = (SubscriptionSpecFluentImpl) o;
    if (channel != null ? !channel.equals(that.channel) :that.channel != null) return false;
    if (delivery != null ? !delivery.equals(that.delivery) :that.delivery != null) return false;
    if (reply != null ? !reply.equals(that.reply) :that.reply != null) return false;
    if (subscriber != null ? !subscriber.equals(that.subscriber) :that.subscriber != null) return false;
    return true;
  }
  public int hashCode() {
    return java.util.Objects.hash(channel,  delivery,  reply,  subscriber,  super.hashCode());
  }
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("{");
    if (channel != null) { sb.append("channel:"); sb.append(channel + ","); }
    if (delivery != null) { sb.append("delivery:"); sb.append(delivery + ","); }
    if (reply != null) { sb.append("reply:"); sb.append(reply + ","); }
    if (subscriber != null) { sb.append("subscriber:"); sb.append(subscriber); }
    sb.append("}");
    return sb.toString();
  }
  class ChannelNestedImpl extends KReferenceFluentImpl> implements SubscriptionSpecFluent.ChannelNested,Nested{
    ChannelNestedImpl(KReference item) {
      this.builder = new KReferenceBuilder(this, item);
    }
    ChannelNestedImpl() {
      this.builder = new KReferenceBuilder(this);
    }
    KReferenceBuilder builder;
    public N and() {
      return (N) SubscriptionSpecFluentImpl.this.withChannel(builder.build());
    }
    public N endChannel() {
      return and();
    }
    
  }
  class DeliveryNestedImpl extends DeliverySpecFluentImpl> implements SubscriptionSpecFluent.DeliveryNested,Nested{
    DeliveryNestedImpl(DeliverySpec item) {
      this.builder = new DeliverySpecBuilder(this, item);
    }
    DeliveryNestedImpl() {
      this.builder = new DeliverySpecBuilder(this);
    }
    DeliverySpecBuilder builder;
    public N and() {
      return (N) SubscriptionSpecFluentImpl.this.withDelivery(builder.build());
    }
    public N endDelivery() {
      return and();
    }
    
  }
  class ReplyNestedImpl extends DestinationFluentImpl> implements SubscriptionSpecFluent.ReplyNested,Nested{
    ReplyNestedImpl(Destination item) {
      this.builder = new DestinationBuilder(this, item);
    }
    ReplyNestedImpl() {
      this.builder = new DestinationBuilder(this);
    }
    DestinationBuilder builder;
    public N and() {
      return (N) SubscriptionSpecFluentImpl.this.withReply(builder.build());
    }
    public N endReply() {
      return and();
    }
    
  }
  class SubscriberNestedImpl extends DestinationFluentImpl> implements SubscriptionSpecFluent.SubscriberNested,Nested{
    SubscriberNestedImpl(Destination item) {
      this.builder = new DestinationBuilder(this, item);
    }
    SubscriberNestedImpl() {
      this.builder = new DestinationBuilder(this);
    }
    DestinationBuilder builder;
    public N and() {
      return (N) SubscriptionSpecFluentImpl.this.withSubscriber(builder.build());
    }
    public N endSubscriber() {
      return and();
    }
    
  }
  
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy