01: package org.apache.ojb.broker;
02:
03: import java.io.Serializable;
04: import java.util.List;
05: import java.util.Vector;
06:
07: import org.apache.commons.lang.builder.ToStringBuilder;
08:
09: /**
10: * @author <a href="mailto:schneider@mendel.imp.univie.ac.at">Georg Schneider</a>
11: *
12: */
13: public class Zoo implements Serializable {
14: private int zooId;
15: private String name;
16: private List animals = new Vector();
17:
18: /**
19: * Constructor for Zoo.
20: */
21: public Zoo() {
22: super ();
23: }
24:
25: public Zoo(String name) {
26: this .name = name;
27: }
28:
29: public List getAnimals() {
30: return animals;
31: }
32:
33: public void addAnimal(InterfaceAnimal animal) {
34: animals.add(animal);
35: }
36:
37: public int getZooId() {
38: return zooId;
39: }
40:
41: public String toString() {
42: return new ToStringBuilder(this ).append("id", zooId).append(
43: "name", name).append("animals", animals).toString();
44: }
45:
46: /**
47: * Returns the name.
48: * @return String
49: */
50: public String getName() {
51: return name;
52: }
53:
54: /**
55: * Sets the animals.
56: * @param animals The animals to set
57: */
58: public void setAnimals(List animals) {
59: this .animals = animals;
60: }
61:
62: /**
63: * Sets the name.
64: * @param name The name to set
65: */
66: public void setName(String name) {
67: this .name = name;
68: }
69:
70: /**
71: * Sets the zooId.
72: * @param zooId The zooId to set
73: */
74: public void setZooId(int zooId) {
75: this.zooId = zooId;
76: }
77:
78: }
|