Class FixedPollInterval

java.lang.Object
org.awaitility.pollinterval.FixedPollInterval
All Implemented Interfaces:
PollInterval

public class FixedPollInterval extends Object implements PollInterval
Generates a fixed (linear) poll interval based on the supplied duration
  • Field Details

    • duration

      private final Duration duration
  • Constructor Details

    • FixedPollInterval

      public FixedPollInterval(Duration duration)
      Create a new instance of the FixedPollInterval.
      Parameters:
      duration - The duration of the poll interval
    • FixedPollInterval

      public FixedPollInterval(long pollInterval, TimeUnit unit)
      Create a new instance of the FixedPollInterval.
      Parameters:
      pollInterval - The poll interval amount
      unit - The time unit
  • Method Details

    • next

      public Duration next(int pollCount, Duration previousDuration)
      Generate the next duration
      Specified by:
      next in interface PollInterval
      Parameters:
      pollCount - The number of times the condition has been polled (evaluated)
      previousDuration - The duration of the previously returned poll interval
      Returns:
      Always return the duration that was supplied to this instance of FixedPollInterval
    • fixed

      public static FixedPollInterval fixed(Duration duration)
      Syntactic sugar for create a new instance of FixedPollInterval.
      Parameters:
      duration - The duration of the poll interval
      Returns:
      A new instance of FixedPollInterval
    • fixed

      public static FixedPollInterval fixed(long pollInterval, TimeUnit unit)
      Syntactic sugar for create a new instance of FixedPollInterval.
      Parameters:
      pollInterval - The poll interval amount
      unit - The chrono unit
      Returns:
      A new instance of FixedPollInterval
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object