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.facet.occurrence;
|
10
|
|
11
|
import java.util.HashSet;
|
12
|
import java.util.Set;
|
13
|
|
14
|
import eu.etaxonomy.cdm.api.service.dto.PreservedSpecimenDTO;
|
15
|
import eu.etaxonomy.taxeditor.view.search.facet.Facet;
|
16
|
import eu.etaxonomy.taxeditor.view.search.facet.SearchResult;
|
17
|
|
18
|
/**
|
19
|
* @author pplitzner
|
20
|
* @since Jan 24, 2019
|
21
|
*
|
22
|
*/
|
23
|
public class OccurrenceSearchResult extends SearchResult<PreservedSpecimenDTO> {
|
24
|
|
25
|
public OccurrenceSearchResult(PreservedSpecimenDTO content) {
|
26
|
super(content);
|
27
|
}
|
28
|
|
29
|
@Override
|
30
|
protected Set<Facet> initFacets(PreservedSpecimenDTO content) {
|
31
|
Set<Facet> facets = new HashSet<>();
|
32
|
content.getAssociatedTaxa().forEach(pair->facets.add(new Facet(pair.getValue(), content.getKindOfUnit())));
|
33
|
return facets;
|
34
|
}
|
35
|
|
36
|
}
|