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 java.util.ArrayList;
5
import java.util.List;
6
import javax.xml.bind.annotation.XmlAccessType;
7
import javax.xml.bind.annotation.XmlAccessorType;
8
import javax.xml.bind.annotation.XmlElement;
9
import javax.xml.bind.annotation.XmlRootElement;
10
import javax.xml.bind.annotation.XmlType;
11
 
12
 
13
/**
14
 * <p>Java class for anonymous complex type.
15
 * 
16
 * <p>The following schema fragment specifies the expected content contained within this class.
17
 * 
18
 * <pre>
19
 * &lt;complexType>
20
 *   &lt;complexContent>
21
 *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
22
 *       &lt;sequence>
23
 *         &lt;element name="NextToken" type="{http://www.w3.org/2001/XMLSchema}string"/>
24
 *         &lt;element name="HasNext" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
25
 *         &lt;element name="FeedSubmissionInfo" type="{http://mws.amazonaws.com/doc/2009-01-01/}FeedSubmissionInfo" maxOccurs="unbounded"/>
26
 *       &lt;/sequence>
27
 *     &lt;/restriction>
28
 *   &lt;/complexContent>
29
 * &lt;/complexType>
30
 * </pre>
31
 * Generated by AWS Code Generator
32
 * <p/>
33
 * Wed Feb 18 13:28:59 PST 2009
34
 * 
35
 */
36
@XmlAccessorType(XmlAccessType.FIELD)
37
@XmlType(name = "", propOrder = {
38
    "nextToken",
39
    "hasNext",
40
    "feedSubmissionInfo"
41
})
42
@XmlRootElement(name = "GetFeedSubmissionListByNextTokenResult")
43
public class GetFeedSubmissionListByNextTokenResult {
44
 
45
    @XmlElement(name = "NextToken", required = true)
46
    protected String nextToken;
47
    @XmlElement(name = "HasNext")
48
    protected boolean hasNext;
49
    @XmlElement(name = "FeedSubmissionInfo", required = true)
50
    protected List<FeedSubmissionInfo> feedSubmissionInfo;
51
 
52
    /**
53
     * Default constructor
54
     * 
55
     */
56
    public GetFeedSubmissionListByNextTokenResult() {
57
        super();
58
    }
59
 
60
    /**
61
     * Value constructor
62
     * 
63
     */
64
    public GetFeedSubmissionListByNextTokenResult(final String nextToken, final boolean hasNext, final List<FeedSubmissionInfo> feedSubmissionInfo) {
65
        this.nextToken = nextToken;
66
        this.hasNext = hasNext;
67
        this.feedSubmissionInfo = feedSubmissionInfo;
68
    }
69
 
70
    /**
71
     * Gets the value of the nextToken property.
72
     * 
73
     * @return
74
     *     possible object is
75
     *     {@link String }
76
     *     
77
     */
78
    public String getNextToken() {
79
        return nextToken;
80
    }
81
 
82
    /**
83
     * Sets the value of the nextToken property.
84
     * 
85
     * @param value
86
     *     allowed object is
87
     *     {@link String }
88
     *     
89
     */
90
    public void setNextToken(String value) {
91
        this.nextToken = value;
92
    }
93
 
94
    public boolean isSetNextToken() {
95
        return (this.nextToken!= null);
96
    }
97
 
98
    /**
99
     * Gets the value of the hasNext property.
100
     * 
101
     */
102
    public boolean isHasNext() {
103
        return hasNext;
104
    }
105
 
106
    /**
107
     * Sets the value of the hasNext property.
108
     * 
109
     */
110
    public void setHasNext(boolean value) {
111
        this.hasNext = value;
112
    }
113
 
114
    public boolean isSetHasNext() {
115
        return true;
116
    }
117
 
118
    /**
119
     * Gets the value of the feedSubmissionInfo property.
120
     * 
121
     * <p>
122
     * This accessor method returns a reference to the live list,
123
     * not a snapshot. Therefore any modification you make to the
124
     * returned list will be present inside the JAXB object.
125
     * This is why there is not a <CODE>set</CODE> method for the feedSubmissionInfo property.
126
     * 
127
     * <p>
128
     * For example, to add a new item, do as follows:
129
     * <pre>
130
     *    getFeedSubmissionInfo().add(newItem);
131
     * </pre>
132
     * 
133
     * 
134
     * <p>
135
     * Objects of the following type(s) are allowed in the list
136
     * {@link FeedSubmissionInfo }
137
     * 
138
     * 
139
     */
140
    public List<FeedSubmissionInfo> getFeedSubmissionInfoList() {
141
        if (feedSubmissionInfo == null) {
142
            feedSubmissionInfo = new ArrayList<FeedSubmissionInfo>();
143
        }
144
        return this.feedSubmissionInfo;
145
    }
146
 
147
    public boolean isSetFeedSubmissionInfoList() {
148
        return ((this.feedSubmissionInfo!= null)&&(!this.feedSubmissionInfo.isEmpty()));
149
    }
150
 
151
    public void unsetFeedSubmissionInfoList() {
152
        this.feedSubmissionInfo = null;
153
    }
154
 
155
    /**
156
     * Sets the value of the NextToken property.
157
     * 
158
     * @param value
159
     * @return
160
     *     this instance
161
     */
162
    public GetFeedSubmissionListByNextTokenResult withNextToken(String value) {
163
        setNextToken(value);
164
        return this;
165
    }
166
 
167
    /**
168
     * Sets the value of the HasNext property.
169
     * 
170
     * @param value
171
     * @return
172
     *     this instance
173
     */
174
    public GetFeedSubmissionListByNextTokenResult withHasNext(boolean value) {
175
        setHasNext(value);
176
        return this;
177
    }
178
 
179
    /**
180
     * Sets the value of the FeedSubmissionInfo property.
181
     * 
182
     * @param values
183
     * @return
184
     *     this instance
185
     */
186
    public GetFeedSubmissionListByNextTokenResult withFeedSubmissionInfoList(FeedSubmissionInfo... values) {
187
        for (FeedSubmissionInfo value: values) {
188
            getFeedSubmissionInfoList().add(value);
189
        }
190
        return this;
191
    }
192
 
193
    /**
194
     * Sets the value of the feedSubmissionInfo property.
195
     * 
196
     * @param feedSubmissionInfoList
197
     *     allowed object is
198
     *     {@link FeedSubmissionInfo }
199
     *     
200
     */
201
    public void setFeedSubmissionInfoList(List<FeedSubmissionInfo> feedSubmissionInfoList) {
202
        this.feedSubmissionInfo = feedSubmissionInfoList;
203
    }
204
 
205
 
206
    /**
207
     * 
208
     * XML fragment representation of this object
209
     * 
210
     * @return XML fragment for this object. Name for outer
211
     * tag expected to be set by calling method. This fragment
212
     * returns inner properties representation only
213
     */
214
    protected String toXMLFragment() {
215
        StringBuffer xml = new StringBuffer();
216
        if (isSetNextToken()) {
217
            xml.append("<NextToken>");
218
            xml.append(escapeXML(getNextToken()));
219
            xml.append("</NextToken>");
220
        }
221
        if (isSetHasNext()) {
222
            xml.append("<HasNext>");
223
            xml.append(isHasNext() + "");
224
            xml.append("</HasNext>");
225
        }
226
        java.util.List<FeedSubmissionInfo> feedSubmissionInfoList = getFeedSubmissionInfoList();
227
        for (FeedSubmissionInfo feedSubmissionInfo : feedSubmissionInfoList) {
228
            xml.append("<FeedSubmissionInfo>");
229
            xml.append(feedSubmissionInfo.toXMLFragment());
230
            xml.append("</FeedSubmissionInfo>");
231
        }
232
        return xml.toString();
233
    }
234
 
235
    /**
236
     * 
237
     * Escape XML special characters
238
     */
239
    private String escapeXML(String string) {
240
        StringBuffer sb = new StringBuffer();
241
        int length = string.length();
242
        for (int i = 0; i < length; ++i) {
243
            char c = string.charAt(i);
244
            switch (c) {
245
            case '&':
246
                sb.append("&amp;");
247
                break;
248
            case '<':
249
                sb.append("&lt;");
250
                break;
251
            case '>':
252
                sb.append("&gt;");
253
                break;
254
            case '\'':
255
                sb.append("&#039;");
256
                break;
257
            case '"':
258
                sb.append("&quot;");
259
                break;
260
            default:
261
                sb.append(c);
262
            }
263
        }
264
        return sb.toString();
265
    }
266
 
267
 
268
 
269
    /**
270
     *
271
     * JSON fragment representation of this object
272
     *
273
     * @return JSON fragment for this object. Name for outer
274
     * object expected to be set by calling method. This fragment
275
     * returns inner properties representation only
276
     *
277
     */
278
    protected String toJSONFragment() {
279
        StringBuffer json = new StringBuffer();
280
        boolean first = true;
281
        if (isSetNextToken()) {
282
            if (!first) json.append(", ");
283
            json.append(quoteJSON("NextToken"));
284
            json.append(" : ");
285
            json.append(quoteJSON(getNextToken()));
286
            first = false;
287
        }
288
        if (isSetHasNext()) {
289
            if (!first) json.append(", ");
290
            json.append(quoteJSON("HasNext"));
291
            json.append(" : ");
292
            json.append(quoteJSON(isHasNext() + ""));
293
            first = false;
294
        }
295
        if (isSetFeedSubmissionInfoList()) {
296
            if (!first) json.append(", ");
297
            json.append("\"FeedSubmissionInfo\" : [");
298
            java.util.List<FeedSubmissionInfo> feedSubmissionInfoList = getFeedSubmissionInfoList();
299
            for (FeedSubmissionInfo feedSubmissionInfo : feedSubmissionInfoList) {
300
                if (feedSubmissionInfoList.indexOf(feedSubmissionInfo) > 0) json.append(", ");
301
                json.append("{");
302
                json.append("");
303
                json.append(feedSubmissionInfo.toJSONFragment());
304
                json.append("}");
305
                first = false;
306
            }
307
            json.append("]");
308
        }
309
        return json.toString();
310
    }
311
 
312
    /**
313
     *
314
     * Quote JSON string
315
     */
316
    private String quoteJSON(String string) {
317
        StringBuffer sb = new StringBuffer();
318
        sb.append("\"");
319
        int length = string.length();
320
        for (int i = 0; i < length; ++i) {
321
            char c = string.charAt(i);
322
            switch (c) {
323
            case '"':
324
                sb.append("\\\"");
325
                break;
326
            case '\\':
327
                sb.append("\\\\");
328
                break;
329
            case '/':
330
                sb.append("\\/");
331
                break;
332
            case '\b':
333
                sb.append("\\b");
334
                break;
335
            case '\f':
336
                sb.append("\\f");
337
                break;
338
            case '\n':
339
                sb.append("\\n");
340
                break;
341
            case '\r':
342
                sb.append("\\r");
343
                break;
344
            case '\t':
345
                sb.append("\\t");
346
                break;
347
            default:
348
                if (c <  ' ') {
349
                    sb.append("\\u" + String.format("%03x", Integer.valueOf(c)));
350
                } else {
351
                sb.append(c);
352
            }
353
        }
354
        }
355
        sb.append("\"");
356
        return sb.toString();
357
    }
358
 
359
 
360
}