KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > test > jbossnet > ejbsimple > HelloData


1 /*
2  * JBoss, the OpenSource J2EE webOS
3  *
4  * Distributable under LGPL license.
5  * See terms of license at gnu.org.
6  */

7
8 package org.jboss.test.jbossnet.ejbsimple;
9
10 /**
11  * A serializable data object for testing data passed to an EJB through the web
12  * service interface.
13  * @author jung
14  * @version $Revision: 1.1.1.1.6.1 $
15  * @jboss-net.xml-schema urn="ejbsimple:HelloData" array="true"
16  */

17
18 public class HelloData implements java.io.Serializable JavaDoc
19 {
20    static final long serialVersionUID = 3470987363548611533L;
21    private String JavaDoc name;
22
23    public String JavaDoc getName()
24    {
25       return name;
26    }
27
28    public void setName(String JavaDoc name)
29    {
30       this.name = name;
31    }
32
33    public boolean equals(Object JavaDoc obj)
34    {
35       if (this == obj)
36          return true;
37       if (obj == null || (obj instanceof HelloData) == false)
38          return false;
39       HelloData other = (HelloData) obj;
40       if (name == null && other.name == null)
41          return true;
42       if (name == null && other.name != null)
43          return false;
44       return (name.equals(other.name));
45    }
46
47    public int hashCode()
48    {
49       if (name == null)
50          return 0;
51       else
52          return name.hashCode();
53    }
54 }
55
Popular Tags