01: /*
02: * Enhydra Java Application Server
03: * The Initial Developer of the Original Code is Lutris Technologies Inc.
04: * Portions created by Lutris are Copyright (C) 1997-2000 Lutris Technologies
05: * Inc.
06: * All Rights Reserved.
07: *
08: * The contents of this file are subject to the Enhydra Public License Version
09: * 1.0 (the "License"); you may not use this file except in compliance with the
10: * License. You may obtain a copy of the License at
11: * http://www.enhydra.org/software/license/epl.html
12: *
13: * Software distributed under the License is distributed on an "AS IS" basis,
14: * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
15: * License for the specific language governing rights and limitations under the
16: * License.
17: *
18: *
19: */
20:
21: package golfShop.business.item;
22:
23: import golfShop.data.item.ItemDO;
24: import golfShop.spec.cart.CartItem;
25:
26: /**
27: */
28: public class Item implements CartItem, java.io.Serializable {
29: private ItemDO itemDO;
30:
31: static public Item getItem(long ObjectId) {
32: return new Item(ItemDO.getItemByObjectId(ObjectId));
33: }
34:
35: /**
36: * Constructor
37: *
38: * @param itemDO An ItemDO data object.
39: */
40: public Item(ItemDO itemDO) {
41: this .itemDO = itemDO;
42: }
43:
44: public String getName() {
45: return itemDO.getName();
46: }
47:
48: // needs error-checking
49: public void setName(String name) {
50: itemDO.setName(name);
51: }
52:
53: public String getDescription() {
54: return itemDO.getDescription();
55: }
56:
57: // needs error-checking
58: public void setDescription(String description) {
59: itemDO.setDescription(description);
60: }
61:
62: public long getObjectId() {
63: return itemDO.getObjectId();
64: }
65:
66: public double getPrice() {
67: return itemDO.getPrice();
68: }
69:
70: // needs error-checking
71: public void setPrice(double price) {
72: itemDO.setPrice(price);
73: }
74:
75: /*
76: * Generate info for debugging.
77: */
78: public String toString() {
79: return getName() + "|" + getDescription() + "|" + getObjectId()
80: + "|" + getPrice();
81: }
82: }
|