001: /**
002: * Copyright (c) 2005 Red Hat, Inc. All rights reserved.
003: *
004: * This library is free software; you can redistribute it and/or
005: * modify it under the terms of the GNU Lesser General Public
006: * License as published by the Free Software Foundation; either
007: * version 2.1 of the License, or any later version.
008: *
009: * This library is distributed in the hope that it will be useful,
010: * but WITHOUT ANY WARRANTY; without even the implied warranty of
011: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
012: * Lesser General Public License for more details.
013: *
014: * You should have received a copy of the GNU Lesser General Public
015: * License along with this library; if not, write to the Free Software
016: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
017: * USA
018: *
019: * Component of: Red Hat Application Server
020: *
021: * Initial Developers: Gregory Lapouchnian
022: * Patrick Smith
023: * --------------------------------------------------------------------------
024: * $Id: Item.java 7027 2005-07-08 14:00:45Z glapouch $
025: * --------------------------------------------------------------------------
026: */package olstore.client;
027:
028: import java.awt.image.BufferedImage;
029:
030: /**
031: * A representation of a single item on sale in the store.
032: */
033: public class Item {
034:
035: /** The title of this item. */
036: private String title;
037:
038: /** The description for this item. */
039: private String description;
040:
041: /** The price of this item. */
042: private String price;
043:
044: /** The product category for this item. */
045: private String category;
046:
047: /** The unique ID for this item. */
048: private String id;
049:
050: /** The image for this item. */
051: private BufferedImage image;
052:
053: /**
054: * A single item from the catalog.
055: * @param title item's name
056: * @param description item's description
057: * @param price the price
058: * @param category the product category
059: * @param id the unique ID
060: * @param image an image showing this item
061: */
062: public Item(String title, String description, String price,
063: String category, String id, BufferedImage image) {
064:
065: this .title = title;
066: this .description = description;
067: this .price = price;
068: this .category = category;
069: this .id = id;
070: this .image = image;
071: }
072:
073: /**
074: * Get the product category.
075: * @return Returns the category.
076: */
077: public String getCategory() {
078: return category;
079: }
080:
081: /**
082: * Set the product category.
083: * @param category The category to set.
084: */
085: public void setCategory(String category) {
086: this .category = category;
087: }
088:
089: /**
090: * Get the description of this item.
091: * @return Returns the description.
092: */
093: public String getDescription() {
094: return description;
095: }
096:
097: /**
098: * Set the description for this item.
099: * @param description
100: * The description to set.
101: */
102: public void setDescription(String description) {
103: this .description = description;
104: }
105:
106: /**
107: * Get the image showing this item.
108: * @return Returns the image.
109: */
110: public BufferedImage getImage() {
111: return image;
112: }
113:
114: /**
115: * Set the image that represents this item.
116: * @param image The image to set.
117: */
118: public void setImage(BufferedImage image) {
119: this .image = image;
120: }
121:
122: /**
123: * Get the price for this item.
124: * @return Returns the price.
125: */
126: public String getPrice() {
127: return price;
128: }
129:
130: /**
131: * Set the price for this item.
132: * @param price The price to set.
133: */
134: public void setPrice(String price) {
135: this .price = price;
136: }
137:
138: /**
139: * Get the title for this item.
140: * @return Returns the title.
141: */
142: public String getTitle() {
143: return title;
144: }
145:
146: /**
147: * Set the title for this item.
148: * @param title The title to set.
149: */
150: public void setTitle(String title) {
151: this .title = title;
152: }
153:
154: /**
155: * Get the ID for this item.
156: * @return The ID for this item.
157: */
158: public String getId() {
159: return id;
160: }
161: }
|