001: /*
002: * Coefficient - facilitates project based collaboration
003: * Copyright (C) 2003, Dylan Etkin, CSIR icomtek
004: * PO Box 395
005: * Pretoria 0001, RSA
006: * This library is free software; you can redistribute it and/or
007: * modify it under the terms of the GNU Lesser General Public
008: * License as published by the Free Software Foundation; either
009: * version 2.1 of the License, or (at your option) any later version.
010: * This library is distributed in the hope that it will be useful,
011: * but WITHOUT ANY WARRANTY; without even the implied warranty of
012: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
013: * Lesser General Public License for more details.
014: *
015: * You should have received a copy of the GNU Lesser General Public
016: * License along with this library; if not, write to the Free Software
017: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
018: */
019:
020: package za.org.coefficient.authentication;
021:
022: /**
023: * Title: Project Engine
024: * Description: Simple role object to describe user roles
025: * Copyright: Copyright (c) 2003
026: * Company: icomtek CSIR
027: * @author Krishendran Rangappa
028: * @version 1.0
029: *
030: * @hibernate.class
031: * table="COEFFICIENT_ROLE"
032: */
033: public class Role implements java.io.Serializable {
034: //~ Instance fields ========================================================
035:
036: private Long id;
037: private String description;
038: private long roleValue;
039:
040: //~ Constructors ===========================================================
041:
042: public Role() {
043: }
044:
045: public Role(long roleValue, String description) {
046: this .roleValue = roleValue;
047: this .description = description;
048: }
049:
050: //~ Methods ================================================================
051:
052: public void setDescription(String desc) {
053: this .description = desc;
054: }
055:
056: /**
057: * Gets the value of description
058: *
059: * @return the value of description
060: * @hibernate.property
061: * column="DESCRIPTION"
062: */
063: public String getDescription() {
064: return description;
065: }
066:
067: public void setId(Long id) {
068: this .id = id;
069: }
070:
071: /**
072: * @hibernate.id
073: * generator-class="native"
074: */
075: public Long getId() {
076: return id;
077: }
078:
079: public void setRoleValue(long roleValue) {
080: this .roleValue = roleValue;
081: }
082:
083: /**
084: * Gets the value of roleValue
085: *
086: * @return the value of roleValue
087: * @hibernate.property
088: * column="ROLE_VALUE"
089: */
090: public long getRoleValue() {
091: return roleValue;
092: }
093:
094: public boolean equals(Object other) {
095: Role o = (Role) other;
096:
097: return roleValue == o.roleValue;
098: }
099:
100: public String toString() {
101: return description;
102: }
103: }
|