KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > za > org > coefficient > authentication > ProjectMember


1 /*
2  * Coefficient - facilitates project based collaboration
3  * Copyright (C) 2003, Dylan Etkin, CSIR icomtek
4  * PO Box 395
5  * Pretoria 0001, RSA
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18  */

19
20 package za.org.coefficient.authentication;
21
22
23 /**
24  * Title: Project Engine
25  * Description: Memeber containing a CoefficientUser and a Role, created by projects
26  * Copyright: Copyright (c) 2003
27  * Company: icomtek CSIR
28  * @author Dylan Etkin
29  * @version 1.0
30  * @hibernate.class
31  * table="COEFFICIENT_PROJECT_MEMBER"
32  */

33 public class ProjectMember implements java.io.Serializable JavaDoc {
34     //~ Instance fields ========================================================
35

36     private CoefficientUser coefficientUser;
37     private Long JavaDoc id;
38     private Role projectRole;
39     private long version;
40
41     //~ Constructors ===========================================================
42

43     public ProjectMember() {
44     }
45
46     public ProjectMember(CoefficientUser user, Role projectRole) {
47         this.coefficientUser = user;
48         this.projectRole = projectRole;
49     }
50
51     //~ Methods ================================================================
52

53     public void setId(Long JavaDoc id) {
54         this.id = id;
55     }
56
57     /**
58      * @hibernate.id
59      * generator-class="native"
60      */

61     public Long JavaDoc getId() {
62         return id;
63     }
64
65     /**
66      * Sets the value of user
67      *
68      * @param user Value to assign to this.user
69      */

70     public void setCoefficientUser(CoefficientUser user) {
71         this.coefficientUser = user;
72     }
73
74     /**
75      * Gets the value of user
76      *
77      * @return the value of user
78      * @hibernate.many-to-one
79      * column="COEFFICIENT_USER"
80      */

81     public CoefficientUser getCoefficientUser() {
82         return this.coefficientUser;
83     }
84
85     /**
86      * Sets the value of projectRole
87      *
88      * @param argProjectRole Value to assign to this.projectRole
89      */

90     public void setProjectRole(Role argProjectRole) {
91         this.projectRole = argProjectRole;
92     }
93
94     /**
95      * Gets the value of projectRole
96      *
97      * @return the value of projectRole
98      * @hibernate.many-to-one
99      * column="PROJECT_ROLE"
100      */

101     public Role getProjectRole() {
102         return this.projectRole;
103     }
104
105     /**
106      * Sets the value of version
107      *
108      * @param version Value to assign to this.version
109      */

110     public void setVersion(long version) {
111         this.version = version;
112     }
113
114     /**
115      * Gets the value of version
116      *
117      * @return the value of version
118      * @hibernate.version
119      * column="VERSION"
120      * type="long"
121      */

122     public long getVersion() {
123         return this.version;
124     }
125
126     public boolean equals(Object JavaDoc other) {
127         ProjectMember o = (ProjectMember) other;
128
129         return (this != null) && (o != null)
130         && (((projectRole == null) && (o.projectRole == null))
131         || projectRole.equals(o.projectRole))
132         && (((coefficientUser == null) && (o.coefficientUser == null))
133         || coefficientUser.equals(o.coefficientUser));
134     }
135 }
136
Popular Tags