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 this( query, grouping, String.CASE_INSENSITIVE_ORDER );
44 }
45
46 public GroupedSearchRequest( Query query, Grouping grouping, Comparator<String> groupKeyComparator )
47 {
48 this( query, grouping, groupKeyComparator, null );
49 }
50
51 public GroupedSearchRequest( Query query, Grouping grouping, IndexingContext context )
52 {
53 this( query, grouping, String.CASE_INSENSITIVE_ORDER, context );
54 }
55
56 public GroupedSearchRequest( Query query, Grouping grouping, Comparator<String> groupKeyComparator,
57 IndexingContext context )
58 {
59 super( query, context != null ? Arrays.asList( new IndexingContext[] { context } ) : null );
60
61 this.grouping = grouping;
62
63 this.groupKeyComparator = groupKeyComparator;
64 }
65
66 public Grouping getGrouping()
67 {
68 return grouping;
69 }
70
71 public void setGrouping( Grouping grouping )
72 {
73 this.grouping = grouping;
74 }
75
76 public Comparator<String> getGroupKeyComparator()
77 {
78 return groupKeyComparator;
79 }
80
81 public void setGroupKeyComparator( Comparator<String> groupKeyComparator )
82 {
83 this.groupKeyComparator = groupKeyComparator;
84 }
85 }