1 package ejava.examples.webtier.bo; 2 3 import java.io.Serializable; 4 5 public class Person implements Serializable { 6 private static final long serialVersionUID = 1L; 7 private long id; 8 private String firstName; 9 private String lastName; 10 11 public Person() {} 12 public Person(long id) { setId(id); } 13 public Person(long id, String firstName, String lastName) { 14 setId(id); 15 setFirstName(firstName); 16 setLastName(lastName); 17 } 18 public long getId() { 19 return id; 20 } 21 private void setId(long id) { 22 this.id = id; 23 } 24 25 public String getFirstName() { 26 return firstName; 27 } 28 public void setFirstName(String firstName) { 29 this.firstName = firstName; 30 } 31 public String getLastName() { 32 return lastName; 33 } 34 public void setLastName(String lastName) { 35 this.lastName = lastName; 36 } 37 public String toString() { 38 StringBuilder text = new StringBuilder(); 39 text.append("id=" + id); 40 text.append(", firstName=" + firstName); 41 text.append(", lastName=" + lastName); 42 return text.toString(); 43 } 44 }