net.thucydides.core.scheduling.TimeSchedule Maven / Gradle / Ivy
package net.thucydides.core.scheduling;
import java.util.concurrent.TimeUnit;
public abstract class TimeSchedule {
protected final ThucydidesFluentWait fluentWait;
private final int amount;
public TimeSchedule(ThucydidesFluentWait fluentWait, int amount) {
this.fluentWait = fluentWait;
this.amount = amount;
}
abstract protected ThucydidesFluentWait updateWaitBy(int amount, TimeUnit unit);
public ThucydidesFluentWait milliseconds() {
return updateWaitBy(amount, TimeUnit.MILLISECONDS);
}
public ThucydidesFluentWait second() {
return updateWaitBy(amount, TimeUnit.SECONDS);
}
public ThucydidesFluentWait seconds() {
return updateWaitBy(amount, TimeUnit.SECONDS);
}
public ThucydidesFluentWait minute() {
return updateWaitBy(amount, TimeUnit.MINUTES);
}
public ThucydidesFluentWait minutes() {
return updateWaitBy(amount, TimeUnit.MINUTES);
}
public ThucydidesFluentWait hour() {
return updateWaitBy(amount, TimeUnit.HOURS);
}
public ThucydidesFluentWait hours() {
return updateWaitBy(amount, TimeUnit.HOURS);
}
}