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