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

import java.util.Objects;

public abstract class SuccessBackupFeedback implements BackupFeedback {

    private final String message;

    public SuccessBackupFeedback(String successMessage) {
        this.message = Objects.requireNonNull(successMessage);
    }

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

    @Override
    public String getFeedback() {
        return message;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        SuccessBackupFeedback that = (SuccessBackupFeedback) o;
        return message.equals(that.message);
    }

    @Override
    public int hashCode() {
        return Objects.hash(message);
    }
}