KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > test > webservice > marshalltest > types > Bean


1 /*
2   * JBoss, Home of Professional Open Source
3   * Copyright 2005, JBoss Inc., and individual contributors as indicated
4   * by the @authors tag. See the copyright.txt in the distribution for a
5   * full listing of individual contributors.
6   *
7   * This is free software; you can redistribute it and/or modify it
8   * under the terms of the GNU Lesser General Public License as
9   * published by the Free Software Foundation; either version 2.1 of
10   * the License, or (at your option) any later version.
11   *
12   * This software is distributed in the hope that it will be useful,
13   * but WITHOUT ANY WARRANTY; without even the implied warranty of
14   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15   * Lesser General Public License for more details.
16   *
17   * You should have received a copy of the GNU Lesser General Public
18   * License along with this software; if not, write to the Free
19   * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20   * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21   */

22 package org.jboss.test.webservice.marshalltest.types;
23
24 import java.util.Arrays JavaDoc;
25
26 public class Bean implements java.io.Serializable JavaDoc
27 {
28    static final long serialVersionUID = 6584528323279029461L;
29    private int x;
30    private int y;
31    private byte[] base64;
32
33    public Bean()
34    {
35    }
36
37    public int getX()
38    {
39       return x;
40    }
41
42    public void setX(int x)
43    {
44       this.x = x;
45    }
46
47    public int getY()
48    {
49       return y;
50    }
51
52    public void setY(int y)
53    {
54       this.y = y;
55    }
56
57    public byte[] getBase64()
58    {
59       return base64;
60    }
61
62    public void setBase64(byte[] base64)
63    {
64       this.base64 = base64;
65    }
66
67    public boolean equals(Object JavaDoc o)
68    {
69       if (this == o) return true;
70       if (!(o instanceof Bean)) return false;
71
72       final Bean bean = (Bean)o;
73
74       if (x != bean.x) return false;
75       if (y != bean.y) return false;
76       if (!Arrays.equals(base64, bean.base64)) return false;
77
78       return true;
79    }
80
81    public int hashCode()
82    {
83       int result;
84       result = x;
85       result = 29 * result + y;
86       return result;
87    }
88
89    public String JavaDoc toString()
90    {
91       String JavaDoc str = (base64 != null ? new String JavaDoc(base64) : null);
92       return "[x=" + x + ",y=" + y + ",base64=" + str + "]";
93    }
94 }
95
Popular Tags