1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.jetspeed.om.registry.base;
18
19 import org.apache.jetspeed.om.registry.*;
20
21 /***
22 * Bean like implementation of the Parameter interface suitable for
23 * Castor serialization.
24 *
25 * @see org.apache.jetspeed.om.registry.Parameter
26 * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
27 * @version $Id: BaseCachedParameter.java,v 1.5 2004/02/23 03:08:26 jford Exp $
28 */
29 public class BaseCachedParameter extends BaseParameter
30 implements CachedParameter, java.io.Serializable
31 {
32 private boolean cachedOnName = true;
33 private boolean cachedOnValue = true;
34
35 /***
36 * Implements the equals operation so that 2 elements are equal if
37 * all their member values are equal.
38 */
39 public boolean equals(Object object)
40 {
41 if (object==null)
42 {
43 return false;
44 }
45
46 BaseCachedParameter obj = (BaseCachedParameter)object;
47
48 if (cachedOnName != obj.getCachedOnName())
49 {
50 return false;
51 }
52
53 if (cachedOnValue != obj.getCachedOnValue())
54 {
55 return false;
56 }
57
58 return super.equals(object);
59 }
60
61 public boolean isCachedOnName()
62 {
63 return cachedOnName;
64 }
65
66 public boolean isCachedOnValue()
67 {
68 return cachedOnValue;
69 }
70
71 public void setCachedOnName(boolean cached)
72 {
73 this.cachedOnName = cached;
74 }
75
76 public void setCachedOnValue(boolean cached)
77 {
78 this.cachedOnValue = cached;
79 }
80
81
82 public boolean getCachedOnName()
83 {
84 return cachedOnName;
85 }
86
87 public boolean getCachedOnValue()
88 {
89 return cachedOnValue;
90 }
91
92 }