public class RetryUtils extends Object
| Constructor and Description |
|---|
RetryUtils() |
| Modifier and Type | Method and Description |
|---|---|
static <T> T |
withRetry(Callable<T> action,
int maxAttempts)
This method attempts to execute a given action up to a specified number of times with a 1-second delay.
|
public static <T> T withRetry(Callable<T> action, int maxAttempts)
action - The action to be executed.maxAttempts - The maximum number of attempts to execute the action.RuntimeException - if the action fails on all attempts.Copyright © 2023. All rights reserved.