summaryrefslogtreecommitdiffstats
path: root/node-maintainer/src/main/java/com/yahoo/vespa/hosted/node/verification/commons/parser/ParseResult.java
blob: 130cdba86aa2af18f565ca1c50e1cc61d23c7ef5 (plain) (blame)
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
package com.yahoo.vespa.hosted.node.verification.commons.parser;

import java.util.Objects;

/**
 * Created by sgrostad on 17/07/2017.
 */
public class ParseResult {

    private final String searchWord;
    private final String value;

    public ParseResult(String searchWord, String value) {
        this.searchWord = searchWord;
        this.value = value;
    }

    public String getSearchWord() {
        return searchWord;
    }

    public String getValue() {
        return value;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj) return true;
        if (obj instanceof ParseResult) {
            ParseResult parseResult = (ParseResult) obj;
            if (this.searchWord.equals(parseResult.getSearchWord()) && this.value.equals(parseResult.getValue())) {
                return true;
            }
        }
        return false;
    }

    @Override
    public int hashCode() {
        return Objects.hash(searchWord, value);
    }

    @Override
    public String toString() {
        return "Search word: " + searchWord + ", Value: " + value;
    }

}