1 package com.atlassian.sal.api.search;
2
3 import com.atlassian.sal.api.message.Message;
4
5 import java.util.List;
6 import java.util.ArrayList;
7 import java.util.Collections;
8
9
10
11
12
13
14
15 public class SearchResults
16 {
17 private final List<Message> errors = new ArrayList<Message>();
18 private final List<SearchMatch> matches = new ArrayList<SearchMatch>();
19 private final long searchTime;
20 private final int totalResults;
21
22
23
24
25
26
27 public SearchResults(List<Message> errors)
28 {
29 this.errors
30 .addAll(errors);
31 searchTime = 0L;
32 totalResults = 0;
33 }
34
35
36
37
38
39
40
41
42 public SearchResults(List<SearchMatch> matches, int totalResults, long searchTime)
43 {
44 this.totalResults = totalResults;
45 this.matches
46 .addAll(matches);
47 this.searchTime = searchTime;
48 }
49
50
51
52
53 public List<Message> getErrors()
54 {
55 return Collections.unmodifiableList(errors);
56 }
57
58
59
60
61 public List<SearchMatch> getMatches()
62 {
63 return Collections.unmodifiableList(matches);
64 }
65
66
67
68
69 public long getSearchTime()
70 {
71 return searchTime;
72 }
73
74
75
76
77 public int getTotalResults()
78 {
79 return totalResults;
80 }
81 }