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 / 10:45:42 PM
040: * The JForum Project
041: * http://www.jforum.net
042: */
043: package net.jforum.entities;
044:
045: import java.io.Serializable;
046:
047: /**
048: * Represents an user ranking in the System.
049: * An user ranking is just a given "status" which some user have
050: * basead on the number of messages posted by them.
051: *
052: * @author Rafael Steil
053: * @version $Id: Ranking.java,v 1.8 2006/12/02 03:19:55 rafaelsteil Exp $
054: */
055: public class Ranking implements Serializable {
056: private int id;
057: private String title;
058: private boolean special;
059: private String image;
060: private int min;
061:
062: public Ranking() {
063: }
064:
065: /**
066: * @return int
067: */
068: public int getId() {
069: return this .id;
070: }
071:
072: /**
073: * @return String
074: */
075: public String getImage() {
076: return this .image;
077: }
078:
079: /**
080: * @return String
081: */
082: public boolean isSpecial() {
083: return this .special;
084: }
085:
086: /**
087: * @return String
088: */
089: public String getTitle() {
090: return (this .title == null ? "" : this .title);
091: }
092:
093: /**
094: * Sets the id.
095: * @param id The id to set
096: */
097: public void setId(int id) {
098: this .id = id;
099: }
100:
101: /**
102: * Sets the image.
103: * @param image The image to set
104: */
105: public void setImage(String image) {
106: this .image = image;
107: }
108:
109: /**
110: * Sets the special.
111: * @param special The special to set
112: */
113: public void setSpecial(boolean special) {
114: this .special = special;
115: }
116:
117: /**
118: * Sets the title.
119: * @param title The title to set
120: */
121: public void setTitle(String title) {
122: this .title = title;
123: }
124:
125: /**
126: * @return
127: */
128: public int getMin() {
129: return this .min;
130: }
131:
132: /**
133: * @param i
134: */
135: public void setMin(int i) {
136: this .min = i;
137: }
138:
139: public boolean equals(Object o) {
140: if (o == this ) {
141: return true;
142: }
143:
144: if (!(o instanceof Ranking)) {
145: return false;
146: }
147:
148: return ((Ranking) o).getId() == this .getId();
149: }
150:
151: public int hashCode() {
152: return this.getId();
153: }
154: }
|