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

There is a newer version: 3.11.0-rc3
Show newest version
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.processing.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 actionName;

  private final Optional> retryWithTrace;

  private final Optional> onAutoTrace;

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

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

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

  @Override
  Optional actionName() {
    return actionName;
  }

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

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

  @Override
  public String toString() {
    return "Options{"
        + "listener=" + listener + ", "
        + "timeout=" + timeout + ", "
        + "actionName=" + actionName + ", "
        + "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.actionName.equals(that.actionName())
          && 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$ ^= actionName.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 actionName = 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 actionName(String actionName) {
      this.actionName = Optional.of(actionName);
      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.actionName,
          this.retryWithTrace,
          this.onAutoTrace);
    }
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy