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

io.fabric8.knative.eventing.contrib.awssqs.v1alpha1.AwsSqsSourceSpecFluentImpl Maven / Gradle / Ivy

package io.fabric8.knative.eventing.contrib.awssqs.v1alpha1;

import java.lang.SuppressWarnings;
import io.fabric8.kubernetes.api.builder.Nested;
import io.fabric8.kubernetes.api.model.ObjectReferenceFluentImpl;
import java.lang.String;
import io.fabric8.kubernetes.api.model.SecretKeySelector;
import java.util.LinkedHashMap;
import io.fabric8.kubernetes.api.model.ObjectReference;
import java.lang.Deprecated;
import io.fabric8.kubernetes.api.model.ObjectReferenceBuilder;
import io.fabric8.kubernetes.api.builder.BaseFluent;
import java.lang.Object;
import java.lang.Boolean;
import java.util.Map;

 /**
  * Generated
  */
  @SuppressWarnings(value = "unchecked")
  public class AwsSqsSourceSpecFluentImpl> extends BaseFluent implements AwsSqsSourceSpecFluent{
  public AwsSqsSourceSpecFluentImpl() {
  }
  public AwsSqsSourceSpecFluentImpl(io.fabric8.knative.eventing.contrib.awssqs.v1alpha1.AwsSqsSourceSpec instance) {
    this.withAnnotations(instance.getAnnotations()); 
    this.withAwsCredsSecret(instance.getAwsCredsSecret()); 
    this.withQueueUrl(instance.getQueueUrl()); 
    this.withServiceAccountName(instance.getServiceAccountName()); 
    this.withSink(instance.getSink()); 
  }
  private Map annotations;
  private SecretKeySelector awsCredsSecret;
  private java.lang.String queueUrl;
  private java.lang.String serviceAccountName;
  private ObjectReferenceBuilder sink;
  public A addToAnnotations(java.lang.String key,java.lang.String value) {
    if(this.annotations == null && key != null && value != null) { this.annotations = new LinkedHashMap(); }
    if(key != null && value != null) {this.annotations.put(key, value);} return (A)this;
  }
  public A addToAnnotations(java.util.Map map) {
    if(this.annotations == null && map != null) { this.annotations = new java.util.LinkedHashMap(); }
    if(map != null) { this.annotations.putAll(map);} return (A)this;
  }
  public A removeFromAnnotations(java.lang.String key) {
    if(this.annotations == null) { return (A) this; }
    if(key != null && this.annotations != null) {this.annotations.remove(key);} return (A)this;
  }
  public A removeFromAnnotations(java.util.Map map) {
    if(this.annotations == null) { return (A) this; }
    if(map != null) { for(Object key : map.keySet()) {if (this.annotations != null){this.annotations.remove(key);}}} return (A)this;
  }
  public java.util.Map getAnnotations() {
    return this.annotations;
  }
  public A withAnnotations(java.util.Map annotations) {
    if (annotations == null) { this.annotations =  null;} else {this.annotations = new java.util.LinkedHashMap(annotations);} return (A) this;
  }
  public Boolean hasAnnotations() {
    return this.annotations != null;
  }
  public io.fabric8.kubernetes.api.model.SecretKeySelector getAwsCredsSecret() {
    return this.awsCredsSecret;
  }
  public A withAwsCredsSecret(io.fabric8.kubernetes.api.model.SecretKeySelector awsCredsSecret) {
    this.awsCredsSecret=awsCredsSecret; return (A) this;
  }
  public java.lang.Boolean hasAwsCredsSecret() {
    return this.awsCredsSecret != null;
  }
  public A withNewAwsCredsSecret(java.lang.String key,java.lang.String name,java.lang.Boolean optional) {
    return (A)withAwsCredsSecret(new SecretKeySelector(key, name, optional));
  }
  public java.lang.String getQueueUrl() {
    return this.queueUrl;
  }
  public A withQueueUrl(java.lang.String queueUrl) {
    this.queueUrl=queueUrl; return (A) this;
  }
  public java.lang.Boolean hasQueueUrl() {
    return this.queueUrl != null;
  }
  public java.lang.String getServiceAccountName() {
    return this.serviceAccountName;
  }
  public A withServiceAccountName(java.lang.String serviceAccountName) {
    this.serviceAccountName=serviceAccountName; return (A) this;
  }
  public java.lang.Boolean hasServiceAccountName() {
    return this.serviceAccountName != null;
  }
  
  /**
   * This method has been deprecated, please use method buildSink instead.
   * @return The buildable object.
   */
  @Deprecated
  public io.fabric8.kubernetes.api.model.ObjectReference getSink() {
    return this.sink!=null ?this.sink.build():null;
  }
  public io.fabric8.kubernetes.api.model.ObjectReference buildSink() {
    return this.sink!=null ?this.sink.build():null;
  }
  public A withSink(io.fabric8.kubernetes.api.model.ObjectReference sink) {
    _visitables.get("sink").remove(this.sink);
    if (sink!=null){ this.sink= new ObjectReferenceBuilder(sink); _visitables.get("sink").add(this.sink);} return (A) this;
  }
  public java.lang.Boolean hasSink() {
    return this.sink != null;
  }
  public AwsSqsSourceSpecFluent.SinkNested withNewSink() {
    return new AwsSqsSourceSpecFluentImpl.SinkNestedImpl();
  }
  public io.fabric8.knative.eventing.contrib.awssqs.v1alpha1.AwsSqsSourceSpecFluent.SinkNested withNewSinkLike(io.fabric8.kubernetes.api.model.ObjectReference item) {
    return new AwsSqsSourceSpecFluentImpl.SinkNestedImpl(item);
  }
  public io.fabric8.knative.eventing.contrib.awssqs.v1alpha1.AwsSqsSourceSpecFluent.SinkNested editSink() {
    return withNewSinkLike(getSink());
  }
  public io.fabric8.knative.eventing.contrib.awssqs.v1alpha1.AwsSqsSourceSpecFluent.SinkNested editOrNewSink() {
    return withNewSinkLike(getSink() != null ? getSink(): new io.fabric8.kubernetes.api.model.ObjectReferenceBuilder().build());
  }
  public io.fabric8.knative.eventing.contrib.awssqs.v1alpha1.AwsSqsSourceSpecFluent.SinkNested editOrNewSinkLike(io.fabric8.kubernetes.api.model.ObjectReference item) {
    return withNewSinkLike(getSink() != null ? getSink(): item);
  }
  public boolean equals(Object o) {
    if (this == o) return true;
    if (o == null || getClass() != o.getClass()) return false;
    AwsSqsSourceSpecFluentImpl that = (AwsSqsSourceSpecFluentImpl) o;
    if (annotations != null ? !annotations.equals(that.annotations) :that.annotations != null) return false;
    if (awsCredsSecret != null ? !awsCredsSecret.equals(that.awsCredsSecret) :that.awsCredsSecret != null) return false;
    if (queueUrl != null ? !queueUrl.equals(that.queueUrl) :that.queueUrl != null) return false;
    if (serviceAccountName != null ? !serviceAccountName.equals(that.serviceAccountName) :that.serviceAccountName != null) return false;
    if (sink != null ? !sink.equals(that.sink) :that.sink != null) return false;
    return true;
  }
  public int hashCode() {
    return java.util.Objects.hash(annotations,  awsCredsSecret,  queueUrl,  serviceAccountName,  sink,  super.hashCode());
  }
  public java.lang.String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("{");
    if (annotations != null && !annotations.isEmpty()) { sb.append("annotations:"); sb.append(annotations + ","); }
    if (awsCredsSecret != null) { sb.append("awsCredsSecret:"); sb.append(awsCredsSecret + ","); }
    if (queueUrl != null) { sb.append("queueUrl:"); sb.append(queueUrl + ","); }
    if (serviceAccountName != null) { sb.append("serviceAccountName:"); sb.append(serviceAccountName + ","); }
    if (sink != null) { sb.append("sink:"); sb.append(sink); }
    sb.append("}");
    return sb.toString();
  }
  class SinkNestedImpl extends ObjectReferenceFluentImpl> implements io.fabric8.knative.eventing.contrib.awssqs.v1alpha1.AwsSqsSourceSpecFluent.SinkNested,Nested{
    SinkNestedImpl(io.fabric8.kubernetes.api.model.ObjectReference item) {
      this.builder = new io.fabric8.kubernetes.api.model.ObjectReferenceBuilder(this, item);
    }
    SinkNestedImpl() {
      this.builder = new io.fabric8.kubernetes.api.model.ObjectReferenceBuilder(this);
    }
    io.fabric8.kubernetes.api.model.ObjectReferenceBuilder builder;
    public N and() {
      return (N) AwsSqsSourceSpecFluentImpl.this.withSink(builder.build());
    }
    public N endSink() {
      return and();
    }
    
  }
  
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy