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:47:29 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 a banner in the System.
049: *
050: * @author Samuel Yung
051: * @version $Id: Banner.java,v 1.4 2006/08/23 02:13:46 rafaelsteil Exp $
052: */
053: public class Banner implements Serializable {
054: private int id;
055: private String comment;
056: private boolean active;
057: private int type;
058: private String name;
059: private String description;
060: private int width;
061: private int height;
062: private int views;
063: private int clicks;
064: private String url;
065: private int placement;
066: private int weight;
067:
068: public Banner() {
069: }
070:
071: public Banner(int id) {
072: this .id = id;
073: }
074:
075: public Banner(Banner c) {
076: this .id = c.getId();
077: this .comment = c.getComment();
078: this .active = c.isActive();
079: this .type = c.getType();
080: this .name = c.getName();
081: this .description = c.getDescription();
082: this .width = c.getWeight();
083: this .height = c.getHeight();
084: this .views = c.getViews();
085: this .clicks = c.getClicks();
086: this .url = c.getUrl();
087: this .placement = c.getPlacement();
088: this .weight = c.getWeight();
089: }
090:
091: /**
092: * @return int
093: */
094: public int getId() {
095: return this .id;
096: }
097:
098: public String getComment() {
099: return comment;
100: }
101:
102: public boolean isActive() {
103: return active;
104: }
105:
106: public int getType() {
107: return type;
108: }
109:
110: public String getName() {
111: return name;
112: }
113:
114: public String getDescription() {
115: return description;
116: }
117:
118: public int getWidth() {
119: return width;
120: }
121:
122: public int getHeight() {
123: return height;
124: }
125:
126: public int getViews() {
127: return views;
128: }
129:
130: public int getClicks() {
131: return clicks;
132: }
133:
134: public String getUrl() {
135: return url;
136: }
137:
138: public int getPlacement() {
139: return placement;
140: }
141:
142: public int getWeight() {
143: return weight;
144: }
145:
146: /**
147: * Sets the id.
148: * @param id The id to set
149: */
150: public void setId(int id) {
151: this .id = id;
152: }
153:
154: public void setComment(String comment) {
155: this .comment = comment;
156: }
157:
158: public void setActive(boolean active) {
159: this .active = active;
160: }
161:
162: public void setType(int type) {
163: this .type = type;
164: }
165:
166: public void setName(String name) {
167: this .name = name;
168: }
169:
170: public void setDescription(String description) {
171: this .description = description;
172: }
173:
174: public void setWidth(int width) {
175: this .width = width;
176: }
177:
178: public void setHeight(int height) {
179: this .height = height;
180: }
181:
182: public void setViews(int views) {
183: this .views = views;
184: }
185:
186: public void setClicks(int clicks) {
187: this .clicks = clicks;
188: }
189:
190: public void setUrl(String url) {
191: this .url = url;
192: }
193:
194: public void setPlacement(int placement) {
195: this .placement = placement;
196: }
197:
198: public void setWeight(int weight) {
199: this .weight = weight;
200: }
201:
202: /**
203: * @see java.lang.Object#hashCode()
204: */
205: public int hashCode() {
206: return this .id;
207: }
208:
209: /**
210: * @see java.lang.Object#equals(java.lang.Object)
211: */
212: public boolean equals(Object o) {
213: return ((o instanceof Banner) && (((Banner) o).getId() == this .id));
214: }
215:
216: /**
217: * @see java.lang.Object#toString()
218: */
219: public String toString() {
220: return "[comment=" + this .comment + ", id=" + this .id
221: + ", type=" + this .type + ", name=" + this .name
222: + ", description=" + this .description + ", active="
223: + this .active + "]";
224: }
225:
226: }
|