1 22 43 package org.jboss.test.hibernate.model; 44 45 import java.io.Serializable ; 46 47 50 public class Name implements Serializable { 51 private String firstName; 52 private String lastName; 53 private Character initial; 54 55 public Name() {} 56 57 public Name(String first, Character middle, String last) { 58 firstName = first; 59 initial = middle; 60 lastName = last; 61 } 62 63 public String getFirstName() { 64 return firstName; 65 } 66 67 public void setFirstName(String firstName) { 68 this.firstName = firstName; 69 } 70 71 public Character getInitial() { 72 return initial; 73 } 74 75 public void setInitial(Character initial) { 76 this.initial = initial; 77 } 78 79 public String getLastName() { 80 return lastName; 81 } 82 83 public void setLastName(String lastName) { 84 this.lastName = lastName; 85 } 86 87 public String toString() { 88 StringBuffer buf = new StringBuffer () 89 .append(firstName) 90 .append(' '); 91 if (initial!=null) buf.append(initial) 92 .append(' '); 93 return buf.append(lastName) 94 .toString(); 95 } 96 97 } 98 99 | Popular Tags |