Class RetryOptions

java.lang.Object
io.temporal.common.RetryOptions

public final class RetryOptions extends Object
  • Method Details

    • newBuilder

      public static RetryOptions.Builder newBuilder()
    • newBuilder

      public static RetryOptions.Builder newBuilder(RetryOptions options)
      Creates builder with fields pre-populated from passed options.
      Parameters:
      options - can be null
    • getDefaultInstance

      public static RetryOptions getDefaultInstance()
    • merge

      public static RetryOptions merge(MethodRetry r, RetryOptions o)
      Merges annotation with explicitly provided RetryOptions. If there is conflict RetryOptions takes precedence.
    • merge

      public RetryOptions merge(RetryOptions o)
      The parameter options takes precedence.
    • getInitialInterval

      public Duration getInitialInterval()
    • getBackoffCoefficient

      public double getBackoffCoefficient()
    • getMaximumAttempts

      public int getMaximumAttempts()
    • getMaximumInterval

      public Duration getMaximumInterval()
    • getDoNotRetry

      public String[] getDoNotRetry()
      Returns:
      null if not configured. When merging with annotation it makes a difference. null means use values from an annotation. Empty list means do not retry on anything.
    • toBuilder

      public RetryOptions.Builder toBuilder()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • calculateSleepTime

      public long calculateSleepTime(long attempt)
    • shouldRethrow

      public boolean shouldRethrow(Throwable e, Optional<Duration> expiration, long attempt, long elapsed, long sleepTime)