KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > remoting > transport > http > ComplexObject


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

7 package org.jboss.remoting.transport.http;
8
9 import java.io.Serializable JavaDoc;
10
11 /**
12  * @author <a HREF="mailto:tom.elrod@jboss.com">Tom Elrod</a>
13  */

14 public class ComplexObject implements Serializable JavaDoc
15 {
16    public int i = 42;
17    public String JavaDoc s = "test";
18    public boolean b = true;
19
20    public ComplexObject()
21    {
22
23    }
24
25    public ComplexObject(int i, String JavaDoc s, boolean b)
26    {
27       this.i = i;
28       this.s = s;
29       this.b = b;
30    }
31
32    public boolean equals(Object JavaDoc o)
33    {
34       if(o instanceof ComplexObject)
35       {
36          ComplexObject co = (ComplexObject)o;
37          if(co.i == i && co.s.equals(s) && co.b == b)
38          {
39             return true;
40          }
41          else
42          {
43             return false;
44          }
45       }
46       else
47       {
48          return false;
49       }
50    }
51 }
Popular Tags