public final class RetryOptions
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
RetryOptions.Builder |
Modifier and Type | Method and Description |
---|---|
long |
calculateSleepTime(long attempt) |
boolean |
equals(java.lang.Object o) |
double |
getBackoffCoefficient() |
static RetryOptions |
getDefaultInstance() |
java.lang.String[] |
getDoNotRetry() |
java.time.Duration |
getInitialInterval() |
int |
getMaximumAttempts() |
java.time.Duration |
getMaximumInterval() |
int |
hashCode() |
static RetryOptions |
merge(MethodRetry r,
RetryOptions o)
Merges annotation with explicitly provided RetryOptions.
|
RetryOptions |
merge(RetryOptions o)
The parameter options takes precedence.
|
static RetryOptions.Builder |
newBuilder() |
static RetryOptions.Builder |
newBuilder(RetryOptions options)
Creates builder with fields pre-populated from passed options.
|
boolean |
shouldRethrow(java.lang.Throwable e,
java.util.Optional<java.time.Duration> expiration,
long attempt,
long elapsed,
long sleepTime) |
RetryOptions.Builder |
toBuilder() |
java.lang.String |
toString() |
public static RetryOptions.Builder newBuilder()
public static RetryOptions.Builder newBuilder(RetryOptions options)
options
- can be nullpublic static RetryOptions getDefaultInstance()
public static RetryOptions merge(MethodRetry r, RetryOptions o)
public RetryOptions merge(RetryOptions o)
public java.time.Duration getInitialInterval()
public double getBackoffCoefficient()
public int getMaximumAttempts()
public java.time.Duration getMaximumInterval()
public java.lang.String[] getDoNotRetry()
public RetryOptions.Builder toBuilder()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public long calculateSleepTime(long attempt)
public boolean shouldRethrow(java.lang.Throwable e, java.util.Optional<java.time.Duration> expiration, long attempt, long elapsed, long sleepTime)