1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/**
* $RCSfile$
* $Revision$
* $Date$
*
* Copyright (C) 2004 Jive Software. All rights reserved.
*
* This software is published under the terms of the GNU Public License (GPL),
* a copy of which is included in this distribution.
*/
package org.jivesoftware.messenger.container;
import java.io.Serializable;
/**
* Used to return multiple service matches.
*
* @author Iain Shigeoka
*/
public class ServiceMatches implements Serializable {
/**
* The items that matched.
*/
public ServiceItem[] items;
/**
* The total number of items that matched
*/
public int totalMatches;
/**
* Serializable id. Increment whenever class signature changes.
*/
private static final long serialVersionUID = 1;
/**
* Create an empty match result.
*/
public ServiceMatches() {
items = new ServiceItem[]{
};
totalMatches = 0;
}
/**
* Create a match result with predefined settings.
*
* @param itemList the items found.
* @param matchCount the number of matches found.
*/
public ServiceMatches(ServiceItem[] itemList, int matchCount) {
if (itemList == null) {
items = new ServiceItem[]{};
totalMatches = 0;
}
else {
items = itemList;
}
this.totalMatches = matchCount;
}
}