public class FixedPollInterval extends Object implements PollInterval
Constructor and Description |
---|
FixedPollInterval(Duration duration)
Create a new instance of the
FixedPollInterval . |
FixedPollInterval(long pollInterval,
TimeUnit unit)
Create a new instance of the
FixedPollInterval . |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
static FixedPollInterval |
fixed(Duration duration)
Syntactic sugar for create a new instance of
FixedPollInterval . |
static FixedPollInterval |
fixed(long pollInterval,
TimeUnit unit)
Syntactic sugar for create a new instance of
FixedPollInterval . |
int |
hashCode() |
Duration |
next(int pollCount,
Duration previousDuration)
Generate the next duration
|
String |
toString() |
public FixedPollInterval(Duration duration)
FixedPollInterval
.duration
- The duration of the poll intervalpublic FixedPollInterval(long pollInterval, TimeUnit unit)
FixedPollInterval
.pollInterval
- The poll interval amountunit
- The time unitpublic Duration next(int pollCount, Duration previousDuration)
next
in interface PollInterval
pollCount
- The number of times the condition has been polled (evaluated)previousDuration
- The duration of the previously returned poll intervalFixedPollInterval
public static FixedPollInterval fixed(Duration duration)
FixedPollInterval
.duration
- The duration of the poll intervalFixedPollInterval
public static FixedPollInterval fixed(long pollInterval, TimeUnit unit)
FixedPollInterval
.pollInterval
- The poll interval amountunit
- The time unitFixedPollInterval
Copyright © 2010–2015. All rights reserved.