Class SupplierWaiter<X>

  • All Implemented Interfaces:
    Waiter

    public class SupplierWaiter<X>
    extends Object
    implements Waiter
    • Method Detail

      • timeout

        public SupplierWaiter timeout​(TimeUnit timeUnit,
                                      long t)
        Description copied from interface: Waiter
        Sets waiter timeout after which waiters stops waiting. Timeout is logged in case of setting Waiter.logPoint(LogPoint) to anything else then Waiter.LogPoint.NONE
        Specified by:
        timeout in interface Waiter
        Parameters:
        timeUnit - timeUnit that is converts time t to milliseconds
        t - timeout in timeUnit
        Returns:
        this
      • interval

        public SupplierWaiter interval​(long millis)
        Description copied from interface: Waiter
        Sets waiter conditions check interval.
        Specified by:
        interval in interface Waiter
        Parameters:
        millis - interval in milliseconds
        Returns:
        this
      • interval

        public SupplierWaiter interval​(TimeUnit timeUnit,
                                       long t)
        Description copied from interface: Waiter
        Sets waiter conditions check interval.
        Specified by:
        interval in interface Waiter
        Parameters:
        timeUnit - timeUnit that is converts time t to milliseconds
        t - interval in milliseconds
        Returns:
        this
      • reason

        public SupplierWaiter reason​(String reason)
        Description copied from interface: Waiter
        Sets waiting reason.
        Specified by:
        reason in interface Waiter
        Parameters:
        reason - what the waiters what upon.
        Returns:
        this
      • level

        public SupplierWaiter level​(org.slf4j.event.Level level)
        Description copied from interface: Waiter
        Set the level of severity for a log message.
        Specified by:
        level in interface Waiter
        Parameters:
        level - what level of severity should be used to log the message.
        Returns:
        this
        See Also:
        Level
      • onIteration

        public SupplierWaiter onIteration​(Runnable runnable)
        Description copied from interface: Waiter
        Sets waiters execution for each iteration.
        Specified by:
        onIteration in interface Waiter
        Parameters:
        runnable - code to be executed upon successful waiting.
        Returns:
        this
      • onSuccess

        public SupplierWaiter onSuccess​(Runnable runnable)
        Description copied from interface: Waiter
        Sets waiters successful awaiting execution.
        Specified by:
        onSuccess in interface Waiter
        Parameters:
        runnable - code to be executed upon successful waiting.
        Returns:
        this
      • onFailure

        public SupplierWaiter onFailure​(Runnable runnable)
        Description copied from interface: Waiter
        Sets waiters failed awaiting execution.
        Specified by:
        onFailure in interface Waiter
        Parameters:
        runnable - code to be executed upon failed waiting.
        Returns:
        this
      • onTimeout

        public SupplierWaiter onTimeout​(Runnable runnable)
        Description copied from interface: Waiter
        Sets waiters timed out awaiting execution.
        Specified by:
        onTimeout in interface Waiter
        Parameters:
        runnable - code to be executed upon timed out waiting.
        Returns:
        this
      • failFast

        public SupplierWaiter failFast​(FailFastCheck failFast)
        Description copied from interface: Waiter
        Sets waiters fail fast function that indicates (returns true) if there is an error state and waiting should not proceed.
        Specified by:
        failFast in interface Waiter
        Parameters:
        failFast - returns true if waiting has failed.
        Returns:
        this
      • waitFor

        public boolean waitFor()
        Description copied from interface: Waiter
        Waits till condition is met.
        Specified by:
        waitFor in interface Waiter
        Returns:
        true if wanted condition was met, false if unwanted state condition was met