Convert Sparky to Spring-Boot
[aai/sparky-be.git] / sparkybe-onap-service / src / test / java / org / onap / aai / sparky / search / entity / MockSearchResponse.java
1 package org.onap.aai.sparky.search.entity;
2
3 import java.util.ArrayList;
4 import java.util.List;
5
6 import org.onap.aai.sparky.common.search.CommonSearchSuggestion;
7
8 public class MockSearchResponse {
9   private long processingTimeInMs;
10   private int totalFound;
11
12   private List<CommonSearchSuggestion> suggestions;
13   
14   /**
15    * Instantiates a new search response.
16    */
17   public MockSearchResponse() {
18     this.suggestions = new ArrayList<CommonSearchSuggestion>();
19     this.processingTimeInMs = 0;
20     this.totalFound = 0;
21   }
22
23   public long getProcessingTimeInMs() {
24     return processingTimeInMs;
25   }
26
27   public void setProcessingTimeInMs(long processingTimeInMs) {
28     this.processingTimeInMs = processingTimeInMs;
29   }
30   
31   public int getTotalFound() {
32     return totalFound;
33   }
34   
35   public void setTotalFound(int totalFound) {
36     this.totalFound = totalFound;
37   }
38
39   public List<CommonSearchSuggestion> getSuggestions() {
40     return suggestions;
41   }
42
43   public void setSuggestions(List<CommonSearchSuggestion> suggestions) {
44     this.suggestions = suggestions;
45   }
46
47   /**
48    * Adds the entity entry.
49    *
50    * @param suggestionEntry that will be converted to JSON
51    */
52   public void addSuggestion(CommonSearchSuggestion suggestionEntity){
53     suggestions.add(suggestionEntity);
54   }
55   
56   /**
57    * Increments the total number of hits for this SearchResponse by
58    *  the value passed in.
59    * 
60    * @param additionalCount - Count to increment the total found
61    */
62   public void addToTotalFound(int additionalCount) {
63     totalFound += additionalCount;
64   }
65
66   @Override
67   public String toString() {
68     return "DummySearchResponse [processingTimeInMs=" + processingTimeInMs + ", totalFound="
69         + totalFound + ", suggestions=" + suggestions + "]";
70   }
71 }