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 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 name="Count" type="{http://www.w3.org/2001/XMLSchema}int"/>
22
 *       &lt;/sequence>
23
 *     &lt;/restriction>
24
 *   &lt;/complexContent>
25
 * &lt;/complexType>
26
 * </pre>
27
 * Generated by AWS Code Generator
28
 * <p/>
29
 * Wed Feb 18 13:28:59 PST 2009
30
 * 
31
 */
32
@XmlAccessorType(XmlAccessType.FIELD)
33
@XmlType(name = "", propOrder = {
34
    "count"
35
})
36
@XmlRootElement(name = "GetReportRequestCountResult")
37
public class GetReportRequestCountResult {
38
 
39
    @XmlElement(name = "Count")
40
    protected int count;
41
 
42
    /**
43
     * Default constructor
44
     * 
45
     */
46
    public GetReportRequestCountResult() {
47
        super();
48
    }
49
 
50
    /**
51
     * Value constructor
52
     * 
53
     */
54
    public GetReportRequestCountResult(final int count) {
55
        this.count = count;
56
    }
57
 
58
    /**
59
     * Gets the value of the count property.
60
     * 
61
     */
62
    public int getCount() {
63
        return count;
64
    }
65
 
66
    /**
67
     * Sets the value of the count property.
68
     * 
69
     */
70
    public void setCount(int value) {
71
        this.count = value;
72
    }
73
 
74
    public boolean isSetCount() {
75
        return true;
76
    }
77
 
78
    /**
79
     * Sets the value of the Count property.
80
     * 
81
     * @param value
82
     * @return
83
     *     this instance
84
     */
85
    public GetReportRequestCountResult withCount(int value) {
86
        setCount(value);
87
        return this;
88
    }
89
 
90
 
91
    /**
92
     * 
93
     * XML fragment representation of this object
94
     * 
95
     * @return XML fragment for this object. Name for outer
96
     * tag expected to be set by calling method. This fragment
97
     * returns inner properties representation only
98
     */
99
    protected String toXMLFragment() {
100
        StringBuffer xml = new StringBuffer();
101
        if (isSetCount()) {
102
            xml.append("<Count>");
103
            xml.append(getCount() + "");
104
            xml.append("</Count>");
105
        }
106
        return xml.toString();
107
    }
108
 
109
    /**
110
     * 
111
     * Escape XML special characters
112
     */
113
    private String escapeXML(String string) {
114
        StringBuffer sb = new StringBuffer();
115
        int length = string.length();
116
        for (int i = 0; i < length; ++i) {
117
            char c = string.charAt(i);
118
            switch (c) {
119
            case '&':
120
                sb.append("&amp;");
121
                break;
122
            case '<':
123
                sb.append("&lt;");
124
                break;
125
            case '>':
126
                sb.append("&gt;");
127
                break;
128
            case '\'':
129
                sb.append("&#039;");
130
                break;
131
            case '"':
132
                sb.append("&quot;");
133
                break;
134
            default:
135
                sb.append(c);
136
            }
137
        }
138
        return sb.toString();
139
    }
140
 
141
 
142
 
143
    /**
144
     *
145
     * JSON fragment representation of this object
146
     *
147
     * @return JSON fragment for this object. Name for outer
148
     * object expected to be set by calling method. This fragment
149
     * returns inner properties representation only
150
     *
151
     */
152
    protected String toJSONFragment() {
153
        StringBuffer json = new StringBuffer();
154
        boolean first = true;
155
        if (isSetCount()) {
156
            if (!first) json.append(", ");
157
            json.append(quoteJSON("Count"));
158
            json.append(" : ");
159
            json.append(quoteJSON(getCount() + ""));
160
            first = false;
161
        }
162
        return json.toString();
163
    }
164
 
165
    /**
166
     *
167
     * Quote JSON string
168
     */
169
    private String quoteJSON(String string) {
170
        StringBuffer sb = new StringBuffer();
171
        sb.append("\"");
172
        int length = string.length();
173
        for (int i = 0; i < length; ++i) {
174
            char c = string.charAt(i);
175
            switch (c) {
176
            case '"':
177
                sb.append("\\\"");
178
                break;
179
            case '\\':
180
                sb.append("\\\\");
181
                break;
182
            case '/':
183
                sb.append("\\/");
184
                break;
185
            case '\b':
186
                sb.append("\\b");
187
                break;
188
            case '\f':
189
                sb.append("\\f");
190
                break;
191
            case '\n':
192
                sb.append("\\n");
193
                break;
194
            case '\r':
195
                sb.append("\\r");
196
                break;
197
            case '\t':
198
                sb.append("\\t");
199
                break;
200
            default:
201
                if (c <  ' ') {
202
                    sb.append("\\u" + String.format("%03x", Integer.valueOf(c)));
203
                } else {
204
                sb.append(c);
205
            }
206
        }
207
        }
208
        sb.append("\"");
209
        return sb.toString();
210
    }
211
 
212
 
213
}