Interface RetryableQuestion<A>

All Superinterfaces:
Question<A>, Retryable

public interface RetryableQuestion<A> extends Question<A>, Retryable
A Question that will be retried until it yields an answer deemed acceptable(A) or the timeout is reached. Exceptions thrown will be ignored if they match the isIgnoredException predicate.
  • Method Details

    • getIgnoredExceptions

      default Set<Class<? extends Exception>> getIgnoredExceptions()
      Returns:
      the Set of Exception classes that will be ignored when thrown in a retry
    • isIgnoredException

      default boolean isIgnoredException(Exception exception)
      Returns:
      the predicate that decides weather the exception will be ignored when thrown in a retry
    • acceptable

      default boolean acceptable(A answer)
      This determines if a given answer is acceptable. In that case the retrying will be stopped and the answer is returned.

      By default this will accept

      Parameters:
      answer - an answer
      Returns:
      true if the given answer is acceptable