Package org.awaitility.pollinterval
Class FixedPollInterval
- java.lang.Object
-
- org.awaitility.pollinterval.FixedPollInterval
-
- All Implemented Interfaces:
PollInterval
public class FixedPollInterval extends java.lang.Object implements PollInterval
Generates a fixed (linear) poll interval based on the supplied duration
-
-
Field Summary
Fields Modifier and Type Field Description private java.time.Durationduration
-
Constructor Summary
Constructors Constructor Description FixedPollInterval(long pollInterval, java.util.concurrent.TimeUnit unit)Create a new instance of theFixedPollInterval.FixedPollInterval(java.time.Duration duration)Create a new instance of theFixedPollInterval.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)static FixedPollIntervalfixed(long pollInterval, java.util.concurrent.TimeUnit unit)Syntactic sugar for create a new instance ofFixedPollInterval.static FixedPollIntervalfixed(java.time.Duration duration)Syntactic sugar for create a new instance ofFixedPollInterval.inthashCode()java.time.Durationnext(int pollCount, java.time.Duration previousDuration)Generate the next durationjava.lang.StringtoString()
-
-
-
Constructor Detail
-
FixedPollInterval
public FixedPollInterval(java.time.Duration duration)
Create a new instance of theFixedPollInterval.- Parameters:
duration- The duration of the poll interval
-
FixedPollInterval
public FixedPollInterval(long pollInterval, java.util.concurrent.TimeUnit unit)Create a new instance of theFixedPollInterval.- Parameters:
pollInterval- The poll interval amountunit- The time unit
-
-
Method Detail
-
next
public java.time.Duration next(int pollCount, java.time.Duration previousDuration)Generate the next duration- Specified by:
nextin interfacePollInterval- 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(java.time.Duration duration)
Syntactic sugar for create a new instance ofFixedPollInterval.- Parameters:
duration- The duration of the poll interval- Returns:
- A new instance of
FixedPollInterval
-
fixed
public static FixedPollInterval fixed(long pollInterval, java.util.concurrent.TimeUnit unit)
Syntactic sugar for create a new instance ofFixedPollInterval.- Parameters:
pollInterval- The poll interval amountunit- The chrono unit- Returns:
- A new instance of
FixedPollInterval
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-