Class WaitHelper


  • public class WaitHelper
    extends Object
    Convenience class to waitForResult for an event to occur.
    • Constructor Detail

      • WaitHelper

        public WaitHelper()
    • Method Detail

      • waitForResult

        public static boolean waitForResult​(WaitHelper.ResultHolder resultHolder)
        Wait for result set to true by another thread in resultHolder. Default timeout 1000ms.
        Parameters:
        resultHolder - holder of a boolean result - wait for value "true"
        Returns:
        true if value was set during timeout
      • waitForResult

        public static boolean waitForResult​(WaitHelper.ResultHolder resultHolder,
                                            int timeout)
        Wait for result set to true by another thread in resultHolder.
        Parameters:
        resultHolder - holder of a boolean result - wait for value "true"
        timeout - how long to wait
        Returns:
        true if value was set during timeout
      • waitForCommand

        public static boolean waitForCommand​(WaitHelper.Command command)
        Wait for custom command to return true. Default timeout 1000ms.
        Parameters:
        command - wait for "true"
        Returns:
        true if command returned true during command
      • waitForCommand

        public static boolean waitForCommand​(WaitHelper.Command command,
                                             int timeout)
        Wait for custom command to return true. Default timeout 1000ms.
        Parameters:
        command - wait for return "true" value
        Returns:
        true if command returned true during command