| Modifier and Type | Method and Description |
|---|---|
Waiters.WaiterBuilder<T> |
checkIntervalMs(long checkIntervalMs)
Specify the interval between checks of the condition.
|
Waiters.WaiterBuilder<T> |
maxTimeToWaitMs(long maxTimeToWaitMs)
Specify the maximum amount of time to wait for the condition to be met.
|
Waiters.WaiterBuilder<T> |
message(String message)
Specifies a static message for the exception in case the condition isn't met.
|
Waiters.WaiterBuilder<T> |
messageGenerator(Function<T,String> messageGenerator)
Supply a function for generating the exception message in case the condition isn't met.
|
void |
run()
Wait for the condition to be true, throw an
Waiters.ConditionNotMetException
if the condition is not met in time. |
public void run()
Waiters.ConditionNotMetException
if the condition is not met in time.
This method is overridden from the Runnable interface, allowing the WaiterBuilder to be run as a separate thread.
public Waiters.WaiterBuilder<T> message(String message)
message - the message to be displayed when an exception is thrown.public Waiters.WaiterBuilder<T> messageGenerator(Function<T,String> messageGenerator)
messageGenerator - a function that takes the last value as a parameter to create a message.public Waiters.WaiterBuilder<T> maxTimeToWaitMs(long maxTimeToWaitMs)
maxTimeToWaitMs - the maximum time in milliseconds to wait for the condition.public Waiters.WaiterBuilder<T> checkIntervalMs(long checkIntervalMs)
checkIntervalMs - the interval between checks in milliseconds.Copyright © 2024. All rights reserved.