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

com.google.cloud.pubsublite.beam.AutoValue_PublisherOptions Maven / Gradle / Ivy

There is a newer version: 0.23.0
Show newest version
package com.google.cloud.pubsublite.beam;

import com.google.cloud.pubsublite.TopicPath;
import javax.annotation.Generated;
import org.checkerframework.checker.nullness.qual.Nullable;

@Generated("com.google.auto.value.processor.AutoValueProcessor")
final class AutoValue_PublisherOptions extends PublisherOptions {

  private final TopicPath topicPath;

  private final @Nullable SerializableSupplier publisherSupplier;

  private AutoValue_PublisherOptions(
      TopicPath topicPath,
      @Nullable SerializableSupplier publisherSupplier) {
    this.topicPath = topicPath;
    this.publisherSupplier = publisherSupplier;
  }

  @Override
  public TopicPath topicPath() {
    return topicPath;
  }

  @Override
  public @Nullable SerializableSupplier publisherSupplier() {
    return publisherSupplier;
  }

  @Override
  public String toString() {
    return "PublisherOptions{"
        + "topicPath=" + topicPath + ", "
        + "publisherSupplier=" + publisherSupplier
        + "}";
  }

  @Override
  public boolean equals(Object o) {
    if (o == this) {
      return true;
    }
    if (o instanceof PublisherOptions) {
      PublisherOptions that = (PublisherOptions) o;
      return this.topicPath.equals(that.topicPath())
          && (this.publisherSupplier == null ? that.publisherSupplier() == null : this.publisherSupplier.equals(that.publisherSupplier()));
    }
    return false;
  }

  @Override
  public int hashCode() {
    int h$ = 1;
    h$ *= 1000003;
    h$ ^= topicPath.hashCode();
    h$ *= 1000003;
    h$ ^= (publisherSupplier == null) ? 0 : publisherSupplier.hashCode();
    return h$;
  }

  private static final long serialVersionUID = 275311613L;

  static final class Builder extends PublisherOptions.Builder {
    private TopicPath topicPath;
    private @Nullable SerializableSupplier publisherSupplier;
    Builder() {
    }
    @Override
    public PublisherOptions.Builder setTopicPath(TopicPath topicPath) {
      if (topicPath == null) {
        throw new NullPointerException("Null topicPath");
      }
      this.topicPath = topicPath;
      return this;
    }
    @Override
    public PublisherOptions.Builder setPublisherSupplier(SerializableSupplier publisherSupplier) {
      this.publisherSupplier = publisherSupplier;
      return this;
    }
    @Override
    public PublisherOptions build() {
      if (this.topicPath == null) {
        String missing = " topicPath";
        throw new IllegalStateException("Missing required properties:" + missing);
      }
      return new AutoValue_PublisherOptions(
          this.topicPath,
          this.publisherSupplier);
    }
  }

}