01: /*
02: * Copyright (C) 2007 XStream Committers.
03: * All rights reserved.
04: *
05: * The software in this package is published under the terms of the BSD
06: * style license a copy of which has been included with this distribution in
07: * the LICENSE.txt file.
08: *
09: * Created on 30. April 2007 by Joerg Schaible
10: */
11: package com.thoughtworks.acceptance.objects;
12:
13: import java.util.ArrayList;
14:
15: public class Product {
16:
17: String name;
18: String id;
19: double price;
20: ArrayList tags;
21:
22: public Product(String name, String id, double price) {
23: super ();
24: this .name = name;
25: this .id = id;
26: this .price = price;
27: }
28:
29: public String getId() {
30: return id;
31: }
32:
33: public void setId(String id) {
34: this .id = id;
35: }
36:
37: public String getName() {
38: return name;
39: }
40:
41: public void setName(String name) {
42: this .name = name;
43: }
44:
45: public double getPrice() {
46: return price;
47: }
48:
49: public void setPrice(double price) {
50: this .price = price;
51: }
52:
53: public ArrayList getTags() {
54: return tags;
55: }
56:
57: public void setTags(ArrayList tags) {
58: this .tags = tags;
59: }
60:
61: public String toString() {
62: String ret = "[" + name + ", " + id + ", " + price;
63: if (tags != null) {
64: ret += "\n{";
65: for (java.util.Iterator it = tags.iterator(); it.hasNext();) {
66: String tag = (String) it.next();
67: ret += tag + "\n";
68: }
69: ret += "}";
70: }
71: ret += "]";
72: return ret;
73: }
74:
75: }
|