KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > cocoon > forms > samples > dreamteam > TeamMember


1 /*
2  * Copyright 1999-2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package org.apache.cocoon.forms.samples.dreamteam;
17
18 /**
19  * TeamMember
20  */

21 public class TeamMember {
22     private String JavaDoc memberId = null;
23     private String JavaDoc name = null;
24     private String JavaDoc position = null;
25     private String JavaDoc country = null;
26
27     public TeamMember() {
28         super();
29     }
30
31     public String JavaDoc getMemberId() {
32         return memberId;
33     }
34
35     public void setMemberId(String JavaDoc memberID) {
36         this.memberId = memberID;
37     }
38
39     public String JavaDoc getName() {
40         return name;
41     }
42
43     public String JavaDoc getLastName() {
44         if (name == null) {
45             return "Name not set!";
46         }
47         String JavaDoc lastName = name.substring(name.indexOf(" ") + 1);
48         if (lastName.equals("")) {
49             lastName = name;
50         }
51         return lastName;
52     }
53
54     public void setName(String JavaDoc name) {
55         this.name = name;
56     }
57
58     public String JavaDoc getPosition() {
59         return position;
60     }
61
62     public void setPosition(String JavaDoc profession) {
63         this.position = profession;
64     }
65
66     public String JavaDoc getCountry() {
67         return country;
68     }
69
70     public void setCountry(String JavaDoc country) {
71         this.country = country;
72     }
73
74     public String JavaDoc toString() {
75         String JavaDoc result = "<member id='" + memberId + "'><name>" + name
76                 + "</name><position>" + position + "</position><country>"
77                 + country + "</country></member>";
78         return result;
79     }
80
81 }
82
Popular Tags