Skip to content

Commit c75b750

Browse files
committed
Improve RetryPolicy javadocs around delays.
Fixes #345.
1 parent db0f3df commit c75b750

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

core/src/main/java/dev/failsafe/RetryPolicyBuilder.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,8 @@ public RetryPolicyBuilder<R> abortOn(List<Class<? extends Throwable>> exceptions
148148
}
149149

150150
/**
151-
* Specifies that retries should be aborted if the {@code abortPredicate} matches the exception. Any exception
152-
* thrown from the {@code abortPredicate} is treated as a {@code false} result.
151+
* Specifies that retries should be aborted if the {@code abortPredicate} matches the exception. Any exception thrown
152+
* from the {@code abortPredicate} is treated as a {@code false} result.
153153
*
154154
* @throws NullPointerException if {@code abortPredicate} is null
155155
*/
@@ -314,8 +314,8 @@ public RetryPolicyBuilder<R> withBackoff(Duration delay, Duration maxDelay, doub
314314
}
315315

316316
/**
317-
* Sets the {@code delay} to occur between retries. Replaces any previously configured {@link #withBackoff(Duration,
318-
* Duration) backoff} or {@link #withDelay(Duration, Duration) random} delays.
317+
* Sets the fixed {@code delay} to occur between retries. Replaces any previously configured {@link
318+
* #withBackoff(Duration, Duration) backoff} or {@link #withDelay(Duration, Duration) random} delays.
319319
*
320320
* @throws NullPointerException if {@code delay} is null
321321
* @throws IllegalArgumentException if {@code delay} <= 0

core/src/main/java/dev/failsafe/RetryPolicyConfig.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,15 +96,16 @@ public boolean allowsRetries() {
9696
* @see RetryPolicyBuilder#abortOn(List)
9797
* @see RetryPolicyBuilder#abortOn(CheckedPredicate)
9898
* @see RetryPolicyBuilder#abortIf(CheckedBiPredicate)
99-
* @see RetryPolicyBuilder#abortIf(CheckedPredicate)
100-
* @see RetryPolicyBuilder#abortWhen(Object)
99+
* @see RetryPolicyBuilder#abortIf(CheckedPredicate)
100+
* @see RetryPolicyBuilder#abortWhen(Object)
101101
*/
102102
public List<CheckedBiPredicate<R, Throwable>> getAbortConditions() {
103103
return abortConditions;
104104
}
105105

106106
/**
107-
* Returns the delay between retries. Defaults to {@link Duration#ZERO}.
107+
* Returns the delay between retries, else {@link Duration#ZERO} if delays have not been configured. If backoff
108+
* delays are configured, this value will represent the initial delay.
108109
*
109110
* @see RetryPolicyBuilder#withDelay(Duration)
110111
* @see RetryPolicyBuilder#withBackoff(Duration, Duration, double)
@@ -117,7 +118,7 @@ public Duration getDelay() {
117118
}
118119

119120
/**
120-
* Returns the min delay between retries.
121+
* Returns the min random delay between retries, else {@code null} if random delays have not been configured.
121122
*
122123
* @see RetryPolicyBuilder#withDelay(Duration, Duration)
123124
* @see RetryPolicyBuilder#withDelay(long, long, ChronoUnit)
@@ -127,7 +128,7 @@ public Duration getDelayMin() {
127128
}
128129

129130
/**
130-
* Returns the max delay between retries.
131+
* Returns the max random delay between retries, else {@code null} if random delays have not been configured.
131132
*
132133
* @see RetryPolicyBuilder#withDelay(Duration, Duration)
133134
* @see RetryPolicyBuilder#withDelay(long, long, ChronoUnit)
@@ -176,7 +177,7 @@ public int getMaxAttempts() {
176177
}
177178

178179
/**
179-
* Returns the max delay between backoff retries.
180+
* Returns the max delay between backoff retries, else {@code null} if backoff delays have not been configured.
180181
*
181182
* @see RetryPolicyBuilder#withBackoff(Duration, Duration)
182183
* @see RetryPolicyBuilder#withBackoff(Duration, Duration, double)

0 commit comments

Comments
 (0)