Class RetryConfig

  • All Implemented Interfaces:
    java.io.Serializable

    public class RetryConfig
    extends java.lang.Object
    implements java.io.Serializable
    See Also:
    Serialized Form
    • Method Detail

      • 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