Package dev.comfast.util.waiter
Class Waiter
java.lang.Object
dev.comfast.util.waiter.Waiter
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconfigure(UnaryOperator<WaiterConfig.WaiterConfigBuilder> builderFunc) Updates waiter config.voidRepeat the action till it ends without exception.<T> TRepeat the action till it ends without exception.<T> TwaitForValue(Supplier<T> action) Repeat the action till it returns truthy value.
-
Constructor Details
-
Waiter
public Waiter(long timeoutMs) -
Waiter
public Waiter()
-
-
Method Details
-
configure
Updates waiter config. Examplewaiter.configure(c -> c.description("Custom waiter").timeoutMs(3000)) -
waitFor
Repeat the action till it ends without exception.- Throws:
WaitTimeout- with detailed information about Exceptions happen
-
waitFor
Repeat the action till it ends without exception.- Returns:
- action result
- Throws:
WaitTimeout- with detailed information about Exceptions happen
-
waitForValue
Repeat the action till it returns truthy value.Ignores any Exception during subsequent tries.
- Throws:
WaitTimeout- with detailed information about Exceptions happen
-