1   /**
2    * UserContext.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 UserContext  implements java.io.Serializable {
11      private java.lang.String userContextKey;
12      private java.lang.String[] userCategories;
13      private oasis.names.tc.wsrp.v1.types.UserProfile profile;
14      private oasis.names.tc.wsrp.v1.types.Extension[] extensions;
15  
16      public UserContext() {
17      }
18  
19      public UserContext(
20             oasis.names.tc.wsrp.v1.types.Extension[] extensions,
21             oasis.names.tc.wsrp.v1.types.UserProfile profile,
22             java.lang.String[] userCategories,
23             java.lang.String userContextKey) {
24             this.userContextKey = userContextKey;
25             this.userCategories = userCategories;
26             this.profile = profile;
27             this.extensions = extensions;
28      }
29  
30  
31      /**
32       * Gets the userContextKey value for this UserContext.
33       * 
34       * @return userContextKey
35       */
36      public java.lang.String getUserContextKey() {
37          return userContextKey;
38      }
39  
40  
41      /**
42       * Sets the userContextKey value for this UserContext.
43       * 
44       * @param userContextKey
45       */
46      public void setUserContextKey(java.lang.String userContextKey) {
47          this.userContextKey = userContextKey;
48      }
49  
50  
51      /**
52       * Gets the userCategories value for this UserContext.
53       * 
54       * @return userCategories
55       */
56      public java.lang.String[] getUserCategories() {
57          return userCategories;
58      }
59  
60  
61      /**
62       * Sets the userCategories value for this UserContext.
63       * 
64       * @param userCategories
65       */
66      public void setUserCategories(java.lang.String[] userCategories) {
67          this.userCategories = userCategories;
68      }
69  
70      public java.lang.String getUserCategories(int i) {
71          return this.userCategories[i];
72      }
73  
74      public void setUserCategories(int i, java.lang.String _value) {
75          this.userCategories[i] = _value;
76      }
77  
78  
79      /**
80       * Gets the profile value for this UserContext.
81       * 
82       * @return profile
83       */
84      public oasis.names.tc.wsrp.v1.types.UserProfile getProfile() {
85          return profile;
86      }
87  
88  
89      /**
90       * Sets the profile value for this UserContext.
91       * 
92       * @param profile
93       */
94      public void setProfile(oasis.names.tc.wsrp.v1.types.UserProfile profile) {
95          this.profile = profile;
96      }
97  
98  
99      /**
100      * Gets the extensions value for this UserContext.
101      * 
102      * @return extensions
103      */
104     public oasis.names.tc.wsrp.v1.types.Extension[] getExtensions() {
105         return extensions;
106     }
107 
108 
109     /**
110      * Sets the extensions value for this UserContext.
111      * 
112      * @param extensions
113      */
114     public void setExtensions(oasis.names.tc.wsrp.v1.types.Extension[] extensions) {
115         this.extensions = extensions;
116     }
117 
118     public oasis.names.tc.wsrp.v1.types.Extension getExtensions(int i) {
119         return this.extensions[i];
120     }
121 
122     public void setExtensions(int i, oasis.names.tc.wsrp.v1.types.Extension _value) {
123         this.extensions[i] = _value;
124     }
125 
126     private java.lang.Object __equalsCalc = null;
127     public synchronized boolean equals(java.lang.Object obj) {
128         if (!(obj instanceof UserContext)) return false;
129         UserContext other = (UserContext) obj;
130         if (obj == null) return false;
131         if (this == obj) return true;
132         if (__equalsCalc != null) {
133             return (__equalsCalc == obj);
134         }
135         __equalsCalc = obj;
136         boolean _equals;
137         _equals = true && 
138             ((this.userContextKey==null && other.getUserContextKey()==null) || 
139              (this.userContextKey!=null &&
140               this.userContextKey.equals(other.getUserContextKey()))) &&
141             ((this.userCategories==null && other.getUserCategories()==null) || 
142              (this.userCategories!=null &&
143               java.util.Arrays.equals(this.userCategories, other.getUserCategories()))) &&
144             ((this.profile==null && other.getProfile()==null) || 
145              (this.profile!=null &&
146               this.profile.equals(other.getProfile()))) &&
147             ((this.extensions==null && other.getExtensions()==null) || 
148              (this.extensions!=null &&
149               java.util.Arrays.equals(this.extensions, other.getExtensions())));
150         __equalsCalc = null;
151         return _equals;
152     }
153 
154     private boolean __hashCodeCalc = false;
155     public synchronized int hashCode() {
156         if (__hashCodeCalc) {
157             return 0;
158         }
159         __hashCodeCalc = true;
160         int _hashCode = 1;
161         if (getUserContextKey() != null) {
162             _hashCode += getUserContextKey().hashCode();
163         }
164         if (getUserCategories() != null) {
165             for (int i=0;
166                  i<java.lang.reflect.Array.getLength(getUserCategories());
167                  i++) {
168                 java.lang.Object obj = java.lang.reflect.Array.get(getUserCategories(), i);
169                 if (obj != null &&
170                     !obj.getClass().isArray()) {
171                     _hashCode += obj.hashCode();
172                 }
173             }
174         }
175         if (getProfile() != null) {
176             _hashCode += getProfile().hashCode();
177         }
178         if (getExtensions() != null) {
179             for (int i=0;
180                  i<java.lang.reflect.Array.getLength(getExtensions());
181                  i++) {
182                 java.lang.Object obj = java.lang.reflect.Array.get(getExtensions(), i);
183                 if (obj != null &&
184                     !obj.getClass().isArray()) {
185                     _hashCode += obj.hashCode();
186                 }
187             }
188         }
189         __hashCodeCalc = false;
190         return _hashCode;
191     }
192 
193     // Type metadata
194     private static org.apache.axis.description.TypeDesc typeDesc =
195         new org.apache.axis.description.TypeDesc(UserContext.class, true);
196 
197     static {
198         typeDesc.setXmlType(new javax.xml.namespace.QName("urn:oasis:names:tc:wsrp:v1:types", "UserContext"));
199         org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc();
200         elemField.setFieldName("userContextKey");
201         elemField.setXmlName(new javax.xml.namespace.QName("urn:oasis:names:tc:wsrp:v1:types", "userContextKey"));
202         elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
203         typeDesc.addFieldDesc(elemField);
204         elemField = new org.apache.axis.description.ElementDesc();
205         elemField.setFieldName("userCategories");
206         elemField.setXmlName(new javax.xml.namespace.QName("urn:oasis:names:tc:wsrp:v1:types", "userCategories"));
207         elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
208         elemField.setMinOccurs(0);
209         typeDesc.addFieldDesc(elemField);
210         elemField = new org.apache.axis.description.ElementDesc();
211         elemField.setFieldName("profile");
212         elemField.setXmlName(new javax.xml.namespace.QName("urn:oasis:names:tc:wsrp:v1:types", "profile"));
213         elemField.setXmlType(new javax.xml.namespace.QName("urn:oasis:names:tc:wsrp:v1:types", "UserProfile"));
214         elemField.setMinOccurs(0);
215         typeDesc.addFieldDesc(elemField);
216         elemField = new org.apache.axis.description.ElementDesc();
217         elemField.setFieldName("extensions");
218         elemField.setXmlName(new javax.xml.namespace.QName("urn:oasis:names:tc:wsrp:v1:types", "extensions"));
219         elemField.setXmlType(new javax.xml.namespace.QName("urn:oasis:names:tc:wsrp:v1:types", "Extension"));
220         elemField.setMinOccurs(0);
221         typeDesc.addFieldDesc(elemField);
222     }
223 
224     /**
225      * Return type metadata object
226      */
227     public static org.apache.axis.description.TypeDesc getTypeDesc() {
228         return typeDesc;
229     }
230 
231     /**
232      * Get Custom Serializer
233      */
234     public static org.apache.axis.encoding.Serializer getSerializer(
235            java.lang.String mechType, 
236            java.lang.Class _javaType,  
237            javax.xml.namespace.QName _xmlType) {
238         return 
239           new  org.apache.axis.encoding.ser.BeanSerializer(
240             _javaType, _xmlType, typeDesc);
241     }
242 
243     /**
244      * Get Custom Deserializer
245      */
246     public static org.apache.axis.encoding.Deserializer getDeserializer(
247            java.lang.String mechType, 
248            java.lang.Class _javaType,  
249            javax.xml.namespace.QName _xmlType) {
250         return 
251           new  org.apache.axis.encoding.ser.BeanDeserializer(
252             _javaType, _xmlType, typeDesc);
253     }
254 
255 }
256