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);
697 chandransh 30
  private static final TField ITEM_ID_FIELD_DESC = new TField("item_id", TType.I64, (short)2);
483 rajveer 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;
697 chandransh 43
  private long item_id;
483 rajveer 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"),
697 chandransh 58
    ITEM_ID((short)2, "item_id"),
483 rajveer 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;
697 chandransh 123
  private static final int __ITEM_ID_ISSET_ID = 1;
124
  private static final int __QUANTITY_ISSET_ID = 2;
125
  private static final int __UNIT_PRICE_ISSET_ID = 3;
126
  private static final int __UNIT_WEIGHT_ISSET_ID = 4;
127
  private static final int __TOTAL_PRICE_ISSET_ID = 5;
128
  private static final int __TOTAL_WEIGHT_ISSET_ID = 6;
129
  private BitSet __isset_bit_vector = new BitSet(7);
68 ashish 130
 
131
  public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
132
    put(_Fields.ID, new FieldMetaData("id", TFieldRequirementType.DEFAULT, 
133
        new FieldValueMetaData(TType.I64)));
697 chandransh 134
    put(_Fields.ITEM_ID, new FieldMetaData("item_id", TFieldRequirementType.DEFAULT, 
135
        new FieldValueMetaData(TType.I64)));
483 rajveer 136
    put(_Fields.BRAND, new FieldMetaData("brand", TFieldRequirementType.DEFAULT, 
137
        new FieldValueMetaData(TType.STRING)));
138
    put(_Fields.MODEL_NUMBER, new FieldMetaData("model_number", TFieldRequirementType.DEFAULT, 
139
        new FieldValueMetaData(TType.STRING)));
140
    put(_Fields.MODEL_NAME, new FieldMetaData("model_name", TFieldRequirementType.DEFAULT, 
141
        new FieldValueMetaData(TType.STRING)));
142
    put(_Fields.EXTRA_INFO, new FieldMetaData("extra_info", TFieldRequirementType.DEFAULT, 
143
        new FieldValueMetaData(TType.STRING)));
144
    put(_Fields.QUANTITY, new FieldMetaData("quantity", TFieldRequirementType.DEFAULT, 
145
        new FieldValueMetaData(TType.DOUBLE)));
146
    put(_Fields.UNIT_PRICE, new FieldMetaData("unit_price", TFieldRequirementType.DEFAULT, 
147
        new FieldValueMetaData(TType.DOUBLE)));
148
    put(_Fields.UNIT_WEIGHT, new FieldMetaData("unit_weight", TFieldRequirementType.DEFAULT, 
149
        new FieldValueMetaData(TType.DOUBLE)));
150
    put(_Fields.TOTAL_PRICE, new FieldMetaData("total_price", TFieldRequirementType.DEFAULT, 
151
        new FieldValueMetaData(TType.DOUBLE)));
152
    put(_Fields.TOTAL_WEIGHT, new FieldMetaData("total_weight", TFieldRequirementType.DEFAULT, 
153
        new FieldValueMetaData(TType.DOUBLE)));
668 chandransh 154
    put(_Fields.COLOR, new FieldMetaData("color", TFieldRequirementType.DEFAULT, 
155
        new FieldValueMetaData(TType.STRING)));
68 ashish 156
  }});
157
 
158
  static {
159
    FieldMetaData.addStructMetaDataMap(LineItem.class, metaDataMap);
160
  }
161
 
162
  public LineItem() {
163
  }
164
 
165
  public LineItem(
166
    long id,
697 chandransh 167
    long item_id,
483 rajveer 168
    String brand,
169
    String model_number,
170
    String model_name,
171
    String extra_info,
172
    double quantity,
173
    double unit_price,
174
    double unit_weight,
175
    double total_price,
668 chandransh 176
    double total_weight,
177
    String color)
68 ashish 178
  {
179
    this();
180
    this.id = id;
181
    setIdIsSet(true);
697 chandransh 182
    this.item_id = item_id;
183
    setItem_idIsSet(true);
483 rajveer 184
    this.brand = brand;
185
    this.model_number = model_number;
186
    this.model_name = model_name;
187
    this.extra_info = extra_info;
188
    this.quantity = quantity;
189
    setQuantityIsSet(true);
190
    this.unit_price = unit_price;
191
    setUnit_priceIsSet(true);
192
    this.unit_weight = unit_weight;
193
    setUnit_weightIsSet(true);
194
    this.total_price = total_price;
195
    setTotal_priceIsSet(true);
196
    this.total_weight = total_weight;
197
    setTotal_weightIsSet(true);
668 chandransh 198
    this.color = color;
68 ashish 199
  }
200
 
201
  /**
202
   * Performs a deep copy on <i>other</i>.
203
   */
204
  public LineItem(LineItem other) {
205
    __isset_bit_vector.clear();
206
    __isset_bit_vector.or(other.__isset_bit_vector);
207
    this.id = other.id;
697 chandransh 208
    this.item_id = other.item_id;
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
 
697 chandransh 263
  public long getItem_id() {
264
    return this.item_id;
483 rajveer 265
  }
266
 
697 chandransh 267
  public LineItem setItem_id(long item_id) {
268
    this.item_id = item_id;
269
    setItem_idIsSet(true);
483 rajveer 270
    return this;
271
  }
272
 
697 chandransh 273
  public void unsetItem_id() {
274
    __isset_bit_vector.clear(__ITEM_ID_ISSET_ID);
483 rajveer 275
  }
276
 
697 chandransh 277
  /** Returns true if field item_id is set (has been asigned a value) and false otherwise */
278
  public boolean isSetItem_id() {
279
    return __isset_bit_vector.get(__ITEM_ID_ISSET_ID);
483 rajveer 280
  }
281
 
697 chandransh 282
  public void setItem_idIsSet(boolean value) {
283
    __isset_bit_vector.set(__ITEM_ID_ISSET_ID, value);
68 ashish 284
  }
285
 
483 rajveer 286
  public String getBrand() {
287
    return this.brand;
68 ashish 288
  }
289
 
483 rajveer 290
  public LineItem setBrand(String brand) {
291
    this.brand = brand;
68 ashish 292
    return this;
293
  }
294
 
483 rajveer 295
  public void unsetBrand() {
296
    this.brand = null;
68 ashish 297
  }
298
 
483 rajveer 299
  /** Returns true if field brand is set (has been asigned a value) and false otherwise */
300
  public boolean isSetBrand() {
301
    return this.brand != null;
68 ashish 302
  }
303
 
483 rajveer 304
  public void setBrandIsSet(boolean value) {
305
    if (!value) {
306
      this.brand = null;
307
    }
68 ashish 308
  }
309
 
483 rajveer 310
  public String getModel_number() {
311
    return this.model_number;
68 ashish 312
  }
313
 
483 rajveer 314
  public LineItem setModel_number(String model_number) {
315
    this.model_number = model_number;
68 ashish 316
    return this;
317
  }
318
 
483 rajveer 319
  public void unsetModel_number() {
320
    this.model_number = null;
68 ashish 321
  }
322
 
483 rajveer 323
  /** Returns true if field model_number is set (has been asigned a value) and false otherwise */
324
  public boolean isSetModel_number() {
325
    return this.model_number != null;
68 ashish 326
  }
327
 
483 rajveer 328
  public void setModel_numberIsSet(boolean value) {
329
    if (!value) {
330
      this.model_number = null;
331
    }
68 ashish 332
  }
333
 
483 rajveer 334
  public String getModel_name() {
335
    return this.model_name;
68 ashish 336
  }
337
 
483 rajveer 338
  public LineItem setModel_name(String model_name) {
339
    this.model_name = model_name;
340
    return this;
341
  }
342
 
343
  public void unsetModel_name() {
344
    this.model_name = null;
345
  }
346
 
347
  /** Returns true if field model_name is set (has been asigned a value) and false otherwise */
348
  public boolean isSetModel_name() {
349
    return this.model_name != null;
350
  }
351
 
352
  public void setModel_nameIsSet(boolean value) {
353
    if (!value) {
354
      this.model_name = null;
68 ashish 355
    }
356
  }
357
 
483 rajveer 358
  public String getExtra_info() {
359
    return this.extra_info;
68 ashish 360
  }
361
 
483 rajveer 362
  public LineItem setExtra_info(String extra_info) {
363
    this.extra_info = extra_info;
68 ashish 364
    return this;
365
  }
366
 
483 rajveer 367
  public void unsetExtra_info() {
368
    this.extra_info = null;
68 ashish 369
  }
370
 
483 rajveer 371
  /** Returns true if field extra_info is set (has been asigned a value) and false otherwise */
372
  public boolean isSetExtra_info() {
373
    return this.extra_info != null;
68 ashish 374
  }
375
 
483 rajveer 376
  public void setExtra_infoIsSet(boolean value) {
68 ashish 377
    if (!value) {
483 rajveer 378
      this.extra_info = null;
68 ashish 379
    }
380
  }
381
 
483 rajveer 382
  public double getQuantity() {
383
    return this.quantity;
384
  }
385
 
386
  public LineItem setQuantity(double quantity) {
387
    this.quantity = quantity;
388
    setQuantityIsSet(true);
389
    return this;
390
  }
391
 
392
  public void unsetQuantity() {
393
    __isset_bit_vector.clear(__QUANTITY_ISSET_ID);
394
  }
395
 
396
  /** Returns true if field quantity is set (has been asigned a value) and false otherwise */
397
  public boolean isSetQuantity() {
398
    return __isset_bit_vector.get(__QUANTITY_ISSET_ID);
399
  }
400
 
401
  public void setQuantityIsSet(boolean value) {
402
    __isset_bit_vector.set(__QUANTITY_ISSET_ID, value);
403
  }
404
 
405
  public double getUnit_price() {
406
    return this.unit_price;
407
  }
408
 
409
  public LineItem setUnit_price(double unit_price) {
410
    this.unit_price = unit_price;
411
    setUnit_priceIsSet(true);
412
    return this;
413
  }
414
 
415
  public void unsetUnit_price() {
416
    __isset_bit_vector.clear(__UNIT_PRICE_ISSET_ID);
417
  }
418
 
419
  /** Returns true if field unit_price is set (has been asigned a value) and false otherwise */
420
  public boolean isSetUnit_price() {
421
    return __isset_bit_vector.get(__UNIT_PRICE_ISSET_ID);
422
  }
423
 
424
  public void setUnit_priceIsSet(boolean value) {
425
    __isset_bit_vector.set(__UNIT_PRICE_ISSET_ID, value);
426
  }
427
 
428
  public double getUnit_weight() {
429
    return this.unit_weight;
430
  }
431
 
432
  public LineItem setUnit_weight(double unit_weight) {
433
    this.unit_weight = unit_weight;
434
    setUnit_weightIsSet(true);
435
    return this;
436
  }
437
 
438
  public void unsetUnit_weight() {
439
    __isset_bit_vector.clear(__UNIT_WEIGHT_ISSET_ID);
440
  }
441
 
442
  /** Returns true if field unit_weight is set (has been asigned a value) and false otherwise */
443
  public boolean isSetUnit_weight() {
444
    return __isset_bit_vector.get(__UNIT_WEIGHT_ISSET_ID);
445
  }
446
 
447
  public void setUnit_weightIsSet(boolean value) {
448
    __isset_bit_vector.set(__UNIT_WEIGHT_ISSET_ID, value);
449
  }
450
 
451
  public double getTotal_price() {
452
    return this.total_price;
453
  }
454
 
455
  public LineItem setTotal_price(double total_price) {
456
    this.total_price = total_price;
457
    setTotal_priceIsSet(true);
458
    return this;
459
  }
460
 
461
  public void unsetTotal_price() {
462
    __isset_bit_vector.clear(__TOTAL_PRICE_ISSET_ID);
463
  }
464
 
465
  /** Returns true if field total_price is set (has been asigned a value) and false otherwise */
466
  public boolean isSetTotal_price() {
467
    return __isset_bit_vector.get(__TOTAL_PRICE_ISSET_ID);
468
  }
469
 
470
  public void setTotal_priceIsSet(boolean value) {
471
    __isset_bit_vector.set(__TOTAL_PRICE_ISSET_ID, value);
472
  }
473
 
474
  public double getTotal_weight() {
475
    return this.total_weight;
476
  }
477
 
478
  public LineItem setTotal_weight(double total_weight) {
479
    this.total_weight = total_weight;
480
    setTotal_weightIsSet(true);
481
    return this;
482
  }
483
 
484
  public void unsetTotal_weight() {
485
    __isset_bit_vector.clear(__TOTAL_WEIGHT_ISSET_ID);
486
  }
487
 
488
  /** Returns true if field total_weight is set (has been asigned a value) and false otherwise */
489
  public boolean isSetTotal_weight() {
490
    return __isset_bit_vector.get(__TOTAL_WEIGHT_ISSET_ID);
491
  }
492
 
493
  public void setTotal_weightIsSet(boolean value) {
494
    __isset_bit_vector.set(__TOTAL_WEIGHT_ISSET_ID, value);
495
  }
496
 
668 chandransh 497
  public String getColor() {
498
    return this.color;
499
  }
500
 
501
  public LineItem setColor(String color) {
502
    this.color = color;
503
    return this;
504
  }
505
 
506
  public void unsetColor() {
507
    this.color = null;
508
  }
509
 
510
  /** Returns true if field color is set (has been asigned a value) and false otherwise */
511
  public boolean isSetColor() {
512
    return this.color != null;
513
  }
514
 
515
  public void setColorIsSet(boolean value) {
516
    if (!value) {
517
      this.color = null;
518
    }
519
  }
520
 
68 ashish 521
  public void setFieldValue(_Fields field, Object value) {
522
    switch (field) {
483 rajveer 523
    case ID:
68 ashish 524
      if (value == null) {
483 rajveer 525
        unsetId();
68 ashish 526
      } else {
483 rajveer 527
        setId((Long)value);
68 ashish 528
      }
529
      break;
530
 
697 chandransh 531
    case ITEM_ID:
68 ashish 532
      if (value == null) {
697 chandransh 533
        unsetItem_id();
68 ashish 534
      } else {
697 chandransh 535
        setItem_id((Long)value);
68 ashish 536
      }
537
      break;
538
 
483 rajveer 539
    case BRAND:
68 ashish 540
      if (value == null) {
483 rajveer 541
        unsetBrand();
68 ashish 542
      } else {
483 rajveer 543
        setBrand((String)value);
68 ashish 544
      }
545
      break;
546
 
483 rajveer 547
    case MODEL_NUMBER:
68 ashish 548
      if (value == null) {
483 rajveer 549
        unsetModel_number();
68 ashish 550
      } else {
483 rajveer 551
        setModel_number((String)value);
68 ashish 552
      }
553
      break;
554
 
483 rajveer 555
    case MODEL_NAME:
556
      if (value == null) {
557
        unsetModel_name();
558
      } else {
559
        setModel_name((String)value);
560
      }
561
      break;
562
 
563
    case EXTRA_INFO:
564
      if (value == null) {
565
        unsetExtra_info();
566
      } else {
567
        setExtra_info((String)value);
568
      }
569
      break;
570
 
571
    case QUANTITY:
572
      if (value == null) {
573
        unsetQuantity();
574
      } else {
575
        setQuantity((Double)value);
576
      }
577
      break;
578
 
579
    case UNIT_PRICE:
580
      if (value == null) {
581
        unsetUnit_price();
582
      } else {
583
        setUnit_price((Double)value);
584
      }
585
      break;
586
 
587
    case UNIT_WEIGHT:
588
      if (value == null) {
589
        unsetUnit_weight();
590
      } else {
591
        setUnit_weight((Double)value);
592
      }
593
      break;
594
 
595
    case TOTAL_PRICE:
596
      if (value == null) {
597
        unsetTotal_price();
598
      } else {
599
        setTotal_price((Double)value);
600
      }
601
      break;
602
 
603
    case TOTAL_WEIGHT:
604
      if (value == null) {
605
        unsetTotal_weight();
606
      } else {
607
        setTotal_weight((Double)value);
608
      }
609
      break;
610
 
668 chandransh 611
    case COLOR:
612
      if (value == null) {
613
        unsetColor();
614
      } else {
615
        setColor((String)value);
616
      }
617
      break;
618
 
68 ashish 619
    }
620
  }
621
 
622
  public void setFieldValue(int fieldID, Object value) {
623
    setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
624
  }
625
 
626
  public Object getFieldValue(_Fields field) {
627
    switch (field) {
628
    case ID:
629
      return new Long(getId());
630
 
697 chandransh 631
    case ITEM_ID:
632
      return new Long(getItem_id());
68 ashish 633
 
483 rajveer 634
    case BRAND:
635
      return getBrand();
68 ashish 636
 
483 rajveer 637
    case MODEL_NUMBER:
638
      return getModel_number();
639
 
640
    case MODEL_NAME:
641
      return getModel_name();
642
 
643
    case EXTRA_INFO:
644
      return getExtra_info();
645
 
646
    case QUANTITY:
647
      return new Double(getQuantity());
648
 
649
    case UNIT_PRICE:
650
      return new Double(getUnit_price());
651
 
652
    case UNIT_WEIGHT:
653
      return new Double(getUnit_weight());
654
 
655
    case TOTAL_PRICE:
656
      return new Double(getTotal_price());
657
 
658
    case TOTAL_WEIGHT:
659
      return new Double(getTotal_weight());
660
 
668 chandransh 661
    case COLOR:
662
      return getColor();
663
 
68 ashish 664
    }
665
    throw new IllegalStateException();
666
  }
667
 
668
  public Object getFieldValue(int fieldId) {
669
    return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
670
  }
671
 
672
  /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
673
  public boolean isSet(_Fields field) {
674
    switch (field) {
675
    case ID:
676
      return isSetId();
697 chandransh 677
    case ITEM_ID:
678
      return isSetItem_id();
483 rajveer 679
    case BRAND:
680
      return isSetBrand();
681
    case MODEL_NUMBER:
682
      return isSetModel_number();
683
    case MODEL_NAME:
684
      return isSetModel_name();
685
    case EXTRA_INFO:
686
      return isSetExtra_info();
687
    case QUANTITY:
688
      return isSetQuantity();
689
    case UNIT_PRICE:
690
      return isSetUnit_price();
691
    case UNIT_WEIGHT:
692
      return isSetUnit_weight();
693
    case TOTAL_PRICE:
694
      return isSetTotal_price();
695
    case TOTAL_WEIGHT:
696
      return isSetTotal_weight();
668 chandransh 697
    case COLOR:
698
      return isSetColor();
68 ashish 699
    }
700
    throw new IllegalStateException();
701
  }
702
 
703
  public boolean isSet(int fieldID) {
704
    return isSet(_Fields.findByThriftIdOrThrow(fieldID));
705
  }
706
 
707
  @Override
708
  public boolean equals(Object that) {
709
    if (that == null)
710
      return false;
711
    if (that instanceof LineItem)
712
      return this.equals((LineItem)that);
713
    return false;
714
  }
715
 
716
  public boolean equals(LineItem that) {
717
    if (that == null)
718
      return false;
719
 
720
    boolean this_present_id = true;
721
    boolean that_present_id = true;
722
    if (this_present_id || that_present_id) {
723
      if (!(this_present_id && that_present_id))
724
        return false;
725
      if (this.id != that.id)
726
        return false;
727
    }
728
 
697 chandransh 729
    boolean this_present_item_id = true;
730
    boolean that_present_item_id = true;
731
    if (this_present_item_id || that_present_item_id) {
732
      if (!(this_present_item_id && that_present_item_id))
68 ashish 733
        return false;
697 chandransh 734
      if (this.item_id != that.item_id)
68 ashish 735
        return false;
736
    }
737
 
483 rajveer 738
    boolean this_present_brand = true && this.isSetBrand();
739
    boolean that_present_brand = true && that.isSetBrand();
740
    if (this_present_brand || that_present_brand) {
741
      if (!(this_present_brand && that_present_brand))
68 ashish 742
        return false;
483 rajveer 743
      if (!this.brand.equals(that.brand))
68 ashish 744
        return false;
745
    }
746
 
483 rajveer 747
    boolean this_present_model_number = true && this.isSetModel_number();
748
    boolean that_present_model_number = true && that.isSetModel_number();
749
    if (this_present_model_number || that_present_model_number) {
750
      if (!(this_present_model_number && that_present_model_number))
751
        return false;
752
      if (!this.model_number.equals(that.model_number))
753
        return false;
754
    }
755
 
756
    boolean this_present_model_name = true && this.isSetModel_name();
757
    boolean that_present_model_name = true && that.isSetModel_name();
758
    if (this_present_model_name || that_present_model_name) {
759
      if (!(this_present_model_name && that_present_model_name))
760
        return false;
761
      if (!this.model_name.equals(that.model_name))
762
        return false;
763
    }
764
 
765
    boolean this_present_extra_info = true && this.isSetExtra_info();
766
    boolean that_present_extra_info = true && that.isSetExtra_info();
767
    if (this_present_extra_info || that_present_extra_info) {
768
      if (!(this_present_extra_info && that_present_extra_info))
769
        return false;
770
      if (!this.extra_info.equals(that.extra_info))
771
        return false;
772
    }
773
 
774
    boolean this_present_quantity = true;
775
    boolean that_present_quantity = true;
776
    if (this_present_quantity || that_present_quantity) {
777
      if (!(this_present_quantity && that_present_quantity))
778
        return false;
779
      if (this.quantity != that.quantity)
780
        return false;
781
    }
782
 
783
    boolean this_present_unit_price = true;
784
    boolean that_present_unit_price = true;
785
    if (this_present_unit_price || that_present_unit_price) {
786
      if (!(this_present_unit_price && that_present_unit_price))
787
        return false;
788
      if (this.unit_price != that.unit_price)
789
        return false;
790
    }
791
 
792
    boolean this_present_unit_weight = true;
793
    boolean that_present_unit_weight = true;
794
    if (this_present_unit_weight || that_present_unit_weight) {
795
      if (!(this_present_unit_weight && that_present_unit_weight))
796
        return false;
797
      if (this.unit_weight != that.unit_weight)
798
        return false;
799
    }
800
 
801
    boolean this_present_total_price = true;
802
    boolean that_present_total_price = true;
803
    if (this_present_total_price || that_present_total_price) {
804
      if (!(this_present_total_price && that_present_total_price))
805
        return false;
806
      if (this.total_price != that.total_price)
807
        return false;
808
    }
809
 
810
    boolean this_present_total_weight = true;
811
    boolean that_present_total_weight = true;
812
    if (this_present_total_weight || that_present_total_weight) {
813
      if (!(this_present_total_weight && that_present_total_weight))
814
        return false;
815
      if (this.total_weight != that.total_weight)
816
        return false;
817
    }
818
 
668 chandransh 819
    boolean this_present_color = true && this.isSetColor();
820
    boolean that_present_color = true && that.isSetColor();
821
    if (this_present_color || that_present_color) {
822
      if (!(this_present_color && that_present_color))
823
        return false;
824
      if (!this.color.equals(that.color))
825
        return false;
826
    }
827
 
68 ashish 828
    return true;
829
  }
830
 
831
  @Override
832
  public int hashCode() {
833
    return 0;
834
  }
835
 
483 rajveer 836
  public int compareTo(LineItem other) {
837
    if (!getClass().equals(other.getClass())) {
838
      return getClass().getName().compareTo(other.getClass().getName());
839
    }
840
 
841
    int lastComparison = 0;
842
    LineItem typedOther = (LineItem)other;
843
 
844
    lastComparison = Boolean.valueOf(isSetId()).compareTo(isSetId());
845
    if (lastComparison != 0) {
846
      return lastComparison;
847
    }
848
    lastComparison = TBaseHelper.compareTo(id, typedOther.id);
849
    if (lastComparison != 0) {
850
      return lastComparison;
851
    }
697 chandransh 852
    lastComparison = Boolean.valueOf(isSetItem_id()).compareTo(isSetItem_id());
483 rajveer 853
    if (lastComparison != 0) {
854
      return lastComparison;
855
    }
697 chandransh 856
    lastComparison = TBaseHelper.compareTo(item_id, typedOther.item_id);
483 rajveer 857
    if (lastComparison != 0) {
858
      return lastComparison;
859
    }
860
    lastComparison = Boolean.valueOf(isSetBrand()).compareTo(isSetBrand());
861
    if (lastComparison != 0) {
862
      return lastComparison;
863
    }
864
    lastComparison = TBaseHelper.compareTo(brand, typedOther.brand);
865
    if (lastComparison != 0) {
866
      return lastComparison;
867
    }
868
    lastComparison = Boolean.valueOf(isSetModel_number()).compareTo(isSetModel_number());
869
    if (lastComparison != 0) {
870
      return lastComparison;
871
    }
872
    lastComparison = TBaseHelper.compareTo(model_number, typedOther.model_number);
873
    if (lastComparison != 0) {
874
      return lastComparison;
875
    }
876
    lastComparison = Boolean.valueOf(isSetModel_name()).compareTo(isSetModel_name());
877
    if (lastComparison != 0) {
878
      return lastComparison;
879
    }
880
    lastComparison = TBaseHelper.compareTo(model_name, typedOther.model_name);
881
    if (lastComparison != 0) {
882
      return lastComparison;
883
    }
884
    lastComparison = Boolean.valueOf(isSetExtra_info()).compareTo(isSetExtra_info());
885
    if (lastComparison != 0) {
886
      return lastComparison;
887
    }
888
    lastComparison = TBaseHelper.compareTo(extra_info, typedOther.extra_info);
889
    if (lastComparison != 0) {
890
      return lastComparison;
891
    }
892
    lastComparison = Boolean.valueOf(isSetQuantity()).compareTo(isSetQuantity());
893
    if (lastComparison != 0) {
894
      return lastComparison;
895
    }
896
    lastComparison = TBaseHelper.compareTo(quantity, typedOther.quantity);
897
    if (lastComparison != 0) {
898
      return lastComparison;
899
    }
900
    lastComparison = Boolean.valueOf(isSetUnit_price()).compareTo(isSetUnit_price());
901
    if (lastComparison != 0) {
902
      return lastComparison;
903
    }
904
    lastComparison = TBaseHelper.compareTo(unit_price, typedOther.unit_price);
905
    if (lastComparison != 0) {
906
      return lastComparison;
907
    }
908
    lastComparison = Boolean.valueOf(isSetUnit_weight()).compareTo(isSetUnit_weight());
909
    if (lastComparison != 0) {
910
      return lastComparison;
911
    }
912
    lastComparison = TBaseHelper.compareTo(unit_weight, typedOther.unit_weight);
913
    if (lastComparison != 0) {
914
      return lastComparison;
915
    }
916
    lastComparison = Boolean.valueOf(isSetTotal_price()).compareTo(isSetTotal_price());
917
    if (lastComparison != 0) {
918
      return lastComparison;
919
    }
920
    lastComparison = TBaseHelper.compareTo(total_price, typedOther.total_price);
921
    if (lastComparison != 0) {
922
      return lastComparison;
923
    }
924
    lastComparison = Boolean.valueOf(isSetTotal_weight()).compareTo(isSetTotal_weight());
925
    if (lastComparison != 0) {
926
      return lastComparison;
927
    }
928
    lastComparison = TBaseHelper.compareTo(total_weight, typedOther.total_weight);
929
    if (lastComparison != 0) {
930
      return lastComparison;
931
    }
668 chandransh 932
    lastComparison = Boolean.valueOf(isSetColor()).compareTo(isSetColor());
933
    if (lastComparison != 0) {
934
      return lastComparison;
935
    }
936
    lastComparison = TBaseHelper.compareTo(color, typedOther.color);
937
    if (lastComparison != 0) {
938
      return lastComparison;
939
    }
483 rajveer 940
    return 0;
941
  }
942
 
68 ashish 943
  public void read(TProtocol iprot) throws TException {
944
    TField field;
945
    iprot.readStructBegin();
946
    while (true)
947
    {
948
      field = iprot.readFieldBegin();
949
      if (field.type == TType.STOP) { 
950
        break;
951
      }
952
      _Fields fieldId = _Fields.findByThriftId(field.id);
953
      if (fieldId == null) {
954
        TProtocolUtil.skip(iprot, field.type);
955
      } else {
956
        switch (fieldId) {
957
          case ID:
958
            if (field.type == TType.I64) {
959
              this.id = iprot.readI64();
960
              setIdIsSet(true);
961
            } else { 
962
              TProtocolUtil.skip(iprot, field.type);
963
            }
964
            break;
697 chandransh 965
          case ITEM_ID:
966
            if (field.type == TType.I64) {
967
              this.item_id = iprot.readI64();
968
              setItem_idIsSet(true);
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();
697 chandransh 1063
    oprot.writeFieldBegin(ITEM_ID_FIELD_DESC);
1064
    oprot.writeI64(this.item_id);
1065
    oprot.writeFieldEnd();
483 rajveer 1066
    if (this.brand != null) {
1067
      oprot.writeFieldBegin(BRAND_FIELD_DESC);
1068
      oprot.writeString(this.brand);
1069
      oprot.writeFieldEnd();
1070
    }
1071
    if (this.model_number != null) {
1072
      oprot.writeFieldBegin(MODEL_NUMBER_FIELD_DESC);
1073
      oprot.writeString(this.model_number);
1074
      oprot.writeFieldEnd();
1075
    }
1076
    if (this.model_name != null) {
1077
      oprot.writeFieldBegin(MODEL_NAME_FIELD_DESC);
1078
      oprot.writeString(this.model_name);
1079
      oprot.writeFieldEnd();
1080
    }
1081
    if (this.extra_info != null) {
1082
      oprot.writeFieldBegin(EXTRA_INFO_FIELD_DESC);
1083
      oprot.writeString(this.extra_info);
1084
      oprot.writeFieldEnd();
1085
    }
1086
    oprot.writeFieldBegin(QUANTITY_FIELD_DESC);
1087
    oprot.writeDouble(this.quantity);
1088
    oprot.writeFieldEnd();
1089
    oprot.writeFieldBegin(UNIT_PRICE_FIELD_DESC);
1090
    oprot.writeDouble(this.unit_price);
1091
    oprot.writeFieldEnd();
1092
    oprot.writeFieldBegin(UNIT_WEIGHT_FIELD_DESC);
1093
    oprot.writeDouble(this.unit_weight);
1094
    oprot.writeFieldEnd();
1095
    oprot.writeFieldBegin(TOTAL_PRICE_FIELD_DESC);
1096
    oprot.writeDouble(this.total_price);
1097
    oprot.writeFieldEnd();
1098
    oprot.writeFieldBegin(TOTAL_WEIGHT_FIELD_DESC);
1099
    oprot.writeDouble(this.total_weight);
1100
    oprot.writeFieldEnd();
668 chandransh 1101
    if (this.color != null) {
1102
      oprot.writeFieldBegin(COLOR_FIELD_DESC);
1103
      oprot.writeString(this.color);
1104
      oprot.writeFieldEnd();
1105
    }
68 ashish 1106
    oprot.writeFieldStop();
1107
    oprot.writeStructEnd();
1108
  }
1109
 
1110
  @Override
1111
  public String toString() {
1112
    StringBuilder sb = new StringBuilder("LineItem(");
1113
    boolean first = true;
1114
 
483 rajveer 1115
    sb.append("id:");
1116
    sb.append(this.id);
1117
    first = false;
1118
    if (!first) sb.append(", ");
697 chandransh 1119
    sb.append("item_id:");
1120
    sb.append(this.item_id);
68 ashish 1121
    first = false;
1122
    if (!first) sb.append(", ");
483 rajveer 1123
    sb.append("brand:");
1124
    if (this.brand == null) {
1125
      sb.append("null");
1126
    } else {
1127
      sb.append(this.brand);
1128
    }
68 ashish 1129
    first = false;
1130
    if (!first) sb.append(", ");
483 rajveer 1131
    sb.append("model_number:");
1132
    if (this.model_number == null) {
1133
      sb.append("null");
1134
    } else {
1135
      sb.append(this.model_number);
1136
    }
68 ashish 1137
    first = false;
1138
    if (!first) sb.append(", ");
483 rajveer 1139
    sb.append("model_name:");
1140
    if (this.model_name == null) {
68 ashish 1141
      sb.append("null");
1142
    } else {
483 rajveer 1143
      sb.append(this.model_name);
68 ashish 1144
    }
1145
    first = false;
483 rajveer 1146
    if (!first) sb.append(", ");
1147
    sb.append("extra_info:");
1148
    if (this.extra_info == null) {
1149
      sb.append("null");
1150
    } else {
1151
      sb.append(this.extra_info);
1152
    }
1153
    first = false;
1154
    if (!first) sb.append(", ");
1155
    sb.append("quantity:");
1156
    sb.append(this.quantity);
1157
    first = false;
1158
    if (!first) sb.append(", ");
1159
    sb.append("unit_price:");
1160
    sb.append(this.unit_price);
1161
    first = false;
1162
    if (!first) sb.append(", ");
1163
    sb.append("unit_weight:");
1164
    sb.append(this.unit_weight);
1165
    first = false;
1166
    if (!first) sb.append(", ");
1167
    sb.append("total_price:");
1168
    sb.append(this.total_price);
1169
    first = false;
1170
    if (!first) sb.append(", ");
1171
    sb.append("total_weight:");
1172
    sb.append(this.total_weight);
1173
    first = false;
668 chandransh 1174
    if (!first) sb.append(", ");
1175
    sb.append("color:");
1176
    if (this.color == null) {
1177
      sb.append("null");
1178
    } else {
1179
      sb.append(this.color);
1180
    }
1181
    first = false;
68 ashish 1182
    sb.append(")");
1183
    return sb.toString();
1184
  }
1185
 
1186
  public void validate() throws TException {
1187
    // check for required fields
1188
  }
1189
 
1190
}
1191