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="Count" type="{http://www.w3.org/2001/XMLSchema}int"/>
24
 *         &lt;element name="ReportSchedule" type="{http://mws.amazonaws.com/doc/2009-01-01/}ReportSchedule" maxOccurs="unbounded"/>
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 = "", propOrder = {
37
    "count",
38
    "reportSchedule"
39
})
40
@XmlRootElement(name = "ManageReportScheduleResult")
41
public class ManageReportScheduleResult {
42
 
43
    @XmlElement(name = "Count")
44
    protected int count;
45
    @XmlElement(name = "ReportSchedule", required = true)
46
    protected List<ReportSchedule> reportSchedule;
47
 
48
    /**
49
     * Default constructor
50
     * 
51
     */
52
    public ManageReportScheduleResult() {
53
        super();
54
    }
55
 
56
    /**
57
     * Value constructor
58
     * 
59
     */
60
    public ManageReportScheduleResult(final int count, final List<ReportSchedule> reportSchedule) {
61
        this.count = count;
62
        this.reportSchedule = reportSchedule;
63
    }
64
 
65
    /**
66
     * Gets the value of the count property.
67
     * 
68
     */
69
    public int getCount() {
70
        return count;
71
    }
72
 
73
    /**
74
     * Sets the value of the count property.
75
     * 
76
     */
77
    public void setCount(int value) {
78
        this.count = value;
79
    }
80
 
81
    public boolean isSetCount() {
82
        return true;
83
    }
84
 
85
    /**
86
     * Gets the value of the reportSchedule property.
87
     * 
88
     * <p>
89
     * This accessor method returns a reference to the live list,
90
     * not a snapshot. Therefore any modification you make to the
91
     * returned list will be present inside the JAXB object.
92
     * This is why there is not a <CODE>set</CODE> method for the reportSchedule property.
93
     * 
94
     * <p>
95
     * For example, to add a new item, do as follows:
96
     * <pre>
97
     *    getReportSchedule().add(newItem);
98
     * </pre>
99
     * 
100
     * 
101
     * <p>
102
     * Objects of the following type(s) are allowed in the list
103
     * {@link ReportSchedule }
104
     * 
105
     * 
106
     */
107
    public List<ReportSchedule> getReportScheduleList() {
108
        if (reportSchedule == null) {
109
            reportSchedule = new ArrayList<ReportSchedule>();
110
        }
111
        return this.reportSchedule;
112
    }
113
 
114
    public boolean isSetReportScheduleList() {
115
        return ((this.reportSchedule!= null)&&(!this.reportSchedule.isEmpty()));
116
    }
117
 
118
    public void unsetReportScheduleList() {
119
        this.reportSchedule = null;
120
    }
121
 
122
    /**
123
     * Sets the value of the Count property.
124
     * 
125
     * @param value
126
     * @return
127
     *     this instance
128
     */
129
    public ManageReportScheduleResult withCount(int value) {
130
        setCount(value);
131
        return this;
132
    }
133
 
134
    /**
135
     * Sets the value of the ReportSchedule property.
136
     * 
137
     * @param values
138
     * @return
139
     *     this instance
140
     */
141
    public ManageReportScheduleResult withReportScheduleList(ReportSchedule... values) {
142
        for (ReportSchedule value: values) {
143
            getReportScheduleList().add(value);
144
        }
145
        return this;
146
    }
147
 
148
    /**
149
     * Sets the value of the reportSchedule property.
150
     * 
151
     * @param reportSchedule
152
     *     allowed object is
153
     *     {@link ReportSchedule }
154
     *     
155
     */
156
    public void setReportScheduleList(List<ReportSchedule> reportSchedule) {
157
        this.reportSchedule = reportSchedule;
158
    }
159
 
160
 
161
    /**
162
     * 
163
     * XML fragment representation of this object
164
     * 
165
     * @return XML fragment for this object. Name for outer
166
     * tag expected to be set by calling method. This fragment
167
     * returns inner properties representation only
168
     */
169
    protected String toXMLFragment() {
170
        StringBuffer xml = new StringBuffer();
171
        if (isSetCount()) {
172
            xml.append("<Count>");
173
            xml.append(getCount() + "");
174
            xml.append("</Count>");
175
        }
176
        java.util.List<ReportSchedule> reportScheduleList = getReportScheduleList();
177
        for (ReportSchedule reportSchedule : reportScheduleList) {
178
            xml.append("<ReportSchedule>");
179
            xml.append(reportSchedule.toXMLFragment());
180
            xml.append("</ReportSchedule>");
181
        }
182
        return xml.toString();
183
    }
184
 
185
    /**
186
     * 
187
     * Escape XML special characters
188
     */
189
    private String escapeXML(String string) {
190
        StringBuffer sb = new StringBuffer();
191
        int length = string.length();
192
        for (int i = 0; i < length; ++i) {
193
            char c = string.charAt(i);
194
            switch (c) {
195
            case '&':
196
                sb.append("&amp;");
197
                break;
198
            case '<':
199
                sb.append("&lt;");
200
                break;
201
            case '>':
202
                sb.append("&gt;");
203
                break;
204
            case '\'':
205
                sb.append("&#039;");
206
                break;
207
            case '"':
208
                sb.append("&quot;");
209
                break;
210
            default:
211
                sb.append(c);
212
            }
213
        }
214
        return sb.toString();
215
    }
216
 
217
 
218
 
219
    /**
220
     *
221
     * JSON fragment representation of this object
222
     *
223
     * @return JSON fragment for this object. Name for outer
224
     * object expected to be set by calling method. This fragment
225
     * returns inner properties representation only
226
     *
227
     */
228
    protected String toJSONFragment() {
229
        StringBuffer json = new StringBuffer();
230
        boolean first = true;
231
        if (isSetCount()) {
232
            if (!first) json.append(", ");
233
            json.append(quoteJSON("Count"));
234
            json.append(" : ");
235
            json.append(quoteJSON(getCount() + ""));
236
            first = false;
237
        }
238
        if (isSetReportScheduleList()) {
239
            if (!first) json.append(", ");
240
            json.append("\"ReportSchedule\" : [");
241
            java.util.List<ReportSchedule> reportScheduleList = getReportScheduleList();
242
            for (ReportSchedule reportSchedule : reportScheduleList) {
243
                if (reportScheduleList.indexOf(reportSchedule) > 0) json.append(", ");
244
                json.append("{");
245
                json.append("");
246
                json.append(reportSchedule.toJSONFragment());
247
                json.append("}");
248
                first = false;
249
            }
250
            json.append("]");
251
        }
252
        return json.toString();
253
    }
254
 
255
    /**
256
     *
257
     * Quote JSON string
258
     */
259
    private String quoteJSON(String string) {
260
        StringBuffer sb = new StringBuffer();
261
        sb.append("\"");
262
        int length = string.length();
263
        for (int i = 0; i < length; ++i) {
264
            char c = string.charAt(i);
265
            switch (c) {
266
            case '"':
267
                sb.append("\\\"");
268
                break;
269
            case '\\':
270
                sb.append("\\\\");
271
                break;
272
            case '/':
273
                sb.append("\\/");
274
                break;
275
            case '\b':
276
                sb.append("\\b");
277
                break;
278
            case '\f':
279
                sb.append("\\f");
280
                break;
281
            case '\n':
282
                sb.append("\\n");
283
                break;
284
            case '\r':
285
                sb.append("\\r");
286
                break;
287
            case '\t':
288
                sb.append("\\t");
289
                break;
290
            default:
291
                if (c <  ' ') {
292
                    sb.append("\\u" + String.format("%03x", Integer.valueOf(c)));
293
                } else {
294
                sb.append(c);
295
            }
296
        }
297
        }
298
        sb.append("\"");
299
        return sb.toString();
300
    }
301
 
302
 
303
}