Refactoring Consolidation Service
[sdc.git] / catalog-dao / src / main / java / org / openecomp / sdc / be / dao / model / FacetedSearchResult.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * SDC
4  * ================================================================================
5  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6  * ================================================================================
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  * ============LICENSE_END=========================================================
19  */
20
21 package org.openecomp.sdc.be.dao.model;
22
23 import java.util.HashMap;
24 import java.util.Map;
25
26 /**
27  * Contains results for a search query.
28  * 
29  */
30
31 @SuppressWarnings("PMD.UnusedPrivateField")
32 public class FacetedSearchResult extends GetMultipleDataResult {
33         private static final long serialVersionUID = 1L;
34
35         private Map<String, FacetedSearchFacet[]> facets;
36
37         /**
38          * Argument constructor.
39          * 
40          * @param from
41          *            The start index of the returned elements.
42          * @param to
43          *            The end index of the returned elements.
44          * @param queryDuration
45          *            The duration of the query.
46          * @param totalResults
47          *            The total results for this query.
48          * @param types
49          *            The types of data found.
50          * @param data
51          *            The found data.
52          * @param hashMap
53          *            The facets if any for the query.
54          */
55         public FacetedSearchResult(final int from, final int to, final long queryDuration, final long totalResults,
56                         final String[] types, final Object[] data, final HashMap<String, FacetedSearchFacet[]> hashMap) {
57                 super(types, data, queryDuration, totalResults, from, to);
58                 this.facets = hashMap;
59         }
60
61         public Map<String, FacetedSearchFacet[]> getFacets() {
62                 return facets;
63         }
64
65         public void setFacets(Map<String, FacetedSearchFacet[]> facets) {
66                 this.facets = facets;
67         }
68
69         public FacetedSearchResult() {
70         }
71
72 }