summaryrefslogtreecommitdiff
path: root/src/main/java/com/keuin/kbackupfabric/backup/incremental/serializer/SavedIncrementalBackup.java
blob: e2e50b6f89b4e78e51f3186e1e103db54b98e860 (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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
package com.keuin.kbackupfabric.backup.incremental.serializer;


import com.keuin.kbackupfabric.backup.incremental.ObjectCollection2;

import java.io.Serializable;
import java.time.ZonedDateTime;

/**
 * The abstraction of an object saved in the disk, containing all information (except binary data of files) about an incremental backup.
 */
public interface SavedIncrementalBackup extends Serializable {

    /**
     * Get an instance with the latest version.
     */
    static SavedIncrementalBackup newLatest(ObjectCollection2 objectCollection2, String backupName, ZonedDateTime backupTime, long totalSizeBytes, long increasedSizeBytes, int filesAdded, int totalFiles) {
        return new SavedIncBackupV1(objectCollection2, backupName, backupTime, totalSizeBytes, increasedSizeBytes, filesAdded, totalFiles);
    }

    /**
     * Get the object collection of the level directory.
     *
     * @return the object collection.
     */
    ObjectCollection2 getObjectCollection();

    /**
     * Get the custom backup name.
     *
     * @return the backup name.
     */
    String getBackupName();

    /**
     * Get the time when this backup was made.
     *
     * @return the time.
     */
    ZonedDateTime getBackupTime();

    /**
     * Get new files added to the base.
     *
     * @return file count.
     */
    int getFilesAdded();

    /**
     * Get the total size of the saved world.
     *
     * @return the size in bytes.
     */
    long getTotalSizeBytes();

    /**
     * Get the size we cost to add this backup into the base.
     *
     * @return the increased size in bytes.
     */
    long getIncreasedSizeBytes();
}