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

com.google.gerrit.server.update.AutoValue_RetryHelper_Options Maven / Gradle / Ivy

package com.google.gerrit.server.update;

import com.github.rholder.retry.RetryListener;
import com.google.gerrit.common.Nullable;
import java.time.Duration;
import java.util.Optional;
import java.util.function.Consumer;
import java.util.function.Predicate;
import javax.annotation.Generated;

@Generated("com.google.auto.value.processor.AutoValueProcessor")
final class AutoValue_RetryHelper_Options extends RetryHelper.Options {

  private final RetryListener listener;

  private final Duration timeout;

  private final Optional> caller;

  private final Optional> retryWithTrace;

  private final Optional> onAutoTrace;

  private AutoValue_RetryHelper_Options(
      @Nullable RetryListener listener,
      @Nullable Duration timeout,
      Optional> caller,
      Optional> retryWithTrace,
      Optional> onAutoTrace) {
    this.listener = listener;
    this.timeout = timeout;
    this.caller = caller;
    this.retryWithTrace = retryWithTrace;
    this.onAutoTrace = onAutoTrace;
  }

  @Nullable
  @Override
  RetryListener listener() {
    return listener;
  }

  @Nullable
  @Override
  Duration timeout() {
    return timeout;
  }

  @Override
  Optional> caller() {
    return caller;
  }

  @Override
  Optional> retryWithTrace() {
    return retryWithTrace;
  }

  @Override
  Optional> onAutoTrace() {
    return onAutoTrace;
  }

  @Override
  public String toString() {
    return "Options{"
         + "listener=" + listener + ", "
         + "timeout=" + timeout + ", "
         + "caller=" + caller + ", "
         + "retryWithTrace=" + retryWithTrace + ", "
         + "onAutoTrace=" + onAutoTrace
        + "}";
  }

  @Override
  public boolean equals(Object o) {
    if (o == this) {
      return true;
    }
    if (o instanceof RetryHelper.Options) {
      RetryHelper.Options that = (RetryHelper.Options) o;
      return (this.listener == null ? that.listener() == null : this.listener.equals(that.listener()))
          && (this.timeout == null ? that.timeout() == null : this.timeout.equals(that.timeout()))
          && this.caller.equals(that.caller())
          && this.retryWithTrace.equals(that.retryWithTrace())
          && this.onAutoTrace.equals(that.onAutoTrace());
    }
    return false;
  }

  @Override
  public int hashCode() {
    int h$ = 1;
    h$ *= 1000003;
    h$ ^= (listener == null) ? 0 : listener.hashCode();
    h$ *= 1000003;
    h$ ^= (timeout == null) ? 0 : timeout.hashCode();
    h$ *= 1000003;
    h$ ^= caller.hashCode();
    h$ *= 1000003;
    h$ ^= retryWithTrace.hashCode();
    h$ *= 1000003;
    h$ ^= onAutoTrace.hashCode();
    return h$;
  }

  static final class Builder extends RetryHelper.Options.Builder {
    private RetryListener listener;
    private Duration timeout;
    private Optional> caller = Optional.empty();
    private Optional> retryWithTrace = Optional.empty();
    private Optional> onAutoTrace = Optional.empty();
    Builder() {
    }
    @Override
    public RetryHelper.Options.Builder listener(RetryListener listener) {
      this.listener = listener;
      return this;
    }
    @Override
    public RetryHelper.Options.Builder timeout(Duration timeout) {
      this.timeout = timeout;
      return this;
    }
    @Override
    public RetryHelper.Options.Builder caller(Class caller) {
      this.caller = Optional.of(caller);
      return this;
    }
    @Override
    public RetryHelper.Options.Builder retryWithTrace(Predicate retryWithTrace) {
      this.retryWithTrace = Optional.of(retryWithTrace);
      return this;
    }
    @Override
    public RetryHelper.Options.Builder onAutoTrace(Consumer onAutoTrace) {
      this.onAutoTrace = Optional.of(onAutoTrace);
      return this;
    }
    @Override
    public RetryHelper.Options build() {
      return new AutoValue_RetryHelper_Options(
          this.listener,
          this.timeout,
          this.caller,
          this.retryWithTrace,
          this.onAutoTrace);
    }
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy