com.google.cloud.pubsublite.beam.AutoValue_SubscriberOptions Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pubsublite-beam-io Show documentation
Show all versions of pubsublite-beam-io Show documentation
Beam IO for Google Cloud Pub/Sub Lite
package com.google.cloud.pubsublite.beam;
import com.google.cloud.pubsublite.Partition;
import com.google.cloud.pubsublite.SubscriptionPath;
import com.google.cloud.pubsublite.cloudpubsub.FlowControlSettings;
import com.google.cloud.pubsublite.internal.wire.Committer;
import com.google.cloud.pubsublite.internal.wire.SubscriberFactory;
import java.util.Set;
import javax.annotation.Generated;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.joda.time.Duration;
@Generated("com.google.auto.value.processor.AutoValueProcessor")
final class AutoValue_SubscriberOptions extends SubscriberOptions {
private final SubscriptionPath subscriptionPath;
private final FlowControlSettings flowControlSettings;
private final Set partitions;
private final Duration minBundleTimeout;
private final @Nullable SubscriberFactory subscriberFactory;
private final @Nullable SerializableSupplier committerSupplier;
private final @Nullable SerializableSupplier backlogReaderSupplier;
private final @Nullable SerializableSupplier offsetReaderSupplier;
private AutoValue_SubscriberOptions(
SubscriptionPath subscriptionPath,
FlowControlSettings flowControlSettings,
Set partitions,
Duration minBundleTimeout,
@Nullable SubscriberFactory subscriberFactory,
@Nullable SerializableSupplier committerSupplier,
@Nullable SerializableSupplier backlogReaderSupplier,
@Nullable SerializableSupplier offsetReaderSupplier) {
this.subscriptionPath = subscriptionPath;
this.flowControlSettings = flowControlSettings;
this.partitions = partitions;
this.minBundleTimeout = minBundleTimeout;
this.subscriberFactory = subscriberFactory;
this.committerSupplier = committerSupplier;
this.backlogReaderSupplier = backlogReaderSupplier;
this.offsetReaderSupplier = offsetReaderSupplier;
}
@Override
public SubscriptionPath subscriptionPath() {
return subscriptionPath;
}
@Override
public FlowControlSettings flowControlSettings() {
return flowControlSettings;
}
@Override
public Set partitions() {
return partitions;
}
@Override
public Duration minBundleTimeout() {
return minBundleTimeout;
}
@Override
@Nullable SubscriberFactory subscriberFactory() {
return subscriberFactory;
}
@Override
@Nullable SerializableSupplier committerSupplier() {
return committerSupplier;
}
@Override
@Nullable SerializableSupplier backlogReaderSupplier() {
return backlogReaderSupplier;
}
@Override
@Nullable SerializableSupplier offsetReaderSupplier() {
return offsetReaderSupplier;
}
@Override
public String toString() {
return "SubscriberOptions{"
+ "subscriptionPath=" + subscriptionPath + ", "
+ "flowControlSettings=" + flowControlSettings + ", "
+ "partitions=" + partitions + ", "
+ "minBundleTimeout=" + minBundleTimeout + ", "
+ "subscriberFactory=" + subscriberFactory + ", "
+ "committerSupplier=" + committerSupplier + ", "
+ "backlogReaderSupplier=" + backlogReaderSupplier + ", "
+ "offsetReaderSupplier=" + offsetReaderSupplier
+ "}";
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (o instanceof SubscriberOptions) {
SubscriberOptions that = (SubscriberOptions) o;
return this.subscriptionPath.equals(that.subscriptionPath())
&& this.flowControlSettings.equals(that.flowControlSettings())
&& this.partitions.equals(that.partitions())
&& this.minBundleTimeout.equals(that.minBundleTimeout())
&& (this.subscriberFactory == null ? that.subscriberFactory() == null : this.subscriberFactory.equals(that.subscriberFactory()))
&& (this.committerSupplier == null ? that.committerSupplier() == null : this.committerSupplier.equals(that.committerSupplier()))
&& (this.backlogReaderSupplier == null ? that.backlogReaderSupplier() == null : this.backlogReaderSupplier.equals(that.backlogReaderSupplier()))
&& (this.offsetReaderSupplier == null ? that.offsetReaderSupplier() == null : this.offsetReaderSupplier.equals(that.offsetReaderSupplier()));
}
return false;
}
@Override
public int hashCode() {
int h$ = 1;
h$ *= 1000003;
h$ ^= subscriptionPath.hashCode();
h$ *= 1000003;
h$ ^= flowControlSettings.hashCode();
h$ *= 1000003;
h$ ^= partitions.hashCode();
h$ *= 1000003;
h$ ^= minBundleTimeout.hashCode();
h$ *= 1000003;
h$ ^= (subscriberFactory == null) ? 0 : subscriberFactory.hashCode();
h$ *= 1000003;
h$ ^= (committerSupplier == null) ? 0 : committerSupplier.hashCode();
h$ *= 1000003;
h$ ^= (backlogReaderSupplier == null) ? 0 : backlogReaderSupplier.hashCode();
h$ *= 1000003;
h$ ^= (offsetReaderSupplier == null) ? 0 : offsetReaderSupplier.hashCode();
return h$;
}
private static final long serialVersionUID = 269598118L;
@Override
public SubscriberOptions.Builder toBuilder() {
return new Builder(this);
}
static final class Builder extends SubscriberOptions.Builder {
private SubscriptionPath subscriptionPath;
private FlowControlSettings flowControlSettings;
private Set partitions;
private Duration minBundleTimeout;
private @Nullable SubscriberFactory subscriberFactory;
private @Nullable SerializableSupplier committerSupplier;
private @Nullable SerializableSupplier backlogReaderSupplier;
private @Nullable SerializableSupplier offsetReaderSupplier;
Builder() {
}
private Builder(SubscriberOptions source) {
this.subscriptionPath = source.subscriptionPath();
this.flowControlSettings = source.flowControlSettings();
this.partitions = source.partitions();
this.minBundleTimeout = source.minBundleTimeout();
this.subscriberFactory = source.subscriberFactory();
this.committerSupplier = source.committerSupplier();
this.backlogReaderSupplier = source.backlogReaderSupplier();
this.offsetReaderSupplier = source.offsetReaderSupplier();
}
@Override
public SubscriberOptions.Builder setSubscriptionPath(SubscriptionPath subscriptionPath) {
if (subscriptionPath == null) {
throw new NullPointerException("Null subscriptionPath");
}
this.subscriptionPath = subscriptionPath;
return this;
}
@Override
public SubscriberOptions.Builder setFlowControlSettings(FlowControlSettings flowControlSettings) {
if (flowControlSettings == null) {
throw new NullPointerException("Null flowControlSettings");
}
this.flowControlSettings = flowControlSettings;
return this;
}
@Override
public SubscriberOptions.Builder setPartitions(Set partitions) {
if (partitions == null) {
throw new NullPointerException("Null partitions");
}
this.partitions = partitions;
return this;
}
@Override
public SubscriberOptions.Builder setMinBundleTimeout(Duration minBundleTimeout) {
if (minBundleTimeout == null) {
throw new NullPointerException("Null minBundleTimeout");
}
this.minBundleTimeout = minBundleTimeout;
return this;
}
@Override
SubscriberOptions.Builder setSubscriberFactory(SubscriberFactory subscriberFactory) {
this.subscriberFactory = subscriberFactory;
return this;
}
@Override
SubscriberOptions.Builder setCommitterSupplier(SerializableSupplier committerSupplier) {
this.committerSupplier = committerSupplier;
return this;
}
@Override
SubscriberOptions.Builder setBacklogReaderSupplier(SerializableSupplier backlogReaderSupplier) {
this.backlogReaderSupplier = backlogReaderSupplier;
return this;
}
@Override
SubscriberOptions.Builder setOffsetReaderSupplier(SerializableSupplier offsetReaderSupplier) {
this.offsetReaderSupplier = offsetReaderSupplier;
return this;
}
@Override
public SubscriberOptions build() {
String missing = "";
if (this.subscriptionPath == null) {
missing += " subscriptionPath";
}
if (this.flowControlSettings == null) {
missing += " flowControlSettings";
}
if (this.partitions == null) {
missing += " partitions";
}
if (this.minBundleTimeout == null) {
missing += " minBundleTimeout";
}
if (!missing.isEmpty()) {
throw new IllegalStateException("Missing required properties:" + missing);
}
return new AutoValue_SubscriberOptions(
this.subscriptionPath,
this.flowControlSettings,
this.partitions,
this.minBundleTimeout,
this.subscriberFactory,
this.committerSupplier,
this.backlogReaderSupplier,
this.offsetReaderSupplier);
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy