001: /**********************************************************************************
002: * $URL: https://source.sakaiproject.org/svn/msgcntr/trunk/messageforums-hbm/src/java/org/sakaiproject/component/app/messageforums/dao/hibernate/PrivateMessageRecipientImpl.java $
003: * $Id: PrivateMessageRecipientImpl.java 9227 2006-05-15 15:02:42Z cwen@iupui.edu $
004: ***********************************************************************************
005: *
006: * Copyright (c) 2003, 2004, 2005, 2006 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 org.sakaiproject.api.app.messageforums.PrivateMessageRecipient;
023:
024: public class PrivateMessageRecipientImpl implements
025: PrivateMessageRecipient {
026:
027: private String userId;
028: private String typeUuid;
029: private String contextId;
030: private Boolean read;
031:
032: /**
033: * default constructor
034: */
035: public PrivateMessageRecipientImpl() {
036: }
037:
038: /**
039: * constructor
040: * @param userId
041: * @param typeUuid
042: * @param contextId
043: * @param read
044: */
045: public PrivateMessageRecipientImpl(String userId, String typeUuid,
046: String contextId, Boolean read) {
047: this .userId = userId;
048: this .typeUuid = typeUuid;
049: this .contextId = contextId;
050: this .read = read;
051: }
052:
053: /**
054: * @see org.sakaiproject.api.app.messageforums.PrivateMessageRecipients#getTypeUuid()
055: */
056: public String getTypeUuid() {
057: return typeUuid;
058: }
059:
060: /**
061: * @see org.sakaiproject.api.app.messageforums.PrivateMessageRecipients#setTypeUuid(java.lang.String)
062: */
063: public void setTypeUuid(String typeUuid) {
064: this .typeUuid = typeUuid;
065: }
066:
067: /**
068: * @see org.sakaiproject.api.app.messageforums.PrivateMessageRecipient#getContextId()
069: */
070: public String getContextId() {
071: return contextId;
072: }
073:
074: /**
075: * @see org.sakaiproject.api.app.messageforums.PrivateMessageRecipient#setContextId(java.lang.String)
076: */
077: public void setContextId(String contextId) {
078: this .contextId = contextId;
079: }
080:
081: /**
082: * @see org.sakaiproject.component.app.messageforums.dao.hibernate.PrivateMessageRecipients#getUserId()
083: */
084: public String getUserId() {
085: return userId;
086: }
087:
088: /**
089: * @see org.sakaiproject.component.app.messageforums.dao.hibernate.PrivateMessageRecipients#setUserId(java.lang.String)
090: */
091: public void setUserId(String userId) {
092: this .userId = userId;
093: }
094:
095: /**
096: * @see org.sakaiproject.component.app.messageforums.dao.hibernate.PrivateMessageRecipients#getRead()
097: */
098: public Boolean getRead() {
099: return read;
100: }
101:
102: /**
103: * @see org.sakaiproject.component.app.messageforums.dao.hibernate.PrivateMessageRecipients#setRead(java.lang.Boolean)
104: */
105: public void setRead(Boolean read) {
106: this .read = read;
107: }
108:
109: /**
110: * @see java.lang.Object#equals(java.lang.Object)
111: */
112: public boolean equals(Object obj) {
113: if (obj == this ) {
114: return true;
115: }
116:
117: if (!(obj instanceof PrivateMessageRecipientImpl))
118: return false;
119:
120: PrivateMessageRecipientImpl objCast = (PrivateMessageRecipientImpl) obj;
121:
122: return (objCast.userId != null && objCast.userId
123: .equals(this .userId))
124: && (objCast.typeUuid != null && objCast.typeUuid
125: .equals(this .typeUuid))
126: && (objCast.contextId != null && objCast.contextId
127: .equals(this .contextId))
128: && (objCast.read != null && objCast.read
129: .equals(this .read));
130: }
131:
132: /**
133: * @see java.lang.Object#hashCode()
134: */
135: public int hashCode() {
136: int result = 17;
137: result = 41 * result
138: + ((userId == null) ? 0 : userId.hashCode());
139: result = 41 * result
140: + ((typeUuid == null) ? 0 : typeUuid.hashCode());
141: result = 41 * result
142: + ((contextId == null) ? 0 : contextId.hashCode());
143: result = 41 * result + ((read == null) ? 0 : read.hashCode());
144: return result;
145: }
146:
147: }
|