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.List;
14:
15: public class Category {
16:
17: String name;
18: String id;
19: List products;
20:
21: public Category(String name, String id) {
22: super ();
23: this .name = name;
24: this .id = id;
25: }
26:
27: public String getId() {
28: return id;
29: }
30:
31: public void setId(String id) {
32: this .id = id;
33: }
34:
35: public String getName() {
36: return name;
37: }
38:
39: public void setName(String name) {
40: this .name = name;
41: }
42:
43: public List getProducts() {
44: return products;
45: }
46:
47: public void setProducts(List products) {
48: this .products = products;
49: }
50:
51: public String toString() {
52: String ret = "[" + name + ", " + id;
53: if (products != null) {
54: ret += "\n{";
55: for (java.util.Iterator it = products.iterator(); it
56: .hasNext();) {
57: Product product = (Product) it.next();
58: ret += product + "\n";
59: }
60: ret += "}";
61: }
62: ret += "]";
63: return ret;
64: }
65:
66: }
|