Subversion Repositories SmartDukaan

Rev

Rev 18719 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
18719 kshitij.so 1
/**
2
 * Autogenerated by Thrift Compiler (0.7.0)
3
 *
4
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
 */
6
package in.shop2020.model.v1.catalog;
7
 
8
import java.util.List;
9
import java.util.ArrayList;
10
import java.util.Map;
11
import java.util.HashMap;
12
import java.util.EnumMap;
13
import java.util.Set;
14
import java.util.HashSet;
15
import java.util.EnumSet;
16
import java.util.Collections;
17
import java.util.BitSet;
18
import java.nio.ByteBuffer;
19
import java.util.Arrays;
20
import org.slf4j.Logger;
21
import org.slf4j.LoggerFactory;
22
 
23
public class DtrPricing implements org.apache.thrift.TBase<DtrPricing, DtrPricing._Fields>, java.io.Serializable, Cloneable {
24
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("DtrPricing");
25
 
26
  private static final org.apache.thrift.protocol.TField SELLING_PRICE_FIELD_DESC = new org.apache.thrift.protocol.TField("sellingPrice", org.apache.thrift.protocol.TType.DOUBLE, (short)1);
27
  private static final org.apache.thrift.protocol.TField BULK_PRICING_FIELD_DESC = new org.apache.thrift.protocol.TField("bulkPricing", org.apache.thrift.protocol.TType.MAP, (short)2);
28
  private static final org.apache.thrift.protocol.TField CATALOG_ITEM_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("catalog_item_id", org.apache.thrift.protocol.TType.I64, (short)3);
29
  private static final org.apache.thrift.protocol.TField MINIMUM_BUY_QUANTITY_FIELD_DESC = new org.apache.thrift.protocol.TField("minimumBuyQuantity", org.apache.thrift.protocol.TType.I64, (short)4);
30
  private static final org.apache.thrift.protocol.TField MAXIMUM_BUY_QUANTITY_FIELD_DESC = new org.apache.thrift.protocol.TField("maximumBuyQuantity", org.apache.thrift.protocol.TType.I64, (short)5);
31
 
32
  private double sellingPrice; // required
33
  private Map<Long,Double> bulkPricing; // required
34
  private long catalog_item_id; // required
35
  private long minimumBuyQuantity; // required
36
  private long maximumBuyQuantity; // required
37
 
38
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
39
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
40
    SELLING_PRICE((short)1, "sellingPrice"),
41
    BULK_PRICING((short)2, "bulkPricing"),
42
    CATALOG_ITEM_ID((short)3, "catalog_item_id"),
43
    MINIMUM_BUY_QUANTITY((short)4, "minimumBuyQuantity"),
44
    MAXIMUM_BUY_QUANTITY((short)5, "maximumBuyQuantity");
45
 
46
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
47
 
48
    static {
49
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
50
        byName.put(field.getFieldName(), field);
51
      }
52
    }
53
 
54
    /**
55
     * Find the _Fields constant that matches fieldId, or null if its not found.
56
     */
57
    public static _Fields findByThriftId(int fieldId) {
58
      switch(fieldId) {
59
        case 1: // SELLING_PRICE
60
          return SELLING_PRICE;
61
        case 2: // BULK_PRICING
62
          return BULK_PRICING;
63
        case 3: // CATALOG_ITEM_ID
64
          return CATALOG_ITEM_ID;
65
        case 4: // MINIMUM_BUY_QUANTITY
66
          return MINIMUM_BUY_QUANTITY;
67
        case 5: // MAXIMUM_BUY_QUANTITY
68
          return MAXIMUM_BUY_QUANTITY;
69
        default:
70
          return null;
71
      }
72
    }
73
 
74
    /**
75
     * Find the _Fields constant that matches fieldId, throwing an exception
76
     * if it is not found.
77
     */
78
    public static _Fields findByThriftIdOrThrow(int fieldId) {
79
      _Fields fields = findByThriftId(fieldId);
80
      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
81
      return fields;
82
    }
83
 
84
    /**
85
     * Find the _Fields constant that matches name, or null if its not found.
86
     */
87
    public static _Fields findByName(String name) {
88
      return byName.get(name);
89
    }
90
 
91
    private final short _thriftId;
92
    private final String _fieldName;
93
 
94
    _Fields(short thriftId, String fieldName) {
95
      _thriftId = thriftId;
96
      _fieldName = fieldName;
97
    }
98
 
99
    public short getThriftFieldId() {
100
      return _thriftId;
101
    }
102
 
103
    public String getFieldName() {
104
      return _fieldName;
105
    }
106
  }
107
 
108
  // isset id assignments
109
  private static final int __SELLINGPRICE_ISSET_ID = 0;
110
  private static final int __CATALOG_ITEM_ID_ISSET_ID = 1;
111
  private static final int __MINIMUMBUYQUANTITY_ISSET_ID = 2;
112
  private static final int __MAXIMUMBUYQUANTITY_ISSET_ID = 3;
113
  private BitSet __isset_bit_vector = new BitSet(4);
114
 
115
  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
116
  static {
117
    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
118
    tmpMap.put(_Fields.SELLING_PRICE, new org.apache.thrift.meta_data.FieldMetaData("sellingPrice", org.apache.thrift.TFieldRequirementType.DEFAULT, 
119
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
120
    tmpMap.put(_Fields.BULK_PRICING, new org.apache.thrift.meta_data.FieldMetaData("bulkPricing", org.apache.thrift.TFieldRequirementType.DEFAULT, 
121
        new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, 
122
            new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64), 
123
            new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE))));
124
    tmpMap.put(_Fields.CATALOG_ITEM_ID, new org.apache.thrift.meta_data.FieldMetaData("catalog_item_id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
125
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
126
    tmpMap.put(_Fields.MINIMUM_BUY_QUANTITY, new org.apache.thrift.meta_data.FieldMetaData("minimumBuyQuantity", org.apache.thrift.TFieldRequirementType.DEFAULT, 
127
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
128
    tmpMap.put(_Fields.MAXIMUM_BUY_QUANTITY, new org.apache.thrift.meta_data.FieldMetaData("maximumBuyQuantity", org.apache.thrift.TFieldRequirementType.DEFAULT, 
129
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
130
    metaDataMap = Collections.unmodifiableMap(tmpMap);
131
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(DtrPricing.class, metaDataMap);
132
  }
133
 
134
  public DtrPricing() {
135
  }
136
 
137
  public DtrPricing(
138
    double sellingPrice,
139
    Map<Long,Double> bulkPricing,
140
    long catalog_item_id,
141
    long minimumBuyQuantity,
142
    long maximumBuyQuantity)
143
  {
144
    this();
145
    this.sellingPrice = sellingPrice;
146
    setSellingPriceIsSet(true);
147
    this.bulkPricing = bulkPricing;
148
    this.catalog_item_id = catalog_item_id;
149
    setCatalog_item_idIsSet(true);
150
    this.minimumBuyQuantity = minimumBuyQuantity;
151
    setMinimumBuyQuantityIsSet(true);
152
    this.maximumBuyQuantity = maximumBuyQuantity;
153
    setMaximumBuyQuantityIsSet(true);
154
  }
155
 
156
  /**
157
   * Performs a deep copy on <i>other</i>.
158
   */
159
  public DtrPricing(DtrPricing other) {
160
    __isset_bit_vector.clear();
161
    __isset_bit_vector.or(other.__isset_bit_vector);
162
    this.sellingPrice = other.sellingPrice;
163
    if (other.isSetBulkPricing()) {
164
      Map<Long,Double> __this__bulkPricing = new HashMap<Long,Double>();
165
      for (Map.Entry<Long, Double> other_element : other.bulkPricing.entrySet()) {
166
 
167
        Long other_element_key = other_element.getKey();
168
        Double other_element_value = other_element.getValue();
169
 
170
        Long __this__bulkPricing_copy_key = other_element_key;
171
 
172
        Double __this__bulkPricing_copy_value = other_element_value;
173
 
174
        __this__bulkPricing.put(__this__bulkPricing_copy_key, __this__bulkPricing_copy_value);
175
      }
176
      this.bulkPricing = __this__bulkPricing;
177
    }
178
    this.catalog_item_id = other.catalog_item_id;
179
    this.minimumBuyQuantity = other.minimumBuyQuantity;
180
    this.maximumBuyQuantity = other.maximumBuyQuantity;
181
  }
182
 
183
  public DtrPricing deepCopy() {
184
    return new DtrPricing(this);
185
  }
186
 
187
  @Override
188
  public void clear() {
189
    setSellingPriceIsSet(false);
190
    this.sellingPrice = 0.0;
191
    this.bulkPricing = null;
192
    setCatalog_item_idIsSet(false);
193
    this.catalog_item_id = 0;
194
    setMinimumBuyQuantityIsSet(false);
195
    this.minimumBuyQuantity = 0;
196
    setMaximumBuyQuantityIsSet(false);
197
    this.maximumBuyQuantity = 0;
198
  }
199
 
200
  public double getSellingPrice() {
201
    return this.sellingPrice;
202
  }
203
 
204
  public void setSellingPrice(double sellingPrice) {
205
    this.sellingPrice = sellingPrice;
206
    setSellingPriceIsSet(true);
207
  }
208
 
209
  public void unsetSellingPrice() {
210
    __isset_bit_vector.clear(__SELLINGPRICE_ISSET_ID);
211
  }
212
 
213
  /** Returns true if field sellingPrice is set (has been assigned a value) and false otherwise */
214
  public boolean isSetSellingPrice() {
215
    return __isset_bit_vector.get(__SELLINGPRICE_ISSET_ID);
216
  }
217
 
218
  public void setSellingPriceIsSet(boolean value) {
219
    __isset_bit_vector.set(__SELLINGPRICE_ISSET_ID, value);
220
  }
221
 
222
  public int getBulkPricingSize() {
223
    return (this.bulkPricing == null) ? 0 : this.bulkPricing.size();
224
  }
225
 
226
  public void putToBulkPricing(long key, double val) {
227
    if (this.bulkPricing == null) {
228
      this.bulkPricing = new HashMap<Long,Double>();
229
    }
230
    this.bulkPricing.put(key, val);
231
  }
232
 
233
  public Map<Long,Double> getBulkPricing() {
234
    return this.bulkPricing;
235
  }
236
 
237
  public void setBulkPricing(Map<Long,Double> bulkPricing) {
238
    this.bulkPricing = bulkPricing;
239
  }
240
 
241
  public void unsetBulkPricing() {
242
    this.bulkPricing = null;
243
  }
244
 
245
  /** Returns true if field bulkPricing is set (has been assigned a value) and false otherwise */
246
  public boolean isSetBulkPricing() {
247
    return this.bulkPricing != null;
248
  }
249
 
250
  public void setBulkPricingIsSet(boolean value) {
251
    if (!value) {
252
      this.bulkPricing = null;
253
    }
254
  }
255
 
256
  public long getCatalog_item_id() {
257
    return this.catalog_item_id;
258
  }
259
 
260
  public void setCatalog_item_id(long catalog_item_id) {
261
    this.catalog_item_id = catalog_item_id;
262
    setCatalog_item_idIsSet(true);
263
  }
264
 
265
  public void unsetCatalog_item_id() {
266
    __isset_bit_vector.clear(__CATALOG_ITEM_ID_ISSET_ID);
267
  }
268
 
269
  /** Returns true if field catalog_item_id is set (has been assigned a value) and false otherwise */
270
  public boolean isSetCatalog_item_id() {
271
    return __isset_bit_vector.get(__CATALOG_ITEM_ID_ISSET_ID);
272
  }
273
 
274
  public void setCatalog_item_idIsSet(boolean value) {
275
    __isset_bit_vector.set(__CATALOG_ITEM_ID_ISSET_ID, value);
276
  }
277
 
278
  public long getMinimumBuyQuantity() {
279
    return this.minimumBuyQuantity;
280
  }
281
 
282
  public void setMinimumBuyQuantity(long minimumBuyQuantity) {
283
    this.minimumBuyQuantity = minimumBuyQuantity;
284
    setMinimumBuyQuantityIsSet(true);
285
  }
286
 
287
  public void unsetMinimumBuyQuantity() {
288
    __isset_bit_vector.clear(__MINIMUMBUYQUANTITY_ISSET_ID);
289
  }
290
 
291
  /** Returns true if field minimumBuyQuantity is set (has been assigned a value) and false otherwise */
292
  public boolean isSetMinimumBuyQuantity() {
293
    return __isset_bit_vector.get(__MINIMUMBUYQUANTITY_ISSET_ID);
294
  }
295
 
296
  public void setMinimumBuyQuantityIsSet(boolean value) {
297
    __isset_bit_vector.set(__MINIMUMBUYQUANTITY_ISSET_ID, value);
298
  }
299
 
300
  public long getMaximumBuyQuantity() {
301
    return this.maximumBuyQuantity;
302
  }
303
 
304
  public void setMaximumBuyQuantity(long maximumBuyQuantity) {
305
    this.maximumBuyQuantity = maximumBuyQuantity;
306
    setMaximumBuyQuantityIsSet(true);
307
  }
308
 
309
  public void unsetMaximumBuyQuantity() {
310
    __isset_bit_vector.clear(__MAXIMUMBUYQUANTITY_ISSET_ID);
311
  }
312
 
313
  /** Returns true if field maximumBuyQuantity is set (has been assigned a value) and false otherwise */
314
  public boolean isSetMaximumBuyQuantity() {
315
    return __isset_bit_vector.get(__MAXIMUMBUYQUANTITY_ISSET_ID);
316
  }
317
 
318
  public void setMaximumBuyQuantityIsSet(boolean value) {
319
    __isset_bit_vector.set(__MAXIMUMBUYQUANTITY_ISSET_ID, value);
320
  }
321
 
322
  public void setFieldValue(_Fields field, Object value) {
323
    switch (field) {
324
    case SELLING_PRICE:
325
      if (value == null) {
326
        unsetSellingPrice();
327
      } else {
328
        setSellingPrice((Double)value);
329
      }
330
      break;
331
 
332
    case BULK_PRICING:
333
      if (value == null) {
334
        unsetBulkPricing();
335
      } else {
336
        setBulkPricing((Map<Long,Double>)value);
337
      }
338
      break;
339
 
340
    case CATALOG_ITEM_ID:
341
      if (value == null) {
342
        unsetCatalog_item_id();
343
      } else {
344
        setCatalog_item_id((Long)value);
345
      }
346
      break;
347
 
348
    case MINIMUM_BUY_QUANTITY:
349
      if (value == null) {
350
        unsetMinimumBuyQuantity();
351
      } else {
352
        setMinimumBuyQuantity((Long)value);
353
      }
354
      break;
355
 
356
    case MAXIMUM_BUY_QUANTITY:
357
      if (value == null) {
358
        unsetMaximumBuyQuantity();
359
      } else {
360
        setMaximumBuyQuantity((Long)value);
361
      }
362
      break;
363
 
364
    }
365
  }
366
 
367
  public Object getFieldValue(_Fields field) {
368
    switch (field) {
369
    case SELLING_PRICE:
370
      return Double.valueOf(getSellingPrice());
371
 
372
    case BULK_PRICING:
373
      return getBulkPricing();
374
 
375
    case CATALOG_ITEM_ID:
376
      return Long.valueOf(getCatalog_item_id());
377
 
378
    case MINIMUM_BUY_QUANTITY:
379
      return Long.valueOf(getMinimumBuyQuantity());
380
 
381
    case MAXIMUM_BUY_QUANTITY:
382
      return Long.valueOf(getMaximumBuyQuantity());
383
 
384
    }
385
    throw new IllegalStateException();
386
  }
387
 
388
  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
389
  public boolean isSet(_Fields field) {
390
    if (field == null) {
391
      throw new IllegalArgumentException();
392
    }
393
 
394
    switch (field) {
395
    case SELLING_PRICE:
396
      return isSetSellingPrice();
397
    case BULK_PRICING:
398
      return isSetBulkPricing();
399
    case CATALOG_ITEM_ID:
400
      return isSetCatalog_item_id();
401
    case MINIMUM_BUY_QUANTITY:
402
      return isSetMinimumBuyQuantity();
403
    case MAXIMUM_BUY_QUANTITY:
404
      return isSetMaximumBuyQuantity();
405
    }
406
    throw new IllegalStateException();
407
  }
408
 
409
  @Override
410
  public boolean equals(Object that) {
411
    if (that == null)
412
      return false;
413
    if (that instanceof DtrPricing)
414
      return this.equals((DtrPricing)that);
415
    return false;
416
  }
417
 
418
  public boolean equals(DtrPricing that) {
419
    if (that == null)
420
      return false;
421
 
422
    boolean this_present_sellingPrice = true;
423
    boolean that_present_sellingPrice = true;
424
    if (this_present_sellingPrice || that_present_sellingPrice) {
425
      if (!(this_present_sellingPrice && that_present_sellingPrice))
426
        return false;
427
      if (this.sellingPrice != that.sellingPrice)
428
        return false;
429
    }
430
 
431
    boolean this_present_bulkPricing = true && this.isSetBulkPricing();
432
    boolean that_present_bulkPricing = true && that.isSetBulkPricing();
433
    if (this_present_bulkPricing || that_present_bulkPricing) {
434
      if (!(this_present_bulkPricing && that_present_bulkPricing))
435
        return false;
436
      if (!this.bulkPricing.equals(that.bulkPricing))
437
        return false;
438
    }
439
 
440
    boolean this_present_catalog_item_id = true;
441
    boolean that_present_catalog_item_id = true;
442
    if (this_present_catalog_item_id || that_present_catalog_item_id) {
443
      if (!(this_present_catalog_item_id && that_present_catalog_item_id))
444
        return false;
445
      if (this.catalog_item_id != that.catalog_item_id)
446
        return false;
447
    }
448
 
449
    boolean this_present_minimumBuyQuantity = true;
450
    boolean that_present_minimumBuyQuantity = true;
451
    if (this_present_minimumBuyQuantity || that_present_minimumBuyQuantity) {
452
      if (!(this_present_minimumBuyQuantity && that_present_minimumBuyQuantity))
453
        return false;
454
      if (this.minimumBuyQuantity != that.minimumBuyQuantity)
455
        return false;
456
    }
457
 
458
    boolean this_present_maximumBuyQuantity = true;
459
    boolean that_present_maximumBuyQuantity = true;
460
    if (this_present_maximumBuyQuantity || that_present_maximumBuyQuantity) {
461
      if (!(this_present_maximumBuyQuantity && that_present_maximumBuyQuantity))
462
        return false;
463
      if (this.maximumBuyQuantity != that.maximumBuyQuantity)
464
        return false;
465
    }
466
 
467
    return true;
468
  }
469
 
470
  @Override
471
  public int hashCode() {
472
    return 0;
473
  }
474
 
475
  public int compareTo(DtrPricing other) {
476
    if (!getClass().equals(other.getClass())) {
477
      return getClass().getName().compareTo(other.getClass().getName());
478
    }
479
 
480
    int lastComparison = 0;
481
    DtrPricing typedOther = (DtrPricing)other;
482
 
483
    lastComparison = Boolean.valueOf(isSetSellingPrice()).compareTo(typedOther.isSetSellingPrice());
484
    if (lastComparison != 0) {
485
      return lastComparison;
486
    }
487
    if (isSetSellingPrice()) {
488
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sellingPrice, typedOther.sellingPrice);
489
      if (lastComparison != 0) {
490
        return lastComparison;
491
      }
492
    }
493
    lastComparison = Boolean.valueOf(isSetBulkPricing()).compareTo(typedOther.isSetBulkPricing());
494
    if (lastComparison != 0) {
495
      return lastComparison;
496
    }
497
    if (isSetBulkPricing()) {
498
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.bulkPricing, typedOther.bulkPricing);
499
      if (lastComparison != 0) {
500
        return lastComparison;
501
      }
502
    }
503
    lastComparison = Boolean.valueOf(isSetCatalog_item_id()).compareTo(typedOther.isSetCatalog_item_id());
504
    if (lastComparison != 0) {
505
      return lastComparison;
506
    }
507
    if (isSetCatalog_item_id()) {
508
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.catalog_item_id, typedOther.catalog_item_id);
509
      if (lastComparison != 0) {
510
        return lastComparison;
511
      }
512
    }
513
    lastComparison = Boolean.valueOf(isSetMinimumBuyQuantity()).compareTo(typedOther.isSetMinimumBuyQuantity());
514
    if (lastComparison != 0) {
515
      return lastComparison;
516
    }
517
    if (isSetMinimumBuyQuantity()) {
518
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.minimumBuyQuantity, typedOther.minimumBuyQuantity);
519
      if (lastComparison != 0) {
520
        return lastComparison;
521
      }
522
    }
523
    lastComparison = Boolean.valueOf(isSetMaximumBuyQuantity()).compareTo(typedOther.isSetMaximumBuyQuantity());
524
    if (lastComparison != 0) {
525
      return lastComparison;
526
    }
527
    if (isSetMaximumBuyQuantity()) {
528
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.maximumBuyQuantity, typedOther.maximumBuyQuantity);
529
      if (lastComparison != 0) {
530
        return lastComparison;
531
      }
532
    }
533
    return 0;
534
  }
535
 
536
  public _Fields fieldForId(int fieldId) {
537
    return _Fields.findByThriftId(fieldId);
538
  }
539
 
540
  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
541
    org.apache.thrift.protocol.TField field;
542
    iprot.readStructBegin();
543
    while (true)
544
    {
545
      field = iprot.readFieldBegin();
546
      if (field.type == org.apache.thrift.protocol.TType.STOP) { 
547
        break;
548
      }
549
      switch (field.id) {
550
        case 1: // SELLING_PRICE
551
          if (field.type == org.apache.thrift.protocol.TType.DOUBLE) {
552
            this.sellingPrice = iprot.readDouble();
553
            setSellingPriceIsSet(true);
554
          } else { 
555
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
556
          }
557
          break;
558
        case 2: // BULK_PRICING
559
          if (field.type == org.apache.thrift.protocol.TType.MAP) {
560
            {
21963 amit.gupta 561
              org.apache.thrift.protocol.TMap _map22 = iprot.readMapBegin();
562
              this.bulkPricing = new HashMap<Long,Double>(2*_map22.size);
563
              for (int _i23 = 0; _i23 < _map22.size; ++_i23)
18719 kshitij.so 564
              {
21963 amit.gupta 565
                long _key24; // required
566
                double _val25; // required
567
                _key24 = iprot.readI64();
568
                _val25 = iprot.readDouble();
569
                this.bulkPricing.put(_key24, _val25);
18719 kshitij.so 570
              }
571
              iprot.readMapEnd();
572
            }
573
          } else { 
574
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
575
          }
576
          break;
577
        case 3: // CATALOG_ITEM_ID
578
          if (field.type == org.apache.thrift.protocol.TType.I64) {
579
            this.catalog_item_id = iprot.readI64();
580
            setCatalog_item_idIsSet(true);
581
          } else { 
582
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
583
          }
584
          break;
585
        case 4: // MINIMUM_BUY_QUANTITY
586
          if (field.type == org.apache.thrift.protocol.TType.I64) {
587
            this.minimumBuyQuantity = iprot.readI64();
588
            setMinimumBuyQuantityIsSet(true);
589
          } else { 
590
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
591
          }
592
          break;
593
        case 5: // MAXIMUM_BUY_QUANTITY
594
          if (field.type == org.apache.thrift.protocol.TType.I64) {
595
            this.maximumBuyQuantity = iprot.readI64();
596
            setMaximumBuyQuantityIsSet(true);
597
          } else { 
598
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
599
          }
600
          break;
601
        default:
602
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
603
      }
604
      iprot.readFieldEnd();
605
    }
606
    iprot.readStructEnd();
607
    validate();
608
  }
609
 
610
  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
611
    validate();
612
 
613
    oprot.writeStructBegin(STRUCT_DESC);
614
    oprot.writeFieldBegin(SELLING_PRICE_FIELD_DESC);
615
    oprot.writeDouble(this.sellingPrice);
616
    oprot.writeFieldEnd();
617
    if (this.bulkPricing != null) {
618
      oprot.writeFieldBegin(BULK_PRICING_FIELD_DESC);
619
      {
620
        oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I64, org.apache.thrift.protocol.TType.DOUBLE, this.bulkPricing.size()));
21963 amit.gupta 621
        for (Map.Entry<Long, Double> _iter26 : this.bulkPricing.entrySet())
18719 kshitij.so 622
        {
21963 amit.gupta 623
          oprot.writeI64(_iter26.getKey());
624
          oprot.writeDouble(_iter26.getValue());
18719 kshitij.so 625
        }
626
        oprot.writeMapEnd();
627
      }
628
      oprot.writeFieldEnd();
629
    }
630
    oprot.writeFieldBegin(CATALOG_ITEM_ID_FIELD_DESC);
631
    oprot.writeI64(this.catalog_item_id);
632
    oprot.writeFieldEnd();
633
    oprot.writeFieldBegin(MINIMUM_BUY_QUANTITY_FIELD_DESC);
634
    oprot.writeI64(this.minimumBuyQuantity);
635
    oprot.writeFieldEnd();
636
    oprot.writeFieldBegin(MAXIMUM_BUY_QUANTITY_FIELD_DESC);
637
    oprot.writeI64(this.maximumBuyQuantity);
638
    oprot.writeFieldEnd();
639
    oprot.writeFieldStop();
640
    oprot.writeStructEnd();
641
  }
642
 
643
  @Override
644
  public String toString() {
645
    StringBuilder sb = new StringBuilder("DtrPricing(");
646
    boolean first = true;
647
 
648
    sb.append("sellingPrice:");
649
    sb.append(this.sellingPrice);
650
    first = false;
651
    if (!first) sb.append(", ");
652
    sb.append("bulkPricing:");
653
    if (this.bulkPricing == null) {
654
      sb.append("null");
655
    } else {
656
      sb.append(this.bulkPricing);
657
    }
658
    first = false;
659
    if (!first) sb.append(", ");
660
    sb.append("catalog_item_id:");
661
    sb.append(this.catalog_item_id);
662
    first = false;
663
    if (!first) sb.append(", ");
664
    sb.append("minimumBuyQuantity:");
665
    sb.append(this.minimumBuyQuantity);
666
    first = false;
667
    if (!first) sb.append(", ");
668
    sb.append("maximumBuyQuantity:");
669
    sb.append(this.maximumBuyQuantity);
670
    first = false;
671
    sb.append(")");
672
    return sb.toString();
673
  }
674
 
675
  public void validate() throws org.apache.thrift.TException {
676
    // check for required fields
677
  }
678
 
679
  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
680
    try {
681
      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
682
    } catch (org.apache.thrift.TException te) {
683
      throw new java.io.IOException(te);
684
    }
685
  }
686
 
687
  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
688
    try {
689
      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
690
      __isset_bit_vector = new BitSet(1);
691
      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
692
    } catch (org.apache.thrift.TException te) {
693
      throw new java.io.IOException(te);
694
    }
695
  }
696
 
697
}
698