Project

General

Profile

1
package eu.dnetlib.domain.data;
2

    
3
import java.util.Collection;
4
import java.util.List;
5

    
6
/**
7
 * 
8
 * @author kiatrop
9
 *
10
 */
11

    
12
/**
13
 * Contains the results of a query together with 
14
 * information about the returned locale,
15
 * the total number of records , the current page, the page size  
16
 */
17
public class SearchResult {
18
	//the cql query
19
	private String query;	
20
	//the locale
21
	private String locale;	
22
	//the total number of records in the index
23
	//for the given query
24
	private int total;
25
	//the current page of results
26
	private int page;
27
	//the current number of records in the current page
28
	private int size;
29
	//refine fields
30
	private Collection<String> fields;
31
	
32
	//search results in xml
33
	private List<String> searchResults;
34
	
35
	//refine - browse results in xml
36
	private List<String> browseResults;
37
	
38
	public SearchResult() {
39
	}
40
	
41
	public SearchResult(String query, String locale, int total, 
42
			int page, int size, List<String> searchResults) {
43
		this(query, locale, total, page, size, searchResults, null, null);
44
	}
45
	
46
	public SearchResult(String query, String locale, Collection<String> fields,
47
			List<String> browseResults) {
48
		this(query, locale, 0, 0, 0, null, browseResults, fields);
49
	}
50
	
51
	public SearchResult(String query, String locale, int total, int page, int size, 
52
			List<String> searchResults, List<String> browseResults,  Collection<String> fields) {
53
		this.query = query;
54
		this.locale = locale;
55
		this.total = total;
56
		this.page = page;
57
		this.size = size;
58
		this.fields = fields;
59
		
60
		this.searchResults = searchResults;
61
		this.browseResults = browseResults;
62
	}
63

    
64
	public String getQuery() {
65
		return query;
66
	}
67

    
68
	public void setQuery(String query) {
69
		this.query = query;
70
	}
71

    
72
	public String getLocale() {
73
		return locale;
74
	}
75

    
76
	public void setLocale(String locale) {
77
		this.locale = locale;
78
	}
79

    
80
	public int getTotal() {
81
		return total;
82
	}
83

    
84
	public void setTotal(int total) {
85
		this.total = total;
86
	}
87

    
88
	public int getPage() {
89
		return page;
90
	}
91

    
92
	public void setPage(int page) {
93
		this.page = page;
94
	}
95

    
96
	public int getSize() {
97
		return size;
98
	}
99

    
100
	public void setSize(int size) {
101
		this.size = size;
102
	}
103

    
104
	public Collection<String> getFields() {
105
		return fields;
106
	}
107

    
108
	public void setFields(Collection<String> fields) {
109
		this.fields = fields;
110
	}
111

    
112
	public List<String> getSearchResults() {
113
		return searchResults;
114
	}
115

    
116
	public void setSearchResults(List<String> searchResults) {
117
		this.searchResults = searchResults;
118
	}
119

    
120
	public List<String> getBrowseResults() {
121
		return browseResults;
122
	}
123

    
124
	public void setBrowseResults(List<String> browseResults) {
125
		this.browseResults = browseResults;
126
	}
127
}
(19-19/23)