Subversion Repositories SmartDukaan

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
8224 manish.sha 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/}SubmitFeedResult"/>
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
    "submitFeedResult",
36
    "responseMetadata"
37
})
38
@XmlRootElement(name = "SubmitFeedResponse")
39
public class SubmitFeedResponse {
40
 
41
    @XmlElement(name = "SubmitFeedResult", required = true)
42
    protected SubmitFeedResult submitFeedResult;
43
    @XmlElement(name = "ResponseMetadata", required = true)
44
    protected ResponseMetadata responseMetadata;
45
 
46
    /**
47
     * Default constructor
48
     * 
49
     */
50
    public SubmitFeedResponse() {
51
        super();
52
    }
53
 
54
    /**
55
     * Value constructor
56
     * 
57
     */
58
    public SubmitFeedResponse(final SubmitFeedResult submitFeedResult, final ResponseMetadata responseMetadata) {
59
        this.submitFeedResult = submitFeedResult;
60
        this.responseMetadata = responseMetadata;
61
    }
62
 
63
    /**
64
     * Gets the value of the submitFeedResult property.
65
     * 
66
     * @return
67
     *     possible object is
68
     *     {@link SubmitFeedResult }
69
     *     
70
     */
71
    public SubmitFeedResult getSubmitFeedResult() {
72
        return submitFeedResult;
73
    }
74
 
75
    /**
76
     * Sets the value of the submitFeedResult property.
77
     * 
78
     * @param value
79
     *     allowed object is
80
     *     {@link SubmitFeedResult }
81
     *     
82
     */
83
    public void setSubmitFeedResult(SubmitFeedResult value) {
84
        this.submitFeedResult = value;
85
    }
86
 
87
    public boolean isSetSubmitFeedResult() {
88
        return (this.submitFeedResult!= 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 SubmitFeedResult property.
121
     * 
122
     * @param value
123
     * @return
124
     *     this instance
125
     */
126
    public SubmitFeedResponse withSubmitFeedResult(SubmitFeedResult value) {
127
        setSubmitFeedResult(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 SubmitFeedResponse 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("<SubmitFeedResponse xmlns=\"http://mws.amazonaws.com/doc/2009-01-01/\">");
170
        if (isSetSubmitFeedResult()) {
171
            SubmitFeedResult  submitFeedResult = getSubmitFeedResult();
172
            xml.append("<SubmitFeedResult>");
173
            xml.append(submitFeedResult.toXMLFragment());
174
            xml.append("</SubmitFeedResult>");
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("</SubmitFeedResponse>");
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("{\"SubmitFeedResponse\" : {");
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 (isSetSubmitFeedResult()) {
235
            if (!first) json.append(", ");
236
            json.append("\"SubmitFeedResult\" : {");
237
            SubmitFeedResult  submitFeedResult = getSubmitFeedResult();
238
 
239
            json.append(submitFeedResult.toJSONFragment());
240
            json.append("}");
241
            first = false;
242
        } 
243
        if (isSetResponseMetadata()) {
244
            if (!first) json.append(", ");
245
            json.append("\"ResponseMetadata\" : {");
246
            ResponseMetadata  responseMetadata = getResponseMetadata();
247
 
248
            json.append(responseMetadata.toJSONFragment());
249
            json.append("}");
250
            first = false;
251
        } 
252
        json.append("}");
253
        json.append("}");
254
        return json.toString();
255
    }
256
 
257
    /**
258
     * 
259
     * Quote JSON string
260
     */
261
    private String quoteJSON(String string) {
262
        StringBuffer sb = new StringBuffer();
263
        sb.append("\"");
264
        int length = string.length();
265
        for (int i = 0; i < length; ++i) {
266
            char c = string.charAt(i);
267
            switch (c) {
268
            case '"':
269
                sb.append("\\\"");
270
                break;
271
            case '\\':
272
                sb.append("\\\\");
273
                break;
274
            case '/':
275
                sb.append("\\/");
276
                break;
277
            case '\b':
278
                sb.append("\\b");
279
                break;
280
            case '\f':
281
                sb.append("\\f");
282
                break;
283
            case '\n':
284
                sb.append("\\n");
285
                break;
286
            case '\r':
287
                sb.append("\\r");
288
                break;
289
            case '\t':
290
                sb.append("\\t");
291
                break;
292
            default:
293
                if (c <  ' ') {
294
                    sb.append("\\u" + String.format("%03x", Integer.valueOf(c)));
295
                } else {
296
                sb.append(c);
297
                }
298
            }
299
        }
300
        sb.append("\"");
301
        return sb.toString();
302
    }
303
 
304
 
305
}