summaryrefslogtreecommitdiff
path: root/src/main/java/com/keuin/kbackupfabric/ui/BackupInfo.java
diff options
context:
space:
mode:
authorKeuin <[email protected]>2021-01-25 15:25:34 +0800
committerKeuin <[email protected]>2021-01-25 15:25:34 +0800
commit08ac6aaea58b7309ea95a12ca6227a6ca3ce4db5 (patch)
treed305fc23d2cec9935ccb5e5a5390c9d5e54a8726 /src/main/java/com/keuin/kbackupfabric/ui/BackupInfo.java
parenta817715ad4f625e355b285d67ee323e8b2006ae4 (diff)
Improve user interaction.
Code refactor.
Diffstat (limited to 'src/main/java/com/keuin/kbackupfabric/ui/BackupInfo.java')
-rw-r--r--src/main/java/com/keuin/kbackupfabric/ui/BackupInfo.java34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/main/java/com/keuin/kbackupfabric/ui/BackupInfo.java b/src/main/java/com/keuin/kbackupfabric/ui/BackupInfo.java
new file mode 100644
index 0000000..cf537f9
--- /dev/null
+++ b/src/main/java/com/keuin/kbackupfabric/ui/BackupInfo.java
@@ -0,0 +1,34 @@
+package com.keuin.kbackupfabric.ui;
+
+import com.keuin.kbackupfabric.operation.backup.method.ConfiguredBackupMethod;
+import com.keuin.kbackupfabric.util.DateUtil;
+import net.minecraft.server.MinecraftServer;
+
+import java.time.LocalDateTime;
+
+/**
+ * Used in UI part. Holds necessary information for displaying a backup.
+ */
+public interface BackupInfo {
+ String getName();
+
+ LocalDateTime getCreationTime();
+
+ long getSizeBytes();
+
+ String getType();
+
+ default String getCanonicalName() {
+ return getName() + "-" + DateUtil.getString(getCreationTime());
+ }
+
+ ConfiguredBackupMethod createConfiguredBackupMethod(MinecraftServer server);
+
+ /**
+ * This is depreciated. But eliminating all usages needs to refactor the UI code.
+ *
+ * @return the backup file name.
+ */
+ @Deprecated
+ String getBackupFileName();
+} \ No newline at end of file