Project

General

Profile

Download (981 Bytes) 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
import java.util.HashSet;
12
import java.util.Set;
13

    
14
/**
15
 * @author pplitzner
16
 * @since Jan 23, 2019
17
 *
18
 */
19
public class SearchResult {
20

    
21
    private Set<String> facets = new HashSet<>();
22
    private Object content;
23

    
24
    public SearchResult(Object content) {
25
        super();
26
        this.content = content;
27
        initFacets(content);
28
    }
29

    
30
    private void initFacets(Object content){
31
        facets.add(content.toString().substring(0, 3));
32
    }
33

    
34
    public boolean hasFacet(String facet){
35
        return facets.contains(facet);
36
    }
37

    
38
    public Object getContent() {
39
        return content;
40
    }
41

    
42
    public Set<String> getFacets() {
43
        return facets;
44
    }
45

    
46
}
(3-3/8)