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.XmlSchemaType;
8
import javax.xml.bind.annotation.XmlType;
9
import javax.xml.datatype.XMLGregorianCalendar;
10
 
11
 
12
/**
13
 * <p>Java class for ReportInfo complex type.
14
 * 
15
 * <p>The following schema fragment specifies the expected content contained within this class.
16
 * 
17
 * <pre>
18
 * &lt;complexType name="ReportInfo">
19
 *   &lt;complexContent>
20
 *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
21
 *       &lt;sequence>
22
 *         &lt;element name="ReportId" type="{http://www.w3.org/2001/XMLSchema}string"/>
23
 *         &lt;element name="ReportType" type="{http://www.w3.org/2001/XMLSchema}string"/>
24
 *         &lt;element name="ReportRequestId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
25
 *         &lt;element name="AvailableDate" type="{http://www.w3.org/2001/XMLSchema}dateTime"/>
26
 *         &lt;element name="Acknowledged" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
27
 *         &lt;element name="AcknowledgedDate" type="{http://www.w3.org/2001/XMLSchema}dateTime"/>
28
 *       &lt;/sequence>
29
 *     &lt;/restriction>
30
 *   &lt;/complexContent>
31
 * &lt;/complexType>
32
 * </pre>
33
 * Generated by AWS Code Generator
34
 * <p/>
35
 * Wed Feb 18 13:28:59 PST 2009
36
 * 
37
 */
38
@XmlAccessorType(XmlAccessType.FIELD)
39
@XmlType(name = "ReportInfo", propOrder = {
40
    "reportId",
41
    "reportType",
42
    "reportRequestId",
43
    "availableDate",
44
    "acknowledged",
45
    "acknowledgedDate"
46
})
47
public class ReportInfo {
48
 
49
    @XmlElement(name = "ReportId", required = true)
50
    protected String reportId;
51
    @XmlElement(name = "ReportType", required = true)
52
    protected String reportType;
53
    @XmlElement(name = "ReportRequestId")
54
    protected String reportRequestId;
55
    @XmlElement(name = "AvailableDate", required = true)
56
    @XmlSchemaType(name = "dateTime")
57
    protected XMLGregorianCalendar availableDate;
58
    @XmlElement(name = "Acknowledged")
59
    protected boolean acknowledged;
60
    @XmlElement(name = "AcknowledgedDate", required = true)
61
    @XmlSchemaType(name = "dateTime")
62
    protected XMLGregorianCalendar acknowledgedDate;
63
 
64
    /**
65
     * Default constructor
66
     * 
67
     */
68
    public ReportInfo() {
69
        super();
70
    }
71
 
72
    /**
73
     * Value constructor
74
     * 
75
     */
76
    public ReportInfo(final String reportId, final String reportType, final String reportRequestId, final XMLGregorianCalendar availableDate, final boolean acknowledged, final XMLGregorianCalendar acknowledgedDate) {
77
        this.reportId = reportId;
78
        this.reportType = reportType;
79
        this.reportRequestId = reportRequestId;
80
        this.availableDate = availableDate;
81
        this.acknowledged = acknowledged;
82
        this.acknowledgedDate = acknowledgedDate;
83
    }
84
 
85
    /**
86
     * Gets the value of the reportId property.
87
     * 
88
     * @return
89
     *     possible object is
90
     *     {@link String }
91
     *     
92
     */
93
    public String getReportId() {
94
        return reportId;
95
    }
96
 
97
    /**
98
     * Sets the value of the reportId property.
99
     * 
100
     * @param value
101
     *     allowed object is
102
     *     {@link String }
103
     *     
104
     */
105
    public void setReportId(String value) {
106
        this.reportId = value;
107
    }
108
 
109
    public boolean isSetReportId() {
110
        return (this.reportId!= null);
111
    }
112
 
113
    /**
114
     * Gets the value of the reportType property.
115
     * 
116
     * @return
117
     *     possible object is
118
     *     {@link String }
119
     *     
120
     */
121
    public String getReportType() {
122
        return reportType;
123
    }
124
 
125
    /**
126
     * Sets the value of the reportType property.
127
     * 
128
     * @param value
129
     *     allowed object is
130
     *     {@link String }
131
     *     
132
     */
133
    public void setReportType(String value) {
134
        this.reportType = value;
135
    }
136
 
137
    public boolean isSetReportType() {
138
        return (this.reportType!= null);
139
    }
140
 
141
    /**
142
     * Gets the value of the reportRequestId property.
143
     * 
144
     * @return
145
     *     possible object is
146
     *     {@link String }
147
     *     
148
     */
149
    public String getReportRequestId() {
150
        return reportRequestId;
151
    }
152
 
153
    /**
154
     * Sets the value of the reportRequestId property.
155
     * 
156
     * @param value
157
     *     allowed object is
158
     *     {@link String }
159
     *     
160
     */
161
    public void setReportRequestId(String value) {
162
        this.reportRequestId = value;
163
    }
164
 
165
    public boolean isSetReportRequestId() {
166
        return (this.reportRequestId!= null);
167
    }
168
 
169
    /**
170
     * Gets the value of the availableDate property.
171
     * 
172
     * @return
173
     *     possible object is
174
     *     {@link XMLGregorianCalendar }
175
     *     
176
     */
177
    public XMLGregorianCalendar getAvailableDate() {
178
        return availableDate;
179
    }
180
 
181
    /**
182
     * Sets the value of the availableDate property.
183
     * 
184
     * @param value
185
     *     allowed object is
186
     *     {@link XMLGregorianCalendar }
187
     *     
188
     */
189
    public void setAvailableDate(XMLGregorianCalendar value) {
190
        this.availableDate = value;
191
    }
192
 
193
    public boolean isSetAvailableDate() {
194
        return (this.availableDate!= null);
195
    }
196
 
197
    /**
198
     * Gets the value of the acknowledged property.
199
     * 
200
     */
201
    public boolean isAcknowledged() {
202
        return acknowledged;
203
    }
204
 
205
    /**
206
     * Sets the value of the acknowledged property.
207
     * 
208
     */
209
    public void setAcknowledged(boolean value) {
210
        this.acknowledged = value;
211
    }
212
 
213
    public boolean isSetAcknowledged() {
214
        return true;
215
    }
216
 
217
    /**
218
     * Gets the value of the acknowledgedDate property.
219
     * 
220
     * @return
221
     *     possible object is
222
     *     {@link XMLGregorianCalendar }
223
     *     
224
     */
225
    public XMLGregorianCalendar getAcknowledgedDate() {
226
        return acknowledgedDate;
227
    }
228
 
229
    /**
230
     * Sets the value of the acknowledgedDate property.
231
     * 
232
     * @param value
233
     *     allowed object is
234
     *     {@link XMLGregorianCalendar }
235
     *     
236
     */
237
    public void setAcknowledgedDate(XMLGregorianCalendar value) {
238
        this.acknowledgedDate = value;
239
    }
240
 
241
    public boolean isSetAcknowledgedDate() {
242
        return (this.acknowledgedDate!= null);
243
    }
244
 
245
    /**
246
     * Sets the value of the ReportId property.
247
     * 
248
     * @param value
249
     * @return
250
     *     this instance
251
     */
252
    public ReportInfo withReportId(String value) {
253
        setReportId(value);
254
        return this;
255
    }
256
 
257
    /**
258
     * Sets the value of the ReportType property.
259
     * 
260
     * @param value
261
     * @return
262
     *     this instance
263
     */
264
    public ReportInfo withReportType(String value) {
265
        setReportType(value);
266
        return this;
267
    }
268
 
269
    /**
270
     * Sets the value of the ReportRequestId property.
271
     * 
272
     * @param value
273
     * @return
274
     *     this instance
275
     */
276
    public ReportInfo withReportRequestId(String value) {
277
        setReportRequestId(value);
278
        return this;
279
    }
280
 
281
    /**
282
     * Sets the value of the AvailableDate property.
283
     * 
284
     * @param value
285
     * @return
286
     *     this instance
287
     */
288
    public ReportInfo withAvailableDate(XMLGregorianCalendar value) {
289
        setAvailableDate(value);
290
        return this;
291
    }
292
 
293
    /**
294
     * Sets the value of the Acknowledged property.
295
     * 
296
     * @param value
297
     * @return
298
     *     this instance
299
     */
300
    public ReportInfo withAcknowledged(boolean value) {
301
        setAcknowledged(value);
302
        return this;
303
    }
304
 
305
    /**
306
     * Sets the value of the AcknowledgedDate property.
307
     * 
308
     * @param value
309
     * @return
310
     *     this instance
311
     */
312
    public ReportInfo withAcknowledgedDate(XMLGregorianCalendar value) {
313
        setAcknowledgedDate(value);
314
        return this;
315
    }
316
 
317
 
318
    /**
319
     * 
320
     * XML fragment representation of this object
321
     * 
322
     * @return XML fragment for this object. Name for outer
323
     * tag expected to be set by calling method. This fragment
324
     * returns inner properties representation only
325
     */
326
    protected String toXMLFragment() {
327
        StringBuffer xml = new StringBuffer();
328
        if (isSetReportId()) {
329
            xml.append("<ReportId>");
330
            xml.append(escapeXML(getReportId()));
331
            xml.append("</ReportId>");
332
        }
333
        if (isSetReportType()) {
334
            xml.append("<ReportType>");
335
            xml.append(escapeXML(getReportType()));
336
            xml.append("</ReportType>");
337
        }
338
        if (isSetReportRequestId()) {
339
            xml.append("<ReportRequestId>");
340
            xml.append(escapeXML(getReportRequestId()));
341
            xml.append("</ReportRequestId>");
342
        }
343
        if (isSetAvailableDate()) {
344
            xml.append("<AvailableDate>");
345
            xml.append(getAvailableDate() + "");
346
            xml.append("</AvailableDate>");
347
        }
348
        if (isSetAcknowledged()) {
349
            xml.append("<Acknowledged>");
350
            xml.append(isAcknowledged() + "");
351
            xml.append("</Acknowledged>");
352
        }
353
        if (isSetAcknowledgedDate()) {
354
            xml.append("<AcknowledgedDate>");
355
            xml.append(getAcknowledgedDate() + "");
356
            xml.append("</AcknowledgedDate>");
357
        }
358
        return xml.toString();
359
    }
360
 
361
    /**
362
     * 
363
     * Escape XML special characters
364
     */
365
    private String escapeXML(String string) {
366
        StringBuffer sb = new StringBuffer();
367
        int length = string.length();
368
        for (int i = 0; i < length; ++i) {
369
            char c = string.charAt(i);
370
            switch (c) {
371
            case '&':
372
                sb.append("&amp;");
373
                break;
374
            case '<':
375
                sb.append("&lt;");
376
                break;
377
            case '>':
378
                sb.append("&gt;");
379
                break;
380
            case '\'':
381
                sb.append("&#039;");
382
                break;
383
            case '"':
384
                sb.append("&quot;");
385
                break;
386
            default:
387
                sb.append(c);
388
            }
389
        }
390
        return sb.toString();
391
    }
392
 
393
 
394
 
395
    /**
396
     *
397
     * JSON fragment representation of this object
398
     *
399
     * @return JSON fragment for this object. Name for outer
400
     * object expected to be set by calling method. This fragment
401
     * returns inner properties representation only
402
     *
403
     */
404
    protected String toJSONFragment() {
405
        StringBuffer json = new StringBuffer();
406
        boolean first = true;
407
        if (isSetReportId()) {
408
            if (!first) json.append(", ");
409
            json.append(quoteJSON("ReportId"));
410
            json.append(" : ");
411
            json.append(quoteJSON(getReportId()));
412
            first = false;
413
        }
414
        if (isSetReportType()) {
415
            if (!first) json.append(", ");
416
            json.append(quoteJSON("ReportType"));
417
            json.append(" : ");
418
            json.append(quoteJSON(getReportType()));
419
            first = false;
420
        }
421
        if (isSetReportRequestId()) {
422
            if (!first) json.append(", ");
423
            json.append(quoteJSON("ReportRequestId"));
424
            json.append(" : ");
425
            json.append(quoteJSON(getReportRequestId()));
426
            first = false;
427
        }
428
        if (isSetAvailableDate()) {
429
            if (!first) json.append(", ");
430
            json.append(quoteJSON("AvailableDate"));
431
            json.append(" : ");
432
            json.append(quoteJSON(getAvailableDate() + ""));
433
            first = false;
434
        }
435
        if (isSetAcknowledged()) {
436
            if (!first) json.append(", ");
437
            json.append(quoteJSON("Acknowledged"));
438
            json.append(" : ");
439
            json.append(quoteJSON(isAcknowledged() + ""));
440
            first = false;
441
        }
442
        if (isSetAcknowledgedDate()) {
443
            if (!first) json.append(", ");
444
            json.append(quoteJSON("AcknowledgedDate"));
445
            json.append(" : ");
446
            json.append(quoteJSON(getAcknowledgedDate() + ""));
447
            first = false;
448
        }
449
        return json.toString();
450
    }
451
 
452
    /**
453
     *
454
     * Quote JSON string
455
     */
456
    private String quoteJSON(String string) {
457
        StringBuffer sb = new StringBuffer();
458
        sb.append("\"");
459
        int length = string.length();
460
        for (int i = 0; i < length; ++i) {
461
            char c = string.charAt(i);
462
            switch (c) {
463
            case '"':
464
                sb.append("\\\"");
465
                break;
466
            case '\\':
467
                sb.append("\\\\");
468
                break;
469
            case '/':
470
                sb.append("\\/");
471
                break;
472
            case '\b':
473
                sb.append("\\b");
474
                break;
475
            case '\f':
476
                sb.append("\\f");
477
                break;
478
            case '\n':
479
                sb.append("\\n");
480
                break;
481
            case '\r':
482
                sb.append("\\r");
483
                break;
484
            case '\t':
485
                sb.append("\\t");
486
                break;
487
            default:
488
                if (c <  ' ') {
489
                    sb.append("\\u" + String.format("%03x", Integer.valueOf(c)));
490
                } else {
491
                sb.append(c);
492
            }
493
        }
494
        }
495
        sb.append("\"");
496
        return sb.toString();
497
    }
498
 
499
 
500
}