diff options
Diffstat (limited to 'src/main/java/com/keuin/kbackupfabric/ui/BackupInfo.java')
-rw-r--r-- | src/main/java/com/keuin/kbackupfabric/ui/BackupInfo.java | 34 |
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 |