001: /*
002: * Copyright (c) JForum Team
003: * All rights reserved.
004:
005: * Redistribution and use in source and binary forms,
006: * with or without modification, are permitted provided
007: * that the following conditions are met:
008:
009: * 1) Redistributions of source code must retain the above
010: * copyright notice, this list of conditions and the
011: * following disclaimer.
012: * 2) Redistributions in binary form must reproduce the
013: * above copyright notice, this list of conditions and
014: * the following disclaimer in the documentation and/or
015: * other materials provided with the distribution.
016: * 3) Neither the name of "Rafael Steil" nor
017: * the names of its contributors may be used to endorse
018: * or promote products derived from this software without
019: * specific prior written permission.
020: *
021: * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
022: * HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
023: * EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
024: * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
025: * MERCHANTABILITY AND FITNESS FOR A PARTICULAR
026: * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
027: * THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
028: * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
029: * EXEMPLARY, OR CONSEQUENTIAL DAMAGES
030: * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
031: * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
032: * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
033: * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
034: * IN CONTRACT, STRICT LIABILITY, OR TORT
035: * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
036: * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
037: * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
038: *
039: * This file creating date: Feb 17, 2003 / 8:50:57 PM
040: * net.jforum.entities.Group.java
041: * The JForum Project
042: * http://www.jforum.net
043: *
044: * $Id: Group.java,v 1.5 2006/08/23 02:13:46 rafaelsteil Exp $
045: */
046: package net.jforum.entities;
047:
048: /**
049: * Represents a group in the system.
050: *
051: * @author Rafael Steil
052: */
053: public class Group {
054: private int id;
055: private int parentId;
056: private String name;
057: private String description;
058:
059: /**
060: * Default constructor
061: * **/
062: public Group() {
063: }
064:
065: /**
066: * Create a new <code>Group</code> object.
067: *
068: * @param id The Group ID
069: * @param parentId The parent ID for the group
070: * @param name The Group Name
071: * @param description The Group Description
072: **/
073: public Group(int id, int parentId, String name, String description) {
074: setName(name);
075: setId(id);
076: setParentId(parentId);
077: setDescription(description);
078: }
079:
080: /**
081: * @return String
082: */
083: public String getDescription() {
084: return this .description;
085: }
086:
087: /**
088: * @return int
089: */
090: public int getId() {
091: return this .id;
092: }
093:
094: /**
095: * @return int
096: */
097: public int getParentId() {
098: return this .parentId;
099: }
100:
101: /**
102: * @return String
103: */
104: public String getName() {
105: return this .name;
106: }
107:
108: /**
109: * Sets the description.
110: * @param description The description to set
111: */
112: public void setDescription(String description) {
113: this .description = description;
114: }
115:
116: /**
117: * Sets the id.
118: * @param id The id to set
119: */
120: public void setId(int id) {
121: this .id = id;
122: }
123:
124: /**
125: * Sets the parent id.
126: * @param id The parent id to set
127: */
128: public void setParentId(int parentId) {
129: this .parentId = parentId;
130: }
131:
132: /**
133: * Sets the name.
134: * @param name The name to set
135: */
136: public void setName(String name) {
137: this .name = name;
138: }
139:
140: /*
141: * @see java.lang.Object#equals(java.lang.Object)
142: */
143: public boolean equals(Object o) {
144: if (!(o instanceof Group)) {
145: return false;
146: }
147:
148: return (((Group) o).getId() == this .id);
149: }
150:
151: /*
152: * @see java.lang.Object#hashCode()
153: */
154: public int hashCode() {
155: return this .id;
156: }
157:
158: /*
159: * @see java.lang.Object#toString()
160: */
161: public String toString() {
162: return this .name + " - " + this.id;
163: }
164:
165: }
|