Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
NameString |
|
| 1.0;1 |
1 | /* | |
2 | * $Id: NameString.java 10789 2008-02-12 20:04:43Z dfeist $ | |
3 | * -------------------------------------------------------------------------------------- | |
4 | * Copyright (c) MuleSource, Inc. All rights reserved. http://www.mulesource.com | |
5 | * | |
6 | * The software in this package is published under the terms of the CPAL v1.0 | |
7 | * license, a copy of which has been included with this distribution in the | |
8 | * LICENSE.txt file. | |
9 | */ | |
10 | ||
11 | package org.mule.example.hello; | |
12 | ||
13 | import java.io.Serializable; | |
14 | ||
15 | /** | |
16 | * <code>NameString</code> TODO (document class) | |
17 | */ | |
18 | public class NameString implements Serializable | |
19 | { | |
20 | /** | |
21 | * Serial version | |
22 | */ | |
23 | private static final long serialVersionUID = 7010138636008560022L; | |
24 | ||
25 | private String name; | |
26 | private String greeting; | |
27 | ||
28 | public NameString() | |
29 | 4 | { |
30 | 4 | this.name = null; |
31 | 4 | } |
32 | ||
33 | public NameString(String name) | |
34 | 16 | { |
35 | 16 | this.name = name; |
36 | 16 | } |
37 | ||
38 | /** | |
39 | * @return Returns the name. | |
40 | */ | |
41 | public String getName() | |
42 | { | |
43 | 26 | return name; |
44 | } | |
45 | ||
46 | /** | |
47 | * @param name The name to set. | |
48 | */ | |
49 | public void setName(String name) | |
50 | { | |
51 | 6 | this.name = name; |
52 | 6 | } |
53 | ||
54 | /** | |
55 | * @return Returns the greeting. | |
56 | */ | |
57 | public String getGreeting() | |
58 | { | |
59 | 16 | return greeting; |
60 | } | |
61 | ||
62 | /** | |
63 | * @param greeting The greeting to set. | |
64 | */ | |
65 | public void setGreeting(String greeting) | |
66 | { | |
67 | 2 | this.greeting = greeting; |
68 | 2 | } |
69 | ||
70 | public boolean isValid() | |
71 | { | |
72 | 2 | return name != null && name.length() > 0; |
73 | } | |
74 | ||
75 | } |