Subversion Repositories SmartDukaan

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
7473 vikram.rag 1
 
2
package com.amazonservices.mws.orders.model;
3
 
4
import javax.xml.bind.annotation.XmlAccessType;
5
import javax.xml.bind.annotation.XmlAccessorType;
6
import javax.xml.bind.annotation.XmlElement;
7
import javax.xml.bind.annotation.XmlRootElement;
8
import javax.xml.bind.annotation.XmlType;
9
 
10
 
11
/**
12
 * <p>Java class for anonymous complex type.
13
 * 
14
 * <p>The following schema fragment specifies the expected content contained within this class.
15
 * 
16
 * <pre>
17
 * &lt;complexType>
18
 *   &lt;complexContent>
19
 *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
20
 *       &lt;sequence>
21
 *         &lt;element ref="{https://mws.amazonservices.com/Orders/2011-01-01}GetServiceStatusResult"/>
22
 *         &lt;element ref="{https://mws.amazonservices.com/Orders/2011-01-01}ResponseMetadata"/>
23
 *       &lt;/sequence>
24
 *     &lt;/restriction>
25
 *   &lt;/complexContent>
26
 * &lt;/complexType>
27
 * </pre>
28
 * 
29
 * 
30
 */
31
@XmlAccessorType(XmlAccessType.FIELD)
32
@XmlType(name = "", propOrder = {
33
    "getServiceStatusResult",
34
    "responseMetadata"
35
})
36
@XmlRootElement(name = "GetServiceStatusResponse")
37
public class GetServiceStatusResponse {
38
 
39
    @XmlElement(name = "GetServiceStatusResult", required = true)
40
    protected GetServiceStatusResult getServiceStatusResult;
41
    @XmlElement(name = "ResponseMetadata", required = true)
42
    protected ResponseMetadata responseMetadata;
43
 
44
    /**
45
     * Default constructor
46
     * 
47
     */
48
    public GetServiceStatusResponse() {
49
        super();
50
    }
51
 
52
    /**
53
     * Value constructor
54
     * 
55
     */
56
    public GetServiceStatusResponse(final GetServiceStatusResult getServiceStatusResult, final ResponseMetadata responseMetadata) {
57
        this.getServiceStatusResult = getServiceStatusResult;
58
        this.responseMetadata = responseMetadata;
59
    }
60
 
61
    /**
62
     * Gets the value of the getServiceStatusResult property.
63
     * 
64
     * @return
65
     *     possible object is
66
     *     {@link GetServiceStatusResult }
67
     *     
68
     */
69
    public GetServiceStatusResult getGetServiceStatusResult() {
70
        return getServiceStatusResult;
71
    }
72
 
73
    /**
74
     * Sets the value of the getServiceStatusResult property.
75
     * 
76
     * @param value
77
     *     allowed object is
78
     *     {@link GetServiceStatusResult }
79
     *     
80
     */
81
    public void setGetServiceStatusResult(GetServiceStatusResult value) {
82
        this.getServiceStatusResult = value;
83
    }
84
 
85
    public boolean isSetGetServiceStatusResult() {
86
        return (this.getServiceStatusResult!= null);
87
    }
88
 
89
    /**
90
     * Gets the value of the responseMetadata property.
91
     * 
92
     * @return
93
     *     possible object is
94
     *     {@link ResponseMetadata }
95
     *     
96
     */
97
    public ResponseMetadata getResponseMetadata() {
98
        return responseMetadata;
99
    }
100
 
101
    /**
102
     * Sets the value of the responseMetadata property.
103
     * 
104
     * @param value
105
     *     allowed object is
106
     *     {@link ResponseMetadata }
107
     *     
108
     */
109
    public void setResponseMetadata(ResponseMetadata value) {
110
        this.responseMetadata = value;
111
    }
112
 
113
    public boolean isSetResponseMetadata() {
114
        return (this.responseMetadata!= null);
115
    }
116
 
117
    /**
118
     * Sets the value of the GetServiceStatusResult property.
119
     * 
120
     * @param value
121
     * @return
122
     *     this instance
123
     */
124
    public GetServiceStatusResponse withGetServiceStatusResult(GetServiceStatusResult value) {
125
        setGetServiceStatusResult(value);
126
        return this;
127
    }
128
 
129
    /**
130
     * Sets the value of the ResponseMetadata property.
131
     * 
132
     * @param value
133
     * @return
134
     *     this instance
135
     */
136
    public GetServiceStatusResponse withResponseMetadata(ResponseMetadata value) {
137
        setResponseMetadata(value);
138
        return this;
139
    }
140
 
141
 
142
    @javax.xml.bind.annotation.XmlTransient
143
    private ResponseHeaderMetadata responseHeaderMetadata;
144
 
145
 
146
    /**
147
     * Checks whether the ResponseHeaderMetadata field has been set.
148
     */
149
    public boolean isSetResponseHeaderMetadata() { 
150
        return this.responseHeaderMetadata != null;
151
    }  
152
 
153
 
154
    /**
155
     * Sets the ResponseHeaderMetadata field.
156
     */
157
    public void setResponseHeaderMetadata(ResponseHeaderMetadata responseHeaderMetadata) { 
158
        this.responseHeaderMetadata = responseHeaderMetadata;
159
    } 
160
 
161
 
162
    /**
163
     * Gets the ResponseHeaderMetadata field.
164
     */
165
    public ResponseHeaderMetadata getResponseHeaderMetadata() {  
166
        return responseHeaderMetadata;
167
    }  
168
 
169
 
170
 
171
    /**
172
     * 
173
     * XML string representation of this object
174
     * 
175
     * @return XML String
176
     */
177
    public String toXML() {
178
        StringBuffer xml = new StringBuffer();
179
        xml.append("<GetServiceStatusResponse xmlns=\"https://mws.amazonservices.com/Orders/2011-01-01\">");
180
        if (isSetGetServiceStatusResult()) {
181
            GetServiceStatusResult  getServiceStatusResult = getGetServiceStatusResult();
182
            xml.append("<GetServiceStatusResult>");
183
            xml.append(getServiceStatusResult.toXMLFragment());
184
            xml.append("</GetServiceStatusResult>");
185
        } 
186
        if (isSetResponseMetadata()) {
187
            ResponseMetadata  responseMetadata = getResponseMetadata();
188
            xml.append("<ResponseMetadata>");
189
            xml.append(responseMetadata.toXMLFragment());
190
            xml.append("</ResponseMetadata>");
191
        } 
192
        xml.append("</GetServiceStatusResponse>");
193
        return xml.toString();
194
    }
195
 
196
    /**
197
     * 
198
     * Escape XML special characters
199
     */
200
    private String escapeXML(String string) {
201
        if (string == null)
202
            return "null";
203
        StringBuffer sb = new StringBuffer();
204
        int length = string.length();
205
        for (int i = 0; i < length; ++i) {
206
            char c = string.charAt(i);
207
            switch (c) {
208
            case '&':
209
                sb.append("&amp;");
210
                break;
211
            case '<':
212
                sb.append("&lt;");
213
                break;
214
            case '>':
215
                sb.append("&gt;");
216
                break;
217
            case '\'':
218
                sb.append("&#039;");
219
                break;
220
            case '"':
221
                sb.append("&quot;");
222
                break;
223
            default:
224
                sb.append(c);
225
            }
226
        }
227
        return sb.toString();
228
    }
229
 
230
 
231
 
232
    /**
233
     * 
234
     * JSON string representation of this object
235
     * 
236
     * @return JSON String
237
     */
238
    public String toJSON() {
239
        StringBuffer json = new StringBuffer();
240
        json.append("{\"GetServiceStatusResponse\" : {");
241
        json.append(quoteJSON("@xmlns"));
242
        json.append(" : ");
243
        json.append(quoteJSON("https://mws.amazonservices.com/Orders/2011-01-01"));
244
        boolean first = true;
245
        json.append(", ");
246
        if (isSetGetServiceStatusResult()) {
247
            if (!first) json.append(", ");
248
            json.append("\"GetServiceStatusResult\" : {");
249
            GetServiceStatusResult  getServiceStatusResult = getGetServiceStatusResult();
250
 
251
            json.append(getServiceStatusResult.toJSONFragment());
252
            json.append("}");
253
            first = false;
254
        } 
255
        if (isSetResponseMetadata()) {
256
            if (!first) json.append(", ");
257
            json.append("\"ResponseMetadata\" : {");
258
            ResponseMetadata  responseMetadata = getResponseMetadata();
259
 
260
            json.append(responseMetadata.toJSONFragment());
261
            json.append("}");
262
            first = false;
263
        } 
264
        json.append("}");
265
        json.append("}");
266
        return json.toString();
267
    }
268
 
269
    /**
270
     * 
271
     * Quote JSON string
272
     */
273
    private String quoteJSON(String string) {
274
        if (string == null)
275
             return "null";
276
        StringBuffer sb = new StringBuffer();
277
        sb.append("\"");
278
        int length = string.length();
279
        for (int i = 0; i < length; ++i) {
280
            char c = string.charAt(i);
281
            switch (c) {
282
            case '"':
283
                sb.append("\\\"");
284
                break;
285
            case '\\':
286
                sb.append("\\\\");
287
                break;
288
            case '/':
289
                sb.append("\\/");
290
                break;
291
            case '\b':
292
                sb.append("\\b");
293
                break;
294
            case '\f':
295
                sb.append("\\f");
296
                break;
297
            case '\n':
298
                sb.append("\\n");
299
                break;
300
            case '\r':
301
                sb.append("\\r");
302
                break;
303
            case '\t':
304
                sb.append("\\t");
305
                break;
306
            default:
307
                if (c <  ' ') {
308
                    sb.append("\\u" + String.format("%03x", Integer.valueOf(c)));
309
                } else {
310
                sb.append(c);
311
                }
312
            }
313
        }
314
        sb.append("\"");
315
        return sb.toString();
316
    }
317
 
318
 
319
}