KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > cache > data > Person


1 package org.jboss.cache.data;
2
3 import java.util.List JavaDoc;
4
5 /**
6  * @author Ben Wang
7  */

8 public class Person implements java.io.Serializable JavaDoc {
9    protected String JavaDoc name;
10    protected Address address;
11
12    public void setName(String JavaDoc name)
13    {
14       this.name = name;
15    }
16
17    public String JavaDoc getName()
18    {
19       return this.name;
20    }
21
22    public void setAddress(Address address)
23    {
24       this.address = address;
25    }
26
27    public Address getAddress()
28    {
29       return this.address;
30    }
31
32    public String JavaDoc toString()
33    {
34       StringBuffer JavaDoc buf = new StringBuffer JavaDoc();
35       buf.append("{Name = " +name);
36       if (address != null)
37          buf.append(", Address = " + address.getSimpleAddress());
38       buf.append("}\n");
39
40       return buf.toString();
41    }
42
43 }
44
Popular Tags