2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
6 * Copyright © 2017-2018 Amdocs
7 * ================================================================================
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19 * ============LICENSE_END=========================================================
22 package org.onap.aai.sparky.search.entity;
24 import java.util.ArrayList;
25 import java.util.List;
27 import org.onap.aai.sparky.common.search.CommonSearchSuggestion;
29 public class MockSearchResponse {
30 private long processingTimeInMs;
31 private int totalFound;
33 private List<CommonSearchSuggestion> suggestions;
36 * Instantiates a new search response.
38 public MockSearchResponse() {
39 this.suggestions = new ArrayList<CommonSearchSuggestion>();
40 this.processingTimeInMs = 0;
44 public long getProcessingTimeInMs() {
45 return processingTimeInMs;
48 public void setProcessingTimeInMs(long processingTimeInMs) {
49 this.processingTimeInMs = processingTimeInMs;
52 public int getTotalFound() {
56 public void setTotalFound(int totalFound) {
57 this.totalFound = totalFound;
60 public List<CommonSearchSuggestion> getSuggestions() {
64 public void setSuggestions(List<CommonSearchSuggestion> suggestions) {
65 this.suggestions = suggestions;
69 * Adds the entity entry.
71 * @param suggestionEntry that will be converted to JSON
73 public void addSuggestion(CommonSearchSuggestion suggestionEntity){
74 suggestions.add(suggestionEntity);
78 * Increments the total number of hits for this SearchResponse by
79 * the value passed in.
81 * @param additionalCount - Count to increment the total found
83 public void addToTotalFound(int additionalCount) {
84 totalFound += additionalCount;
88 public String toString() {
89 return "DummySearchResponse [processingTimeInMs=" + processingTimeInMs + ", totalFound="
90 + totalFound + ", suggestions=" + suggestions + "]";