package net.knarcraft.blacksmith.formatting; /** * The important intervals when not using exact wait times */ public enum TimeInterval { /** * Less than 10 seconds left */ INTERVAL_LESS_THAN_10_SECONDS("in just a moment", 10), /** * Less than 30 seconds left */ INTERVAL_LESS_THAN_30_SECONDS("in a little while", 30), /** * Less than 1 minute left */ INTERVAL_LESS_THAN_1_MINUTE("in a while", 60), /** * Less than 5 minutes left */ INTERVAL_LESS_THAN_5_MINUTES("after some time", 300), /** * More than 5 minutes left */ INTERVAL_MORE_THAN_5_MINUTES("in quite a while", Integer.MAX_VALUE); private final String defaultText; private final int maxSeconds; /** * Instantiates a new time interval * * @param defaultText
The default text used to describe the time interval
* @param maxSecondsThe maximum number of seconds to fall within this interval
*/ TimeInterval(String defaultText, int maxSeconds) { this.defaultText = defaultText; this.maxSeconds = maxSeconds; } /** * Gets the default text to display for this interval * * @returnThe default text to display for this interval
*/ public String getDefaultText() { return this.defaultText; } /** * Gets the maximum number of seconds before exceeding this interval * * @returnThe max seconds of this interval
*/ public int getIntervalMax() { return maxSeconds; } }