Project

General

Profile

1
package eu.dnetlib.rmi.provision;
2

    
3
import javax.xml.bind.annotation.XmlAttribute;
4
import javax.xml.bind.annotation.XmlRootElement;
5

    
6
/**
7
 * <pre>
8
 * {@code
9
 * <groupresult field="facetFieldName">
10
 * 	<value>facetFieldValue</value>
11
 * 	<count>1</count>
12
 * </groupresult>
13
 * }
14
 * </pre>
15
 *
16
 * @author claudio
17
 */
18
@XmlRootElement(namespace = "", name = "groupresult")
19
public class GroupResult {
20

    
21
	private String name;
22

    
23
	private String value;
24

    
25
	private int count;
26

    
27
	public GroupResult() {
28
	}
29

    
30
	/**
31
	 * Builds a groupResult.
32
	 *
33
	 * @param name
34
	 * @param value
35
	 * @param count
36
	 */
37
	public GroupResult(final String name, final String value, final int count) {
38
		this.name = name;
39
		this.value = value;
40
		this.count = count;
41
	}
42

    
43
	@Override
44
	public boolean equals(final Object obj) {
45
		if (!(obj instanceof GroupResult)) return false;
46
		final GroupResult g = (GroupResult) obj;
47
		if ((this.getCount() == g.getCount()) && this.getName().equals(g.getName()) && this.getValue().equals(g.getValue())) return true;
48
		return false;
49
	}
50

    
51
	@XmlAttribute(name = "field", required = true)
52
	public String getName() {
53
		return name;
54
	}
55

    
56
	public void setName(final String name) {
57
		this.name = name;
58
	}
59

    
60
	public String getValue() {
61
		return value;
62
	}
63

    
64
	public void setValue(final String value) {
65
		this.value = value;
66
	}
67

    
68
	public int getCount() {
69
		return count;
70
	}
71

    
72
	public void setCount(final int count) {
73
		this.count = count;
74
	}
75

    
76
}
(2-2/8)