summaryrefslogtreecommitdiff
path: root/src/main/java/com/keuin/kbackupfabric/KBConfiguration.java
blob: 54b43482dd178c399baf2d71a87505e96c688ca0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package com.keuin.kbackupfabric;

/**
 * Global plugin configuration.
 */
public class KBConfiguration {
    // auto backup interval in seconds. Set this to a negative value to disable auto backup.
    private final int autoBackupIntervalSeconds;
    // name of backup created automatically. By default, it is `auto-backup`
    private final String autoBackupName;
    // if no player has logged in since previous backup, we skip this backup
    private final boolean skipAutoBackupIfNoPlayerLoggedIn;

    public KBConfiguration() {
        autoBackupIntervalSeconds = -1; // disabled by default
        autoBackupName = "auto-backup";
        skipAutoBackupIfNoPlayerLoggedIn = false;
    }

    public KBConfiguration(int autoBackupIntervalSeconds, String autoBackupName, boolean skipAutoBackupIfNoPlayerLoggedIn) {
        this.autoBackupIntervalSeconds = autoBackupIntervalSeconds;
        this.autoBackupName = autoBackupName;
        this.skipAutoBackupIfNoPlayerLoggedIn = skipAutoBackupIfNoPlayerLoggedIn;
    }

    public int getAutoBackupIntervalSeconds() {
        return autoBackupIntervalSeconds;
    }

    public String getAutoBackupName() {
        return autoBackupName;
    }
}