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

io.fabric8.knative.duck.v1beta1.DeliveryStatusFluent Maven / Gradle / Ivy

The newest version!
package io.fabric8.knative.duck.v1beta1;

import java.lang.SuppressWarnings;
import io.fabric8.kubernetes.api.builder.Nested;
import java.lang.String;
import java.util.LinkedHashMap;
import io.fabric8.knative.duck.v1.KReference;
import io.fabric8.knative.duck.v1.KReferenceFluent;
import io.fabric8.knative.duck.v1.KReferenceBuilder;
import io.fabric8.kubernetes.api.builder.BaseFluent;
import java.lang.Object;
import java.util.Map;

/**
 * Generated
 */
@SuppressWarnings("unchecked")
public class DeliveryStatusFluent> extends BaseFluent{
  public DeliveryStatusFluent() {
  }
  
  public DeliveryStatusFluent(DeliveryStatus instance) {
    this.copyInstance(instance);
  }
  private KReferenceBuilder deadLetterChannel;
  private Map additionalProperties;
  
  protected void copyInstance(DeliveryStatus instance) {
    instance = (instance != null ? instance : new DeliveryStatus());
    if (instance != null) {
          this.withDeadLetterChannel(instance.getDeadLetterChannel());
          this.withAdditionalProperties(instance.getAdditionalProperties());
        }
  }
  
  public KReference buildDeadLetterChannel() {
    return this.deadLetterChannel != null ? this.deadLetterChannel.build() : null;
  }
  
  public A withDeadLetterChannel(KReference deadLetterChannel) {
    this._visitables.remove("deadLetterChannel");
    if (deadLetterChannel != null) {
        this.deadLetterChannel = new KReferenceBuilder(deadLetterChannel);
        this._visitables.get("deadLetterChannel").add(this.deadLetterChannel);
    } else {
        this.deadLetterChannel = null;
        this._visitables.get("deadLetterChannel").remove(this.deadLetterChannel);
    }
    return (A) this;
  }
  
  public boolean hasDeadLetterChannel() {
    return this.deadLetterChannel != null;
  }
  
  public DeadLetterChannelNested withNewDeadLetterChannel() {
    return new DeadLetterChannelNested(null);
  }
  
  public DeadLetterChannelNested withNewDeadLetterChannelLike(KReference item) {
    return new DeadLetterChannelNested(item);
  }
  
  public DeadLetterChannelNested editDeadLetterChannel() {
    return withNewDeadLetterChannelLike(java.util.Optional.ofNullable(buildDeadLetterChannel()).orElse(null));
  }
  
  public DeadLetterChannelNested editOrNewDeadLetterChannel() {
    return withNewDeadLetterChannelLike(java.util.Optional.ofNullable(buildDeadLetterChannel()).orElse(new KReferenceBuilder().build()));
  }
  
  public DeadLetterChannelNested editOrNewDeadLetterChannelLike(KReference item) {
    return withNewDeadLetterChannelLike(java.util.Optional.ofNullable(buildDeadLetterChannel()).orElse(item));
  }
  
  public A addToAdditionalProperties(String key,Object value) {
    if(this.additionalProperties == null && key != null && value != null) { this.additionalProperties = new LinkedHashMap(); }
    if(key != null && value != null) {this.additionalProperties.put(key, value);} return (A)this;
  }
  
  public A addToAdditionalProperties(Map map) {
    if(this.additionalProperties == null && map != null) { this.additionalProperties = new LinkedHashMap(); }
    if(map != null) { this.additionalProperties.putAll(map);} return (A)this;
  }
  
  public A removeFromAdditionalProperties(String key) {
    if(this.additionalProperties == null) { return (A) this; }
    if(key != null && this.additionalProperties != null) {this.additionalProperties.remove(key);} return (A)this;
  }
  
  public A removeFromAdditionalProperties(Map map) {
    if(this.additionalProperties == null) { return (A) this; }
    if(map != null) { for(Object key : map.keySet()) {if (this.additionalProperties != null){this.additionalProperties.remove(key);}}} return (A)this;
  }
  
  public Map getAdditionalProperties() {
    return this.additionalProperties;
  }
  
  public A withAdditionalProperties(Map additionalProperties) {
    if (additionalProperties == null) {
      this.additionalProperties = null;
    } else {
      this.additionalProperties = new LinkedHashMap(additionalProperties);
    }
    return (A) this;
  }
  
  public boolean hasAdditionalProperties() {
    return this.additionalProperties != null;
  }
  
  public boolean equals(Object o) {
    if (this == o) return true;
    if (o == null || getClass() != o.getClass()) return false;
    if (!super.equals(o)) return false;
    DeliveryStatusFluent that = (DeliveryStatusFluent) o;
    if (!java.util.Objects.equals(deadLetterChannel, that.deadLetterChannel)) return false;
    if (!java.util.Objects.equals(additionalProperties, that.additionalProperties)) return false;
    return true;
  }
  
  public int hashCode() {
    return java.util.Objects.hash(deadLetterChannel,  additionalProperties,  super.hashCode());
  }
  
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("{");
    if (deadLetterChannel != null) { sb.append("deadLetterChannel:"); sb.append(deadLetterChannel + ","); }
    if (additionalProperties != null && !additionalProperties.isEmpty()) { sb.append("additionalProperties:"); sb.append(additionalProperties); }
    sb.append("}");
    return sb.toString();
  }
  public class DeadLetterChannelNested extends KReferenceFluent> implements Nested{
    DeadLetterChannelNested(KReference item) {
      this.builder = new KReferenceBuilder(this, item);
    }
    KReferenceBuilder builder;
    
    public N and() {
      return (N) DeliveryStatusFluent.this.withDeadLetterChannel(builder.build());
    }
    
    public N endDeadLetterChannel() {
      return and();
    }
    
  
  }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy