Class RetryPolicy.Builder

java.lang.Object
io.superdurable.dex.RetryPolicy.Builder
Enclosing class:
RetryPolicy

public static final class RetryPolicy.Builder extends Object
Builds immutable RetryPolicy values.
  • Method Details

    • initialInterval

      public RetryPolicy.Builder initialInterval(Duration value)
      Sets the delay before the first retry.
      Parameters:
      value - the initial retry interval, or null for the server default
      Returns:
      this builder
    • backoffCoefficient

      public RetryPolicy.Builder backoffCoefficient(double value)
      Sets the multiplier applied to each successive retry interval.
      Parameters:
      value - the exponential-backoff coefficient
      Returns:
      this builder
    • maximumInterval

      public RetryPolicy.Builder maximumInterval(Duration value)
      Caps the delay between attempts.
      Parameters:
      value - the maximum retry interval, or null for the server default
      Returns:
      this builder
    • maximumAttempts

      public RetryPolicy.Builder maximumAttempts(int value)
      Limits the total number of attempts, including the initial attempt.
      Parameters:
      value - the maximum attempt count; zero leaves the server default
      Returns:
      this builder
    • totalDuration

      public RetryPolicy.Builder totalDuration(Duration value)
      Limits the total elapsed retry duration.

      Step method retries default to four hours when this value is unset. An explicit value may be shorter or longer.

      Parameters:
      value - the total retry duration, or null for the server default
      Returns:
      this builder
    • build

      public RetryPolicy build()
      Builds an immutable retry policy from the current values.
      Returns:
      the configured retry policy