Package io.github.resilience4j.retry
Class RetryConfig
- java.lang.Object
-
- io.github.resilience4j.retry.RetryConfig
-
- All Implemented Interfaces:
java.io.Serializable
public class RetryConfig extends java.lang.Object implements java.io.Serializable- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classRetryConfig.Builder<T>
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_MAX_ATTEMPTSstatic longDEFAULT_WAIT_DURATION
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <T> RetryConfig.Builder<T>custom()Returns a builder to create a custom RetryConfig.static <T> RetryConfig.Builder<T>from(RetryConfig baseConfig)java.util.function.Predicate<java.lang.Throwable>getExceptionPredicate()java.util.function.Function<java.lang.Integer,java.lang.Long>getIntervalFunction()intgetMaxAttempts()<T> java.util.function.Predicate<T>getResultPredicate()Return the Predicate which evaluates if an result should be retried.static RetryConfigofDefaults()Creates a default Retry configuration.
-
-
-
Field Detail
-
DEFAULT_WAIT_DURATION
public static final long DEFAULT_WAIT_DURATION
- See Also:
- Constant Field Values
-
DEFAULT_MAX_ATTEMPTS
public static final int DEFAULT_MAX_ATTEMPTS
- See Also:
- Constant Field Values
-
-
Method Detail
-
custom
public static <T> RetryConfig.Builder<T> custom()
Returns a builder to create a custom RetryConfig.- Type Parameters:
T- The type being built.- Returns:
- a
RetryConfig.Builder
-
from
public static <T> RetryConfig.Builder<T> from(RetryConfig baseConfig)
-
ofDefaults
public static RetryConfig ofDefaults()
Creates a default Retry configuration.- Returns:
- a default Retry configuration.
-
getMaxAttempts
public int getMaxAttempts()
- Returns:
- the maximum allowed attempts to make.
-
getIntervalFunction
public java.util.function.Function<java.lang.Integer,java.lang.Long> getIntervalFunction()
-
getExceptionPredicate
public java.util.function.Predicate<java.lang.Throwable> getExceptionPredicate()
-
getResultPredicate
@Nullable public <T> java.util.function.Predicate<T> getResultPredicate()
Return the Predicate which evaluates if an result should be retried. The Predicate must return true if the result should be retried, otherwise it must return false.- Type Parameters:
T- The type of result.- Returns:
- the result predicate
-
-