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