Interface WaitForConditionWaitStrategy<T>

Type Parameters:
T - the type of state being polled
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface WaitForConditionWaitStrategy<T>
Strategy that computes the delay before the next polling attempt in a waitForCondition operation.

Implementations evaluate the current state and attempt number to compute a Duration delay. The continue/stop decision is handled separately by WaitForConditionResult. When the maximum number of attempts is exceeded, the strategy should throw a WaitForConditionFailedException.

See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    evaluate(T state, int attempt)
    Computes the delay before the next polling attempt based on the current state and attempt number.
  • Method Details

    • evaluate

      Duration evaluate(T state, int attempt)
      Computes the delay before the next polling attempt based on the current state and attempt number.
      Parameters:
      state - the current state returned by the check function
      attempt - the attempt number (1-based)
      Returns:
      a Duration representing the delay before the next polling attempt
      Throws:
      WaitForConditionFailedException - if the maximum number of attempts has been exceeded