Project

General

Profile

1
package eu.dnetlib.clients.index.client.response;
2

    
3
import java.util.List;
4
import javax.xml.bind.annotation.XmlRootElement;
5

    
6
import eu.dnetlib.clients.index.query.QueryResponseParser;
7

    
8
@XmlRootElement
9
public class LookupResponse {
10

    
11
	private long total;
12
	private long from;
13
	private long to;
14
	private List<String> records;
15

    
16
	public LookupResponse() {
17
	}
18

    
19
	public LookupResponse(final QueryResponseParser parser) {
20
		this.total = parser.getNumFound();
21
		this.from = parser.getStart();
22
		this.to = parser.getStart() + parser.getResults().size();
23
		this.records = parser.getResults();
24

    
25
	}
26

    
27
	public LookupResponse(final long total, final long from, final long to, final List<String> records) {
28
		this.total = total;
29
		this.from = from;
30
		this.to = to;
31
		this.records = records;
32
	}
33

    
34
	public long getTotal() {
35
		return total;
36
	}
37

    
38
	public void setTotal(final long total) {
39
		this.total = total;
40
	}
41

    
42
	public long getFrom() {
43
		return from;
44
	}
45

    
46
	public void setFrom(final long from) {
47
		this.from = from;
48
	}
49

    
50
	public long getTo() {
51
		return to;
52
	}
53

    
54
	public void setTo(final long to) {
55
		this.to = to;
56
	}
57

    
58
	public List<String> getRecords() {
59
		return records;
60
	}
61

    
62
	public void setRecords(final List<String> records) {
63
		this.records = records;
64
	}
65

    
66
}
(3-3/3)