KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > hibernate > test > component > Person


1 //$Id: Person.java,v 1.3 2005/04/26 21:53:54 oneovthafew Exp $
2
package org.hibernate.test.component;
3
4 import java.util.Date JavaDoc;
5
6 /**
7  * @author Gavin King
8  */

9 public class Person {
10     private String JavaDoc name;
11     private Date JavaDoc dob;
12     private String JavaDoc address;
13     private String JavaDoc currentAddress;
14     private String JavaDoc previousAddress;
15     private int yob;
16     Person() {}
17     public Person(String JavaDoc name, Date JavaDoc dob, String JavaDoc address) {
18         this.name = name;
19         this.dob = dob;
20         this.address = address;
21         this.currentAddress = address;
22     }
23     public int getYob() {
24         return yob;
25     }
26     public void setYob(int age) {
27         this.yob = age;
28     }
29     public String JavaDoc getAddress() {
30         return address;
31     }
32     public void setAddress(String JavaDoc address) {
33         this.address = address;
34     }
35     public Date JavaDoc getDob() {
36         return dob;
37     }
38     public void setDob(Date JavaDoc dob) {
39         this.dob = dob;
40     }
41     public String JavaDoc getName() {
42         return name;
43     }
44     public void setName(String JavaDoc name) {
45         this.name = name;
46     }
47     public String JavaDoc getPreviousAddress() {
48         return previousAddress;
49     }
50     public void setPreviousAddress(String JavaDoc previousAddress) {
51         this.previousAddress = previousAddress;
52     }
53     public void changeAddress(String JavaDoc add) {
54         setPreviousAddress( getAddress() );
55         setAddress(add);
56     }
57     public String JavaDoc getCurrentAddress() {
58         return currentAddress;
59     }
60     public void setCurrentAddress(String JavaDoc currentAddress) {
61         this.currentAddress = currentAddress;
62     }
63 }
64
Popular Tags