1   /**
2    * Resource.java
3    *
4    * This file was auto-generated from WSDL
5    * by the Apache Axis 1.2RC3 Feb 28, 2005 (10:15:14 EST) WSDL2Java emitter.
6    */
7   
8   package oasis.names.tc.wsrp.v1.types;
9   
10  public class Resource  implements java.io.Serializable {
11      private oasis.names.tc.wsrp.v1.types.ResourceValue[] values;
12      private oasis.names.tc.wsrp.v1.types.Extension[] extensions;
13      private java.lang.String resourceName;  // attribute
14  
15      public Resource() {
16      }
17  
18      public Resource(
19             oasis.names.tc.wsrp.v1.types.Extension[] extensions,
20             java.lang.String resourceName,
21             oasis.names.tc.wsrp.v1.types.ResourceValue[] values) {
22             this.values = values;
23             this.extensions = extensions;
24             this.resourceName = resourceName;
25      }
26  
27  
28      /**
29       * Gets the values value for this Resource.
30       * 
31       * @return values
32       */
33      public oasis.names.tc.wsrp.v1.types.ResourceValue[] getValues() {
34          return values;
35      }
36  
37  
38      /**
39       * Sets the values value for this Resource.
40       * 
41       * @param values
42       */
43      public void setValues(oasis.names.tc.wsrp.v1.types.ResourceValue[] values) {
44          this.values = values;
45      }
46  
47      public oasis.names.tc.wsrp.v1.types.ResourceValue getValues(int i) {
48          return this.values[i];
49      }
50  
51      public void setValues(int i, oasis.names.tc.wsrp.v1.types.ResourceValue _value) {
52          this.values[i] = _value;
53      }
54  
55  
56      /**
57       * Gets the extensions value for this Resource.
58       * 
59       * @return extensions
60       */
61      public oasis.names.tc.wsrp.v1.types.Extension[] getExtensions() {
62          return extensions;
63      }
64  
65  
66      /**
67       * Sets the extensions value for this Resource.
68       * 
69       * @param extensions
70       */
71      public void setExtensions(oasis.names.tc.wsrp.v1.types.Extension[] extensions) {
72          this.extensions = extensions;
73      }
74  
75      public oasis.names.tc.wsrp.v1.types.Extension getExtensions(int i) {
76          return this.extensions[i];
77      }
78  
79      public void setExtensions(int i, oasis.names.tc.wsrp.v1.types.Extension _value) {
80          this.extensions[i] = _value;
81      }
82  
83  
84      /**
85       * Gets the resourceName value for this Resource.
86       * 
87       * @return resourceName
88       */
89      public java.lang.String getResourceName() {
90          return resourceName;
91      }
92  
93  
94      /**
95       * Sets the resourceName value for this Resource.
96       * 
97       * @param resourceName
98       */
99      public void setResourceName(java.lang.String resourceName) {
100         this.resourceName = resourceName;
101     }
102 
103     private java.lang.Object __equalsCalc = null;
104     public synchronized boolean equals(java.lang.Object obj) {
105         if (!(obj instanceof Resource)) return false;
106         Resource other = (Resource) obj;
107         if (obj == null) return false;
108         if (this == obj) return true;
109         if (__equalsCalc != null) {
110             return (__equalsCalc == obj);
111         }
112         __equalsCalc = obj;
113         boolean _equals;
114         _equals = true && 
115             ((this.values==null && other.getValues()==null) || 
116              (this.values!=null &&
117               java.util.Arrays.equals(this.values, other.getValues()))) &&
118             ((this.extensions==null && other.getExtensions()==null) || 
119              (this.extensions!=null &&
120               java.util.Arrays.equals(this.extensions, other.getExtensions()))) &&
121             ((this.resourceName==null && other.getResourceName()==null) || 
122              (this.resourceName!=null &&
123               this.resourceName.equals(other.getResourceName())));
124         __equalsCalc = null;
125         return _equals;
126     }
127 
128     private boolean __hashCodeCalc = false;
129     public synchronized int hashCode() {
130         if (__hashCodeCalc) {
131             return 0;
132         }
133         __hashCodeCalc = true;
134         int _hashCode = 1;
135         if (getValues() != null) {
136             for (int i=0;
137                  i<java.lang.reflect.Array.getLength(getValues());
138                  i++) {
139                 java.lang.Object obj = java.lang.reflect.Array.get(getValues(), i);
140                 if (obj != null &&
141                     !obj.getClass().isArray()) {
142                     _hashCode += obj.hashCode();
143                 }
144             }
145         }
146         if (getExtensions() != null) {
147             for (int i=0;
148                  i<java.lang.reflect.Array.getLength(getExtensions());
149                  i++) {
150                 java.lang.Object obj = java.lang.reflect.Array.get(getExtensions(), i);
151                 if (obj != null &&
152                     !obj.getClass().isArray()) {
153                     _hashCode += obj.hashCode();
154                 }
155             }
156         }
157         if (getResourceName() != null) {
158             _hashCode += getResourceName().hashCode();
159         }
160         __hashCodeCalc = false;
161         return _hashCode;
162     }
163 
164     // Type metadata
165     private static org.apache.axis.description.TypeDesc typeDesc =
166         new org.apache.axis.description.TypeDesc(Resource.class, true);
167 
168     static {
169         typeDesc.setXmlType(new javax.xml.namespace.QName("urn:oasis:names:tc:wsrp:v1:types", "Resource"));
170         org.apache.axis.description.AttributeDesc attrField = new org.apache.axis.description.AttributeDesc();
171         attrField.setFieldName("resourceName");
172         attrField.setXmlName(new javax.xml.namespace.QName("", "resourceName"));
173         attrField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
174         typeDesc.addFieldDesc(attrField);
175         org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc();
176         elemField.setFieldName("values");
177         elemField.setXmlName(new javax.xml.namespace.QName("urn:oasis:names:tc:wsrp:v1:types", "values"));
178         elemField.setXmlType(new javax.xml.namespace.QName("urn:oasis:names:tc:wsrp:v1:types", "ResourceValue"));
179         typeDesc.addFieldDesc(elemField);
180         elemField = new org.apache.axis.description.ElementDesc();
181         elemField.setFieldName("extensions");
182         elemField.setXmlName(new javax.xml.namespace.QName("urn:oasis:names:tc:wsrp:v1:types", "extensions"));
183         elemField.setXmlType(new javax.xml.namespace.QName("urn:oasis:names:tc:wsrp:v1:types", "Extension"));
184         elemField.setMinOccurs(0);
185         typeDesc.addFieldDesc(elemField);
186     }
187 
188     /**
189      * Return type metadata object
190      */
191     public static org.apache.axis.description.TypeDesc getTypeDesc() {
192         return typeDesc;
193     }
194 
195     /**
196      * Get Custom Serializer
197      */
198     public static org.apache.axis.encoding.Serializer getSerializer(
199            java.lang.String mechType, 
200            java.lang.Class _javaType,  
201            javax.xml.namespace.QName _xmlType) {
202         return 
203           new  org.apache.axis.encoding.ser.BeanSerializer(
204             _javaType, _xmlType, typeDesc);
205     }
206 
207     /**
208      * Get Custom Deserializer
209      */
210     public static org.apache.axis.encoding.Deserializer getDeserializer(
211            java.lang.String mechType, 
212            java.lang.Class _javaType,  
213            javax.xml.namespace.QName _xmlType) {
214         return 
215           new  org.apache.axis.encoding.ser.BeanDeserializer(
216             _javaType, _xmlType, typeDesc);
217     }
218 
219 }
220