Subversion Repositories SmartDukaan

Rev

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