public class Waiters extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Waiters.ConditionNotMetException |
static class |
Waiters.WaiterBuilder<T> |
| Constructor and Description |
|---|
Waiters() |
| Modifier and Type | Method and Description |
|---|---|
static Waiters.WaiterBuilder<Boolean> |
builder(Supplier<Boolean> condition)
Create a builder that will succeed when the supplied condition is met
|
static <T> Waiters.WaiterBuilder<T> |
builder(Supplier<T> valueSupplier,
Predicate<T> conditionTester)
Create a Waiter that will succeed when the value matches the predicate
|
static void |
waitForCondition(String message,
Supplier<Boolean> condition,
long maxTimeToWaitMs)
Wait for a condition to be true, throw an
Waiters.ConditionNotMetException if the condition is not met in time |
public static void waitForCondition(String message, Supplier<Boolean> condition, long maxTimeToWaitMs)
Waiters.ConditionNotMetException if the condition is not met in timecondition - The condition to testmaxTimeToWaitMs - The maximum amount of time to wait before failingpublic static Waiters.WaiterBuilder<Boolean> builder(Supplier<Boolean> condition)
condition - the condition, when it returns true the waiter will completeWaiters.WaiterBuilderpublic static <T> Waiters.WaiterBuilder<T> builder(Supplier<T> valueSupplier, Predicate<T> conditionTester)
T - the value being testedvalueSupplier - the supplier of the value, regularly evaluatedconditionTester - the predicate that determines if the condition has been metWaiters.WaiterBuilderCopyright © 2023. All rights reserved.