Subversion Repositories SmartDukaan

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
7473 vikram.rag 1
 
2
package com.amazonservices.mws.orders.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.XmlType;
8
 
9
 
10
/**
11
 * <p>Java class for InvoiceData complex type.
12
 * 
13
 * <p>The following schema fragment specifies the expected content contained within this class.
14
 * 
15
 * <pre>
16
 * &lt;complexType name="InvoiceData">
17
 *   &lt;complexContent>
18
 *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
19
 *       &lt;sequence>
20
 *         &lt;element name="InvoiceRequirement" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
21
 *         &lt;element name="BuyerSelectedInvoiceCategory" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
22
 *         &lt;element name="InvoiceTitle" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
23
 *         &lt;element name="InvoiceInformation" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
24
 *       &lt;/sequence>
25
 *     &lt;/restriction>
26
 *   &lt;/complexContent>
27
 * &lt;/complexType>
28
 * </pre>
29
 * 
30
 * 
31
 */
32
@XmlAccessorType(XmlAccessType.FIELD)
33
@XmlType(name = "InvoiceData", propOrder = {
34
    "invoiceRequirement",
35
    "buyerSelectedInvoiceCategory",
36
    "invoiceTitle",
37
    "invoiceInformation"
38
})
39
public class InvoiceData {
40
 
41
    @XmlElement(name = "InvoiceRequirement")
42
    protected String invoiceRequirement;
43
    @XmlElement(name = "BuyerSelectedInvoiceCategory")
44
    protected String buyerSelectedInvoiceCategory;
45
    @XmlElement(name = "InvoiceTitle")
46
    protected String invoiceTitle;
47
    @XmlElement(name = "InvoiceInformation")
48
    protected String invoiceInformation;
49
 
50
    /**
51
     * Default constructor
52
     * 
53
     */
54
    public InvoiceData() {
55
        super();
56
    }
57
 
58
    /**
59
     * Value constructor
60
     * 
61
     */
62
    public InvoiceData(final String invoiceRequirement, final String buyerSelectedInvoiceCategory, final String invoiceTitle, final String invoiceInformation) {
63
        this.invoiceRequirement = invoiceRequirement;
64
        this.buyerSelectedInvoiceCategory = buyerSelectedInvoiceCategory;
65
        this.invoiceTitle = invoiceTitle;
66
        this.invoiceInformation = invoiceInformation;
67
    }
68
 
69
    /**
70
     * Gets the value of the invoiceRequirement property.
71
     * 
72
     * @return
73
     *     possible object is
74
     *     {@link String }
75
     *     
76
     */
77
    public String getInvoiceRequirement() {
78
        return invoiceRequirement;
79
    }
80
 
81
    /**
82
     * Sets the value of the invoiceRequirement property.
83
     * 
84
     * @param value
85
     *     allowed object is
86
     *     {@link String }
87
     *     
88
     */
89
    public void setInvoiceRequirement(String value) {
90
        this.invoiceRequirement = value;
91
    }
92
 
93
    public boolean isSetInvoiceRequirement() {
94
        return (this.invoiceRequirement!= null);
95
    }
96
 
97
    /**
98
     * Gets the value of the buyerSelectedInvoiceCategory property.
99
     * 
100
     * @return
101
     *     possible object is
102
     *     {@link String }
103
     *     
104
     */
105
    public String getBuyerSelectedInvoiceCategory() {
106
        return buyerSelectedInvoiceCategory;
107
    }
108
 
109
    /**
110
     * Sets the value of the buyerSelectedInvoiceCategory property.
111
     * 
112
     * @param value
113
     *     allowed object is
114
     *     {@link String }
115
     *     
116
     */
117
    public void setBuyerSelectedInvoiceCategory(String value) {
118
        this.buyerSelectedInvoiceCategory = value;
119
    }
120
 
121
    public boolean isSetBuyerSelectedInvoiceCategory() {
122
        return (this.buyerSelectedInvoiceCategory!= null);
123
    }
124
 
125
    /**
126
     * Gets the value of the invoiceTitle property.
127
     * 
128
     * @return
129
     *     possible object is
130
     *     {@link String }
131
     *     
132
     */
133
    public String getInvoiceTitle() {
134
        return invoiceTitle;
135
    }
136
 
137
    /**
138
     * Sets the value of the invoiceTitle property.
139
     * 
140
     * @param value
141
     *     allowed object is
142
     *     {@link String }
143
     *     
144
     */
145
    public void setInvoiceTitle(String value) {
146
        this.invoiceTitle = value;
147
    }
148
 
149
    public boolean isSetInvoiceTitle() {
150
        return (this.invoiceTitle!= null);
151
    }
152
 
153
    /**
154
     * Gets the value of the invoiceInformation property.
155
     * 
156
     * @return
157
     *     possible object is
158
     *     {@link String }
159
     *     
160
     */
161
    public String getInvoiceInformation() {
162
        return invoiceInformation;
163
    }
164
 
165
    /**
166
     * Sets the value of the invoiceInformation property.
167
     * 
168
     * @param value
169
     *     allowed object is
170
     *     {@link String }
171
     *     
172
     */
173
    public void setInvoiceInformation(String value) {
174
        this.invoiceInformation = value;
175
    }
176
 
177
    public boolean isSetInvoiceInformation() {
178
        return (this.invoiceInformation!= null);
179
    }
180
 
181
    /**
182
     * Sets the value of the InvoiceRequirement property.
183
     * 
184
     * @param value
185
     * @return
186
     *     this instance
187
     */
188
    public InvoiceData withInvoiceRequirement(String value) {
189
        setInvoiceRequirement(value);
190
        return this;
191
    }
192
 
193
    /**
194
     * Sets the value of the BuyerSelectedInvoiceCategory property.
195
     * 
196
     * @param value
197
     * @return
198
     *     this instance
199
     */
200
    public InvoiceData withBuyerSelectedInvoiceCategory(String value) {
201
        setBuyerSelectedInvoiceCategory(value);
202
        return this;
203
    }
204
 
205
    /**
206
     * Sets the value of the InvoiceTitle property.
207
     * 
208
     * @param value
209
     * @return
210
     *     this instance
211
     */
212
    public InvoiceData withInvoiceTitle(String value) {
213
        setInvoiceTitle(value);
214
        return this;
215
    }
216
 
217
    /**
218
     * Sets the value of the InvoiceInformation property.
219
     * 
220
     * @param value
221
     * @return
222
     *     this instance
223
     */
224
    public InvoiceData withInvoiceInformation(String value) {
225
        setInvoiceInformation(value);
226
        return this;
227
    }
228
 
229
 
230
 
231
    /**
232
     * 
233
     * XML fragment representation of this object
234
     * 
235
     * @return XML fragment for this object. Name for outer
236
     * tag expected to be set by calling method. This fragment
237
     * returns inner properties representation only
238
     */
239
    public String toXMLFragment() {
240
        StringBuffer xml = new StringBuffer();
241
        if (isSetInvoiceRequirement()) {
242
            xml.append("<InvoiceRequirement>");
243
            xml.append(escapeXML(getInvoiceRequirement()));
244
            xml.append("</InvoiceRequirement>");
245
        }
246
        if (isSetBuyerSelectedInvoiceCategory()) {
247
            xml.append("<BuyerSelectedInvoiceCategory>");
248
            xml.append(escapeXML(getBuyerSelectedInvoiceCategory()));
249
            xml.append("</BuyerSelectedInvoiceCategory>");
250
        }
251
        if (isSetInvoiceTitle()) {
252
            xml.append("<InvoiceTitle>");
253
            xml.append(escapeXML(getInvoiceTitle()));
254
            xml.append("</InvoiceTitle>");
255
        }
256
        if (isSetInvoiceInformation()) {
257
            xml.append("<InvoiceInformation>");
258
            xml.append(escapeXML(getInvoiceInformation()));
259
            xml.append("</InvoiceInformation>");
260
        }
261
        return xml.toString();
262
    }
263
 
264
    /**
265
     * 
266
     * Escape XML special characters
267
     */
268
    private String escapeXML(String string) {
269
        if (string == null)
270
            return "null";
271
        StringBuffer sb = new StringBuffer();
272
        int length = string.length();
273
        for (int i = 0; i < length; ++i) {
274
            char c = string.charAt(i);
275
            switch (c) {
276
            case '&':
277
                sb.append("&amp;");
278
                break;
279
            case '<':
280
                sb.append("&lt;");
281
                break;
282
            case '>':
283
                sb.append("&gt;");
284
                break;
285
            case '\'':
286
                sb.append("&#039;");
287
                break;
288
            case '"':
289
                sb.append("&quot;");
290
                break;
291
            default:
292
                sb.append(c);
293
            }
294
        }
295
        return sb.toString();
296
    }
297
 
298
 
299
 
300
    /**
301
     *
302
     * JSON fragment representation of this object
303
     *
304
     * @return JSON fragment for this object. Name for outer
305
     * object expected to be set by calling method. This fragment
306
     * returns inner properties representation only
307
     *
308
     */
309
    protected String toJSONFragment() {
310
        StringBuffer json = new StringBuffer();
311
        boolean first = true;
312
        if (isSetInvoiceRequirement()) {
313
            if (!first) json.append(", ");
314
            json.append(quoteJSON("InvoiceRequirement"));
315
            json.append(" : ");
316
            json.append(quoteJSON(getInvoiceRequirement()));
317
            first = false;
318
        }
319
        if (isSetBuyerSelectedInvoiceCategory()) {
320
            if (!first) json.append(", ");
321
            json.append(quoteJSON("BuyerSelectedInvoiceCategory"));
322
            json.append(" : ");
323
            json.append(quoteJSON(getBuyerSelectedInvoiceCategory()));
324
            first = false;
325
        }
326
        if (isSetInvoiceTitle()) {
327
            if (!first) json.append(", ");
328
            json.append(quoteJSON("InvoiceTitle"));
329
            json.append(" : ");
330
            json.append(quoteJSON(getInvoiceTitle()));
331
            first = false;
332
        }
333
        if (isSetInvoiceInformation()) {
334
            if (!first) json.append(", ");
335
            json.append(quoteJSON("InvoiceInformation"));
336
            json.append(" : ");
337
            json.append(quoteJSON(getInvoiceInformation()));
338
            first = false;
339
        }
340
        return json.toString();
341
    }
342
 
343
    /**
344
     *
345
     * Quote JSON string
346
     */
347
    private String quoteJSON(String string) {
348
        if (string == null)
349
            return "null";
350
        StringBuffer sb = new StringBuffer();
351
        sb.append("\"");
352
        int length = string.length();
353
        for (int i = 0; i < length; ++i) {
354
            char c = string.charAt(i);
355
            switch (c) {
356
            case '"':
357
                sb.append("\\\"");
358
                break;
359
            case '\\':
360
                sb.append("\\\\");
361
                break;
362
            case '/':
363
                sb.append("\\/");
364
                break;
365
            case '\b':
366
                sb.append("\\b");
367
                break;
368
            case '\f':
369
                sb.append("\\f");
370
                break;
371
            case '\n':
372
                sb.append("\\n");
373
                break;
374
            case '\r':
375
                sb.append("\\r");
376
                break;
377
            case '\t':
378
                sb.append("\\t");
379
                break;
380
            default:
381
                if (c <  ' ') {
382
                    sb.append("\\u" + String.format("%03x", Integer.valueOf(c)));
383
                } else {
384
                sb.append(c);
385
            }
386
        }
387
        }
388
        sb.append("\"");
389
        return sb.toString();
390
    }
391
 
392
 
393
}