001: package org.emforge.projectmanager.base;
002:
003: import org.emforge.projectmanager.base.ProjectDO;
004: import org.emforge.projectmanager.base.ProjectUserRole;
005:
006: import ru.emdev.EmForge.security.dao.Role;
007:
008: /**
009: * Class for mapping projects, users and their roles in project
010: *
011: * @todo: need to project and role fields and add reference to ProjectRole bean
012: */
013: public class ProjectUserRole {
014:
015: protected Long id;
016: protected ProjectDO project;
017: protected String userName;
018: protected Role role;
019:
020: /**
021: * @see org.emforge.projectmanager.base.EmForgeObject#getId()
022: */
023: public Long getId() {
024:
025: return id;
026: }
027:
028: /**
029: * @see org.emforge.projectmanager.base.EmForgeObject#setId(java.lang.Long)
030: */
031: public void setId(Long id) {
032:
033: this .id = id;
034: }
035:
036: /**
037: * @see org.emforge.projectmanager.base.EmForgeObject#getName()
038: */
039: public String getName() {
040:
041: return userName;
042: }
043:
044: /**
045: * @see org.emforge.projectmanager.base.EmForgeObject#setName(java.lang.String)
046: */
047: public void setName(String i_name) {
048:
049: userName = i_name;
050: }
051:
052: /**
053: * @return
054: */
055: public ProjectDO getProject() {
056:
057: return project;
058: }
059:
060: /**
061: * @param project
062: */
063: public void setProject(ProjectDO project) {
064:
065: this .project = project;
066: }
067:
068: /**
069: * @return
070: */
071: public Role getRole() {
072:
073: return role;
074: }
075:
076: /**
077: * @param role
078: */
079: public void setRole(Role role) {
080:
081: this .role = role;
082: }
083:
084: /**
085: * @deprecated Use {@link #getName()}
086: */
087: public String getUserName() {
088:
089: return userName;
090: }
091:
092: /**
093: * @deprecated Use {@link #setName(String)}
094: */
095: public void setUserName(String userName) {
096:
097: this .userName = userName;
098: }
099:
100: /**
101: * @see java.lang.Object#equals(java.lang.Object)
102: */
103: @Override
104: public boolean equals(Object i_obj) {
105:
106: boolean result = false;
107:
108: if (i_obj != null) {
109: if (i_obj == this ) {
110: result = true;
111:
112: } else if (i_obj instanceof ProjectUserRole) {
113: if (((ProjectUserRole) i_obj).getId() == getId()) {
114: result = true;
115: }
116: }
117: }
118:
119: return result;
120: }
121: }
|