KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > xb > binding > metadata > ValueMetaData


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.xb.binding.metadata;
23
24
25 /**
26  * @author <a HREF="mailto:alex@jboss.org">Alexey Loubyansky</a>
27  * @version <tt>$Revision: 1958 $</tt>
28  */

29 public class ValueMetaData
30 {
31    private String JavaDoc id;
32    private String JavaDoc ref;
33    private String JavaDoc unmarshalMethod;
34    private String JavaDoc marshalMethod;
35
36    public String JavaDoc getId()
37    {
38       return id;
39    }
40
41    public void setId(String JavaDoc id)
42    {
43       this.id = id;
44    }
45
46    public String JavaDoc getRef()
47    {
48       return ref;
49    }
50
51    public void setRef(String JavaDoc ref)
52    {
53       this.ref = ref;
54    }
55
56    public String JavaDoc getUnmarshalMethod()
57    {
58       return unmarshalMethod;
59    }
60
61    public void setUnmarshalMethod(String JavaDoc unmarshalMethod)
62    {
63       this.unmarshalMethod = unmarshalMethod;
64    }
65
66    public String JavaDoc getMarshalMethod()
67    {
68       return marshalMethod;
69    }
70
71    public void setMarshalMethod(String JavaDoc marshalMethod)
72    {
73       this.marshalMethod = marshalMethod;
74    }
75
76    public boolean equals(Object JavaDoc o)
77    {
78       if(this == o)
79       {
80          return true;
81       }
82       if(!(o instanceof ValueMetaData))
83       {
84          return false;
85       }
86
87       final ValueMetaData valueMetaData = (ValueMetaData)o;
88
89       if(id != null ? !id.equals(valueMetaData.id) : valueMetaData.id != null)
90       {
91          return false;
92       }
93       if(marshalMethod != null ? !marshalMethod.equals(valueMetaData.marshalMethod) : valueMetaData.marshalMethod != null)
94       {
95          return false;
96       }
97       if(ref != null ? !ref.equals(valueMetaData.ref) : valueMetaData.ref != null)
98       {
99          return false;
100       }
101       if(unmarshalMethod != null ?
102          !unmarshalMethod.equals(valueMetaData.unmarshalMethod) :
103          valueMetaData.unmarshalMethod != null)
104       {
105          return false;
106       }
107
108       return true;
109    }
110
111    public int hashCode()
112    {
113       int result;
114       result = (id != null ? id.hashCode() : 0);
115       result = 29 * result + (ref != null ? ref.hashCode() : 0);
116       result = 29 * result + (unmarshalMethod != null ? unmarshalMethod.hashCode() : 0);
117       result = 29 * result + (marshalMethod != null ? marshalMethod.hashCode() : 0);
118       return result;
119    }
120 }
121
Popular Tags