diff options
author | Keuin <[email protected]> | 2021-02-15 17:52:53 +0800 |
---|---|---|
committer | Keuin <[email protected]> | 2021-02-15 17:52:53 +0800 |
commit | 6d6f0b486ac42b6bd69ddb8862ee3af7b819f3a7 (patch) | |
tree | ce01c3a18b7e90af6204ff0db90a606eade81778 /src/main/java/com/keuin/kbackupfabric/KBConfiguration.java | |
parent | 68b102c763b0d0b21fb71575f1238d3cc879f959 (diff) |
Add tests.
Implementing auto backup and configuration (not finished)
Diffstat (limited to 'src/main/java/com/keuin/kbackupfabric/KBConfiguration.java')
-rw-r--r-- | src/main/java/com/keuin/kbackupfabric/KBConfiguration.java | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/main/java/com/keuin/kbackupfabric/KBConfiguration.java b/src/main/java/com/keuin/kbackupfabric/KBConfiguration.java new file mode 100644 index 0000000..3744430 --- /dev/null +++ b/src/main/java/com/keuin/kbackupfabric/KBConfiguration.java @@ -0,0 +1,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; + } +} |