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

io.fabric8.knative.sinks.v1alpha1.IntegrationSinkSpecFluent Maven / Gradle / Ivy

The newest version!
package io.fabric8.knative.sinks.v1alpha1;

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

/**
 * Generated
 */
@SuppressWarnings("unchecked")
public class IntegrationSinkSpecFluent> extends BaseFluent{
  public IntegrationSinkSpecFluent() {
  }
  
  public IntegrationSinkSpecFluent(IntegrationSinkSpec instance) {
    this.copyInstance(instance);
  }
  private AwsBuilder aws;
  private LogBuilder log;
  private Map additionalProperties;
  
  protected void copyInstance(IntegrationSinkSpec instance) {
    instance = (instance != null ? instance : new IntegrationSinkSpec());
    if (instance != null) {
          this.withAws(instance.getAws());
          this.withLog(instance.getLog());
          this.withAdditionalProperties(instance.getAdditionalProperties());
        }
  }
  
  public Aws buildAws() {
    return this.aws != null ? this.aws.build() : null;
  }
  
  public A withAws(Aws aws) {
    this._visitables.remove("aws");
    if (aws != null) {
        this.aws = new AwsBuilder(aws);
        this._visitables.get("aws").add(this.aws);
    } else {
        this.aws = null;
        this._visitables.get("aws").remove(this.aws);
    }
    return (A) this;
  }
  
  public boolean hasAws() {
    return this.aws != null;
  }
  
  public AwsNested withNewAws() {
    return new AwsNested(null);
  }
  
  public AwsNested withNewAwsLike(Aws item) {
    return new AwsNested(item);
  }
  
  public AwsNested editAws() {
    return withNewAwsLike(java.util.Optional.ofNullable(buildAws()).orElse(null));
  }
  
  public AwsNested editOrNewAws() {
    return withNewAwsLike(java.util.Optional.ofNullable(buildAws()).orElse(new AwsBuilder().build()));
  }
  
  public AwsNested editOrNewAwsLike(Aws item) {
    return withNewAwsLike(java.util.Optional.ofNullable(buildAws()).orElse(item));
  }
  
  public Log buildLog() {
    return this.log != null ? this.log.build() : null;
  }
  
  public A withLog(Log log) {
    this._visitables.remove("log");
    if (log != null) {
        this.log = new LogBuilder(log);
        this._visitables.get("log").add(this.log);
    } else {
        this.log = null;
        this._visitables.get("log").remove(this.log);
    }
    return (A) this;
  }
  
  public boolean hasLog() {
    return this.log != null;
  }
  
  public LogNested withNewLog() {
    return new LogNested(null);
  }
  
  public LogNested withNewLogLike(Log item) {
    return new LogNested(item);
  }
  
  public LogNested editLog() {
    return withNewLogLike(java.util.Optional.ofNullable(buildLog()).orElse(null));
  }
  
  public LogNested editOrNewLog() {
    return withNewLogLike(java.util.Optional.ofNullable(buildLog()).orElse(new LogBuilder().build()));
  }
  
  public LogNested editOrNewLogLike(Log item) {
    return withNewLogLike(java.util.Optional.ofNullable(buildLog()).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;
    IntegrationSinkSpecFluent that = (IntegrationSinkSpecFluent) o;
    if (!java.util.Objects.equals(aws, that.aws)) return false;
    if (!java.util.Objects.equals(log, that.log)) return false;
    if (!java.util.Objects.equals(additionalProperties, that.additionalProperties)) return false;
    return true;
  }
  
  public int hashCode() {
    return java.util.Objects.hash(aws,  log,  additionalProperties,  super.hashCode());
  }
  
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("{");
    if (aws != null) { sb.append("aws:"); sb.append(aws + ","); }
    if (log != null) { sb.append("log:"); sb.append(log + ","); }
    if (additionalProperties != null && !additionalProperties.isEmpty()) { sb.append("additionalProperties:"); sb.append(additionalProperties); }
    sb.append("}");
    return sb.toString();
  }
  public class AwsNested extends AwsFluent> implements Nested{
    AwsNested(Aws item) {
      this.builder = new AwsBuilder(this, item);
    }
    AwsBuilder builder;
    
    public N and() {
      return (N) IntegrationSinkSpecFluent.this.withAws(builder.build());
    }
    
    public N endAws() {
      return and();
    }
    
  
  }
  public class LogNested extends LogFluent> implements Nested{
    LogNested(Log item) {
      this.builder = new LogBuilder(this, item);
    }
    LogBuilder builder;
    
    public N and() {
      return (N) IntegrationSinkSpecFluent.this.withLog(builder.build());
    }
    
    public N endLog() {
      return and();
    }
    
  
  }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy