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

io.fabric8.knative.sources.v1alpha1.CouchDbSourceSpecFluent Maven / Gradle / Ivy

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

import io.fabric8.knative.duck.v1.Destination;
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.DestinationFluent;
import io.fabric8.kubernetes.api.model.ObjectReference;
import io.fabric8.kubernetes.api.model.ObjectReferenceFluent;
import io.fabric8.kubernetes.api.model.ObjectReferenceBuilder;
import io.fabric8.knative.duck.v1.DestinationBuilder;
import io.fabric8.kubernetes.api.builder.BaseFluent;
import java.lang.Object;
import java.util.Map;

/**
 * Generated
 */
@SuppressWarnings("unchecked")
public class CouchDbSourceSpecFluent> extends BaseFluent{
  public CouchDbSourceSpecFluent() {
  }
  
  public CouchDbSourceSpecFluent(CouchDbSourceSpec instance) {
    this.copyInstance(instance);
  }
  private ObjectReferenceBuilder credentials;
  private String database;
  private String feed;
  private String serviceAccountName;
  private DestinationBuilder sink;
  private Map additionalProperties;
  
  protected void copyInstance(CouchDbSourceSpec instance) {
    instance = (instance != null ? instance : new CouchDbSourceSpec());
    if (instance != null) {
          this.withCredentials(instance.getCredentials());
          this.withDatabase(instance.getDatabase());
          this.withFeed(instance.getFeed());
          this.withServiceAccountName(instance.getServiceAccountName());
          this.withSink(instance.getSink());
          this.withAdditionalProperties(instance.getAdditionalProperties());
        }
  }
  
  public ObjectReference buildCredentials() {
    return this.credentials != null ? this.credentials.build() : null;
  }
  
  public A withCredentials(ObjectReference credentials) {
    this._visitables.remove("credentials");
    if (credentials != null) {
        this.credentials = new ObjectReferenceBuilder(credentials);
        this._visitables.get("credentials").add(this.credentials);
    } else {
        this.credentials = null;
        this._visitables.get("credentials").remove(this.credentials);
    }
    return (A) this;
  }
  
  public boolean hasCredentials() {
    return this.credentials != null;
  }
  
  public CredentialsNested withNewCredentials() {
    return new CredentialsNested(null);
  }
  
  public CredentialsNested withNewCredentialsLike(ObjectReference item) {
    return new CredentialsNested(item);
  }
  
  public CredentialsNested editCredentials() {
    return withNewCredentialsLike(java.util.Optional.ofNullable(buildCredentials()).orElse(null));
  }
  
  public CredentialsNested editOrNewCredentials() {
    return withNewCredentialsLike(java.util.Optional.ofNullable(buildCredentials()).orElse(new ObjectReferenceBuilder().build()));
  }
  
  public CredentialsNested editOrNewCredentialsLike(ObjectReference item) {
    return withNewCredentialsLike(java.util.Optional.ofNullable(buildCredentials()).orElse(item));
  }
  
  public String getDatabase() {
    return this.database;
  }
  
  public A withDatabase(String database) {
    this.database = database;
    return (A) this;
  }
  
  public boolean hasDatabase() {
    return this.database != null;
  }
  
  public String getFeed() {
    return this.feed;
  }
  
  public A withFeed(String feed) {
    this.feed = feed;
    return (A) this;
  }
  
  public boolean hasFeed() {
    return this.feed != null;
  }
  
  public String getServiceAccountName() {
    return this.serviceAccountName;
  }
  
  public A withServiceAccountName(String serviceAccountName) {
    this.serviceAccountName = serviceAccountName;
    return (A) this;
  }
  
  public boolean hasServiceAccountName() {
    return this.serviceAccountName != null;
  }
  
  public Destination buildSink() {
    return this.sink != null ? this.sink.build() : null;
  }
  
  public A withSink(Destination sink) {
    this._visitables.remove("sink");
    if (sink != null) {
        this.sink = new DestinationBuilder(sink);
        this._visitables.get("sink").add(this.sink);
    } else {
        this.sink = null;
        this._visitables.get("sink").remove(this.sink);
    }
    return (A) this;
  }
  
  public boolean hasSink() {
    return this.sink != null;
  }
  
  public SinkNested withNewSink() {
    return new SinkNested(null);
  }
  
  public SinkNested withNewSinkLike(Destination item) {
    return new SinkNested(item);
  }
  
  public SinkNested editSink() {
    return withNewSinkLike(java.util.Optional.ofNullable(buildSink()).orElse(null));
  }
  
  public SinkNested editOrNewSink() {
    return withNewSinkLike(java.util.Optional.ofNullable(buildSink()).orElse(new DestinationBuilder().build()));
  }
  
  public SinkNested editOrNewSinkLike(Destination item) {
    return withNewSinkLike(java.util.Optional.ofNullable(buildSink()).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;
    CouchDbSourceSpecFluent that = (CouchDbSourceSpecFluent) o;
    if (!java.util.Objects.equals(credentials, that.credentials)) return false;
    if (!java.util.Objects.equals(database, that.database)) return false;
    if (!java.util.Objects.equals(feed, that.feed)) return false;
    if (!java.util.Objects.equals(serviceAccountName, that.serviceAccountName)) return false;
    if (!java.util.Objects.equals(sink, that.sink)) return false;
    if (!java.util.Objects.equals(additionalProperties, that.additionalProperties)) return false;
    return true;
  }
  
  public int hashCode() {
    return java.util.Objects.hash(credentials,  database,  feed,  serviceAccountName,  sink,  additionalProperties,  super.hashCode());
  }
  
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("{");
    if (credentials != null) { sb.append("credentials:"); sb.append(credentials + ","); }
    if (database != null) { sb.append("database:"); sb.append(database + ","); }
    if (feed != null) { sb.append("feed:"); sb.append(feed + ","); }
    if (serviceAccountName != null) { sb.append("serviceAccountName:"); sb.append(serviceAccountName + ","); }
    if (sink != null) { sb.append("sink:"); sb.append(sink + ","); }
    if (additionalProperties != null && !additionalProperties.isEmpty()) { sb.append("additionalProperties:"); sb.append(additionalProperties); }
    sb.append("}");
    return sb.toString();
  }
  public class CredentialsNested extends ObjectReferenceFluent> implements Nested{
    CredentialsNested(ObjectReference item) {
      this.builder = new ObjectReferenceBuilder(this, item);
    }
    ObjectReferenceBuilder builder;
    
    public N and() {
      return (N) CouchDbSourceSpecFluent.this.withCredentials(builder.build());
    }
    
    public N endCredentials() {
      return and();
    }
    
  
  }
  public class SinkNested extends DestinationFluent> implements Nested{
    SinkNested(Destination item) {
      this.builder = new DestinationBuilder(this, item);
    }
    DestinationBuilder builder;
    
    public N and() {
      return (N) CouchDbSourceSpecFluent.this.withSink(builder.build());
    }
    
    public N endSink() {
      return and();
    }
    
  
  }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy