Skip to content

Commit f41a568

Browse files
committed
Improve Javadoc for RetryPolicy.Builder
1 parent 09372b7 commit f41a568

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

spring-core/src/main/java/org/springframework/core/retry/RetryPolicy.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ private Builder() {
9999

100100
/**
101101
* Specify the maximum number of retry attempts.
102+
* <p>If a {@code maxAttempts} value has already been configured, the
103+
* supplied value will override the existing value.
102104
* @param maxAttempts the maximum number of retry attempts; must be
103105
* greater than zero
104106
* @return this {@code Builder} instance for chained method invocations
@@ -111,6 +113,8 @@ public Builder maxAttempts(int maxAttempts) {
111113

112114
/**
113115
* Specify the maximum retry {@link Duration}.
116+
* <p>If a {@code maxDuration} value has already been configured, the
117+
* supplied value will override the existing value.
114118
* @param maxDuration the maximum retry duration; must be positive
115119
* @return this {@code Builder} instance for chained method invocations
116120
*/
@@ -123,6 +127,9 @@ public Builder maxDuration(Duration maxDuration) {
123127
/**
124128
* Specify the types of exceptions for which the {@link RetryPolicy}
125129
* should retry a failed operation.
130+
* <p>Defaults to all exception types.
131+
* <p>If included exception types have already been configured, the supplied
132+
* types will be added to the existing list of included types.
126133
* <p>This can be combined with {@link #excludes(Class...)} and
127134
* {@link #predicate(Predicate)}.
128135
* @param types the types of exceptions to include in the policy
@@ -138,6 +145,8 @@ public final Builder includes(Class<? extends Throwable>... types) {
138145
/**
139146
* Specify the types of exceptions for which the {@link RetryPolicy}
140147
* should not retry a failed operation.
148+
* <p>If excluded exception types have already been configured, the supplied
149+
* types will be added to the existing list of excluded types.
141150
* <p>This can be combined with {@link #includes(Class...)} and
142151
* {@link #predicate(Predicate)}.
143152
* @param types the types of exceptions to exclude from the policy

0 commit comments

Comments
 (0)