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

zipkin2.finagle.scribe.AutoValue_ScribeZipkinTracer_Config Maven / Gradle / Ivy

The newest version!
package zipkin2.finagle.scribe;

import com.twitter.finagle.Name;
import javax.annotation.processing.Generated;
import zipkin2.internal.Nullable;

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

  @Nullable
  private final String localServiceName;

  private final float initialSampleRate;

  private final Name host;

  private AutoValue_ScribeZipkinTracer_Config(
      @Nullable String localServiceName,
      float initialSampleRate,
      Name host) {
    this.localServiceName = localServiceName;
    this.initialSampleRate = initialSampleRate;
    this.host = host;
  }

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

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

  @Override
  Name host() {
    return host;
  }

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

  @Override
  public boolean equals(Object o) {
    if (o == this) {
      return true;
    }
    if (o instanceof ScribeZipkinTracer.Config) {
      ScribeZipkinTracer.Config that = (ScribeZipkinTracer.Config) o;
      return (this.localServiceName == null ? that.localServiceName() == null : this.localServiceName.equals(that.localServiceName()))
          && Float.floatToIntBits(this.initialSampleRate) == Float.floatToIntBits(that.initialSampleRate())
          && this.host.equals(that.host());
    }
    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$ ^= host.hashCode();
    return h$;
  }

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

  static final class Builder extends ScribeZipkinTracer.Config.Builder {
    private String localServiceName;
    private float initialSampleRate;
    private Name host;
    private byte set$0;
    Builder() {
    }
    Builder(ScribeZipkinTracer.Config source) {
      this.localServiceName = source.localServiceName();
      this.initialSampleRate = source.initialSampleRate();
      this.host = source.host();
      set$0 = (byte) 1;
    }
    @Override
    public ScribeZipkinTracer.Config.Builder localServiceName(String localServiceName) {
      this.localServiceName = localServiceName;
      return this;
    }
    @Override
    public ScribeZipkinTracer.Config.Builder initialSampleRate(float initialSampleRate) {
      this.initialSampleRate = initialSampleRate;
      set$0 |= (byte) 1;
      return this;
    }
    @Override
    public ScribeZipkinTracer.Config.Builder host(Name host) {
      if (host == null) {
        throw new NullPointerException("Null host");
      }
      this.host = host;
      return this;
    }
    @Override
    public ScribeZipkinTracer.Config build() {
      if (set$0 != 1
          || this.host == null) {
        StringBuilder missing = new StringBuilder();
        if ((set$0 & 1) == 0) {
          missing.append(" initialSampleRate");
        }
        if (this.host == null) {
          missing.append(" host");
        }
        throw new IllegalStateException("Missing required properties:" + missing);
      }
      return new AutoValue_ScribeZipkinTracer_Config(
          this.localServiceName,
          this.initialSampleRate,
          this.host);
    }
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy