1
14
15 package com.liferay.portal.kernel.cache.cluster;
16
17 import com.liferay.portal.kernel.util.StringBundler;
18 import com.liferay.portal.kernel.util.StringPool;
19 import com.liferay.portal.kernel.util.Validator;
20
21 import java.io.Serializable;
22
23
28 public class PortalCacheClusterEvent implements Serializable {
29
30 public PortalCacheClusterEvent(
31 String cacheName, Serializable elementKey,
32 PortalCacheClusterEventType portalCacheClusterEventType) {
33
34 _cacheName = cacheName;
35 _elementKey = elementKey;
36 _portalCacheClusterEventType = portalCacheClusterEventType;
37 }
38
39 public boolean equals(Object obj) {
40 if (obj == null) {
41 return false;
42 }
43
44 if (!(obj instanceof PortalCacheClusterEvent)) {
45 return false;
46 }
47
48 PortalCacheClusterEvent portalCacheClusterEvent =
49 (PortalCacheClusterEvent)obj;
50
51 if (Validator.equals(_cacheName, portalCacheClusterEvent._cacheName) &&
52 Validator.equals(
53 _elementKey, portalCacheClusterEvent._elementKey) &&
54 Validator.equals(
55 _portalCacheClusterEventType,
56 portalCacheClusterEvent._portalCacheClusterEventType)) {
57
58 return true;
59 }
60
61 return true;
62 }
63
64 public String getCacheName() {
65 return _cacheName;
66 }
67
68 public Serializable getElementKey() {
69 return _elementKey;
70 }
71
72 public PortalCacheClusterEventType getEventType() {
73 return _portalCacheClusterEventType;
74 }
75
76 public int hashCode() {
77 return toString().hashCode();
78 }
79
80 public String toString() {
81 StringBundler sb = new StringBundler(5);
82
83 sb.append(_cacheName);
84 sb.append(StringPool.COLON);
85 sb.append(_elementKey.toString());
86 sb.append(StringPool.COLON);
87 sb.append(_portalCacheClusterEventType.toString());
88
89 return sb.toString();
90 }
91
92 private String _cacheName;
93 private Serializable _elementKey;
94 private PortalCacheClusterEventType _portalCacheClusterEventType;
95
96 }