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