public interface WaiterAcceptor<T>
WaiterState
that the waiter should be transitioned to.Modifier and Type | Method and Description |
---|---|
static <T> WaiterAcceptor<T> |
errorOnExceptionAcceptor(Predicate<Throwable> errorPredicate)
Creates an error waiter acceptor which determines if the exception should transition the waiter to failure state
|
static <T> WaiterAcceptor<T> |
errorOnResponseAcceptor(Predicate<T> responsePredicate)
Creates a success waiter acceptor which determines if the exception should transition the waiter to success state
|
static <T> WaiterAcceptor<T> |
errorOnResponseAcceptor(Predicate<T> responsePredicate,
String message)
Creates a success waiter acceptor which determines if the exception should transition the waiter to success state
|
default boolean |
matches(T response)
Check to see if the response matches with the expected state defined by this acceptor
|
default boolean |
matches(Throwable throwable)
Check to see if the exception matches the expected state defined by this acceptor
|
default Optional<String> |
message()
Optional message to provide pertaining to the next WaiterState
|
static <T> WaiterAcceptor<T> |
retryOnExceptionAcceptor(Predicate<Throwable> errorPredicate)
Creates a retry on exception waiter acceptor which determines if the exception should transition the waiter to retry state
|
static <T> WaiterAcceptor<T> |
retryOnResponseAcceptor(Predicate<T> responsePredicate)
Creates a retry on exception waiter acceptor which determines if the exception should transition the waiter to retry state
|
static <T> WaiterAcceptor<T> |
successOnExceptionAcceptor(Predicate<Throwable> errorPredicate)
Creates an error waiter acceptor which determines if the exception should transition the waiter to success state
|
static <T> WaiterAcceptor<T> |
successOnResponseAcceptor(Predicate<T> responsePredicate)
Creates a success waiter acceptor which determines if the exception should transition the waiter to success state
|
WaiterState |
waiterState() |
WaiterState waiterState()
WaiterState
that the waiter should be transitioned todefault boolean matches(T response)
response
- the response to inspectdefault boolean matches(Throwable throwable)
throwable
- the exception to inspectdefault Optional<String> message()
static <T> WaiterAcceptor<T> successOnResponseAcceptor(Predicate<T> responsePredicate)
T
- the response typeresponsePredicate
- the predicate of the responseWaiterAcceptor
static <T> WaiterAcceptor<T> successOnExceptionAcceptor(Predicate<Throwable> errorPredicate)
T
- the response typeerrorPredicate
- the Throwable
predicateWaiterAcceptor
static <T> WaiterAcceptor<T> errorOnExceptionAcceptor(Predicate<Throwable> errorPredicate)
T
- the response typeerrorPredicate
- the Throwable
predicateWaiterAcceptor
static <T> WaiterAcceptor<T> errorOnResponseAcceptor(Predicate<T> responsePredicate)
T
- the response typeresponsePredicate
- the predicate of the responseWaiterAcceptor
static <T> WaiterAcceptor<T> errorOnResponseAcceptor(Predicate<T> responsePredicate, String message)
T
- the response typeresponsePredicate
- the predicate of the responseWaiterAcceptor
static <T> WaiterAcceptor<T> retryOnExceptionAcceptor(Predicate<Throwable> errorPredicate)
T
- the response typeerrorPredicate
- the Throwable
predicateWaiterAcceptor
static <T> WaiterAcceptor<T> retryOnResponseAcceptor(Predicate<T> responsePredicate)
T
- the response typeresponsePredicate
- the Throwable
predicateWaiterAcceptor
Copyright © 2022. All rights reserved.