001package fr.aumgn.bukkitutils.timer;
002
003/**
004 * Configuration of a {@link Timer} class.
005 */
006public class TimerConfig {
007
008    /**
009     * Default Config
010     */
011    public static final TimerConfig DEFAULT = new TimerConfig(
012            2 * 60, 20, "%02d:%02d", "Finished");
013
014    private int majorDuration;
015    private int minorDuration;
016    private String format;
017    private String endMessage;
018
019    public TimerConfig(int majorDelay, int minorDelay, String format, String endMessage) {
020        this.majorDuration = majorDelay;
021        this.minorDuration = minorDelay;
022        this.format = format;
023        this.endMessage = endMessage;
024    }
025
026    public int getMajorDuration() {
027        return majorDuration;
028    }
029
030    public TimerConfig setMajorDelay(int majorDelay) {
031        this.majorDuration = majorDelay;
032        return this;
033    }
034
035    public int getMinorDuration() {
036        return minorDuration;
037    }
038
039    public TimerConfig setMinorDelay(int minorDelay) {
040        this.minorDuration = minorDelay;
041        return this;
042    }
043
044    public String getFormat() {
045        return format;
046    }
047
048    public TimerConfig setFormat(String format) {
049        this.format = format;
050        return this;
051    }
052
053    public String getEndMessage() {
054        return endMessage;
055    }
056
057    public TimerConfig setEndMessage(String msg) {
058        this.endMessage = msg;
059        return this;
060    }
061}