Subversion Repositories SmartDukaan

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
12451 kshitij.so 1
 
2
package com.amazonaws.mws.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="{http://mws.amazonaws.com/doc/2009-01-01/}GetReportResult"/>
22
 *         &lt;element ref="{http://mws.amazonaws.com/doc/2009-01-01/}ResponseMetadata"/>
23
 *       &lt;/sequence>
24
 *     &lt;/restriction>
25
 *   &lt;/complexContent>
26
 * &lt;/complexType>
27
 * </pre>
28
 * Generated by AWS Code Generator
29
 * <p/>
30
 * Tue Feb 03 16:00:09 PST 2009
31
 * 
32
 */
33
@XmlAccessorType(XmlAccessType.FIELD)
34
@XmlType(name = "", propOrder = {
35
    "getReportResult",
36
    "responseMetadata"
37
})
38
@XmlRootElement(name = "GetReportResponse")
39
public class GetReportResponse {
40
 
41
    @XmlElement(name = "GetReportResult", required = true)
42
    protected GetReportResult getReportResult;
43
    @XmlElement(name = "ResponseMetadata", required = true)
44
    protected ResponseMetadata responseMetadata;
45
 
46
    /**
47
     * Default constructor
48
     * 
49
     */
50
    public GetReportResponse() {
51
        super();
52
    }
53
 
54
    /**
55
     * Value constructor
56
     * 
57
     */
58
    public GetReportResponse(final GetReportResult getReportResult, final ResponseMetadata responseMetadata) {
59
        this.getReportResult = getReportResult;
60
        this.responseMetadata = responseMetadata;
61
    }
62
 
63
    /**
64
     * Gets the value of the getReportResult property.
65
     * 
66
     * @return
67
     *     possible object is
68
     *     {@link GetReportResult }
69
     *     
70
     */
71
    public GetReportResult getGetReportResult() {
72
        return getReportResult;
73
    }
74
 
75
    /**
76
     * Sets the value of the getReportResult property.
77
     * 
78
     * @param value
79
     *     allowed object is
80
     *     {@link GetReportResult }
81
     *     
82
     */
83
    public void setGetReportResult(GetReportResult value) {
84
        this.getReportResult = value;
85
    }
86
 
87
    public boolean isSetGetReportResult() {
88
        return (this.getReportResult!= null);
89
    }
90
 
91
    /**
92
     * Gets the value of the responseMetadata property.
93
     * 
94
     * @return
95
     *     possible object is
96
     *     {@link ResponseMetadata }
97
     *     
98
     */
99
    public ResponseMetadata getResponseMetadata() {
100
        return responseMetadata;
101
    }
102
 
103
    /**
104
     * Sets the value of the responseMetadata property.
105
     * 
106
     * @param value
107
     *     allowed object is
108
     *     {@link ResponseMetadata }
109
     *     
110
     */
111
    public void setResponseMetadata(ResponseMetadata value) {
112
        this.responseMetadata = value;
113
    }
114
 
115
    public boolean isSetResponseMetadata() {
116
        return (this.responseMetadata!= null);
117
    }
118
 
119
    /**
120
     * Sets the value of the GetReportResult property.
121
     * 
122
     * @param value
123
     * @return
124
     *     this instance
125
     */
126
    public GetReportResponse withGetReportResult(GetReportResult value) {
127
        setGetReportResult(value);
128
        return this;
129
    }
130
 
131
    /**
132
     * Sets the value of the ResponseMetadata property.
133
     * 
134
     * @param value
135
     * @return
136
     *     this instance
137
     */
138
    public GetReportResponse withResponseMetadata(ResponseMetadata value) {
139
        setResponseMetadata(value);
140
        return this;
141
    }
142
 
143
    @javax.xml.bind.annotation.XmlTransient
144
    private ResponseHeaderMetadata responseHeaderMetadata;
145
 
146
 
147
    public boolean isSetResponseHeaderMetadata() { 
148
        return this.responseHeaderMetadata != null;
149
    }  
150
 
151
 
152
    public void setResponseHeaderMetadata(ResponseHeaderMetadata responseHeaderMetadata) { 
153
        this.responseHeaderMetadata = responseHeaderMetadata;
154
    } 
155
 
156
 
157
    public ResponseHeaderMetadata getResponseHeaderMetadata() {  
158
        return responseHeaderMetadata;
159
    }
160
 
161
    /**
162
     * 
163
     * XML string representation of this object
164
     * 
165
     * @return XML String
166
     */
167
    public String toXML() {
168
        StringBuffer xml = new StringBuffer();
169
        xml.append("<GetReportResponse xmlns=\"http://mws.amazonaws.com/doc/2009-01-01/\">");
170
        if (isSetGetReportResult()) {
171
            GetReportResult  getReportResult = getGetReportResult();
172
            xml.append("<GetReportResult>");
173
            xml.append(getReportResult.toXMLFragment());
174
            xml.append("</GetReportResult>");
175
        } 
176
        if (isSetResponseMetadata()) {
177
            ResponseMetadata  responseMetadata = getResponseMetadata();
178
            xml.append("<ResponseMetadata>");
179
            xml.append(responseMetadata.toXMLFragment());
180
            xml.append("</ResponseMetadata>");
181
        } 
182
        xml.append("</GetReportResponse>");
183
        return xml.toString();
184
    }
185
 
186
    /**
187
     * 
188
     * Escape XML special characters
189
     */
190
    private String escapeXML(String string) {
191
        StringBuffer sb = new StringBuffer();
192
        int length = string.length();
193
        for (int i = 0; i < length; ++i) {
194
            char c = string.charAt(i);
195
            switch (c) {
196
            case '&':
197
                sb.append("&amp;");
198
                break;
199
            case '<':
200
                sb.append("&lt;");
201
                break;
202
            case '>':
203
                sb.append("&gt;");
204
                break;
205
            case '\'':
206
                sb.append("&#039;");
207
                break;
208
            case '"':
209
                sb.append("&quot;");
210
                break;
211
            default:
212
                sb.append(c);
213
            }
214
        }
215
        return sb.toString();
216
    }
217
 
218
 
219
 
220
    /**
221
     * 
222
     * JSON string representation of this object
223
     * 
224
     * @return JSON String
225
     */
226
    public String toJSON() {
227
        StringBuffer json = new StringBuffer();
228
        json.append("{\"GetReportResponse\" : {");
229
        json.append(quoteJSON("@xmlns"));
230
        json.append(" : ");
231
        json.append(quoteJSON("http://mws.amazonaws.com/doc/2009-01-01/"));
232
        boolean first = true;
233
        json.append(", ");
234
        if (isSetResponseMetadata()) {
235
            if (!first) json.append(", ");
236
            json.append("\"ResponseMetadata\" : {");
237
            ResponseMetadata  responseMetadata = getResponseMetadata();
238
 
239
            json.append(responseMetadata.toJSONFragment());
240
            json.append("}");
241
            first = false;
242
        } 
243
        json.append("}");
244
        json.append("}");
245
        return json.toString();
246
    }
247
 
248
    /**
249
     * 
250
     * Quote JSON string
251
     */
252
    private String quoteJSON(String string) {
253
        StringBuffer sb = new StringBuffer();
254
        sb.append("\"");
255
        int length = string.length();
256
        for (int i = 0; i < length; ++i) {
257
            char c = string.charAt(i);
258
            switch (c) {
259
            case '"':
260
                sb.append("\\\"");
261
                break;
262
            case '\\':
263
                sb.append("\\\\");
264
                break;
265
            case '/':
266
                sb.append("\\/");
267
                break;
268
            case '\b':
269
                sb.append("\\b");
270
                break;
271
            case '\f':
272
                sb.append("\\f");
273
                break;
274
            case '\n':
275
                sb.append("\\n");
276
                break;
277
            case '\r':
278
                sb.append("\\r");
279
                break;
280
            case '\t':
281
                sb.append("\\t");
282
                break;
283
            default:
284
                if (c <  ' ') {
285
                    sb.append("\\u" + String.format("%03x", Integer.valueOf(c)));
286
                } else {
287
                sb.append(c);
288
                }
289
            }
290
        }
291
        sb.append("\"");
292
        return sb.toString();
293
    }
294
 
295
 
296
}