1 package org.apache.ojb.broker; 2 3 import java.io.Serializable ; 4 import java.util.List ; 5 import java.util.Vector ; 6 7 import org.apache.commons.lang.builder.ToStringBuilder; 8 9 13 public class Zoo implements Serializable 14 { 15 private int zooId; 16 private String name; 17 private List animals = new Vector (); 18 19 22 public Zoo() 23 { 24 super(); 25 } 26 27 public Zoo(String name) 28 { 29 this.name = name; 30 } 31 32 public List getAnimals() 33 { 34 return animals; 35 } 36 37 public void addAnimal(InterfaceAnimal animal) 38 { 39 animals.add(animal); 40 } 41 42 public int getZooId() 43 { 44 return zooId; 45 } 46 47 public String toString() 48 { 49 return new ToStringBuilder(this) 50 .append("id", zooId) 51 .append("name", name) 52 .append("animals", animals) 53 .toString(); 54 } 55 56 60 public String getName() 61 { 62 return name; 63 } 64 65 69 public void setAnimals(List animals) 70 { 71 this.animals = animals; 72 } 73 74 78 public void setName(String name) 79 { 80 this.name = name; 81 } 82 83 87 public void setZooId(int zooId) 88 { 89 this.zooId = zooId; 90 } 91 92 } 93 | Popular Tags |