KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > hibernate > test > lob > Name


1 // $Id: Name.java,v 1.1 2004/11/04 21:59:22 steveebersole Exp $
2
package org.hibernate.test.lob;
3
4 import java.io.Serializable JavaDoc;
5
6 /**
7  * Implementation of Name.
8  *
9  * @author Steve
10  */

11 public class Name implements Serializable JavaDoc {
12
13     private String JavaDoc firstName;
14     private String JavaDoc lastName;
15     private Character JavaDoc initial;
16
17     public Name() {}
18
19     public Name(String JavaDoc first, Character JavaDoc middle, String JavaDoc last) {
20         firstName = first;
21         initial = middle;
22         lastName = last;
23     }
24
25     public String JavaDoc getFirstName() {
26         return firstName;
27     }
28
29     public void setFirstName(String JavaDoc firstName) {
30         this.firstName = firstName;
31     }
32
33     public Character JavaDoc getInitial() {
34         return initial;
35     }
36
37     public void setInitial(Character JavaDoc initial) {
38         this.initial = initial;
39     }
40
41     public String JavaDoc getLastName() {
42         return lastName;
43     }
44
45     public void setLastName(String JavaDoc lastName) {
46         this.lastName = lastName;
47     }
48
49     public String JavaDoc toString() {
50         StringBuffer JavaDoc buf = new StringBuffer JavaDoc()
51             .append(firstName)
52             .append(' ');
53         if (initial!=null) buf.append(initial)
54             .append(' ');
55         return buf.append(lastName)
56             .toString();
57     }
58 }
59
Popular Tags