Package org.shakespeareframework
Interface RetryableQuestion<A>
-
public interface RetryableQuestion<A> extends Question<A>, Retryable
AQuestion
that will be retried until it yields an answer deemedacceptable(A)
or thetimeout
is reached.Exception
s thrown will be ignored if they are contained inignoredExceptions
.
-
-
Field Summary
-
Fields inherited from interface org.shakespeareframework.Retryable
DEFAULT_TIMEOUT
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default boolean
acceptable(A answer)
This determines if a given answer is acceptable.default java.util.Set<java.lang.Class<? extends java.lang.Exception>>
getIgnoredExceptions()
-
Methods inherited from interface org.shakespeareframework.Retryable
getInterval, getTimeout
-
-
-
-
Method Detail
-
getIgnoredExceptions
default java.util.Set<java.lang.Class<? extends java.lang.Exception>> getIgnoredExceptions()
- Returns:
- the
Set
ofException
classes that 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
- a
Optional.isPresent()
, - a !
Collection.isEmpty()
, - a !
Map.isEmpty()
, - an array with length > 0, and
- a
Boolean.TRUE
.
- Parameters:
answer
- an answer- Returns:
true
if the given answer is acceptable
- a
-
-