KickJava   Java API By Example, From Geeks To Geeks.

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


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  * Title: Project Engine
24  * Description: Simple role object to describe user roles
25  * Copyright: Copyright (c) 2003
26  * Company: icomtek CSIR
27  * @author Krishendran Rangappa
28  * @version 1.0
29  *
30  * @hibernate.class
31  * table="COEFFICIENT_ROLE"
32  */

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

36     private Long JavaDoc id;
37     private String JavaDoc description;
38     private long roleValue;
39
40     //~ Constructors ===========================================================
41

42     public Role() {
43     }
44
45     public Role(long roleValue, String JavaDoc description) {
46         this.roleValue = roleValue;
47         this.description = description;
48     }
49
50     //~ Methods ================================================================
51

52     public void setDescription(String JavaDoc desc) {
53         this.description = desc;
54     }
55
56     /**
57      * Gets the value of description
58      *
59      * @return the value of description
60      * @hibernate.property
61      * column="DESCRIPTION"
62      */

63     public String JavaDoc getDescription() {
64         return description;
65     }
66
67     public void setId(Long JavaDoc id) {
68         this.id = id;
69     }
70
71     /**
72      * @hibernate.id
73      * generator-class="native"
74      */

75     public Long JavaDoc getId() {
76         return id;
77     }
78
79     public void setRoleValue(long roleValue) {
80         this.roleValue = roleValue;
81     }
82
83     /**
84      * Gets the value of roleValue
85      *
86      * @return the value of roleValue
87      * @hibernate.property
88      * column="ROLE_VALUE"
89      */

90     public long getRoleValue() {
91         return roleValue;
92     }
93
94     public boolean equals(Object JavaDoc other) {
95         Role o = (Role) other;
96
97         return roleValue == o.roleValue;
98     }
99
100     public String JavaDoc toString() {
101         return description;
102     }
103 }
104
Popular Tags