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

zipkin.finagle.http.AutoValue_HttpZipkinTracer_Config Maven / Gradle / Ivy

The newest version!

package zipkin.finagle.http;

import com.twitter.finagle.Name;
import javax.annotation.Generated;

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

  private final float initialSampleRate;
  private final Name host;
  private final String hostHeader;
  private final boolean compressionEnabled;

  private AutoValue_HttpZipkinTracer_Config(
      float initialSampleRate,
      Name host,
      String hostHeader,
      boolean compressionEnabled) {
    this.initialSampleRate = initialSampleRate;
    this.host = host;
    this.hostHeader = hostHeader;
    this.compressionEnabled = compressionEnabled;
  }

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

  @Override
  Name host() {
    return host;
  }

  @Override
  String hostHeader() {
    return hostHeader;
  }

  @Override
  boolean compressionEnabled() {
    return compressionEnabled;
  }

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

  @Override
  public boolean equals(Object o) {
    if (o == this) {
      return true;
    }
    if (o instanceof HttpZipkinTracer.Config) {
      HttpZipkinTracer.Config that = (HttpZipkinTracer.Config) o;
      return (Float.floatToIntBits(this.initialSampleRate) == Float.floatToIntBits(that.initialSampleRate()))
           && (this.host.equals(that.host()))
           && (this.hostHeader.equals(that.hostHeader()))
           && (this.compressionEnabled == that.compressionEnabled());
    }
    return false;
  }

  @Override
  public int hashCode() {
    int h = 1;
    h *= 1000003;
    h ^= Float.floatToIntBits(this.initialSampleRate);
    h *= 1000003;
    h ^= this.host.hashCode();
    h *= 1000003;
    h ^= this.hostHeader.hashCode();
    h *= 1000003;
    h ^= this.compressionEnabled ? 1231 : 1237;
    return h;
  }

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

  static final class Builder extends HttpZipkinTracer.Config.Builder {
    private Float initialSampleRate;
    private Name host;
    private String hostHeader;
    private Boolean compressionEnabled;
    Builder() {
    }
    private Builder(HttpZipkinTracer.Config source) {
      this.initialSampleRate = source.initialSampleRate();
      this.host = source.host();
      this.hostHeader = source.hostHeader();
      this.compressionEnabled = source.compressionEnabled();
    }
    @Override
    public HttpZipkinTracer.Config.Builder initialSampleRate(float initialSampleRate) {
      this.initialSampleRate = initialSampleRate;
      return this;
    }
    @Override
    public HttpZipkinTracer.Config.Builder host(Name host) {
      if (host == null) {
        throw new NullPointerException("Null host");
      }
      this.host = host;
      return this;
    }
    @Override
    public HttpZipkinTracer.Config.Builder hostHeader(String hostHeader) {
      if (hostHeader == null) {
        throw new NullPointerException("Null hostHeader");
      }
      this.hostHeader = hostHeader;
      return this;
    }
    @Override
    public HttpZipkinTracer.Config.Builder compressionEnabled(boolean compressionEnabled) {
      this.compressionEnabled = compressionEnabled;
      return this;
    }
    @Override
    public HttpZipkinTracer.Config build() {
      String missing = "";
      if (this.initialSampleRate == null) {
        missing += " initialSampleRate";
      }
      if (this.host == null) {
        missing += " host";
      }
      if (this.hostHeader == null) {
        missing += " hostHeader";
      }
      if (this.compressionEnabled == null) {
        missing += " compressionEnabled";
      }
      if (!missing.isEmpty()) {
        throw new IllegalStateException("Missing required properties:" + missing);
      }
      return new AutoValue_HttpZipkinTracer_Config(
          this.initialSampleRate,
          this.host,
          this.hostHeader,
          this.compressionEnabled);
    }
  }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy