|
1 |
| package photospace.meta; |
|
2 |
| |
|
3 |
| import org.apache.commons.lang.builder.*; |
|
4 |
| |
|
5 |
| public class SearchResult |
|
6 |
| extends CollectionMeta |
|
7 |
| { |
|
8 |
| private String query; |
|
9 |
| private long duration; |
|
10 |
| |
|
11 |
0
| public String toString()
|
|
12 |
| { |
|
13 |
0
| return "Search[" + query + ", " + getTotal() + " results]";
|
|
14 |
| } |
|
15 |
| |
|
16 |
0
| public String getQuery()
|
|
17 |
| { |
|
18 |
0
| return query;
|
|
19 |
| } |
|
20 |
| |
|
21 |
30
| public void setQuery(String query)
|
|
22 |
| { |
|
23 |
30
| this.query = query;
|
|
24 |
| } |
|
25 |
| |
|
26 |
0
| public boolean equals(Object o)
|
|
27 |
| { |
|
28 |
0
| if (! (o instanceof SearchResult)) return false;
|
|
29 |
0
| SearchResult search = (SearchResult) o;
|
|
30 |
| |
|
31 |
0
| return new EqualsBuilder()
|
|
32 |
| .append(query, search.getQuery()) |
|
33 |
| .isEquals(); |
|
34 |
| |
|
35 |
| } |
|
36 |
| |
|
37 |
0
| public int hashCode()
|
|
38 |
| { |
|
39 |
0
| return new HashCodeBuilder()
|
|
40 |
| .append(query) |
|
41 |
| .toHashCode(); |
|
42 |
| } |
|
43 |
| |
|
44 |
0
| public long getDuration()
|
|
45 |
| { |
|
46 |
0
| return duration;
|
|
47 |
| } |
|
48 |
| |
|
49 |
17
| public void setDuration(long duration)
|
|
50 |
| { |
|
51 |
17
| this.duration = duration;
|
|
52 |
| } |
|
53 |
| } |