aboutsummaryrefslogtreecommitdiff
path: root/src/cz/crcs/ectester/reader/test/Result.java
blob: c6439ef71b355fc7007742f7455ceaa16baba087 (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
package cz.crcs.ectester.reader.test;

/**
 * @author Jan Jancar johny@neuromancer.sk
 */
public class Result {

    private Value value;
    private String cause;

    public Result(Value value) {
        this.value = value;
    }

    public Result(Value value, String cause) {
        this(value);
        this.cause = cause;
    }

    public Value getValue() {
        return value;
    }

    public String getCause() {
        return cause;
    }

    public enum Value {
        SUCCESS,
        FAILURE,
        ANY
    }

    public boolean compareTo(Result other) {
        if (other == null) {
            return false;
        }
        return value == other.value;
    }

    public boolean compareTo(Value other) {
        if (other == null) {
            return false;
        }
        return value == other;
    }
}