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