001: package org.emforge.projectmanager.base;
002:
003: import java.io.Serializable;
004:
005: import org.emforge.base.PrimitiveImpl;
006: import org.emforge.xfer.EmForgeObject;
007: import org.emforge.projectmanager.base.ProjectDO;
008: import org.emforge.projectmanager.base.ProjectRole;
009:
010: import ru.emdev.EmForge.security.dao.Role;
011:
012: /**
013: * Class to represent email for some role in some project
014: *
015: * @author imusihin
016: */
017: public class ProjectRole extends PrimitiveImpl implements
018: EmForgeObject, Serializable {
019:
020: private static final long serialVersionUID = -7146964727283953457L;
021:
022: protected ProjectDO project;
023: protected Role role;
024: protected String email;
025:
026: /**
027: * @see org.emforge.projectmanager.base.EmForgeObject#getName()
028: */
029: public String getName() {
030:
031: return getRole().getName();
032: }
033:
034: /**
035: * @see org.emforge.projectmanager.base.EmForgeObject#setName(java.lang.String)
036: */
037: public void setName(String i_name) {
038:
039: getRole().setName(i_name);
040: }
041:
042: /**
043: * @see org.emforge.projectmanager.base.EmForgeObject#getDisplayName()
044: * @todo To be modified to get real display name
045: */
046: public String getDisplayName() {
047:
048: return getName();
049: }
050:
051: /**
052: * @see org.emforge.projectmanager.base.EmForgeObject#setDisplayName(java.lang.String)
053: * @todo To be modified to set real display name
054: */
055: public void setDisplayName(String i_displayName) {
056:
057: setName(i_displayName);
058: }
059:
060: /**
061: * @return
062: */
063: public ProjectDO getProject() {
064:
065: return project;
066: }
067:
068: /**
069: * @param project
070: */
071: public void setProject(ProjectDO project) {
072:
073: this .project = project;
074: }
075:
076: /**
077: * @return
078: */
079: public Role getRole() {
080:
081: return role;
082: }
083:
084: /**
085: * @param role
086: */
087: public void setRole(Role role) {
088:
089: this .role = role;
090: }
091:
092: /**
093: * @return
094: */
095: public String getEmail() {
096:
097: return email;
098: }
099:
100: /**
101: * @param email
102: */
103: public void setEmail(String email) {
104:
105: this .email = email;
106: }
107:
108: /**
109: * @see java.lang.Object#equals(java.lang.Object)
110: */
111: @Override
112: public boolean equals(Object i_obj) {
113:
114: boolean result = false;
115:
116: if (i_obj != null) {
117: if (i_obj == this ) {
118: result = true;
119:
120: } else if (i_obj instanceof ProjectRole) {
121: if (((ProjectRole) i_obj).getId() == getId()) {
122: result = true;
123: }
124: }
125: }
126:
127: return result;
128: }
129: }
|