KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > inversoft > verge > mvc > test > Customer


1 /*
2  * Copyright (c) 2003, Inversoft
3  *
4  * This software is distribuable under the GNU Lesser General Public License.
5  * For more information visit gnu.org.
6  */

7 package com.inversoft.verge.mvc.test;
8
9
10 /**
11  * <p>
12  * This class is a test javabean that represents a customer
13  * </p>
14  *
15  * @author Brian Pontarelli
16  * @since 2.0
17  * @version 2.0
18  */

19 public class Customer {
20
21     private String JavaDoc firstName;
22     private String JavaDoc lastName;
23     private String JavaDoc phone;
24     private Address address;
25     private Integer JavaDoc userID;
26     private boolean male;
27     private int age;
28     private int testInt;
29     private float testFloat;
30
31
32     /**
33      * Constructor for Customer.
34      */

35     public Customer() {
36         super();
37     }
38
39
40     /**
41      * Retrieves the customers first name
42      *
43      * @return Returns the customers first name
44      */

45     public String JavaDoc getFirstName() {
46         return firstName;
47     }
48
49     /**
50      * Populates the customers first name
51      *
52      * @param firstName The value of the customers first name
53      */

54     public void setFirstName(String JavaDoc firstName) {
55         this.firstName = firstName;
56     }
57
58     /**
59      * Retrieves the customers last name
60      *
61      * @return Returns the customers last name
62      */

63     public String JavaDoc getLastName() {
64         return lastName;
65     }
66
67     /**
68      * Populates the customers last name
69      *
70      * @param lastName The value of the customers last name
71      */

72     public void setLastName(String JavaDoc lastName) {
73         this.lastName = lastName;
74     }
75
76     /**
77      * Retrieves the customers phone number as a string
78      *
79      * @return The customers phone number
80      */

81     public String JavaDoc getPhone() {
82         return phone;
83     }
84
85     /**
86      * Sets the customers phone number as a string
87      *
88      * @param phone The customers phone number
89      */

90     public void setPhone(String JavaDoc phone) {
91         this.phone = phone;
92     }
93
94     /**
95      * Retrieves the customers address
96      *
97      * @return Returns the customers address
98      */

99     public Address getAddress() {
100         return address;
101     }
102
103     /**
104      * Populates the customers address
105      *
106      * @param address The value of the customers address
107      */

108     public void setAddress(Address address) {
109         this.address = address;
110     }
111
112     /**
113      * Retrieves the customers user id
114      *
115      * @return Returns the customers user id
116      */

117     public Integer JavaDoc getUserID() {
118         return userID;
119     }
120
121     /**
122      * Populates the customers user id
123      *
124      * @param userID The value of the customers user id
125      */

126     public void setUserID(Integer JavaDoc userID) {
127         this.userID = userID;
128     }
129
130     /**
131      * Retrieves the customer's age
132      *
133      * @return Returns the customer's age
134      */

135     public int getAge() {
136         return age;
137     }
138
139     /**
140      * Populates the customer's age
141      *
142      * @param age The value of the customer's age
143      */

144     public void setAge(int age) {
145         this.age = age;
146     }
147
148     /**
149      * Retrieves the customers sex as a boolean
150      *
151      * @return Returns the customers sex as a boolean
152      */

153     public boolean isMale() {
154         return male;
155     }
156
157     /**
158      * Populates the customers sex as a boolean
159      *
160      * @param male The value of the customers sex as a boolean
161      */

162     public void setMale(boolean male) {
163         this.male = male;
164     }
165
166     /**
167      * A test integer
168      *
169      * @return Returns the test integer
170      */

171     public int getTestInt() {
172         return testInt;
173     }
174
175     /**
176      * Populates the test ineteger
177      *
178      * @param testInt The new test integer
179      */

180     public void setTestInt(int testInt) {
181         this.testInt = testInt;
182     }
183
184     /**
185      * A test float
186      *
187      * @return Returns the test float
188      */

189     public float getTestFloat() {
190         return testFloat;
191     }
192
193     /**
194      * Populates the test float
195      *
196      * @param testFloat The new test float
197      */

198     public void setTestFloat(float testFloat) {
199         this.testFloat = testFloat;
200     }
201
202     /**
203      * Converts the customer to a string
204      *
205      * @see java.lang.Object#toString()
206      */

207     public String JavaDoc toString() {
208         StringBuffer JavaDoc buf = new StringBuffer JavaDoc();
209         buf.append("First name: ").append(firstName).append("\n");
210         buf.append("Last name: ").append(lastName).append("\n");
211         buf.append("Address: ").append(address).append("\n");
212         buf.append("userID: ").append(userID).append("\n");
213         buf.append("male: ").append(male).append("\n");
214         buf.append("age: ").append(age).append("\n");
215         buf.append("testInt: ").append(testInt).append("\n");
216         buf.append("testFloat: ").append(testFloat).append("\n");
217         return buf.toString();
218     }
219 }
220
Popular Tags