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 ReportSchedule complex type.
14
 * 
15
 * <p>The following schema fragment specifies the expected content contained within this class.
16
 * 
17
 * <pre>
18
 * &lt;complexType name="ReportSchedule">
19
 *   &lt;complexContent>
20
 *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
21
 *       &lt;sequence>
22
 *         &lt;element name="ReportType" type="{http://www.w3.org/2001/XMLSchema}string"/>
23
 *         &lt;element name="Schedule" type="{http://www.w3.org/2001/XMLSchema}string"/>
24
 *         &lt;element name="ScheduledDate" type="{http://www.w3.org/2001/XMLSchema}dateTime"/>
25
 *       &lt;/sequence>
26
 *     &lt;/restriction>
27
 *   &lt;/complexContent>
28
 * &lt;/complexType>
29
 * </pre>
30
 * Generated by AWS Code Generator
31
 * <p/>
32
 * Wed Feb 18 13:28:59 PST 2009
33
 * 
34
 */
35
@XmlAccessorType(XmlAccessType.FIELD)
36
@XmlType(name = "ReportSchedule", propOrder = {
37
    "reportType",
38
    "schedule",
39
    "scheduledDate"
40
})
41
public class ReportSchedule {
42
 
43
    @XmlElement(name = "ReportType", required = true)
44
    protected String reportType;
45
    @XmlElement(name = "Schedule", required = true)
46
    protected String schedule;
47
    @XmlElement(name = "ScheduledDate", required = true)
48
    @XmlSchemaType(name = "dateTime")
49
    protected XMLGregorianCalendar scheduledDate;
50
 
51
    /**
52
     * Default constructor
53
     * 
54
     */
55
    public ReportSchedule() {
56
        super();
57
    }
58
 
59
    /**
60
     * Value constructor
61
     * 
62
     */
63
    public ReportSchedule(final String reportType, final String schedule, final XMLGregorianCalendar scheduledDate) {
64
        this.reportType = reportType;
65
        this.schedule = schedule;
66
        this.scheduledDate = scheduledDate;
67
    }
68
 
69
    /**
70
     * Gets the value of the reportType property.
71
     * 
72
     * @return
73
     *     possible object is
74
     *     {@link String }
75
     *     
76
     */
77
    public String getReportType() {
78
        return reportType;
79
    }
80
 
81
    /**
82
     * Sets the value of the reportType property.
83
     * 
84
     * @param value
85
     *     allowed object is
86
     *     {@link String }
87
     *     
88
     */
89
    public void setReportType(String value) {
90
        this.reportType = value;
91
    }
92
 
93
    public boolean isSetReportType() {
94
        return (this.reportType!= null);
95
    }
96
 
97
    /**
98
     * Gets the value of the schedule property.
99
     * 
100
     * @return
101
     *     possible object is
102
     *     {@link String }
103
     *     
104
     */
105
    public String getSchedule() {
106
        return schedule;
107
    }
108
 
109
    /**
110
     * Sets the value of the schedule property.
111
     * 
112
     * @param value
113
     *     allowed object is
114
     *     {@link String }
115
     *     
116
     */
117
    public void setSchedule(String value) {
118
        this.schedule = value;
119
    }
120
 
121
    public boolean isSetSchedule() {
122
        return (this.schedule!= null);
123
    }
124
 
125
    /**
126
     * Gets the value of the scheduledDate property.
127
     * 
128
     * @return
129
     *     possible object is
130
     *     {@link XMLGregorianCalendar }
131
     *     
132
     */
133
    public XMLGregorianCalendar getScheduledDate() {
134
        return scheduledDate;
135
    }
136
 
137
    /**
138
     * Sets the value of the scheduledDate property.
139
     * 
140
     * @param value
141
     *     allowed object is
142
     *     {@link XMLGregorianCalendar }
143
     *     
144
     */
145
    public void setScheduledDate(XMLGregorianCalendar value) {
146
        this.scheduledDate = value;
147
    }
148
 
149
    public boolean isSetScheduledDate() {
150
        return (this.scheduledDate!= null);
151
    }
152
 
153
    /**
154
     * Sets the value of the ReportType property.
155
     * 
156
     * @param value
157
     * @return
158
     *     this instance
159
     */
160
    public ReportSchedule withReportType(String value) {
161
        setReportType(value);
162
        return this;
163
    }
164
 
165
    /**
166
     * Sets the value of the Schedule property.
167
     * 
168
     * @param value
169
     * @return
170
     *     this instance
171
     */
172
    public ReportSchedule withSchedule(String value) {
173
        setSchedule(value);
174
        return this;
175
    }
176
 
177
    /**
178
     * Sets the value of the ScheduledDate property.
179
     * 
180
     * @param value
181
     * @return
182
     *     this instance
183
     */
184
    public ReportSchedule withScheduledDate(XMLGregorianCalendar value) {
185
        setScheduledDate(value);
186
        return this;
187
    }
188
 
189
 
190
    /**
191
     * 
192
     * XML fragment representation of this object
193
     * 
194
     * @return XML fragment for this object. Name for outer
195
     * tag expected to be set by calling method. This fragment
196
     * returns inner properties representation only
197
     */
198
    protected String toXMLFragment() {
199
        StringBuffer xml = new StringBuffer();
200
        if (isSetReportType()) {
201
            xml.append("<ReportType>");
202
            xml.append(escapeXML(getReportType()));
203
            xml.append("</ReportType>");
204
        }
205
        if (isSetSchedule()) {
206
            xml.append("<Schedule>");
207
            xml.append(escapeXML(getSchedule()));
208
            xml.append("</Schedule>");
209
        }
210
        if (isSetScheduledDate()) {
211
            xml.append("<ScheduledDate>");
212
            xml.append(getScheduledDate() + "");
213
            xml.append("</ScheduledDate>");
214
        }
215
        return xml.toString();
216
    }
217
 
218
    /**
219
     * 
220
     * Escape XML special characters
221
     */
222
    private String escapeXML(String string) {
223
        StringBuffer sb = new StringBuffer();
224
        int length = string.length();
225
        for (int i = 0; i < length; ++i) {
226
            char c = string.charAt(i);
227
            switch (c) {
228
            case '&':
229
                sb.append("&amp;");
230
                break;
231
            case '<':
232
                sb.append("&lt;");
233
                break;
234
            case '>':
235
                sb.append("&gt;");
236
                break;
237
            case '\'':
238
                sb.append("&#039;");
239
                break;
240
            case '"':
241
                sb.append("&quot;");
242
                break;
243
            default:
244
                sb.append(c);
245
            }
246
        }
247
        return sb.toString();
248
    }
249
 
250
 
251
 
252
    /**
253
     *
254
     * JSON fragment representation of this object
255
     *
256
     * @return JSON fragment for this object. Name for outer
257
     * object expected to be set by calling method. This fragment
258
     * returns inner properties representation only
259
     *
260
     */
261
    protected String toJSONFragment() {
262
        StringBuffer json = new StringBuffer();
263
        boolean first = true;
264
        if (isSetReportType()) {
265
            if (!first) json.append(", ");
266
            json.append(quoteJSON("ReportType"));
267
            json.append(" : ");
268
            json.append(quoteJSON(getReportType()));
269
            first = false;
270
        }
271
        if (isSetSchedule()) {
272
            if (!first) json.append(", ");
273
            json.append(quoteJSON("Schedule"));
274
            json.append(" : ");
275
            json.append(quoteJSON(getSchedule()));
276
            first = false;
277
        }
278
        if (isSetScheduledDate()) {
279
            if (!first) json.append(", ");
280
            json.append(quoteJSON("ScheduledDate"));
281
            json.append(" : ");
282
            json.append(quoteJSON(getScheduledDate() + ""));
283
            first = false;
284
        }
285
        return json.toString();
286
    }
287
 
288
    /**
289
     *
290
     * Quote JSON string
291
     */
292
    private String quoteJSON(String string) {
293
        StringBuffer sb = new StringBuffer();
294
        sb.append("\"");
295
        int length = string.length();
296
        for (int i = 0; i < length; ++i) {
297
            char c = string.charAt(i);
298
            switch (c) {
299
            case '"':
300
                sb.append("\\\"");
301
                break;
302
            case '\\':
303
                sb.append("\\\\");
304
                break;
305
            case '/':
306
                sb.append("\\/");
307
                break;
308
            case '\b':
309
                sb.append("\\b");
310
                break;
311
            case '\f':
312
                sb.append("\\f");
313
                break;
314
            case '\n':
315
                sb.append("\\n");
316
                break;
317
            case '\r':
318
                sb.append("\\r");
319
                break;
320
            case '\t':
321
                sb.append("\\t");
322
                break;
323
            default:
324
                if (c <  ' ') {
325
                    sb.append("\\u" + String.format("%03x", Integer.valueOf(c)));
326
                } else {
327
                sb.append(c);
328
            }
329
        }
330
        }
331
        sb.append("\"");
332
        return sb.toString();
333
    }
334
 
335
 
336
}