1 | |
package org.apache.maven.index; |
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
|
17 | |
|
18 | |
|
19 | |
|
20 | |
|
21 | |
|
22 | |
import java.util.Arrays; |
23 | |
import java.util.Comparator; |
24 | |
|
25 | |
import org.apache.lucene.search.Query; |
26 | |
import org.apache.maven.index.context.IndexingContext; |
27 | |
|
28 | |
|
29 | |
|
30 | |
|
31 | |
|
32 | |
|
33 | |
|
34 | |
public class GroupedSearchRequest |
35 | |
extends AbstractSearchRequest |
36 | |
{ |
37 | |
private Grouping grouping; |
38 | |
|
39 | |
private Comparator<String> groupKeyComparator; |
40 | |
|
41 | |
public GroupedSearchRequest( Query query, Grouping grouping ) |
42 | |
{ |
43 | 62 | this( query, grouping, String.CASE_INSENSITIVE_ORDER ); |
44 | 62 | } |
45 | |
|
46 | |
public GroupedSearchRequest( Query query, Grouping grouping, Comparator<String> groupKeyComparator ) |
47 | |
{ |
48 | 63 | this( query, grouping, groupKeyComparator, null ); |
49 | 63 | } |
50 | |
|
51 | |
public GroupedSearchRequest( Query query, Grouping grouping, IndexingContext context ) |
52 | |
{ |
53 | 0 | this( query, grouping, String.CASE_INSENSITIVE_ORDER, context ); |
54 | 0 | } |
55 | |
|
56 | |
public GroupedSearchRequest( Query query, Grouping grouping, Comparator<String> groupKeyComparator, |
57 | |
IndexingContext context ) |
58 | |
{ |
59 | 63 | super( query, context != null ? Arrays.asList( new IndexingContext[] { context } ) : null ); |
60 | |
|
61 | 63 | this.grouping = grouping; |
62 | |
|
63 | 63 | this.groupKeyComparator = groupKeyComparator; |
64 | 63 | } |
65 | |
|
66 | |
public Grouping getGrouping() |
67 | |
{ |
68 | 63 | return grouping; |
69 | |
} |
70 | |
|
71 | |
public void setGrouping( Grouping grouping ) |
72 | |
{ |
73 | 0 | this.grouping = grouping; |
74 | 0 | } |
75 | |
|
76 | |
public Comparator<String> getGroupKeyComparator() |
77 | |
{ |
78 | 63 | return groupKeyComparator; |
79 | |
} |
80 | |
|
81 | |
public void setGroupKeyComparator( Comparator<String> groupKeyComparator ) |
82 | |
{ |
83 | 0 | this.groupKeyComparator = groupKeyComparator; |
84 | 0 | } |
85 | |
} |