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

io.fabric8.knative.flows.v1.ParallelChannelStatusFluent Maven / Gradle / Ivy

package io.fabric8.knative.flows.v1;

import io.fabric8.knative.internal.pkg.apis.Condition;
import java.lang.SuppressWarnings;
import io.fabric8.kubernetes.api.builder.Nested;
import java.lang.String;
import io.fabric8.knative.internal.pkg.apis.ConditionFluent;
import io.fabric8.knative.internal.pkg.apis.ConditionBuilder;
import io.fabric8.kubernetes.api.model.ObjectReference;
import io.fabric8.kubernetes.api.model.ObjectReferenceFluent;
import io.fabric8.kubernetes.api.model.ObjectReferenceBuilder;
import io.fabric8.kubernetes.api.builder.BaseFluent;
import java.lang.Object;

 /**
  * Generated
  */
  @SuppressWarnings(value = "unchecked")
  public class ParallelChannelStatusFluent> extends BaseFluent{
  public ParallelChannelStatusFluent() {
  }
  public ParallelChannelStatusFluent(ParallelChannelStatus instance) {
    instance = (instance != null ? instance : new ParallelChannelStatus());

    if (instance != null) {
      this.withChannel(instance.getChannel());
      this.withReady(instance.getReady());
      this.withChannel(instance.getChannel());
      this.withReady(instance.getReady());
    }
  }
  private ObjectReferenceBuilder channel;
  private ConditionBuilder ready;
  public ObjectReference buildChannel() {
    return this.channel!=null ?this.channel.build():null;
  }
  public A withChannel(ObjectReference channel) {
    _visitables.get("channel").remove(this.channel);
    if (channel!=null){ this.channel= new ObjectReferenceBuilder(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 ChannelNested withNewChannel() {
    return new ChannelNested(null);
  }
  public ChannelNested withNewChannelLike(ObjectReference item) {
    return new ChannelNested(item);
  }
  public ChannelNested editChannel() {
    return withNewChannelLike(java.util.Optional.ofNullable(buildChannel()).orElse(null));
  }
  public ChannelNested editOrNewChannel() {
    return withNewChannelLike(java.util.Optional.ofNullable(buildChannel()).orElse(new ObjectReferenceBuilder().build()));
  }
  public ChannelNested editOrNewChannelLike(ObjectReference item) {
    return withNewChannelLike(java.util.Optional.ofNullable(buildChannel()).orElse(item));
  }
  public Condition buildReady() {
    return this.ready!=null ?this.ready.build():null;
  }
  public A withReady(Condition ready) {
    _visitables.get("ready").remove(this.ready);
    if (ready!=null){ this.ready= new ConditionBuilder(ready); _visitables.get("ready").add(this.ready);} else { this.ready = null; _visitables.get("ready").remove(this.ready); } return (A) this;
  }
  public boolean hasReady() {
    return this.ready != null;
  }
  public ReadyNested withNewReady() {
    return new ReadyNested(null);
  }
  public ReadyNested withNewReadyLike(Condition item) {
    return new ReadyNested(item);
  }
  public ReadyNested editReady() {
    return withNewReadyLike(java.util.Optional.ofNullable(buildReady()).orElse(null));
  }
  public ReadyNested editOrNewReady() {
    return withNewReadyLike(java.util.Optional.ofNullable(buildReady()).orElse(new ConditionBuilder().build()));
  }
  public ReadyNested editOrNewReadyLike(Condition item) {
    return withNewReadyLike(java.util.Optional.ofNullable(buildReady()).orElse(item));
  }
  public boolean equals(Object o) {
    if (this == o) return true;
    if (o == null || getClass() != o.getClass()) return false;
    if (!super.equals(o)) return false;
    ParallelChannelStatusFluent that = (ParallelChannelStatusFluent) o;
    if (!java.util.Objects.equals(channel, that.channel)) return false;

    if (!java.util.Objects.equals(ready, that.ready)) return false;

    return true;
  }
  public int hashCode() {
    return java.util.Objects.hash(channel,  ready,  super.hashCode());
  }
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("{");
    if (channel != null) { sb.append("channel:"); sb.append(channel + ","); }
    if (ready != null) { sb.append("ready:"); sb.append(ready); }
    sb.append("}");
    return sb.toString();
  }
  public class ChannelNested extends ObjectReferenceFluent> implements Nested{
    ChannelNested(ObjectReference item) {
      this.builder = new ObjectReferenceBuilder(this, item);
    }
    ObjectReferenceBuilder builder;
    public N and() {
      return (N) ParallelChannelStatusFluent.this.withChannel(builder.build());
    }
    public N endChannel() {
      return and();
    }
    
  }
  public class ReadyNested extends ConditionFluent> implements Nested{
    ReadyNested(Condition item) {
      this.builder = new ConditionBuilder(this, item);
    }
    ConditionBuilder builder;
    public N and() {
      return (N) ParallelChannelStatusFluent.this.withReady(builder.build());
    }
    public N endReady() {
      return and();
    }
    
  }
  
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy