summaryrefslogtreecommitdiff
path: root/src/main/java/com/keuin/kbackupfabric/ui/BackupInfo.java
blob: cf537f96bcb6fcf92e56aa2f6b06dc5869cd8b2b (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
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();
}