Class ForMaxMillisecondsMediator
java.lang.Object
ch.nolix.base.programcontrol.flowcontrol.ForMaxMillisecondsMediator
- All Implemented Interfaces:
IForMaxMillisecondsMediator
A
ForMaxMillisecondsMediator is not mutable.- Author:
- Silvan Wyss
-
Method Summary
Modifier and TypeMethodDescriptionasLongAs(BooleanSupplier condition) static ForMaxMillisecondsMediatorforMaxMilliseconds(int maxDurationInMilliseconds) static ForMaxMillisecondsMediatorforMaxSeconds(int maxDurationInSeconds) until(BooleanSupplier condition) voidwaitAsLongAs(BooleanSupplier condition) Waits until the maxDurationInMilliseconds of the currentIForMaxMillisecondsMediatoris reached or the given condition is unfulfilled.voidwaitUntil(BooleanSupplier condition) Waits until the maxDurationInMilliseconds of the currentIForMaxMillisecondsMediatoris reached or the given condition is fulfilled.
-
Method Details
-
forMaxMilliseconds
- Parameters:
maxDurationInMilliseconds-- Returns:
- a new
ForMaxMillisecondsMediatorfor the given maxDurationInMilliseconds. - Throws:
RuntimeException- if the given maxDurationInMilliseconds is negative.
-
forMaxSeconds
- Parameters:
maxDurationInSeconds-- Returns:
- a new
ForMaxMillisecondsMediatorfor the given maxDurationInSeconds. - Throws:
RuntimeException- if the given maxDurationInSeconds is negative.
-
asLongAs
- Specified by:
asLongAsin interfaceIForMaxMillisecondsMediator- Parameters:
condition-- Returns:
- a new
IAsLongAsMediatorfor the maxDurationInMilliseconds of the currentIForMaxMillisecondsMediatorand for the given condition.
-
until
- Specified by:
untilin interfaceIForMaxMillisecondsMediator- Parameters:
condition-- Returns:
- a new
IAsLongAsMediatorfor the maxDurationInMilliseconds of the currentIForMaxMillisecondsMediatorand for the given condition.
-
waitAsLongAs
Waits until the maxDurationInMilliseconds of the currentIForMaxMillisecondsMediatoris reached or the given condition is unfulfilled.- Specified by:
waitAsLongAsin interfaceIForMaxMillisecondsMediator- Parameters:
condition-
-
waitUntil
Waits until the maxDurationInMilliseconds of the currentIForMaxMillisecondsMediatoris reached or the given condition is fulfilled.- Specified by:
waitUntilin interfaceIForMaxMillisecondsMediator- Parameters:
condition-
-