001: /**********************************************************************************
002: * $URL: https://source.sakaiproject.org/svn/msgcntr/trunk/messageforums-hbm/src/java/org/sakaiproject/component/app/messageforums/dao/hibernate/PermissionLevelImpl.java $
003: * $Id: PermissionLevelImpl.java 9227 2006-05-15 15:02:42Z cwen@iupui.edu $
004: ***********************************************************************************
005: *
006: * Copyright (c) 2003, 2004, 2005, 2006, 2007 The Sakai Foundation.
007: *
008: * Licensed under the Educational Community License, Version 1.0 (the "License");
009: * you may not use this file except in compliance with the License.
010: * You may obtain a copy of the License at
011: *
012: * http://www.opensource.org/licenses/ecl1.php
013: *
014: * Unless required by applicable law or agreed to in writing, software
015: * distributed under the License is distributed on an "AS IS" BASIS,
016: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
017: * See the License for the specific language governing permissions and
018: * limitations under the License.
019: *
020: **********************************************************************************/package org.sakaiproject.component.app.messageforums.dao.hibernate;
021:
022: import java.beans.PropertyDescriptor;
023:
024: import org.sakaiproject.api.app.messageforums.PermissionLevel;
025:
026: public class PermissionLevelImpl extends MutableEntityImpl implements
027: PermissionLevel, Comparable {
028:
029: private String typeUuid;
030: private String name;
031:
032: private Boolean changeSettings;
033: private Boolean deleteAny;
034: private Boolean deleteOwn;
035: private Boolean markAsRead;
036: private Boolean movePosting;
037: private Boolean newForum;
038: private Boolean newResponse;
039: private Boolean newResponseToResponse;
040: private Boolean newTopic;
041: private Boolean postToGradebook;
042: private Boolean read;
043: private Boolean reviseAny;
044: private Boolean reviseOwn;
045: private Boolean moderatePostings;
046:
047: public String getName() {
048: return name;
049: }
050:
051: public void setName(String name) {
052: this .name = name;
053: }
054:
055: public String getTypeUuid() {
056: return typeUuid;
057: }
058:
059: public void setTypeUuid(String typeUuid) {
060: this .typeUuid = typeUuid;
061: }
062:
063: public Boolean getChangeSettings() {
064: return changeSettings;
065: }
066:
067: public void setChangeSettings(Boolean changeSettings) {
068: this .changeSettings = changeSettings;
069: }
070:
071: public Boolean getDeleteAny() {
072: return deleteAny;
073: }
074:
075: public void setDeleteAny(Boolean deleteAny) {
076: this .deleteAny = deleteAny;
077: }
078:
079: public Boolean getDeleteOwn() {
080: return deleteOwn;
081: }
082:
083: public void setDeleteOwn(Boolean deleteOwn) {
084: this .deleteOwn = deleteOwn;
085: }
086:
087: public Boolean getMarkAsRead() {
088: return markAsRead;
089: }
090:
091: public void setMarkAsRead(Boolean markAsRead) {
092: this .markAsRead = markAsRead;
093: }
094:
095: public Boolean getModeratePostings() {
096: return moderatePostings;
097: }
098:
099: public void setModeratePostings(Boolean moderatePostings) {
100: this .moderatePostings = moderatePostings;
101: }
102:
103: public Boolean getMovePosting() {
104: return movePosting;
105: }
106:
107: public void setMovePosting(Boolean movePosting) {
108: this .movePosting = movePosting;
109: }
110:
111: public Boolean getNewForum() {
112: return newForum;
113: }
114:
115: public void setNewForum(Boolean newForum) {
116: this .newForum = newForum;
117: }
118:
119: public Boolean getNewResponse() {
120: return newResponse;
121: }
122:
123: public void setNewResponse(Boolean newResponse) {
124: this .newResponse = newResponse;
125: }
126:
127: public Boolean getNewTopic() {
128: return newTopic;
129: }
130:
131: public void setNewTopic(Boolean newTopic) {
132: this .newTopic = newTopic;
133: }
134:
135: public Boolean getPostToGradebook() {
136: return postToGradebook;
137: }
138:
139: public void setPostToGradebook(Boolean postToGradebook) {
140: this .postToGradebook = postToGradebook;
141: }
142:
143: public Boolean getRead() {
144: return read;
145: }
146:
147: public void setRead(Boolean read) {
148: this .read = read;
149: }
150:
151: public Boolean getNewResponseToResponse() {
152: return newResponseToResponse;
153: }
154:
155: public void setNewResponseToResponse(Boolean newResponseToResponse) {
156: this .newResponseToResponse = newResponseToResponse;
157: }
158:
159: public Boolean getReviseAny() {
160: return reviseAny;
161: }
162:
163: public void setReviseAny(Boolean reviseAny) {
164: this .reviseAny = reviseAny;
165: }
166:
167: public Boolean getReviseOwn() {
168: return reviseOwn;
169: }
170:
171: public void setReviseOwn(Boolean reviseOwn) {
172: this .reviseOwn = reviseOwn;
173: }
174:
175: public int compareTo(Object obj) {
176:
177: PermissionLevelImpl pli = (PermissionLevelImpl) obj;
178: return (name == null) ? 0 : name.compareTo(pli.getName());
179: }
180:
181: /**
182: * @see java.lang.Object#toString()
183: */
184: public String toString() {
185: StringBuffer buffer = new StringBuffer("[");
186: buffer.append(changeSettings);
187: //buffer.append("," + deleteAny);
188: //buffer.append("," + deleteOwn);
189: buffer.append("," + markAsRead);
190: //buffer.append("," + movePosting);
191: buffer.append("," + newForum);
192: buffer.append("," + newResponse);
193: buffer.append("," + newResponseToResponse);
194: buffer.append("," + newTopic);
195: buffer.append("," + postToGradebook);
196: buffer.append("," + read);
197: buffer.append("," + reviseAny);
198: buffer.append("," + reviseOwn);
199: buffer.append("," + moderatePostings);
200: buffer.append("]");
201:
202: return buffer.toString();
203: }
204:
205: /**
206: * @see java.lang.Object#equals(java.lang.Object)
207: */
208: public boolean equals(Object o) {
209: if (o == this ) {
210: return true;
211: }
212:
213: if (!(o instanceof PermissionLevelImpl))
214: return false;
215:
216: PermissionLevelImpl obj = (PermissionLevelImpl) o;
217:
218: boolean returnValue = true;
219:
220: Boolean bThis = this .getChangeSettings();
221: returnValue = (bThis == null) ? obj.getChangeSettings() == null
222: : bThis.equals(obj.getChangeSettings());
223: if (!returnValue)
224: return returnValue;
225: bThis = this .getDeleteAny();
226: returnValue = (bThis == null) ? obj.getDeleteAny() == null
227: : bThis.equals(obj.getDeleteAny());
228: if (!returnValue)
229: return returnValue;
230: bThis = this .getDeleteOwn();
231: returnValue = (bThis == null) ? obj.getDeleteOwn() == null
232: : bThis.equals(obj.getDeleteOwn());
233: if (!returnValue)
234: return returnValue;
235: bThis = this .getMarkAsRead();
236: returnValue = (bThis == null) ? obj.getMarkAsRead() == null
237: : bThis.equals(obj.getMarkAsRead());
238: if (!returnValue)
239: return returnValue;
240: bThis = this .getMovePosting();
241: returnValue = (bThis == null) ? obj.getMovePosting() == null
242: : bThis.equals(obj.getMovePosting());
243: if (!returnValue)
244: return returnValue;
245: bThis = this .getNewForum();
246: returnValue = (bThis == null) ? obj.getNewForum() == null
247: : bThis.equals(obj.getNewForum());
248: if (!returnValue)
249: return returnValue;
250: bThis = this .getNewResponse();
251: returnValue = (bThis == null) ? obj.getNewResponse() == null
252: : bThis.equals(obj.getNewResponse());
253: if (!returnValue)
254: return returnValue;
255: bThis = this .getNewResponseToResponse();
256: returnValue = (bThis == null) ? obj.getNewResponseToResponse() == null
257: : bThis.equals(obj.getNewResponseToResponse());
258: if (!returnValue)
259: return returnValue;
260: bThis = this .getNewTopic();
261: returnValue = (bThis == null) ? obj.getNewTopic() == null
262: : bThis.equals(obj.getNewTopic());
263: if (!returnValue)
264: return returnValue;
265: bThis = this .getPostToGradebook();
266: returnValue = (bThis == null) ? obj.getPostToGradebook() == null
267: : bThis.equals(obj.getPostToGradebook());
268: if (!returnValue)
269: return returnValue;
270: bThis = this .getRead();
271: returnValue = (bThis == null) ? obj.getRead() == null : bThis
272: .equals(obj.getRead());
273: if (!returnValue)
274: return returnValue;
275: bThis = this .getReviseAny();
276: returnValue = (bThis == null) ? obj.getReviseAny() == null
277: : bThis.equals(obj.getReviseAny());
278: if (!returnValue)
279: return returnValue;
280: bThis = this .getReviseOwn();
281: returnValue = (bThis == null) ? obj.getReviseOwn() == null
282: : bThis.equals(obj.getReviseOwn());
283: if (!returnValue)
284: return returnValue;
285: bThis = this .getModeratePostings();
286: returnValue = (bThis == null) ? obj.getModeratePostings() == null
287: : bThis.equals(obj.getModeratePostings());
288: if (!returnValue)
289: return returnValue;
290:
291: return returnValue;
292: }
293:
294: /**
295: * @see java.lang.Object#hashCode()
296: */
297: public int hashCode() {
298: int result = 17;
299:
300: try {
301: Boolean bThis = this .getChangeSettings();
302: int temp = (bThis == null) ? 0 : bThis.hashCode();
303: result = result + temp;
304: bThis = this .getDeleteAny();
305: temp = (bThis == null) ? 0 : bThis.hashCode();
306: result = result + temp;
307: bThis = this .getDeleteOwn();
308: temp = (bThis == null) ? 0 : bThis.hashCode();
309: result = result + temp;
310: bThis = this .getMarkAsRead();
311: temp = (bThis == null) ? 0 : bThis.hashCode();
312: result = result + temp;
313: bThis = this .getMovePosting();
314: temp = (bThis == null) ? 0 : bThis.hashCode();
315: result = result + temp;
316: bThis = this .getNewForum();
317: temp = (bThis == null) ? 0 : bThis.hashCode();
318: result = result + temp;
319: bThis = this .getNewResponse();
320: temp = (bThis == null) ? 0 : bThis.hashCode();
321: result = result + temp;
322: bThis = this .getNewResponseToResponse();
323: temp = (bThis == null) ? 0 : bThis.hashCode();
324: result = result + temp;
325: bThis = this .getNewTopic();
326: temp = (bThis == null) ? 0 : bThis.hashCode();
327: result = result + temp;
328: bThis = this .getPostToGradebook();
329: temp = (bThis == null) ? 0 : bThis.hashCode();
330: result = result + temp;
331: bThis = this .getRead();
332: temp = (bThis == null) ? 0 : bThis.hashCode();
333: result = result + temp;
334: bThis = this .getReviseAny();
335: temp = (bThis == null) ? 0 : bThis.hashCode();
336: result = result + temp;
337: bThis = this .getReviseOwn();
338: temp = (bThis == null) ? 0 : bThis.hashCode();
339: result = result + temp;
340: bThis = this .getModeratePostings();
341: temp = (bThis == null) ? 0 : bThis.hashCode();
342: result = result + temp;
343: } catch (Exception e) {
344: throw new Error(e);
345: }
346:
347: return result;
348: }
349:
350: public PermissionLevel clone() {
351: PermissionLevelImpl pli = new PermissionLevelImpl();
352: pli.setChangeSettings(this.getChangeSettings());
353: pli.setCreated(this.getCreated());
354: pli.setCreatedBy(this.getCreatedBy());
355: pli.setDeleteAny(this.getDeleteAny());
356: pli.setDeleteOwn(this.getDeleteOwn());
357: pli.setId(this.getId());
358: pli.setMarkAsRead(this.getMarkAsRead());
359: pli.setModeratePostings(this.getModeratePostings());
360: pli.setModified(this.getModified());
361: pli.setModifiedBy(this.getModifiedBy());
362: pli.setMovePosting(this.getMovePosting());
363: pli.setName(this.getName());
364: pli.setNewForum(this.getNewForum());
365: pli.setNewResponse(this.getNewResponse());
366: pli.setNewResponseToResponse(this.getNewResponseToResponse());
367: pli.setNewTopic(this.getNewTopic());
368: pli.setPostToGradebook(this.getPostToGradebook());
369: pli.setRead(this.getRead());
370: pli.setReviseAny(this.getReviseAny());
371: pli.setReviseOwn(this.getReviseOwn());
372: pli.setTypeUuid(this.getTypeUuid());
373: pli.setUuid(this.getUuid());
374: pli.setVersion(this.getVersion());
375:
376: return pli;
377: }
378:
379: }
|