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

io.debezium.operator.api.model.FormatFluent Maven / Gradle / Ivy

There is a newer version: 3.0.2.Final
Show newest version
package io.debezium.operator.api.model;

import java.lang.SuppressWarnings;
import io.fabric8.kubernetes.api.builder.Nested;
import java.lang.String;
import io.fabric8.kubernetes.api.builder.BaseFluent;
import java.lang.Object;

/**
 * Generated
 */
@SuppressWarnings("unchecked")
public class FormatFluent> extends BaseFluent{
  public FormatFluent() {
  }
  
  public FormatFluent(Format instance) {
    this.copyInstance(instance);
  }
  private FormatTypeBuilder key;
  private FormatTypeBuilder value;
  private FormatTypeBuilder header;
  
  protected void copyInstance(Format instance) {
    instance = (instance != null ? instance : new Format());
    if (instance != null) {
          this.withKey(instance.getKey());
          this.withValue(instance.getValue());
          this.withHeader(instance.getHeader());
        }
  }
  
  public FormatType buildKey() {
    return this.key != null ? this.key.build() : null;
  }
  
  public A withKey(FormatType key) {
    this._visitables.remove("key");
    if (key != null) {
        this.key = new FormatTypeBuilder(key);
        this._visitables.get("key").add(this.key);
    } else {
        this.key = null;
        this._visitables.get("key").remove(this.key);
    }
    return (A) this;
  }
  
  public boolean hasKey() {
    return this.key != null;
  }
  
  public KeyNested withNewKey() {
    return new KeyNested(null);
  }
  
  public KeyNested withNewKeyLike(FormatType item) {
    return new KeyNested(item);
  }
  
  public KeyNested editKey() {
    return withNewKeyLike(java.util.Optional.ofNullable(buildKey()).orElse(null));
  }
  
  public KeyNested editOrNewKey() {
    return withNewKeyLike(java.util.Optional.ofNullable(buildKey()).orElse(new FormatTypeBuilder().build()));
  }
  
  public KeyNested editOrNewKeyLike(FormatType item) {
    return withNewKeyLike(java.util.Optional.ofNullable(buildKey()).orElse(item));
  }
  
  public FormatType buildValue() {
    return this.value != null ? this.value.build() : null;
  }
  
  public A withValue(FormatType value) {
    this._visitables.remove("value");
    if (value != null) {
        this.value = new FormatTypeBuilder(value);
        this._visitables.get("value").add(this.value);
    } else {
        this.value = null;
        this._visitables.get("value").remove(this.value);
    }
    return (A) this;
  }
  
  public boolean hasValue() {
    return this.value != null;
  }
  
  public ValueNested withNewValue() {
    return new ValueNested(null);
  }
  
  public ValueNested withNewValueLike(FormatType item) {
    return new ValueNested(item);
  }
  
  public ValueNested editValue() {
    return withNewValueLike(java.util.Optional.ofNullable(buildValue()).orElse(null));
  }
  
  public ValueNested editOrNewValue() {
    return withNewValueLike(java.util.Optional.ofNullable(buildValue()).orElse(new FormatTypeBuilder().build()));
  }
  
  public ValueNested editOrNewValueLike(FormatType item) {
    return withNewValueLike(java.util.Optional.ofNullable(buildValue()).orElse(item));
  }
  
  public FormatType buildHeader() {
    return this.header != null ? this.header.build() : null;
  }
  
  public A withHeader(FormatType header) {
    this._visitables.remove("header");
    if (header != null) {
        this.header = new FormatTypeBuilder(header);
        this._visitables.get("header").add(this.header);
    } else {
        this.header = null;
        this._visitables.get("header").remove(this.header);
    }
    return (A) this;
  }
  
  public boolean hasHeader() {
    return this.header != null;
  }
  
  public HeaderNested withNewHeader() {
    return new HeaderNested(null);
  }
  
  public HeaderNested withNewHeaderLike(FormatType item) {
    return new HeaderNested(item);
  }
  
  public HeaderNested editHeader() {
    return withNewHeaderLike(java.util.Optional.ofNullable(buildHeader()).orElse(null));
  }
  
  public HeaderNested editOrNewHeader() {
    return withNewHeaderLike(java.util.Optional.ofNullable(buildHeader()).orElse(new FormatTypeBuilder().build()));
  }
  
  public HeaderNested editOrNewHeaderLike(FormatType item) {
    return withNewHeaderLike(java.util.Optional.ofNullable(buildHeader()).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;
    FormatFluent that = (FormatFluent) o;
    if (!java.util.Objects.equals(key, that.key)) return false;
    if (!java.util.Objects.equals(value, that.value)) return false;
    if (!java.util.Objects.equals(header, that.header)) return false;
    return true;
  }
  
  public int hashCode() {
    return java.util.Objects.hash(key,  value,  header,  super.hashCode());
  }
  
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("{");
    if (key != null) { sb.append("key:"); sb.append(key + ","); }
    if (value != null) { sb.append("value:"); sb.append(value + ","); }
    if (header != null) { sb.append("header:"); sb.append(header); }
    sb.append("}");
    return sb.toString();
  }
  public class KeyNested extends FormatTypeFluent> implements Nested{
    KeyNested(FormatType item) {
      this.builder = new FormatTypeBuilder(this, item);
    }
    FormatTypeBuilder builder;
    
    public N and() {
      return (N) FormatFluent.this.withKey(builder.build());
    }
    
    public N endKey() {
      return and();
    }
    
  
  }
  public class ValueNested extends FormatTypeFluent> implements Nested{
    ValueNested(FormatType item) {
      this.builder = new FormatTypeBuilder(this, item);
    }
    FormatTypeBuilder builder;
    
    public N and() {
      return (N) FormatFluent.this.withValue(builder.build());
    }
    
    public N endValue() {
      return and();
    }
    
  
  }
  public class HeaderNested extends FormatTypeFluent> implements Nested{
    HeaderNested(FormatType item) {
      this.builder = new FormatTypeBuilder(this, item);
    }
    FormatTypeBuilder builder;
    
    public N and() {
      return (N) FormatFluent.this.withHeader(builder.build());
    }
    
    public N endHeader() {
      return and();
    }
    
  
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy