summaryrefslogtreecommitdiff
path: root/src/main/java/com/keuin/kbackupfabric/operation/backup/feedback/IncrementalBackupFeedback.java
blob: f39fde621227015ac51293d93b9be872be8cac85 (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
package com.keuin.kbackupfabric.operation.backup.feedback;

public class IncrementalBackupFeedback implements BackupFeedback {
    private final boolean success;
    private final int newFilesAdded;

    public IncrementalBackupFeedback(boolean success, int newFilesAdded) {
        this.success = success;
        this.newFilesAdded = newFilesAdded;
    }

    @Override
    public boolean isSuccess() {
        return success;
    }

    public long getNewFilesAdded() {
        return newFilesAdded;
    }

    @Override
    public String getFeedback() {
        if (success && newFilesAdded >= 0)
            return String.format("File(s) added: %d.", newFilesAdded);
        else
            return "";
    }
}