1 package org.hibernate.test.component; 3 4 import java.util.Date ; 5 6 9 public class Person { 10 private String name; 11 private Date dob; 12 private String address; 13 private String currentAddress; 14 private String previousAddress; 15 private int yob; 16 Person() {} 17 public Person(String name, Date dob, String 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 getAddress() { 30 return address; 31 } 32 public void setAddress(String address) { 33 this.address = address; 34 } 35 public Date getDob() { 36 return dob; 37 } 38 public void setDob(Date dob) { 39 this.dob = dob; 40 } 41 public String getName() { 42 return name; 43 } 44 public void setName(String name) { 45 this.name = name; 46 } 47 public String getPreviousAddress() { 48 return previousAddress; 49 } 50 public void setPreviousAddress(String previousAddress) { 51 this.previousAddress = previousAddress; 52 } 53 public void changeAddress(String add) { 54 setPreviousAddress( getAddress() ); 55 setAddress(add); 56 } 57 public String getCurrentAddress() { 58 return currentAddress; 59 } 60 public void setCurrentAddress(String currentAddress) { 61 this.currentAddress = currentAddress; 62 } 63 } 64 | Popular Tags |