io.fabric8.knative.eventing.contrib.couchdb.v1alpha1.CouchDbSourceSpecFluentImpl Maven / Gradle / Ivy
package io.fabric8.knative.eventing.contrib.couchdb.v1alpha1;
import io.fabric8.knative.internal.pkg.apis.duck.v1.Destination;
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.ObjectReference;
import java.lang.Deprecated;
import io.fabric8.kubernetes.api.model.ObjectReferenceBuilder;
import io.fabric8.knative.internal.pkg.apis.duck.v1.DestinationBuilder;
import io.fabric8.kubernetes.api.builder.BaseFluent;
import java.lang.Object;
import io.fabric8.knative.internal.pkg.apis.duck.v1.DestinationFluentImpl;
import java.lang.Boolean;
/**
* Generated
*/
@SuppressWarnings(value = "unchecked")
public class CouchDbSourceSpecFluentImpl> extends BaseFluent implements CouchDbSourceSpecFluent{
public CouchDbSourceSpecFluentImpl() {
}
public CouchDbSourceSpecFluentImpl(CouchDbSourceSpec instance) {
this.withCredentials(instance.getCredentials());
this.withDatabase(instance.getDatabase());
this.withFeed(instance.getFeed());
this.withServiceAccountName(instance.getServiceAccountName());
this.withSink(instance.getSink());
}
private ObjectReferenceBuilder credentials;
private String database;
private String feed;
private String serviceAccountName;
private DestinationBuilder sink;
/**
* This method has been deprecated, please use method buildCredentials instead.
* @return The buildable object.
*/
@Deprecated
public ObjectReference getCredentials() {
return this.credentials!=null ?this.credentials.build():null;
}
public ObjectReference buildCredentials() {
return this.credentials!=null ?this.credentials.build():null;
}
public A withCredentials(ObjectReference credentials) {
_visitables.get("credentials").remove(this.credentials);
if (credentials!=null){ this.credentials= new ObjectReferenceBuilder(credentials); _visitables.get("credentials").add(this.credentials);} else { this.credentials = null; _visitables.get("credentials").remove(this.credentials); } return (A) this;
}
public Boolean hasCredentials() {
return this.credentials != null;
}
public CouchDbSourceSpecFluent.CredentialsNested withNewCredentials() {
return new CouchDbSourceSpecFluentImpl.CredentialsNestedImpl();
}
public CouchDbSourceSpecFluent.CredentialsNested withNewCredentialsLike(ObjectReference item) {
return new CouchDbSourceSpecFluentImpl.CredentialsNestedImpl(item);
}
public CouchDbSourceSpecFluent.CredentialsNested editCredentials() {
return withNewCredentialsLike(getCredentials());
}
public CouchDbSourceSpecFluent.CredentialsNested editOrNewCredentials() {
return withNewCredentialsLike(getCredentials() != null ? getCredentials(): new ObjectReferenceBuilder().build());
}
public CouchDbSourceSpecFluent.CredentialsNested editOrNewCredentialsLike(ObjectReference item) {
return withNewCredentialsLike(getCredentials() != null ? getCredentials(): 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;
}
/**
* This method has been deprecated, please use method buildSink instead.
* @return The buildable object.
*/
@Deprecated
public Destination getSink() {
return this.sink!=null ?this.sink.build():null;
}
public Destination buildSink() {
return this.sink!=null ?this.sink.build():null;
}
public A withSink(Destination sink) {
_visitables.get("sink").remove(this.sink);
if (sink!=null){ this.sink= new DestinationBuilder(sink); _visitables.get("sink").add(this.sink);} else { this.sink = null; _visitables.get("sink").remove(this.sink); } return (A) this;
}
public Boolean hasSink() {
return this.sink != null;
}
public CouchDbSourceSpecFluent.SinkNested withNewSink() {
return new CouchDbSourceSpecFluentImpl.SinkNestedImpl();
}
public CouchDbSourceSpecFluent.SinkNested withNewSinkLike(Destination item) {
return new CouchDbSourceSpecFluentImpl.SinkNestedImpl(item);
}
public CouchDbSourceSpecFluent.SinkNested editSink() {
return withNewSinkLike(getSink());
}
public CouchDbSourceSpecFluent.SinkNested editOrNewSink() {
return withNewSinkLike(getSink() != null ? getSink(): new DestinationBuilder().build());
}
public CouchDbSourceSpecFluent.SinkNested editOrNewSinkLike(Destination 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;
CouchDbSourceSpecFluentImpl that = (CouchDbSourceSpecFluentImpl) o;
if (credentials != null ? !credentials.equals(that.credentials) :that.credentials != null) return false;
if (database != null ? !database.equals(that.database) :that.database != null) return false;
if (feed != null ? !feed.equals(that.feed) :that.feed != 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(credentials, database, feed, serviceAccountName, sink, 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); }
sb.append("}");
return sb.toString();
}
class CredentialsNestedImpl extends ObjectReferenceFluentImpl> implements CouchDbSourceSpecFluent.CredentialsNested,Nested{
CredentialsNestedImpl(ObjectReference item) {
this.builder = new ObjectReferenceBuilder(this, item);
}
CredentialsNestedImpl() {
this.builder = new ObjectReferenceBuilder(this);
}
ObjectReferenceBuilder builder;
public N and() {
return (N) CouchDbSourceSpecFluentImpl.this.withCredentials(builder.build());
}
public N endCredentials() {
return and();
}
}
class SinkNestedImpl extends DestinationFluentImpl> implements CouchDbSourceSpecFluent.SinkNested,Nested{
SinkNestedImpl(Destination item) {
this.builder = new DestinationBuilder(this, item);
}
SinkNestedImpl() {
this.builder = new DestinationBuilder(this);
}
DestinationBuilder builder;
public N and() {
return (N) CouchDbSourceSpecFluentImpl.this.withSink(builder.build());
}
public N endSink() {
return and();
}
}
} © 2015 - 2025 Weber Informatics LLC | Privacy Policy