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

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

There is a newer version: 4.13.6
Show newest version

package com.github.kristofa.brave;

import javax.annotation.Generated;

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

  private final Recorder recorder;
  private final ServerSpanThreadBinder currentServerSpan;
  private final LocalSpanThreadBinder currentSpan;
  private final boolean allowNestedLocalSpans;
  private final SpanFactory spanFactory;

  private AutoValue_LocalTracer(
      Recorder recorder,
      ServerSpanThreadBinder currentServerSpan,
      LocalSpanThreadBinder currentSpan,
      boolean allowNestedLocalSpans,
      SpanFactory spanFactory) {
    this.recorder = recorder;
    this.currentServerSpan = currentServerSpan;
    this.currentSpan = currentSpan;
    this.allowNestedLocalSpans = allowNestedLocalSpans;
    this.spanFactory = spanFactory;
  }

  @Override
  Recorder recorder() {
    return recorder;
  }

  @Override
  ServerSpanThreadBinder currentServerSpan() {
    return currentServerSpan;
  }

  @Override
  LocalSpanThreadBinder currentSpan() {
    return currentSpan;
  }

  @Override
  boolean allowNestedLocalSpans() {
    return allowNestedLocalSpans;
  }

  @Override
  SpanFactory spanFactory() {
    return spanFactory;
  }

  @Override
  public String toString() {
    return "LocalTracer{"
        + "recorder=" + recorder + ", "
        + "currentServerSpan=" + currentServerSpan + ", "
        + "currentSpan=" + currentSpan + ", "
        + "allowNestedLocalSpans=" + allowNestedLocalSpans + ", "
        + "spanFactory=" + spanFactory
        + "}";
  }

  @Override
  public boolean equals(Object o) {
    if (o == this) {
      return true;
    }
    if (o instanceof LocalTracer) {
      LocalTracer that = (LocalTracer) o;
      return (this.recorder.equals(that.recorder()))
           && (this.currentServerSpan.equals(that.currentServerSpan()))
           && (this.currentSpan.equals(that.currentSpan()))
           && (this.allowNestedLocalSpans == that.allowNestedLocalSpans())
           && (this.spanFactory.equals(that.spanFactory()));
    }
    return false;
  }

  @Override
  public int hashCode() {
    int h = 1;
    h *= 1000003;
    h ^= this.recorder.hashCode();
    h *= 1000003;
    h ^= this.currentServerSpan.hashCode();
    h *= 1000003;
    h ^= this.currentSpan.hashCode();
    h *= 1000003;
    h ^= this.allowNestedLocalSpans ? 1231 : 1237;
    h *= 1000003;
    h ^= this.spanFactory.hashCode();
    return h;
  }

  static final class Builder extends LocalTracer.Builder {
    private Recorder recorder;
    private ServerSpanThreadBinder currentServerSpan;
    private LocalSpanThreadBinder currentSpan;
    private Boolean allowNestedLocalSpans;
    private SpanFactory spanFactory;
    Builder() {
    }
    @Override
    LocalTracer.Builder recorder(Recorder recorder) {
      if (recorder == null) {
        throw new NullPointerException("Null recorder");
      }
      this.recorder = recorder;
      return this;
    }
    @Override
    LocalTracer.Builder currentServerSpan(ServerSpanThreadBinder currentServerSpan) {
      if (currentServerSpan == null) {
        throw new NullPointerException("Null currentServerSpan");
      }
      this.currentServerSpan = currentServerSpan;
      return this;
    }
    @Override
    LocalTracer.Builder currentSpan(LocalSpanThreadBinder currentSpan) {
      if (currentSpan == null) {
        throw new NullPointerException("Null currentSpan");
      }
      this.currentSpan = currentSpan;
      return this;
    }
    @Override
    LocalTracer.Builder allowNestedLocalSpans(boolean allowNestedLocalSpans) {
      this.allowNestedLocalSpans = allowNestedLocalSpans;
      return this;
    }
    @Override
    LocalTracer.Builder spanFactory(SpanFactory spanFactory) {
      if (spanFactory == null) {
        throw new NullPointerException("Null spanFactory");
      }
      this.spanFactory = spanFactory;
      return this;
    }
    @Override
    LocalTracer build() {
      String missing = "";
      if (this.recorder == null) {
        missing += " recorder";
      }
      if (this.currentServerSpan == null) {
        missing += " currentServerSpan";
      }
      if (this.currentSpan == null) {
        missing += " currentSpan";
      }
      if (this.allowNestedLocalSpans == null) {
        missing += " allowNestedLocalSpans";
      }
      if (this.spanFactory == null) {
        missing += " spanFactory";
      }
      if (!missing.isEmpty()) {
        throw new IllegalStateException("Missing required properties:" + missing);
      }
      return new AutoValue_LocalTracer(
          this.recorder,
          this.currentServerSpan,
          this.currentSpan,
          this.allowNestedLocalSpans,
          this.spanFactory);
    }
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy