Subversion Repositories SmartDukaan

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
68 ashish 1
/**
2
 * Autogenerated by Thrift
3
 *
4
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
 */
6
package in.shop2020.model.v1.order;
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.util.Arrays;
19
import org.slf4j.Logger;
20
import org.slf4j.LoggerFactory;
21
 
22
import org.apache.thrift.*;
23
import org.apache.thrift.meta_data.*;
24
import org.apache.thrift.protocol.*;
25
 
483 rajveer 26
public class LineItem implements TBase<LineItem._Fields>, java.io.Serializable, Cloneable, Comparable<LineItem> {
68 ashish 27
  private static final TStruct STRUCT_DESC = new TStruct("LineItem");
28
 
483 rajveer 29
  private static final TField ID_FIELD_DESC = new TField("id", TType.I64, (short)1);
30
  private static final TField SKU_ID_FIELD_DESC = new TField("sku_id", TType.STRING, (short)2);
31
  private static final TField BRAND_FIELD_DESC = new TField("brand", TType.STRING, (short)3);
32
  private static final TField MODEL_NUMBER_FIELD_DESC = new TField("model_number", TType.STRING, (short)4);
33
  private static final TField MODEL_NAME_FIELD_DESC = new TField("model_name", TType.STRING, (short)5);
34
  private static final TField EXTRA_INFO_FIELD_DESC = new TField("extra_info", TType.STRING, (short)6);
35
  private static final TField QUANTITY_FIELD_DESC = new TField("quantity", TType.DOUBLE, (short)7);
36
  private static final TField UNIT_PRICE_FIELD_DESC = new TField("unit_price", TType.DOUBLE, (short)8);
37
  private static final TField UNIT_WEIGHT_FIELD_DESC = new TField("unit_weight", TType.DOUBLE, (short)9);
38
  private static final TField TOTAL_PRICE_FIELD_DESC = new TField("total_price", TType.DOUBLE, (short)10);
39
  private static final TField TOTAL_WEIGHT_FIELD_DESC = new TField("total_weight", TType.DOUBLE, (short)11);
668 chandransh 40
  private static final TField COLOR_FIELD_DESC = new TField("color", TType.STRING, (short)12);
68 ashish 41
 
42
  private long id;
483 rajveer 43
  private String sku_id;
44
  private String brand;
45
  private String model_number;
46
  private String model_name;
47
  private String extra_info;
48
  private double quantity;
49
  private double unit_price;
50
  private double unit_weight;
51
  private double total_price;
52
  private double total_weight;
668 chandransh 53
  private String color;
68 ashish 54
 
55
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
56
  public enum _Fields implements TFieldIdEnum {
483 rajveer 57
    ID((short)1, "id"),
58
    SKU_ID((short)2, "sku_id"),
59
    BRAND((short)3, "brand"),
60
    MODEL_NUMBER((short)4, "model_number"),
61
    MODEL_NAME((short)5, "model_name"),
62
    EXTRA_INFO((short)6, "extra_info"),
63
    QUANTITY((short)7, "quantity"),
64
    UNIT_PRICE((short)8, "unit_price"),
65
    UNIT_WEIGHT((short)9, "unit_weight"),
66
    TOTAL_PRICE((short)10, "total_price"),
668 chandransh 67
    TOTAL_WEIGHT((short)11, "total_weight"),
68
    COLOR((short)12, "color");
68 ashish 69
 
70
    private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
71
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
72
 
73
    static {
74
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
75
        byId.put((int)field._thriftId, field);
76
        byName.put(field.getFieldName(), field);
77
      }
78
    }
79
 
80
    /**
81
     * Find the _Fields constant that matches fieldId, or null if its not found.
82
     */
83
    public static _Fields findByThriftId(int fieldId) {
84
      return byId.get(fieldId);
85
    }
86
 
87
    /**
88
     * Find the _Fields constant that matches fieldId, throwing an exception
89
     * if it is not found.
90
     */
91
    public static _Fields findByThriftIdOrThrow(int fieldId) {
92
      _Fields fields = findByThriftId(fieldId);
93
      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
94
      return fields;
95
    }
96
 
97
    /**
98
     * Find the _Fields constant that matches name, or null if its not found.
99
     */
100
    public static _Fields findByName(String name) {
101
      return byName.get(name);
102
    }
103
 
104
    private final short _thriftId;
105
    private final String _fieldName;
106
 
107
    _Fields(short thriftId, String fieldName) {
108
      _thriftId = thriftId;
109
      _fieldName = fieldName;
110
    }
111
 
112
    public short getThriftFieldId() {
113
      return _thriftId;
114
    }
115
 
116
    public String getFieldName() {
117
      return _fieldName;
118
    }
119
  }
120
 
121
  // isset id assignments
122
  private static final int __ID_ISSET_ID = 0;
483 rajveer 123
  private static final int __QUANTITY_ISSET_ID = 1;
124
  private static final int __UNIT_PRICE_ISSET_ID = 2;
125
  private static final int __UNIT_WEIGHT_ISSET_ID = 3;
126
  private static final int __TOTAL_PRICE_ISSET_ID = 4;
127
  private static final int __TOTAL_WEIGHT_ISSET_ID = 5;
128
  private BitSet __isset_bit_vector = new BitSet(6);
68 ashish 129
 
130
  public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
131
    put(_Fields.ID, new FieldMetaData("id", TFieldRequirementType.DEFAULT, 
132
        new FieldValueMetaData(TType.I64)));
483 rajveer 133
    put(_Fields.SKU_ID, new FieldMetaData("sku_id", TFieldRequirementType.DEFAULT, 
134
        new FieldValueMetaData(TType.STRING)));
135
    put(_Fields.BRAND, new FieldMetaData("brand", TFieldRequirementType.DEFAULT, 
136
        new FieldValueMetaData(TType.STRING)));
137
    put(_Fields.MODEL_NUMBER, new FieldMetaData("model_number", TFieldRequirementType.DEFAULT, 
138
        new FieldValueMetaData(TType.STRING)));
139
    put(_Fields.MODEL_NAME, new FieldMetaData("model_name", TFieldRequirementType.DEFAULT, 
140
        new FieldValueMetaData(TType.STRING)));
141
    put(_Fields.EXTRA_INFO, new FieldMetaData("extra_info", TFieldRequirementType.DEFAULT, 
142
        new FieldValueMetaData(TType.STRING)));
143
    put(_Fields.QUANTITY, new FieldMetaData("quantity", TFieldRequirementType.DEFAULT, 
144
        new FieldValueMetaData(TType.DOUBLE)));
145
    put(_Fields.UNIT_PRICE, new FieldMetaData("unit_price", TFieldRequirementType.DEFAULT, 
146
        new FieldValueMetaData(TType.DOUBLE)));
147
    put(_Fields.UNIT_WEIGHT, new FieldMetaData("unit_weight", TFieldRequirementType.DEFAULT, 
148
        new FieldValueMetaData(TType.DOUBLE)));
149
    put(_Fields.TOTAL_PRICE, new FieldMetaData("total_price", TFieldRequirementType.DEFAULT, 
150
        new FieldValueMetaData(TType.DOUBLE)));
151
    put(_Fields.TOTAL_WEIGHT, new FieldMetaData("total_weight", TFieldRequirementType.DEFAULT, 
152
        new FieldValueMetaData(TType.DOUBLE)));
668 chandransh 153
    put(_Fields.COLOR, new FieldMetaData("color", TFieldRequirementType.DEFAULT, 
154
        new FieldValueMetaData(TType.STRING)));
68 ashish 155
  }});
156
 
157
  static {
158
    FieldMetaData.addStructMetaDataMap(LineItem.class, metaDataMap);
159
  }
160
 
161
  public LineItem() {
162
  }
163
 
164
  public LineItem(
165
    long id,
483 rajveer 166
    String sku_id,
167
    String brand,
168
    String model_number,
169
    String model_name,
170
    String extra_info,
171
    double quantity,
172
    double unit_price,
173
    double unit_weight,
174
    double total_price,
668 chandransh 175
    double total_weight,
176
    String color)
68 ashish 177
  {
178
    this();
179
    this.id = id;
180
    setIdIsSet(true);
483 rajveer 181
    this.sku_id = sku_id;
182
    this.brand = brand;
183
    this.model_number = model_number;
184
    this.model_name = model_name;
185
    this.extra_info = extra_info;
186
    this.quantity = quantity;
187
    setQuantityIsSet(true);
188
    this.unit_price = unit_price;
189
    setUnit_priceIsSet(true);
190
    this.unit_weight = unit_weight;
191
    setUnit_weightIsSet(true);
192
    this.total_price = total_price;
193
    setTotal_priceIsSet(true);
194
    this.total_weight = total_weight;
195
    setTotal_weightIsSet(true);
668 chandransh 196
    this.color = color;
68 ashish 197
  }
198
 
199
  /**
200
   * Performs a deep copy on <i>other</i>.
201
   */
202
  public LineItem(LineItem other) {
203
    __isset_bit_vector.clear();
204
    __isset_bit_vector.or(other.__isset_bit_vector);
205
    this.id = other.id;
483 rajveer 206
    if (other.isSetSku_id()) {
207
      this.sku_id = other.sku_id;
68 ashish 208
    }
483 rajveer 209
    if (other.isSetBrand()) {
210
      this.brand = other.brand;
211
    }
212
    if (other.isSetModel_number()) {
213
      this.model_number = other.model_number;
214
    }
215
    if (other.isSetModel_name()) {
216
      this.model_name = other.model_name;
217
    }
218
    if (other.isSetExtra_info()) {
219
      this.extra_info = other.extra_info;
220
    }
221
    this.quantity = other.quantity;
222
    this.unit_price = other.unit_price;
223
    this.unit_weight = other.unit_weight;
224
    this.total_price = other.total_price;
225
    this.total_weight = other.total_weight;
668 chandransh 226
    if (other.isSetColor()) {
227
      this.color = other.color;
228
    }
68 ashish 229
  }
230
 
231
  public LineItem deepCopy() {
232
    return new LineItem(this);
233
  }
234
 
235
  @Deprecated
236
  public LineItem clone() {
237
    return new LineItem(this);
238
  }
239
 
483 rajveer 240
  public long getId() {
241
    return this.id;
68 ashish 242
  }
243
 
483 rajveer 244
  public LineItem setId(long id) {
245
    this.id = id;
246
    setIdIsSet(true);
68 ashish 247
    return this;
248
  }
249
 
483 rajveer 250
  public void unsetId() {
251
    __isset_bit_vector.clear(__ID_ISSET_ID);
68 ashish 252
  }
253
 
483 rajveer 254
  /** Returns true if field id is set (has been asigned a value) and false otherwise */
255
  public boolean isSetId() {
256
    return __isset_bit_vector.get(__ID_ISSET_ID);
68 ashish 257
  }
258
 
483 rajveer 259
  public void setIdIsSet(boolean value) {
260
    __isset_bit_vector.set(__ID_ISSET_ID, value);
261
  }
262
 
263
  public String getSku_id() {
264
    return this.sku_id;
265
  }
266
 
267
  public LineItem setSku_id(String sku_id) {
268
    this.sku_id = sku_id;
269
    return this;
270
  }
271
 
272
  public void unsetSku_id() {
273
    this.sku_id = null;
274
  }
275
 
276
  /** Returns true if field sku_id is set (has been asigned a value) and false otherwise */
277
  public boolean isSetSku_id() {
278
    return this.sku_id != null;
279
  }
280
 
281
  public void setSku_idIsSet(boolean value) {
68 ashish 282
    if (!value) {
483 rajveer 283
      this.sku_id = null;
68 ashish 284
    }
285
  }
286
 
483 rajveer 287
  public String getBrand() {
288
    return this.brand;
68 ashish 289
  }
290
 
483 rajveer 291
  public LineItem setBrand(String brand) {
292
    this.brand = brand;
68 ashish 293
    return this;
294
  }
295
 
483 rajveer 296
  public void unsetBrand() {
297
    this.brand = null;
68 ashish 298
  }
299
 
483 rajveer 300
  /** Returns true if field brand is set (has been asigned a value) and false otherwise */
301
  public boolean isSetBrand() {
302
    return this.brand != null;
68 ashish 303
  }
304
 
483 rajveer 305
  public void setBrandIsSet(boolean value) {
306
    if (!value) {
307
      this.brand = null;
308
    }
68 ashish 309
  }
310
 
483 rajveer 311
  public String getModel_number() {
312
    return this.model_number;
68 ashish 313
  }
314
 
483 rajveer 315
  public LineItem setModel_number(String model_number) {
316
    this.model_number = model_number;
68 ashish 317
    return this;
318
  }
319
 
483 rajveer 320
  public void unsetModel_number() {
321
    this.model_number = null;
68 ashish 322
  }
323
 
483 rajveer 324
  /** Returns true if field model_number is set (has been asigned a value) and false otherwise */
325
  public boolean isSetModel_number() {
326
    return this.model_number != null;
68 ashish 327
  }
328
 
483 rajveer 329
  public void setModel_numberIsSet(boolean value) {
330
    if (!value) {
331
      this.model_number = null;
332
    }
68 ashish 333
  }
334
 
483 rajveer 335
  public String getModel_name() {
336
    return this.model_name;
68 ashish 337
  }
338
 
483 rajveer 339
  public LineItem setModel_name(String model_name) {
340
    this.model_name = model_name;
341
    return this;
342
  }
343
 
344
  public void unsetModel_name() {
345
    this.model_name = null;
346
  }
347
 
348
  /** Returns true if field model_name is set (has been asigned a value) and false otherwise */
349
  public boolean isSetModel_name() {
350
    return this.model_name != null;
351
  }
352
 
353
  public void setModel_nameIsSet(boolean value) {
354
    if (!value) {
355
      this.model_name = null;
68 ashish 356
    }
357
  }
358
 
483 rajveer 359
  public String getExtra_info() {
360
    return this.extra_info;
68 ashish 361
  }
362
 
483 rajveer 363
  public LineItem setExtra_info(String extra_info) {
364
    this.extra_info = extra_info;
68 ashish 365
    return this;
366
  }
367
 
483 rajveer 368
  public void unsetExtra_info() {
369
    this.extra_info = null;
68 ashish 370
  }
371
 
483 rajveer 372
  /** Returns true if field extra_info is set (has been asigned a value) and false otherwise */
373
  public boolean isSetExtra_info() {
374
    return this.extra_info != null;
68 ashish 375
  }
376
 
483 rajveer 377
  public void setExtra_infoIsSet(boolean value) {
68 ashish 378
    if (!value) {
483 rajveer 379
      this.extra_info = null;
68 ashish 380
    }
381
  }
382
 
483 rajveer 383
  public double getQuantity() {
384
    return this.quantity;
385
  }
386
 
387
  public LineItem setQuantity(double quantity) {
388
    this.quantity = quantity;
389
    setQuantityIsSet(true);
390
    return this;
391
  }
392
 
393
  public void unsetQuantity() {
394
    __isset_bit_vector.clear(__QUANTITY_ISSET_ID);
395
  }
396
 
397
  /** Returns true if field quantity is set (has been asigned a value) and false otherwise */
398
  public boolean isSetQuantity() {
399
    return __isset_bit_vector.get(__QUANTITY_ISSET_ID);
400
  }
401
 
402
  public void setQuantityIsSet(boolean value) {
403
    __isset_bit_vector.set(__QUANTITY_ISSET_ID, value);
404
  }
405
 
406
  public double getUnit_price() {
407
    return this.unit_price;
408
  }
409
 
410
  public LineItem setUnit_price(double unit_price) {
411
    this.unit_price = unit_price;
412
    setUnit_priceIsSet(true);
413
    return this;
414
  }
415
 
416
  public void unsetUnit_price() {
417
    __isset_bit_vector.clear(__UNIT_PRICE_ISSET_ID);
418
  }
419
 
420
  /** Returns true if field unit_price is set (has been asigned a value) and false otherwise */
421
  public boolean isSetUnit_price() {
422
    return __isset_bit_vector.get(__UNIT_PRICE_ISSET_ID);
423
  }
424
 
425
  public void setUnit_priceIsSet(boolean value) {
426
    __isset_bit_vector.set(__UNIT_PRICE_ISSET_ID, value);
427
  }
428
 
429
  public double getUnit_weight() {
430
    return this.unit_weight;
431
  }
432
 
433
  public LineItem setUnit_weight(double unit_weight) {
434
    this.unit_weight = unit_weight;
435
    setUnit_weightIsSet(true);
436
    return this;
437
  }
438
 
439
  public void unsetUnit_weight() {
440
    __isset_bit_vector.clear(__UNIT_WEIGHT_ISSET_ID);
441
  }
442
 
443
  /** Returns true if field unit_weight is set (has been asigned a value) and false otherwise */
444
  public boolean isSetUnit_weight() {
445
    return __isset_bit_vector.get(__UNIT_WEIGHT_ISSET_ID);
446
  }
447
 
448
  public void setUnit_weightIsSet(boolean value) {
449
    __isset_bit_vector.set(__UNIT_WEIGHT_ISSET_ID, value);
450
  }
451
 
452
  public double getTotal_price() {
453
    return this.total_price;
454
  }
455
 
456
  public LineItem setTotal_price(double total_price) {
457
    this.total_price = total_price;
458
    setTotal_priceIsSet(true);
459
    return this;
460
  }
461
 
462
  public void unsetTotal_price() {
463
    __isset_bit_vector.clear(__TOTAL_PRICE_ISSET_ID);
464
  }
465
 
466
  /** Returns true if field total_price is set (has been asigned a value) and false otherwise */
467
  public boolean isSetTotal_price() {
468
    return __isset_bit_vector.get(__TOTAL_PRICE_ISSET_ID);
469
  }
470
 
471
  public void setTotal_priceIsSet(boolean value) {
472
    __isset_bit_vector.set(__TOTAL_PRICE_ISSET_ID, value);
473
  }
474
 
475
  public double getTotal_weight() {
476
    return this.total_weight;
477
  }
478
 
479
  public LineItem setTotal_weight(double total_weight) {
480
    this.total_weight = total_weight;
481
    setTotal_weightIsSet(true);
482
    return this;
483
  }
484
 
485
  public void unsetTotal_weight() {
486
    __isset_bit_vector.clear(__TOTAL_WEIGHT_ISSET_ID);
487
  }
488
 
489
  /** Returns true if field total_weight is set (has been asigned a value) and false otherwise */
490
  public boolean isSetTotal_weight() {
491
    return __isset_bit_vector.get(__TOTAL_WEIGHT_ISSET_ID);
492
  }
493
 
494
  public void setTotal_weightIsSet(boolean value) {
495
    __isset_bit_vector.set(__TOTAL_WEIGHT_ISSET_ID, value);
496
  }
497
 
668 chandransh 498
  public String getColor() {
499
    return this.color;
500
  }
501
 
502
  public LineItem setColor(String color) {
503
    this.color = color;
504
    return this;
505
  }
506
 
507
  public void unsetColor() {
508
    this.color = null;
509
  }
510
 
511
  /** Returns true if field color is set (has been asigned a value) and false otherwise */
512
  public boolean isSetColor() {
513
    return this.color != null;
514
  }
515
 
516
  public void setColorIsSet(boolean value) {
517
    if (!value) {
518
      this.color = null;
519
    }
520
  }
521
 
68 ashish 522
  public void setFieldValue(_Fields field, Object value) {
523
    switch (field) {
483 rajveer 524
    case ID:
68 ashish 525
      if (value == null) {
483 rajveer 526
        unsetId();
68 ashish 527
      } else {
483 rajveer 528
        setId((Long)value);
68 ashish 529
      }
530
      break;
531
 
483 rajveer 532
    case SKU_ID:
68 ashish 533
      if (value == null) {
483 rajveer 534
        unsetSku_id();
68 ashish 535
      } else {
483 rajveer 536
        setSku_id((String)value);
68 ashish 537
      }
538
      break;
539
 
483 rajveer 540
    case BRAND:
68 ashish 541
      if (value == null) {
483 rajveer 542
        unsetBrand();
68 ashish 543
      } else {
483 rajveer 544
        setBrand((String)value);
68 ashish 545
      }
546
      break;
547
 
483 rajveer 548
    case MODEL_NUMBER:
68 ashish 549
      if (value == null) {
483 rajveer 550
        unsetModel_number();
68 ashish 551
      } else {
483 rajveer 552
        setModel_number((String)value);
68 ashish 553
      }
554
      break;
555
 
483 rajveer 556
    case MODEL_NAME:
557
      if (value == null) {
558
        unsetModel_name();
559
      } else {
560
        setModel_name((String)value);
561
      }
562
      break;
563
 
564
    case EXTRA_INFO:
565
      if (value == null) {
566
        unsetExtra_info();
567
      } else {
568
        setExtra_info((String)value);
569
      }
570
      break;
571
 
572
    case QUANTITY:
573
      if (value == null) {
574
        unsetQuantity();
575
      } else {
576
        setQuantity((Double)value);
577
      }
578
      break;
579
 
580
    case UNIT_PRICE:
581
      if (value == null) {
582
        unsetUnit_price();
583
      } else {
584
        setUnit_price((Double)value);
585
      }
586
      break;
587
 
588
    case UNIT_WEIGHT:
589
      if (value == null) {
590
        unsetUnit_weight();
591
      } else {
592
        setUnit_weight((Double)value);
593
      }
594
      break;
595
 
596
    case TOTAL_PRICE:
597
      if (value == null) {
598
        unsetTotal_price();
599
      } else {
600
        setTotal_price((Double)value);
601
      }
602
      break;
603
 
604
    case TOTAL_WEIGHT:
605
      if (value == null) {
606
        unsetTotal_weight();
607
      } else {
608
        setTotal_weight((Double)value);
609
      }
610
      break;
611
 
668 chandransh 612
    case COLOR:
613
      if (value == null) {
614
        unsetColor();
615
      } else {
616
        setColor((String)value);
617
      }
618
      break;
619
 
68 ashish 620
    }
621
  }
622
 
623
  public void setFieldValue(int fieldID, Object value) {
624
    setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
625
  }
626
 
627
  public Object getFieldValue(_Fields field) {
628
    switch (field) {
629
    case ID:
630
      return new Long(getId());
631
 
483 rajveer 632
    case SKU_ID:
633
      return getSku_id();
68 ashish 634
 
483 rajveer 635
    case BRAND:
636
      return getBrand();
68 ashish 637
 
483 rajveer 638
    case MODEL_NUMBER:
639
      return getModel_number();
640
 
641
    case MODEL_NAME:
642
      return getModel_name();
643
 
644
    case EXTRA_INFO:
645
      return getExtra_info();
646
 
647
    case QUANTITY:
648
      return new Double(getQuantity());
649
 
650
    case UNIT_PRICE:
651
      return new Double(getUnit_price());
652
 
653
    case UNIT_WEIGHT:
654
      return new Double(getUnit_weight());
655
 
656
    case TOTAL_PRICE:
657
      return new Double(getTotal_price());
658
 
659
    case TOTAL_WEIGHT:
660
      return new Double(getTotal_weight());
661
 
668 chandransh 662
    case COLOR:
663
      return getColor();
664
 
68 ashish 665
    }
666
    throw new IllegalStateException();
667
  }
668
 
669
  public Object getFieldValue(int fieldId) {
670
    return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
671
  }
672
 
673
  /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
674
  public boolean isSet(_Fields field) {
675
    switch (field) {
676
    case ID:
677
      return isSetId();
483 rajveer 678
    case SKU_ID:
679
      return isSetSku_id();
680
    case BRAND:
681
      return isSetBrand();
682
    case MODEL_NUMBER:
683
      return isSetModel_number();
684
    case MODEL_NAME:
685
      return isSetModel_name();
686
    case EXTRA_INFO:
687
      return isSetExtra_info();
688
    case QUANTITY:
689
      return isSetQuantity();
690
    case UNIT_PRICE:
691
      return isSetUnit_price();
692
    case UNIT_WEIGHT:
693
      return isSetUnit_weight();
694
    case TOTAL_PRICE:
695
      return isSetTotal_price();
696
    case TOTAL_WEIGHT:
697
      return isSetTotal_weight();
668 chandransh 698
    case COLOR:
699
      return isSetColor();
68 ashish 700
    }
701
    throw new IllegalStateException();
702
  }
703
 
704
  public boolean isSet(int fieldID) {
705
    return isSet(_Fields.findByThriftIdOrThrow(fieldID));
706
  }
707
 
708
  @Override
709
  public boolean equals(Object that) {
710
    if (that == null)
711
      return false;
712
    if (that instanceof LineItem)
713
      return this.equals((LineItem)that);
714
    return false;
715
  }
716
 
717
  public boolean equals(LineItem that) {
718
    if (that == null)
719
      return false;
720
 
721
    boolean this_present_id = true;
722
    boolean that_present_id = true;
723
    if (this_present_id || that_present_id) {
724
      if (!(this_present_id && that_present_id))
725
        return false;
726
      if (this.id != that.id)
727
        return false;
728
    }
729
 
483 rajveer 730
    boolean this_present_sku_id = true && this.isSetSku_id();
731
    boolean that_present_sku_id = true && that.isSetSku_id();
732
    if (this_present_sku_id || that_present_sku_id) {
733
      if (!(this_present_sku_id && that_present_sku_id))
68 ashish 734
        return false;
483 rajveer 735
      if (!this.sku_id.equals(that.sku_id))
68 ashish 736
        return false;
737
    }
738
 
483 rajveer 739
    boolean this_present_brand = true && this.isSetBrand();
740
    boolean that_present_brand = true && that.isSetBrand();
741
    if (this_present_brand || that_present_brand) {
742
      if (!(this_present_brand && that_present_brand))
68 ashish 743
        return false;
483 rajveer 744
      if (!this.brand.equals(that.brand))
68 ashish 745
        return false;
746
    }
747
 
483 rajveer 748
    boolean this_present_model_number = true && this.isSetModel_number();
749
    boolean that_present_model_number = true && that.isSetModel_number();
750
    if (this_present_model_number || that_present_model_number) {
751
      if (!(this_present_model_number && that_present_model_number))
752
        return false;
753
      if (!this.model_number.equals(that.model_number))
754
        return false;
755
    }
756
 
757
    boolean this_present_model_name = true && this.isSetModel_name();
758
    boolean that_present_model_name = true && that.isSetModel_name();
759
    if (this_present_model_name || that_present_model_name) {
760
      if (!(this_present_model_name && that_present_model_name))
761
        return false;
762
      if (!this.model_name.equals(that.model_name))
763
        return false;
764
    }
765
 
766
    boolean this_present_extra_info = true && this.isSetExtra_info();
767
    boolean that_present_extra_info = true && that.isSetExtra_info();
768
    if (this_present_extra_info || that_present_extra_info) {
769
      if (!(this_present_extra_info && that_present_extra_info))
770
        return false;
771
      if (!this.extra_info.equals(that.extra_info))
772
        return false;
773
    }
774
 
775
    boolean this_present_quantity = true;
776
    boolean that_present_quantity = true;
777
    if (this_present_quantity || that_present_quantity) {
778
      if (!(this_present_quantity && that_present_quantity))
779
        return false;
780
      if (this.quantity != that.quantity)
781
        return false;
782
    }
783
 
784
    boolean this_present_unit_price = true;
785
    boolean that_present_unit_price = true;
786
    if (this_present_unit_price || that_present_unit_price) {
787
      if (!(this_present_unit_price && that_present_unit_price))
788
        return false;
789
      if (this.unit_price != that.unit_price)
790
        return false;
791
    }
792
 
793
    boolean this_present_unit_weight = true;
794
    boolean that_present_unit_weight = true;
795
    if (this_present_unit_weight || that_present_unit_weight) {
796
      if (!(this_present_unit_weight && that_present_unit_weight))
797
        return false;
798
      if (this.unit_weight != that.unit_weight)
799
        return false;
800
    }
801
 
802
    boolean this_present_total_price = true;
803
    boolean that_present_total_price = true;
804
    if (this_present_total_price || that_present_total_price) {
805
      if (!(this_present_total_price && that_present_total_price))
806
        return false;
807
      if (this.total_price != that.total_price)
808
        return false;
809
    }
810
 
811
    boolean this_present_total_weight = true;
812
    boolean that_present_total_weight = true;
813
    if (this_present_total_weight || that_present_total_weight) {
814
      if (!(this_present_total_weight && that_present_total_weight))
815
        return false;
816
      if (this.total_weight != that.total_weight)
817
        return false;
818
    }
819
 
668 chandransh 820
    boolean this_present_color = true && this.isSetColor();
821
    boolean that_present_color = true && that.isSetColor();
822
    if (this_present_color || that_present_color) {
823
      if (!(this_present_color && that_present_color))
824
        return false;
825
      if (!this.color.equals(that.color))
826
        return false;
827
    }
828
 
68 ashish 829
    return true;
830
  }
831
 
832
  @Override
833
  public int hashCode() {
834
    return 0;
835
  }
836
 
483 rajveer 837
  public int compareTo(LineItem other) {
838
    if (!getClass().equals(other.getClass())) {
839
      return getClass().getName().compareTo(other.getClass().getName());
840
    }
841
 
842
    int lastComparison = 0;
843
    LineItem typedOther = (LineItem)other;
844
 
845
    lastComparison = Boolean.valueOf(isSetId()).compareTo(isSetId());
846
    if (lastComparison != 0) {
847
      return lastComparison;
848
    }
849
    lastComparison = TBaseHelper.compareTo(id, typedOther.id);
850
    if (lastComparison != 0) {
851
      return lastComparison;
852
    }
853
    lastComparison = Boolean.valueOf(isSetSku_id()).compareTo(isSetSku_id());
854
    if (lastComparison != 0) {
855
      return lastComparison;
856
    }
857
    lastComparison = TBaseHelper.compareTo(sku_id, typedOther.sku_id);
858
    if (lastComparison != 0) {
859
      return lastComparison;
860
    }
861
    lastComparison = Boolean.valueOf(isSetBrand()).compareTo(isSetBrand());
862
    if (lastComparison != 0) {
863
      return lastComparison;
864
    }
865
    lastComparison = TBaseHelper.compareTo(brand, typedOther.brand);
866
    if (lastComparison != 0) {
867
      return lastComparison;
868
    }
869
    lastComparison = Boolean.valueOf(isSetModel_number()).compareTo(isSetModel_number());
870
    if (lastComparison != 0) {
871
      return lastComparison;
872
    }
873
    lastComparison = TBaseHelper.compareTo(model_number, typedOther.model_number);
874
    if (lastComparison != 0) {
875
      return lastComparison;
876
    }
877
    lastComparison = Boolean.valueOf(isSetModel_name()).compareTo(isSetModel_name());
878
    if (lastComparison != 0) {
879
      return lastComparison;
880
    }
881
    lastComparison = TBaseHelper.compareTo(model_name, typedOther.model_name);
882
    if (lastComparison != 0) {
883
      return lastComparison;
884
    }
885
    lastComparison = Boolean.valueOf(isSetExtra_info()).compareTo(isSetExtra_info());
886
    if (lastComparison != 0) {
887
      return lastComparison;
888
    }
889
    lastComparison = TBaseHelper.compareTo(extra_info, typedOther.extra_info);
890
    if (lastComparison != 0) {
891
      return lastComparison;
892
    }
893
    lastComparison = Boolean.valueOf(isSetQuantity()).compareTo(isSetQuantity());
894
    if (lastComparison != 0) {
895
      return lastComparison;
896
    }
897
    lastComparison = TBaseHelper.compareTo(quantity, typedOther.quantity);
898
    if (lastComparison != 0) {
899
      return lastComparison;
900
    }
901
    lastComparison = Boolean.valueOf(isSetUnit_price()).compareTo(isSetUnit_price());
902
    if (lastComparison != 0) {
903
      return lastComparison;
904
    }
905
    lastComparison = TBaseHelper.compareTo(unit_price, typedOther.unit_price);
906
    if (lastComparison != 0) {
907
      return lastComparison;
908
    }
909
    lastComparison = Boolean.valueOf(isSetUnit_weight()).compareTo(isSetUnit_weight());
910
    if (lastComparison != 0) {
911
      return lastComparison;
912
    }
913
    lastComparison = TBaseHelper.compareTo(unit_weight, typedOther.unit_weight);
914
    if (lastComparison != 0) {
915
      return lastComparison;
916
    }
917
    lastComparison = Boolean.valueOf(isSetTotal_price()).compareTo(isSetTotal_price());
918
    if (lastComparison != 0) {
919
      return lastComparison;
920
    }
921
    lastComparison = TBaseHelper.compareTo(total_price, typedOther.total_price);
922
    if (lastComparison != 0) {
923
      return lastComparison;
924
    }
925
    lastComparison = Boolean.valueOf(isSetTotal_weight()).compareTo(isSetTotal_weight());
926
    if (lastComparison != 0) {
927
      return lastComparison;
928
    }
929
    lastComparison = TBaseHelper.compareTo(total_weight, typedOther.total_weight);
930
    if (lastComparison != 0) {
931
      return lastComparison;
932
    }
668 chandransh 933
    lastComparison = Boolean.valueOf(isSetColor()).compareTo(isSetColor());
934
    if (lastComparison != 0) {
935
      return lastComparison;
936
    }
937
    lastComparison = TBaseHelper.compareTo(color, typedOther.color);
938
    if (lastComparison != 0) {
939
      return lastComparison;
940
    }
483 rajveer 941
    return 0;
942
  }
943
 
68 ashish 944
  public void read(TProtocol iprot) throws TException {
945
    TField field;
946
    iprot.readStructBegin();
947
    while (true)
948
    {
949
      field = iprot.readFieldBegin();
950
      if (field.type == TType.STOP) { 
951
        break;
952
      }
953
      _Fields fieldId = _Fields.findByThriftId(field.id);
954
      if (fieldId == null) {
955
        TProtocolUtil.skip(iprot, field.type);
956
      } else {
957
        switch (fieldId) {
958
          case ID:
959
            if (field.type == TType.I64) {
960
              this.id = iprot.readI64();
961
              setIdIsSet(true);
962
            } else { 
963
              TProtocolUtil.skip(iprot, field.type);
964
            }
965
            break;
483 rajveer 966
          case SKU_ID:
967
            if (field.type == TType.STRING) {
968
              this.sku_id = iprot.readString();
68 ashish 969
            } else { 
970
              TProtocolUtil.skip(iprot, field.type);
971
            }
972
            break;
483 rajveer 973
          case BRAND:
974
            if (field.type == TType.STRING) {
975
              this.brand = iprot.readString();
68 ashish 976
            } else { 
977
              TProtocolUtil.skip(iprot, field.type);
978
            }
979
            break;
483 rajveer 980
          case MODEL_NUMBER:
981
            if (field.type == TType.STRING) {
982
              this.model_number = iprot.readString();
983
            } else { 
984
              TProtocolUtil.skip(iprot, field.type);
985
            }
986
            break;
987
          case MODEL_NAME:
988
            if (field.type == TType.STRING) {
989
              this.model_name = iprot.readString();
990
            } else { 
991
              TProtocolUtil.skip(iprot, field.type);
992
            }
993
            break;
994
          case EXTRA_INFO:
995
            if (field.type == TType.STRING) {
996
              this.extra_info = iprot.readString();
997
            } else { 
998
              TProtocolUtil.skip(iprot, field.type);
999
            }
1000
            break;
1001
          case QUANTITY:
1002
            if (field.type == TType.DOUBLE) {
1003
              this.quantity = iprot.readDouble();
1004
              setQuantityIsSet(true);
1005
            } else { 
1006
              TProtocolUtil.skip(iprot, field.type);
1007
            }
1008
            break;
1009
          case UNIT_PRICE:
1010
            if (field.type == TType.DOUBLE) {
1011
              this.unit_price = iprot.readDouble();
1012
              setUnit_priceIsSet(true);
1013
            } else { 
1014
              TProtocolUtil.skip(iprot, field.type);
1015
            }
1016
            break;
1017
          case UNIT_WEIGHT:
1018
            if (field.type == TType.DOUBLE) {
1019
              this.unit_weight = iprot.readDouble();
1020
              setUnit_weightIsSet(true);
1021
            } else { 
1022
              TProtocolUtil.skip(iprot, field.type);
1023
            }
1024
            break;
1025
          case TOTAL_PRICE:
1026
            if (field.type == TType.DOUBLE) {
1027
              this.total_price = iprot.readDouble();
1028
              setTotal_priceIsSet(true);
1029
            } else { 
1030
              TProtocolUtil.skip(iprot, field.type);
1031
            }
1032
            break;
1033
          case TOTAL_WEIGHT:
1034
            if (field.type == TType.DOUBLE) {
1035
              this.total_weight = iprot.readDouble();
1036
              setTotal_weightIsSet(true);
1037
            } else { 
1038
              TProtocolUtil.skip(iprot, field.type);
1039
            }
1040
            break;
668 chandransh 1041
          case COLOR:
1042
            if (field.type == TType.STRING) {
1043
              this.color = iprot.readString();
1044
            } else { 
1045
              TProtocolUtil.skip(iprot, field.type);
1046
            }
1047
            break;
68 ashish 1048
        }
1049
        iprot.readFieldEnd();
1050
      }
1051
    }
1052
    iprot.readStructEnd();
1053
    validate();
1054
  }
1055
 
1056
  public void write(TProtocol oprot) throws TException {
1057
    validate();
1058
 
1059
    oprot.writeStructBegin(STRUCT_DESC);
1060
    oprot.writeFieldBegin(ID_FIELD_DESC);
1061
    oprot.writeI64(this.id);
1062
    oprot.writeFieldEnd();
483 rajveer 1063
    if (this.sku_id != null) {
1064
      oprot.writeFieldBegin(SKU_ID_FIELD_DESC);
1065
      oprot.writeString(this.sku_id);
68 ashish 1066
      oprot.writeFieldEnd();
1067
    }
483 rajveer 1068
    if (this.brand != null) {
1069
      oprot.writeFieldBegin(BRAND_FIELD_DESC);
1070
      oprot.writeString(this.brand);
1071
      oprot.writeFieldEnd();
1072
    }
1073
    if (this.model_number != null) {
1074
      oprot.writeFieldBegin(MODEL_NUMBER_FIELD_DESC);
1075
      oprot.writeString(this.model_number);
1076
      oprot.writeFieldEnd();
1077
    }
1078
    if (this.model_name != null) {
1079
      oprot.writeFieldBegin(MODEL_NAME_FIELD_DESC);
1080
      oprot.writeString(this.model_name);
1081
      oprot.writeFieldEnd();
1082
    }
1083
    if (this.extra_info != null) {
1084
      oprot.writeFieldBegin(EXTRA_INFO_FIELD_DESC);
1085
      oprot.writeString(this.extra_info);
1086
      oprot.writeFieldEnd();
1087
    }
1088
    oprot.writeFieldBegin(QUANTITY_FIELD_DESC);
1089
    oprot.writeDouble(this.quantity);
1090
    oprot.writeFieldEnd();
1091
    oprot.writeFieldBegin(UNIT_PRICE_FIELD_DESC);
1092
    oprot.writeDouble(this.unit_price);
1093
    oprot.writeFieldEnd();
1094
    oprot.writeFieldBegin(UNIT_WEIGHT_FIELD_DESC);
1095
    oprot.writeDouble(this.unit_weight);
1096
    oprot.writeFieldEnd();
1097
    oprot.writeFieldBegin(TOTAL_PRICE_FIELD_DESC);
1098
    oprot.writeDouble(this.total_price);
1099
    oprot.writeFieldEnd();
1100
    oprot.writeFieldBegin(TOTAL_WEIGHT_FIELD_DESC);
1101
    oprot.writeDouble(this.total_weight);
1102
    oprot.writeFieldEnd();
668 chandransh 1103
    if (this.color != null) {
1104
      oprot.writeFieldBegin(COLOR_FIELD_DESC);
1105
      oprot.writeString(this.color);
1106
      oprot.writeFieldEnd();
1107
    }
68 ashish 1108
    oprot.writeFieldStop();
1109
    oprot.writeStructEnd();
1110
  }
1111
 
1112
  @Override
1113
  public String toString() {
1114
    StringBuilder sb = new StringBuilder("LineItem(");
1115
    boolean first = true;
1116
 
483 rajveer 1117
    sb.append("id:");
1118
    sb.append(this.id);
1119
    first = false;
1120
    if (!first) sb.append(", ");
1121
    sb.append("sku_id:");
1122
    if (this.sku_id == null) {
68 ashish 1123
      sb.append("null");
1124
    } else {
483 rajveer 1125
      sb.append(this.sku_id);
68 ashish 1126
    }
1127
    first = false;
1128
    if (!first) sb.append(", ");
483 rajveer 1129
    sb.append("brand:");
1130
    if (this.brand == null) {
1131
      sb.append("null");
1132
    } else {
1133
      sb.append(this.brand);
1134
    }
68 ashish 1135
    first = false;
1136
    if (!first) sb.append(", ");
483 rajveer 1137
    sb.append("model_number:");
1138
    if (this.model_number == null) {
1139
      sb.append("null");
1140
    } else {
1141
      sb.append(this.model_number);
1142
    }
68 ashish 1143
    first = false;
1144
    if (!first) sb.append(", ");
483 rajveer 1145
    sb.append("model_name:");
1146
    if (this.model_name == null) {
68 ashish 1147
      sb.append("null");
1148
    } else {
483 rajveer 1149
      sb.append(this.model_name);
68 ashish 1150
    }
1151
    first = false;
483 rajveer 1152
    if (!first) sb.append(", ");
1153
    sb.append("extra_info:");
1154
    if (this.extra_info == null) {
1155
      sb.append("null");
1156
    } else {
1157
      sb.append(this.extra_info);
1158
    }
1159
    first = false;
1160
    if (!first) sb.append(", ");
1161
    sb.append("quantity:");
1162
    sb.append(this.quantity);
1163
    first = false;
1164
    if (!first) sb.append(", ");
1165
    sb.append("unit_price:");
1166
    sb.append(this.unit_price);
1167
    first = false;
1168
    if (!first) sb.append(", ");
1169
    sb.append("unit_weight:");
1170
    sb.append(this.unit_weight);
1171
    first = false;
1172
    if (!first) sb.append(", ");
1173
    sb.append("total_price:");
1174
    sb.append(this.total_price);
1175
    first = false;
1176
    if (!first) sb.append(", ");
1177
    sb.append("total_weight:");
1178
    sb.append(this.total_weight);
1179
    first = false;
668 chandransh 1180
    if (!first) sb.append(", ");
1181
    sb.append("color:");
1182
    if (this.color == null) {
1183
      sb.append("null");
1184
    } else {
1185
      sb.append(this.color);
1186
    }
1187
    first = false;
68 ashish 1188
    sb.append(")");
1189
    return sb.toString();
1190
  }
1191
 
1192
  public void validate() throws TException {
1193
    // check for required fields
1194
  }
1195
 
1196
}
1197