Project

General

Profile

Download (1.73 KB) Statistics
| Branch: | Tag: | Revision:
1
/**
2
* Copyright (C) 2019 EDIT
3
* European Distributed Institute of Taxonomy
4
* http://www.e-taxonomy.eu
5
*
6
* The contents of this file are subject to the Mozilla Public License Version 1.1
7
* See LICENSE.TXT at the top of this package for the full license terms.
8
*/
9
package eu.etaxonomy.taxeditor.view.search.term;
10

    
11
/**
12
 * @author pplitzner
13
 * @since Jan 24, 2019
14
 *
15
 */
16
public class Facet {
17

    
18
    private String category;
19
    private String facet;
20

    
21
    public Facet(String facet) {
22
        this(facet, null);
23
    }
24

    
25
    public Facet(String facet, String category) {
26
        this.category = category;
27
        this.facet = facet;
28
    }
29

    
30
    public String getCategory() {
31
        return category;
32
    }
33

    
34
    public String getFacet() {
35
        return facet;
36
    }
37

    
38
    @Override
39
    public int hashCode() {
40
        final int prime = 31;
41
        int result = 1;
42
        result = prime * result + ((category == null) ? 0 : category.hashCode());
43
        result = prime * result + ((facet == null) ? 0 : facet.hashCode());
44
        return result;
45
    }
46

    
47
    @Override
48
    public boolean equals(Object obj) {
49
        if (this == obj) {
50
            return true;
51
        }
52
        if (obj == null) {
53
            return false;
54
        }
55
        if (getClass() != obj.getClass()) {
56
            return false;
57
        }
58
        Facet other = (Facet) obj;
59
        if (category == null) {
60
            if (other.category != null) {
61
                return false;
62
            }
63
        } else if (!category.equals(other.category)) {
64
            return false;
65
        }
66
        if (facet == null) {
67
            if (other.facet != null) {
68
                return false;
69
            }
70
        } else if (!facet.equals(other.facet)) {
71
            return false;
72
        }
73
        return true;
74
    }
75

    
76
}
(1-1/9)