Subversion Repositories SmartDukaan

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
7474 vikram.rag 1
 
2
package com.amazonservices.mws.products.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 SellerSKUIdentifier complex type.
12
 * 
13
 * <p>The following schema fragment specifies the expected content contained within this class.
14
 * 
15
 * <pre>
16
 * &lt;complexType name="SellerSKUIdentifier">
17
 *   &lt;complexContent>
18
 *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
19
 *       &lt;sequence>
20
 *         &lt;element name="MarketplaceId" type="{http://www.w3.org/2001/XMLSchema}string"/>
21
 *         &lt;element name="SellerId" type="{http://www.w3.org/2001/XMLSchema}string"/>
22
 *         &lt;element name="SellerSKU" type="{http://www.w3.org/2001/XMLSchema}string"/>
23
 *       &lt;/sequence>
24
 *     &lt;/restriction>
25
 *   &lt;/complexContent>
26
 * &lt;/complexType>
27
 * </pre>
28
 * 
29
 * 
30
 */
31
@XmlAccessorType(XmlAccessType.FIELD)
32
@XmlType(name = "SellerSKUIdentifier", propOrder = {
33
    "marketplaceId",
34
    "sellerId",
35
    "sellerSKU"
36
})
37
public class SellerSKUIdentifier {
38
 
39
    @XmlElement(name = "MarketplaceId", required = true)
40
    protected String marketplaceId;
41
    @XmlElement(name = "SellerId", required = true)
42
    protected String sellerId;
43
    @XmlElement(name = "SellerSKU", required = true)
44
    protected String sellerSKU;
45
 
46
    /**
47
     * Default constructor
48
     * 
49
     */
50
    public SellerSKUIdentifier() {
51
        super();
52
    }
53
 
54
    /**
55
     * Value constructor
56
     * 
57
     */
58
    public SellerSKUIdentifier(final String marketplaceId, final String sellerId, final String sellerSKU) {
59
        this.marketplaceId = marketplaceId;
60
        this.sellerId = sellerId;
61
        this.sellerSKU = sellerSKU;
62
    }
63
 
64
    /**
65
     * Gets the value of the marketplaceId property.
66
     * 
67
     * @return
68
     *     possible object is
69
     *     {@link String }
70
     *     
71
     */
72
    public String getMarketplaceId() {
73
        return marketplaceId;
74
    }
75
 
76
    /**
77
     * Sets the value of the marketplaceId property.
78
     * 
79
     * @param value
80
     *     allowed object is
81
     *     {@link String }
82
     *     
83
     */
84
    public void setMarketplaceId(String value) {
85
        this.marketplaceId = value;
86
    }
87
 
88
    public boolean isSetMarketplaceId() {
89
        return (this.marketplaceId!= null);
90
    }
91
 
92
    /**
93
     * Gets the value of the sellerId property.
94
     * 
95
     * @return
96
     *     possible object is
97
     *     {@link String }
98
     *     
99
     */
100
    public String getSellerId() {
101
        return sellerId;
102
    }
103
 
104
    /**
105
     * Sets the value of the sellerId property.
106
     * 
107
     * @param value
108
     *     allowed object is
109
     *     {@link String }
110
     *     
111
     */
112
    public void setSellerId(String value) {
113
        this.sellerId = value;
114
    }
115
 
116
    public boolean isSetSellerId() {
117
        return (this.sellerId!= null);
118
    }
119
 
120
    /**
121
     * Gets the value of the sellerSKU property.
122
     * 
123
     * @return
124
     *     possible object is
125
     *     {@link String }
126
     *     
127
     */
128
    public String getSellerSKU() {
129
        return sellerSKU;
130
    }
131
 
132
    /**
133
     * Sets the value of the sellerSKU property.
134
     * 
135
     * @param value
136
     *     allowed object is
137
     *     {@link String }
138
     *     
139
     */
140
    public void setSellerSKU(String value) {
141
        this.sellerSKU = value;
142
    }
143
 
144
    public boolean isSetSellerSKU() {
145
        return (this.sellerSKU!= null);
146
    }
147
 
148
    /**
149
     * Sets the value of the MarketplaceId property.
150
     * 
151
     * @param value
152
     * @return
153
     *     this instance
154
     */
155
    public SellerSKUIdentifier withMarketplaceId(String value) {
156
        setMarketplaceId(value);
157
        return this;
158
    }
159
 
160
    /**
161
     * Sets the value of the SellerId property.
162
     * 
163
     * @param value
164
     * @return
165
     *     this instance
166
     */
167
    public SellerSKUIdentifier withSellerId(String value) {
168
        setSellerId(value);
169
        return this;
170
    }
171
 
172
    /**
173
     * Sets the value of the SellerSKU property.
174
     * 
175
     * @param value
176
     * @return
177
     *     this instance
178
     */
179
    public SellerSKUIdentifier withSellerSKU(String value) {
180
        setSellerSKU(value);
181
        return this;
182
    }
183
 
184
 
185
 
186
    /**
187
     * 
188
     * XML fragment representation of this object
189
     * 
190
     * @return XML fragment for this object. Name for outer
191
     * tag expected to be set by calling method. This fragment
192
     * returns inner properties representation only
193
     */
194
    public String toXMLFragment() {
195
        StringBuffer xml = new StringBuffer();
196
        if (isSetMarketplaceId()) {
197
            xml.append("<MarketplaceId>");
198
            xml.append(escapeXML(getMarketplaceId()));
199
            xml.append("</MarketplaceId>");
200
        }
201
        if (isSetSellerId()) {
202
            xml.append("<SellerId>");
203
            xml.append(escapeXML(getSellerId()));
204
            xml.append("</SellerId>");
205
        }
206
        if (isSetSellerSKU()) {
207
            xml.append("<SellerSKU>");
208
            xml.append(escapeXML(getSellerSKU()));
209
            xml.append("</SellerSKU>");
210
        }
211
        return xml.toString();
212
    }
213
 
214
    /**
215
     * 
216
     * Escape XML special characters
217
     */
218
    private String escapeXML(String string) {
219
        if (string == null)
220
            return "null";
221
        StringBuffer sb = new StringBuffer();
222
        int length = string.length();
223
        for (int i = 0; i < length; ++i) {
224
            char c = string.charAt(i);
225
            switch (c) {
226
            case '&':
227
                sb.append("&amp;");
228
                break;
229
            case '<':
230
                sb.append("&lt;");
231
                break;
232
            case '>':
233
                sb.append("&gt;");
234
                break;
235
            case '\'':
236
                sb.append("&#039;");
237
                break;
238
            case '"':
239
                sb.append("&quot;");
240
                break;
241
            default:
242
                sb.append(c);
243
            }
244
        }
245
        return sb.toString();
246
    }
247
 
248
 
249
 
250
    /**
251
     *
252
     * JSON fragment representation of this object
253
     *
254
     * @return JSON fragment for this object. Name for outer
255
     * object expected to be set by calling method. This fragment
256
     * returns inner properties representation only
257
     *
258
     */
259
    protected String toJSONFragment() {
260
        StringBuffer json = new StringBuffer();
261
        boolean first = true;
262
        if (isSetMarketplaceId()) {
263
            if (!first) json.append(", ");
264
            json.append(quoteJSON("MarketplaceId"));
265
            json.append(" : ");
266
            json.append(quoteJSON(getMarketplaceId()));
267
            first = false;
268
        }
269
        if (isSetSellerId()) {
270
            if (!first) json.append(", ");
271
            json.append(quoteJSON("SellerId"));
272
            json.append(" : ");
273
            json.append(quoteJSON(getSellerId()));
274
            first = false;
275
        }
276
        if (isSetSellerSKU()) {
277
            if (!first) json.append(", ");
278
            json.append(quoteJSON("SellerSKU"));
279
            json.append(" : ");
280
            json.append(quoteJSON(getSellerSKU()));
281
            first = false;
282
        }
283
        return json.toString();
284
    }
285
 
286
    /**
287
     *
288
     * Quote JSON string
289
     */
290
    private String quoteJSON(String string) {
291
        if (string == null)
292
            return "null";
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
}