1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package nl.hippo.client.webdav.binding.facets;
17
18 import nl.hippo.client.api.content.FacetValue;
19
20 import org.apache.commons.lang.builder.EqualsBuilder;
21 import org.apache.commons.lang.builder.HashCodeBuilder;
22 import org.apache.commons.lang.builder.ToStringBuilder;
23 import org.apache.commons.lang.builder.ToStringStyle;
24
25 public class FacetValueImpl implements FacetValue {
26
27 private String value;
28 private int hits;
29
30 private FacetValueImpl() {
31 }
32
33 public String getValue() {
34 return value;
35 }
36
37 public int getHits() {
38 return hits;
39 }
40
41 public String toString() {
42 ToStringBuilder builder = new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).append("Value", value)
43 .append("Hits", hits);
44 return builder.toString();
45 }
46
47 public boolean equals(Object obj) {
48 if (obj instanceof FacetValueImpl == false) {
49 return false;
50 }
51 if (this == obj) {
52 return true;
53 }
54 FacetValueImpl rhs = (FacetValueImpl) obj;
55 return new EqualsBuilder().append(value, rhs.value).append(hits, rhs.hits).isEquals();
56 }
57
58 public int hashCode() {
59 return new HashCodeBuilder(83, 7).append(value).append(hits).toHashCode();
60 }
61
62 }