mirror of https://github.com/micromata/borgbackup-butler.git

Kai Reinhard
09.32.2018 4ece88750272b3e2fc0bbccec7202d2faa1115b8
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
package de.micromata.borgbutler.json.borg;
 
import com.fasterxml.jackson.annotation.JsonIgnore;
import de.micromata.borgbutler.json.JsonUtils;
import lombok.Getter;
import lombok.Setter;
 
public abstract class RepositoryMatcher {
    @Getter
    protected Repository repository;
    @Getter
    @Setter
    @JsonIgnore
    protected String originalJson;
 
    public String toString() {
        return JsonUtils.toJson(this, true);
    }
 
    public void updateFrom(RepositoryMatcher from) {
        this.repository = from.repository;
        this.originalJson = from.originalJson;
    }
 
    public boolean matches(String identifier) {
        if (repository == null || identifier == null) {
            return false;
        }
        return identifier.equals(repository.getId()) || identifier.equals(repository.getName())
                || identifier.equals(repository.getLocation());
    }
}