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

zipkin2.finagle.kafka.AutoValue_KafkaZipkinTracer_Config Maven / Gradle / Ivy

There is a newer version: 23.0.1
Show newest version


package zipkin2.finagle.kafka;

import javax.annotation.Generated;
import zipkin2.internal.Nullable;

@Generated("com.google.auto.value.processor.AutoValueProcessor")
final class AutoValue_KafkaZipkinTracer_Config extends KafkaZipkinTracer.Config {

  private final String localServiceName;

  private final float initialSampleRate;

  private final String bootstrapServers;

  private final String topic;

  private AutoValue_KafkaZipkinTracer_Config(
      @Nullable String localServiceName,
      float initialSampleRate,
      String bootstrapServers,
      String topic) {
    this.localServiceName = localServiceName;
    this.initialSampleRate = initialSampleRate;
    this.bootstrapServers = bootstrapServers;
    this.topic = topic;
  }

  @Nullable
  @Override
  public String localServiceName() {
    return localServiceName;
  }

  @Override
  public float initialSampleRate() {
    return initialSampleRate;
  }

  @Override
  String bootstrapServers() {
    return bootstrapServers;
  }

  @Override
  String topic() {
    return topic;
  }

  @Override
  public String toString() {
    return "Config{"
         + "localServiceName=" + localServiceName + ", "
         + "initialSampleRate=" + initialSampleRate + ", "
         + "bootstrapServers=" + bootstrapServers + ", "
         + "topic=" + topic
        + "}";
  }

  @Override
  public boolean equals(Object o) {
    if (o == this) {
      return true;
    }
    if (o instanceof KafkaZipkinTracer.Config) {
      KafkaZipkinTracer.Config that = (KafkaZipkinTracer.Config) o;
      return (this.localServiceName == null ? that.localServiceName() == null : this.localServiceName.equals(that.localServiceName()))
          && Float.floatToIntBits(this.initialSampleRate) == Float.floatToIntBits(that.initialSampleRate())
          && this.bootstrapServers.equals(that.bootstrapServers())
          && this.topic.equals(that.topic());
    }
    return false;
  }

  @Override
  public int hashCode() {
    int h$ = 1;
    h$ *= 1000003;
    h$ ^= (localServiceName == null) ? 0 : localServiceName.hashCode();
    h$ *= 1000003;
    h$ ^= Float.floatToIntBits(initialSampleRate);
    h$ *= 1000003;
    h$ ^= bootstrapServers.hashCode();
    h$ *= 1000003;
    h$ ^= topic.hashCode();
    return h$;
  }

  @Override
  public KafkaZipkinTracer.Config.Builder toBuilder() {
    return new Builder(this);
  }

  static final class Builder implements KafkaZipkinTracer.Config.Builder {
    private String localServiceName;
    private Float initialSampleRate;
    private String bootstrapServers;
    private String topic;
    Builder() {
    }
    private Builder(KafkaZipkinTracer.Config source) {
      this.localServiceName = source.localServiceName();
      this.initialSampleRate = source.initialSampleRate();
      this.bootstrapServers = source.bootstrapServers();
      this.topic = source.topic();
    }
    @Override
    public KafkaZipkinTracer.Config.Builder localServiceName(String localServiceName) {
      this.localServiceName = localServiceName;
      return this;
    }
    @Override
    public KafkaZipkinTracer.Config.Builder initialSampleRate(float initialSampleRate) {
      this.initialSampleRate = initialSampleRate;
      return this;
    }
    @Override
    public KafkaZipkinTracer.Config.Builder bootstrapServers(String bootstrapServers) {
      if (bootstrapServers == null) {
        throw new NullPointerException("Null bootstrapServers");
      }
      this.bootstrapServers = bootstrapServers;
      return this;
    }
    @Override
    public KafkaZipkinTracer.Config.Builder topic(String topic) {
      if (topic == null) {
        throw new NullPointerException("Null topic");
      }
      this.topic = topic;
      return this;
    }
    @Override
    public KafkaZipkinTracer.Config build() {
      String missing = "";
      if (this.initialSampleRate == null) {
        missing += " initialSampleRate";
      }
      if (this.bootstrapServers == null) {
        missing += " bootstrapServers";
      }
      if (this.topic == null) {
        missing += " topic";
      }
      if (!missing.isEmpty()) {
        throw new IllegalStateException("Missing required properties:" + missing);
      }
      return new AutoValue_KafkaZipkinTracer_Config(
          this.localServiceName,
          this.initialSampleRate,
          this.bootstrapServers,
          this.topic);
    }
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy