1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.jetspeed.om.page.impl;
18
19 import java.util.List;
20
21 import org.apache.jetspeed.om.page.SecurityConstraintsDef;
22 import org.apache.jetspeed.page.impl.DatabasePageManagerUtils;
23
24 /***
25 * SecurityConstraintsDefImpl
26 *
27 * @author <a href="mailto:rwatler@apache.org">Randy Watler</a>
28 * @version $Id$
29 */
30 public class SecurityConstraintsDefImpl implements SecurityConstraintsDef
31 {
32 private int id;
33 private String name;
34 private List constraintDefs = DatabasePageManagerUtils.createList();
35
36 private SecurityConstraintDefList securityConstraintDefs;
37
38 /***
39 * accessConstraintDefs
40 *
41 * Access mutable persistent collection member for List wrappers.
42 *
43 * @return persistent collection
44 */
45 List accessConstraintDefs()
46 {
47
48 if (constraintDefs == null)
49 {
50 constraintDefs = DatabasePageManagerUtils.createList();
51 }
52 return constraintDefs;
53 }
54
55
56
57
58 public String getName()
59 {
60 return name;
61 }
62
63
64
65
66 public void setName(String name)
67 {
68 this.name = name;
69 }
70
71
72
73
74 public List getSecurityConstraints()
75 {
76
77
78 if (securityConstraintDefs == null)
79 {
80 securityConstraintDefs = new SecurityConstraintDefList(this);
81 }
82 return securityConstraintDefs;
83 }
84
85
86
87
88 public void setSecurityConstraints(List constraints)
89 {
90
91
92
93 List securityConstraintDefs = getSecurityConstraints();
94 if (constraints != securityConstraintDefs)
95 {
96
97 securityConstraintDefs.clear();
98 if (constraints != null)
99 {
100 securityConstraintDefs.addAll(constraints);
101 }
102 }
103 }
104
105
106
107
108 public boolean equals(Object o)
109 {
110 if (o instanceof SecurityConstraintsDefImpl)
111 {
112 if (name != null)
113 {
114 return name.equals(((SecurityConstraintsDefImpl)o).getName());
115 }
116 return (((SecurityConstraintsDefImpl)o).getName() == null);
117 }
118 return false;
119 }
120
121
122
123
124 public int hashCode()
125 {
126 if (name != null)
127 {
128 return name.hashCode();
129 }
130 return 0;
131 }
132 }