001: /**********************************************************************************
002: * $URL: https://source.sakaiproject.org/svn/profile/tags/sakai_2-4-1/common-composite-component-data/src/java/org/sakaiproject/component/common/edu/person/PersonImpl.java $
003: * $Id: PersonImpl.java 8424 2006-04-27 20:23:44Z ggolden@umich.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.common.edu.person;
021:
022: import org.sakaiproject.api.common.edu.person.Person;
023: import org.sakaiproject.component.common.manager.PersistableImpl;
024:
025: /**
026: * @author <a href="mailto:lance@indiana.edu">Lance Speelmon </a>
027: */
028: public class PersonImpl extends PersistableImpl implements Person {
029: protected String businessKey() {
030: StringBuffer sb = new StringBuffer();
031: sb.append(agentUuid);
032: sb.append(typeUuid);
033: return sb.toString();
034: }
035:
036: /**
037: * @see java.lang.Object#equals(java.lang.Object)
038: */
039: public boolean equals(Object obj) {
040: if (this == obj)
041: return true;
042: if (!(obj instanceof PersonImpl))
043: return false;
044: PersonImpl other = (PersonImpl) obj;
045: return this .businessKey().equals(other.businessKey());
046: }
047:
048: /**
049: * @see java.lang.Object#hashCode()
050: */
051: public int hashCode() {
052: return businessKey().hashCode();
053: }
054:
055: /**
056: * @see java.lang.Object#toString()
057: */
058: public String toString() {
059: StringBuffer sb = new StringBuffer();
060: sb.append("{id=");
061: sb.append(id);
062: sb.append(", uuid=");
063: sb.append(uuid);
064: sb.append(", typeUuid=");
065: sb.append(typeUuid);
066: sb.append("}");
067: return sb.toString();
068: }
069:
070: protected String agentUuid;
071:
072: /**
073: * @see org.sakaiproject.api.common.edu.person.SakaiPerson#getAgentUuid()
074: */
075: public String getAgentUuid() {
076: return agentUuid;
077: }
078:
079: /**
080: * @see org.sakaiproject.api.common.edu.person.SakaiPerson#setAgentUuid(java.lang.String)
081: */
082: public void setAgentUuid(String agentUuid) {
083: this .agentUuid = agentUuid;
084: }
085:
086: protected String typeUuid;
087:
088: /**
089: * @return Returns the typeUuid.
090: */
091: public String getTypeUuid() {
092: return typeUuid;
093: }
094:
095: /**
096: * @param typeUuid
097: * The typeUuid to set.
098: */
099: public void setTypeUuid(String typeUuid) {
100: this .typeUuid = typeUuid;
101: }
102:
103: protected String commonName;
104:
105: /**
106: * @see org.sakaiproject.service.profile.Person#getCommonName()
107: */
108: public String getCommonName() {
109: return commonName;
110: }
111:
112: /**
113: * @param commonName
114: * The commonName to set.
115: */
116: public void setCommonName(String commonName) {
117: this .commonName = commonName;
118: }
119:
120: protected String description;
121:
122: /**
123: * @see org.sakaiproject.service.profile.Person#getDescription()
124: */
125: public String getDescription() {
126: return description;
127: }
128:
129: /**
130: * @param description
131: * The description to set.
132: */
133: public void setDescription(String description) {
134: this .description = description;
135: }
136:
137: protected String seeAlso;
138:
139: /**
140: * @see org.sakaiproject.service.profile.Person#getSeeAlso()
141: */
142: public String getSeeAlso() {
143: return seeAlso;
144: }
145:
146: /**
147: * @param seeAlso
148: * The seeAlso to set.
149: */
150: public void setSeeAlso(String seeAlso) {
151: this .seeAlso = seeAlso;
152: }
153:
154: protected String surname;
155:
156: /**
157: * @see org.sakaiproject.service.profile.Person#getSurname()
158: */
159: public String getSurname() {
160: return surname;
161: }
162:
163: /**
164: * @param surname
165: * The surname to set.
166: */
167: public void setSurname(String surname) {
168: this .surname = surname;
169: }
170:
171: protected String street;
172:
173: /**
174: * @see org.sakaiproject.service.profile.Person#getStreet()
175: */
176: public String getStreet() {
177: return street;
178: }
179:
180: /**
181: * @param street
182: * The street to set.
183: */
184: public void setStreet(String street) {
185: this .street = street;
186: }
187:
188: protected String telephoneNumber;
189:
190: /**
191: * @see org.sakaiproject.service.profile.Person#getTelephoneNumber()
192: */
193: public String getTelephoneNumber() {
194: return telephoneNumber;
195: }
196:
197: /**
198: * @param telephoneNumber
199: * The telephoneNumber to set.
200: */
201: public void setTelephoneNumber(String telephoneNumber) {
202: this.telephoneNumber = telephoneNumber;
203: }
204:
205: }
|