All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.thucydides.core.scheduling.TimeSchedule Maven / Gradle / Ivy

There is a newer version: 4.2.8
Show newest version
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);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy