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

com.github.kristofa.brave.AutoValue_LocalTracer Maven / Gradle / Ivy


package com.github.kristofa.brave;

import java.util.Random;
import javax.annotation.Generated;

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

  private final SpanAndEndpoint.LocalSpanAndEndpoint spanAndEndpoint;
  private final Random randomGenerator;
  private final SpanCollector spanCollector;
  private final boolean allowNestedLocalSpans;
  private final Sampler traceSampler;
  private final AnnotationSubmitter.Clock clock;

  private AutoValue_LocalTracer(
      SpanAndEndpoint.LocalSpanAndEndpoint spanAndEndpoint,
      Random randomGenerator,
      SpanCollector spanCollector,
      boolean allowNestedLocalSpans,
      Sampler traceSampler,
      AnnotationSubmitter.Clock clock) {
    if (spanAndEndpoint == null) {
      throw new NullPointerException("Null spanAndEndpoint");
    }
    this.spanAndEndpoint = spanAndEndpoint;
    if (randomGenerator == null) {
      throw new NullPointerException("Null randomGenerator");
    }
    this.randomGenerator = randomGenerator;
    if (spanCollector == null) {
      throw new NullPointerException("Null spanCollector");
    }
    this.spanCollector = spanCollector;
    this.allowNestedLocalSpans = allowNestedLocalSpans;
    if (traceSampler == null) {
      throw new NullPointerException("Null traceSampler");
    }
    this.traceSampler = traceSampler;
    if (clock == null) {
      throw new NullPointerException("Null clock");
    }
    this.clock = clock;
  }

  @Override
  SpanAndEndpoint.LocalSpanAndEndpoint spanAndEndpoint() {
    return spanAndEndpoint;
  }

  @Override
  Random randomGenerator() {
    return randomGenerator;
  }

  @Override
  SpanCollector spanCollector() {
    return spanCollector;
  }

  @Override
  boolean allowNestedLocalSpans() {
    return allowNestedLocalSpans;
  }

  @Override
  Sampler traceSampler() {
    return traceSampler;
  }

  @Override
  AnnotationSubmitter.Clock clock() {
    return clock;
  }

  @Override
  public String toString() {
    return "LocalTracer{"
        + "spanAndEndpoint=" + spanAndEndpoint + ", "
        + "randomGenerator=" + randomGenerator + ", "
        + "spanCollector=" + spanCollector + ", "
        + "allowNestedLocalSpans=" + allowNestedLocalSpans + ", "
        + "traceSampler=" + traceSampler + ", "
        + "clock=" + clock
        + "}";
  }

  @Override
  public boolean equals(Object o) {
    if (o == this) {
      return true;
    }
    if (o instanceof LocalTracer) {
      LocalTracer that = (LocalTracer) o;
      return (this.spanAndEndpoint.equals(that.spanAndEndpoint()))
           && (this.randomGenerator.equals(that.randomGenerator()))
           && (this.spanCollector.equals(that.spanCollector()))
           && (this.allowNestedLocalSpans == that.allowNestedLocalSpans())
           && (this.traceSampler.equals(that.traceSampler()))
           && (this.clock.equals(that.clock()));
    }
    return false;
  }

  @Override
  public int hashCode() {
    int h = 1;
    h *= 1000003;
    h ^= spanAndEndpoint.hashCode();
    h *= 1000003;
    h ^= randomGenerator.hashCode();
    h *= 1000003;
    h ^= spanCollector.hashCode();
    h *= 1000003;
    h ^= allowNestedLocalSpans ? 1231 : 1237;
    h *= 1000003;
    h ^= traceSampler.hashCode();
    h *= 1000003;
    h ^= clock.hashCode();
    return h;
  }

  static final class Builder extends LocalTracer.Builder {
    private SpanAndEndpoint.LocalSpanAndEndpoint spanAndEndpoint;
    private Random randomGenerator;
    private SpanCollector spanCollector;
    private Boolean allowNestedLocalSpans;
    private Sampler traceSampler;
    private AnnotationSubmitter.Clock clock;
    Builder() {
    }
    Builder(LocalTracer source) {
      this.spanAndEndpoint = source.spanAndEndpoint();
      this.randomGenerator = source.randomGenerator();
      this.spanCollector = source.spanCollector();
      this.allowNestedLocalSpans = source.allowNestedLocalSpans();
      this.traceSampler = source.traceSampler();
      this.clock = source.clock();
    }
    @Override
    public LocalTracer.Builder spanAndEndpoint(SpanAndEndpoint.LocalSpanAndEndpoint spanAndEndpoint) {
      this.spanAndEndpoint = spanAndEndpoint;
      return this;
    }
    @Override
    public LocalTracer.Builder randomGenerator(Random randomGenerator) {
      this.randomGenerator = randomGenerator;
      return this;
    }
    @Override
    public LocalTracer.Builder spanCollector(SpanCollector spanCollector) {
      this.spanCollector = spanCollector;
      return this;
    }
    @Override
    public LocalTracer.Builder allowNestedLocalSpans(boolean allowNestedLocalSpans) {
      this.allowNestedLocalSpans = allowNestedLocalSpans;
      return this;
    }
    @Override
    public LocalTracer.Builder traceSampler(Sampler traceSampler) {
      this.traceSampler = traceSampler;
      return this;
    }
    @Override
    public LocalTracer.Builder clock(AnnotationSubmitter.Clock clock) {
      this.clock = clock;
      return this;
    }
    @Override
    public LocalTracer build() {
      String missing = "";
      if (spanAndEndpoint == null) {
        missing += " spanAndEndpoint";
      }
      if (randomGenerator == null) {
        missing += " randomGenerator";
      }
      if (spanCollector == null) {
        missing += " spanCollector";
      }
      if (allowNestedLocalSpans == null) {
        missing += " allowNestedLocalSpans";
      }
      if (traceSampler == null) {
        missing += " traceSampler";
      }
      if (clock == null) {
        missing += " clock";
      }
      if (!missing.isEmpty()) {
        throw new IllegalStateException("Missing required properties:" + missing);
      }
      return new AutoValue_LocalTracer(
          this.spanAndEndpoint,
          this.randomGenerator,
          this.spanCollector,
          this.allowNestedLocalSpans,
          this.traceSampler,
          this.clock);
    }
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy