Subversion Repositories SmartDukaan

Rev

Rev 1982 | Rev 3555 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
553 chandransh 1
/**
3430 rajveer 2
 * Autogenerated by Thrift Compiler (0.7.0)
553 chandransh 3
 *
4
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
 */
6
package in.shop2020.model.v1.user;
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;
3430 rajveer 18
import java.nio.ByteBuffer;
553 chandransh 19
import java.util.Arrays;
20
import org.slf4j.Logger;
21
import org.slf4j.LoggerFactory;
22
 
3430 rajveer 23
public class Line implements org.apache.thrift.TBase<Line, Line._Fields>, java.io.Serializable, Cloneable {
24
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Line");
553 chandransh 25
 
3430 rajveer 26
  private static final org.apache.thrift.protocol.TField CART_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("cartId", org.apache.thrift.protocol.TType.I64, (short)1);
27
  private static final org.apache.thrift.protocol.TField ITEM_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("itemId", org.apache.thrift.protocol.TType.I64, (short)2);
28
  private static final org.apache.thrift.protocol.TField QUANTITY_FIELD_DESC = new org.apache.thrift.protocol.TField("quantity", org.apache.thrift.protocol.TType.DOUBLE, (short)3);
29
  private static final org.apache.thrift.protocol.TField CREATED_ON_FIELD_DESC = new org.apache.thrift.protocol.TField("createdOn", org.apache.thrift.protocol.TType.I64, (short)4);
30
  private static final org.apache.thrift.protocol.TField UPDATED_ON_FIELD_DESC = new org.apache.thrift.protocol.TField("updatedOn", org.apache.thrift.protocol.TType.I64, (short)5);
31
  private static final org.apache.thrift.protocol.TField LINE_STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("lineStatus", org.apache.thrift.protocol.TType.I32, (short)6);
32
  private static final org.apache.thrift.protocol.TField ESTIMATE_FIELD_DESC = new org.apache.thrift.protocol.TField("estimate", org.apache.thrift.protocol.TType.I32, (short)7);
33
  private static final org.apache.thrift.protocol.TField ACTUAL_PRICE_FIELD_DESC = new org.apache.thrift.protocol.TField("actualPrice", org.apache.thrift.protocol.TType.DOUBLE, (short)8);
34
  private static final org.apache.thrift.protocol.TField DISCOUNTED_PRICE_FIELD_DESC = new org.apache.thrift.protocol.TField("discountedPrice", org.apache.thrift.protocol.TType.DOUBLE, (short)9);
553 chandransh 35
 
3430 rajveer 36
  private long cartId; // required
37
  private long itemId; // required
38
  private double quantity; // required
39
  private long createdOn; // required
40
  private long updatedOn; // required
41
  private LineStatus lineStatus; // required
42
  private int estimate; // required
43
  private double actualPrice; // required
44
  private double discountedPrice; // required
553 chandransh 45
 
46
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 47
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
648 chandransh 48
    CART_ID((short)1, "cartId"),
553 chandransh 49
    ITEM_ID((short)2, "itemId"),
50
    QUANTITY((short)3, "quantity"),
51
    CREATED_ON((short)4, "createdOn"),
52
    UPDATED_ON((short)5, "updatedOn"),
53
    /**
54
     * 
55
     * @see LineStatus
56
     */
614 chandransh 57
    LINE_STATUS((short)6, "lineStatus"),
1982 varun.gupt 58
    ESTIMATE((short)7, "estimate"),
59
    ACTUAL_PRICE((short)8, "actualPrice"),
60
    DISCOUNTED_PRICE((short)9, "discountedPrice");
553 chandransh 61
 
62
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
63
 
64
    static {
65
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
66
        byName.put(field.getFieldName(), field);
67
      }
68
    }
69
 
70
    /**
71
     * Find the _Fields constant that matches fieldId, or null if its not found.
72
     */
73
    public static _Fields findByThriftId(int fieldId) {
3430 rajveer 74
      switch(fieldId) {
75
        case 1: // CART_ID
76
          return CART_ID;
77
        case 2: // ITEM_ID
78
          return ITEM_ID;
79
        case 3: // QUANTITY
80
          return QUANTITY;
81
        case 4: // CREATED_ON
82
          return CREATED_ON;
83
        case 5: // UPDATED_ON
84
          return UPDATED_ON;
85
        case 6: // LINE_STATUS
86
          return LINE_STATUS;
87
        case 7: // ESTIMATE
88
          return ESTIMATE;
89
        case 8: // ACTUAL_PRICE
90
          return ACTUAL_PRICE;
91
        case 9: // DISCOUNTED_PRICE
92
          return DISCOUNTED_PRICE;
93
        default:
94
          return null;
95
      }
553 chandransh 96
    }
97
 
98
    /**
99
     * Find the _Fields constant that matches fieldId, throwing an exception
100
     * if it is not found.
101
     */
102
    public static _Fields findByThriftIdOrThrow(int fieldId) {
103
      _Fields fields = findByThriftId(fieldId);
104
      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
105
      return fields;
106
    }
107
 
108
    /**
109
     * Find the _Fields constant that matches name, or null if its not found.
110
     */
111
    public static _Fields findByName(String name) {
112
      return byName.get(name);
113
    }
114
 
115
    private final short _thriftId;
116
    private final String _fieldName;
117
 
118
    _Fields(short thriftId, String fieldName) {
119
      _thriftId = thriftId;
120
      _fieldName = fieldName;
121
    }
122
 
123
    public short getThriftFieldId() {
124
      return _thriftId;
125
    }
126
 
127
    public String getFieldName() {
128
      return _fieldName;
129
    }
130
  }
131
 
132
  // isset id assignments
648 chandransh 133
  private static final int __CARTID_ISSET_ID = 0;
553 chandransh 134
  private static final int __ITEMID_ISSET_ID = 1;
135
  private static final int __QUANTITY_ISSET_ID = 2;
136
  private static final int __CREATEDON_ISSET_ID = 3;
137
  private static final int __UPDATEDON_ISSET_ID = 4;
614 chandransh 138
  private static final int __ESTIMATE_ISSET_ID = 5;
1982 varun.gupt 139
  private static final int __ACTUALPRICE_ISSET_ID = 6;
140
  private static final int __DISCOUNTEDPRICE_ISSET_ID = 7;
141
  private BitSet __isset_bit_vector = new BitSet(8);
553 chandransh 142
 
3430 rajveer 143
  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
553 chandransh 144
  static {
3430 rajveer 145
    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
146
    tmpMap.put(_Fields.CART_ID, new org.apache.thrift.meta_data.FieldMetaData("cartId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
147
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
148
    tmpMap.put(_Fields.ITEM_ID, new org.apache.thrift.meta_data.FieldMetaData("itemId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
149
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
150
    tmpMap.put(_Fields.QUANTITY, new org.apache.thrift.meta_data.FieldMetaData("quantity", org.apache.thrift.TFieldRequirementType.DEFAULT, 
151
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
152
    tmpMap.put(_Fields.CREATED_ON, new org.apache.thrift.meta_data.FieldMetaData("createdOn", org.apache.thrift.TFieldRequirementType.DEFAULT, 
153
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
154
    tmpMap.put(_Fields.UPDATED_ON, new org.apache.thrift.meta_data.FieldMetaData("updatedOn", org.apache.thrift.TFieldRequirementType.DEFAULT, 
155
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
156
    tmpMap.put(_Fields.LINE_STATUS, new org.apache.thrift.meta_data.FieldMetaData("lineStatus", org.apache.thrift.TFieldRequirementType.DEFAULT, 
157
        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, LineStatus.class)));
158
    tmpMap.put(_Fields.ESTIMATE, new org.apache.thrift.meta_data.FieldMetaData("estimate", org.apache.thrift.TFieldRequirementType.DEFAULT, 
159
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
160
    tmpMap.put(_Fields.ACTUAL_PRICE, new org.apache.thrift.meta_data.FieldMetaData("actualPrice", org.apache.thrift.TFieldRequirementType.DEFAULT, 
161
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
162
    tmpMap.put(_Fields.DISCOUNTED_PRICE, new org.apache.thrift.meta_data.FieldMetaData("discountedPrice", org.apache.thrift.TFieldRequirementType.DEFAULT, 
163
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
164
    metaDataMap = Collections.unmodifiableMap(tmpMap);
165
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Line.class, metaDataMap);
553 chandransh 166
  }
167
 
168
  public Line() {
169
  }
170
 
171
  public Line(
648 chandransh 172
    long cartId,
553 chandransh 173
    long itemId,
174
    double quantity,
175
    long createdOn,
176
    long updatedOn,
614 chandransh 177
    LineStatus lineStatus,
1982 varun.gupt 178
    int estimate,
179
    double actualPrice,
180
    double discountedPrice)
553 chandransh 181
  {
182
    this();
648 chandransh 183
    this.cartId = cartId;
184
    setCartIdIsSet(true);
553 chandransh 185
    this.itemId = itemId;
186
    setItemIdIsSet(true);
187
    this.quantity = quantity;
188
    setQuantityIsSet(true);
189
    this.createdOn = createdOn;
190
    setCreatedOnIsSet(true);
191
    this.updatedOn = updatedOn;
192
    setUpdatedOnIsSet(true);
193
    this.lineStatus = lineStatus;
614 chandransh 194
    this.estimate = estimate;
195
    setEstimateIsSet(true);
1982 varun.gupt 196
    this.actualPrice = actualPrice;
197
    setActualPriceIsSet(true);
198
    this.discountedPrice = discountedPrice;
199
    setDiscountedPriceIsSet(true);
553 chandransh 200
  }
201
 
202
  /**
203
   * Performs a deep copy on <i>other</i>.
204
   */
205
  public Line(Line other) {
206
    __isset_bit_vector.clear();
207
    __isset_bit_vector.or(other.__isset_bit_vector);
648 chandransh 208
    this.cartId = other.cartId;
553 chandransh 209
    this.itemId = other.itemId;
210
    this.quantity = other.quantity;
211
    this.createdOn = other.createdOn;
212
    this.updatedOn = other.updatedOn;
213
    if (other.isSetLineStatus()) {
214
      this.lineStatus = other.lineStatus;
215
    }
614 chandransh 216
    this.estimate = other.estimate;
1982 varun.gupt 217
    this.actualPrice = other.actualPrice;
218
    this.discountedPrice = other.discountedPrice;
553 chandransh 219
  }
220
 
221
  public Line deepCopy() {
222
    return new Line(this);
223
  }
224
 
3430 rajveer 225
  @Override
226
  public void clear() {
227
    setCartIdIsSet(false);
228
    this.cartId = 0;
229
    setItemIdIsSet(false);
230
    this.itemId = 0;
231
    setQuantityIsSet(false);
232
    this.quantity = 0.0;
233
    setCreatedOnIsSet(false);
234
    this.createdOn = 0;
235
    setUpdatedOnIsSet(false);
236
    this.updatedOn = 0;
237
    this.lineStatus = null;
238
    setEstimateIsSet(false);
239
    this.estimate = 0;
240
    setActualPriceIsSet(false);
241
    this.actualPrice = 0.0;
242
    setDiscountedPriceIsSet(false);
243
    this.discountedPrice = 0.0;
553 chandransh 244
  }
245
 
648 chandransh 246
  public long getCartId() {
247
    return this.cartId;
553 chandransh 248
  }
249
 
3430 rajveer 250
  public void setCartId(long cartId) {
648 chandransh 251
    this.cartId = cartId;
252
    setCartIdIsSet(true);
553 chandransh 253
  }
254
 
648 chandransh 255
  public void unsetCartId() {
256
    __isset_bit_vector.clear(__CARTID_ISSET_ID);
553 chandransh 257
  }
258
 
3430 rajveer 259
  /** Returns true if field cartId is set (has been assigned a value) and false otherwise */
648 chandransh 260
  public boolean isSetCartId() {
261
    return __isset_bit_vector.get(__CARTID_ISSET_ID);
553 chandransh 262
  }
263
 
648 chandransh 264
  public void setCartIdIsSet(boolean value) {
265
    __isset_bit_vector.set(__CARTID_ISSET_ID, value);
553 chandransh 266
  }
267
 
268
  public long getItemId() {
269
    return this.itemId;
270
  }
271
 
3430 rajveer 272
  public void setItemId(long itemId) {
553 chandransh 273
    this.itemId = itemId;
274
    setItemIdIsSet(true);
275
  }
276
 
277
  public void unsetItemId() {
278
    __isset_bit_vector.clear(__ITEMID_ISSET_ID);
279
  }
280
 
3430 rajveer 281
  /** Returns true if field itemId is set (has been assigned a value) and false otherwise */
553 chandransh 282
  public boolean isSetItemId() {
283
    return __isset_bit_vector.get(__ITEMID_ISSET_ID);
284
  }
285
 
286
  public void setItemIdIsSet(boolean value) {
287
    __isset_bit_vector.set(__ITEMID_ISSET_ID, value);
288
  }
289
 
290
  public double getQuantity() {
291
    return this.quantity;
292
  }
293
 
3430 rajveer 294
  public void setQuantity(double quantity) {
553 chandransh 295
    this.quantity = quantity;
296
    setQuantityIsSet(true);
297
  }
298
 
299
  public void unsetQuantity() {
300
    __isset_bit_vector.clear(__QUANTITY_ISSET_ID);
301
  }
302
 
3430 rajveer 303
  /** Returns true if field quantity is set (has been assigned a value) and false otherwise */
553 chandransh 304
  public boolean isSetQuantity() {
305
    return __isset_bit_vector.get(__QUANTITY_ISSET_ID);
306
  }
307
 
308
  public void setQuantityIsSet(boolean value) {
309
    __isset_bit_vector.set(__QUANTITY_ISSET_ID, value);
310
  }
311
 
312
  public long getCreatedOn() {
313
    return this.createdOn;
314
  }
315
 
3430 rajveer 316
  public void setCreatedOn(long createdOn) {
553 chandransh 317
    this.createdOn = createdOn;
318
    setCreatedOnIsSet(true);
319
  }
320
 
321
  public void unsetCreatedOn() {
322
    __isset_bit_vector.clear(__CREATEDON_ISSET_ID);
323
  }
324
 
3430 rajveer 325
  /** Returns true if field createdOn is set (has been assigned a value) and false otherwise */
553 chandransh 326
  public boolean isSetCreatedOn() {
327
    return __isset_bit_vector.get(__CREATEDON_ISSET_ID);
328
  }
329
 
330
  public void setCreatedOnIsSet(boolean value) {
331
    __isset_bit_vector.set(__CREATEDON_ISSET_ID, value);
332
  }
333
 
334
  public long getUpdatedOn() {
335
    return this.updatedOn;
336
  }
337
 
3430 rajveer 338
  public void setUpdatedOn(long updatedOn) {
553 chandransh 339
    this.updatedOn = updatedOn;
340
    setUpdatedOnIsSet(true);
341
  }
342
 
343
  public void unsetUpdatedOn() {
344
    __isset_bit_vector.clear(__UPDATEDON_ISSET_ID);
345
  }
346
 
3430 rajveer 347
  /** Returns true if field updatedOn is set (has been assigned a value) and false otherwise */
553 chandransh 348
  public boolean isSetUpdatedOn() {
349
    return __isset_bit_vector.get(__UPDATEDON_ISSET_ID);
350
  }
351
 
352
  public void setUpdatedOnIsSet(boolean value) {
353
    __isset_bit_vector.set(__UPDATEDON_ISSET_ID, value);
354
  }
355
 
356
  /**
357
   * 
358
   * @see LineStatus
359
   */
360
  public LineStatus getLineStatus() {
361
    return this.lineStatus;
362
  }
363
 
364
  /**
365
   * 
366
   * @see LineStatus
367
   */
3430 rajveer 368
  public void setLineStatus(LineStatus lineStatus) {
553 chandransh 369
    this.lineStatus = lineStatus;
370
  }
371
 
372
  public void unsetLineStatus() {
373
    this.lineStatus = null;
374
  }
375
 
3430 rajveer 376
  /** Returns true if field lineStatus is set (has been assigned a value) and false otherwise */
553 chandransh 377
  public boolean isSetLineStatus() {
378
    return this.lineStatus != null;
379
  }
380
 
381
  public void setLineStatusIsSet(boolean value) {
382
    if (!value) {
383
      this.lineStatus = null;
384
    }
385
  }
386
 
614 chandransh 387
  public int getEstimate() {
388
    return this.estimate;
389
  }
390
 
3430 rajveer 391
  public void setEstimate(int estimate) {
614 chandransh 392
    this.estimate = estimate;
393
    setEstimateIsSet(true);
394
  }
395
 
396
  public void unsetEstimate() {
397
    __isset_bit_vector.clear(__ESTIMATE_ISSET_ID);
398
  }
399
 
3430 rajveer 400
  /** Returns true if field estimate is set (has been assigned a value) and false otherwise */
614 chandransh 401
  public boolean isSetEstimate() {
402
    return __isset_bit_vector.get(__ESTIMATE_ISSET_ID);
403
  }
404
 
405
  public void setEstimateIsSet(boolean value) {
406
    __isset_bit_vector.set(__ESTIMATE_ISSET_ID, value);
407
  }
408
 
1982 varun.gupt 409
  public double getActualPrice() {
410
    return this.actualPrice;
411
  }
412
 
3430 rajveer 413
  public void setActualPrice(double actualPrice) {
1982 varun.gupt 414
    this.actualPrice = actualPrice;
415
    setActualPriceIsSet(true);
416
  }
417
 
418
  public void unsetActualPrice() {
419
    __isset_bit_vector.clear(__ACTUALPRICE_ISSET_ID);
420
  }
421
 
3430 rajveer 422
  /** Returns true if field actualPrice is set (has been assigned a value) and false otherwise */
1982 varun.gupt 423
  public boolean isSetActualPrice() {
424
    return __isset_bit_vector.get(__ACTUALPRICE_ISSET_ID);
425
  }
426
 
427
  public void setActualPriceIsSet(boolean value) {
428
    __isset_bit_vector.set(__ACTUALPRICE_ISSET_ID, value);
429
  }
430
 
431
  public double getDiscountedPrice() {
432
    return this.discountedPrice;
433
  }
434
 
3430 rajveer 435
  public void setDiscountedPrice(double discountedPrice) {
1982 varun.gupt 436
    this.discountedPrice = discountedPrice;
437
    setDiscountedPriceIsSet(true);
438
  }
439
 
440
  public void unsetDiscountedPrice() {
441
    __isset_bit_vector.clear(__DISCOUNTEDPRICE_ISSET_ID);
442
  }
443
 
3430 rajveer 444
  /** Returns true if field discountedPrice is set (has been assigned a value) and false otherwise */
1982 varun.gupt 445
  public boolean isSetDiscountedPrice() {
446
    return __isset_bit_vector.get(__DISCOUNTEDPRICE_ISSET_ID);
447
  }
448
 
449
  public void setDiscountedPriceIsSet(boolean value) {
450
    __isset_bit_vector.set(__DISCOUNTEDPRICE_ISSET_ID, value);
451
  }
452
 
553 chandransh 453
  public void setFieldValue(_Fields field, Object value) {
454
    switch (field) {
648 chandransh 455
    case CART_ID:
553 chandransh 456
      if (value == null) {
648 chandransh 457
        unsetCartId();
553 chandransh 458
      } else {
648 chandransh 459
        setCartId((Long)value);
553 chandransh 460
      }
461
      break;
462
 
463
    case ITEM_ID:
464
      if (value == null) {
465
        unsetItemId();
466
      } else {
467
        setItemId((Long)value);
468
      }
469
      break;
470
 
471
    case QUANTITY:
472
      if (value == null) {
473
        unsetQuantity();
474
      } else {
475
        setQuantity((Double)value);
476
      }
477
      break;
478
 
479
    case CREATED_ON:
480
      if (value == null) {
481
        unsetCreatedOn();
482
      } else {
483
        setCreatedOn((Long)value);
484
      }
485
      break;
486
 
487
    case UPDATED_ON:
488
      if (value == null) {
489
        unsetUpdatedOn();
490
      } else {
491
        setUpdatedOn((Long)value);
492
      }
493
      break;
494
 
495
    case LINE_STATUS:
496
      if (value == null) {
497
        unsetLineStatus();
498
      } else {
499
        setLineStatus((LineStatus)value);
500
      }
501
      break;
502
 
614 chandransh 503
    case ESTIMATE:
504
      if (value == null) {
505
        unsetEstimate();
506
      } else {
507
        setEstimate((Integer)value);
508
      }
509
      break;
510
 
1982 varun.gupt 511
    case ACTUAL_PRICE:
512
      if (value == null) {
513
        unsetActualPrice();
514
      } else {
515
        setActualPrice((Double)value);
516
      }
517
      break;
518
 
519
    case DISCOUNTED_PRICE:
520
      if (value == null) {
521
        unsetDiscountedPrice();
522
      } else {
523
        setDiscountedPrice((Double)value);
524
      }
525
      break;
526
 
553 chandransh 527
    }
528
  }
529
 
530
  public Object getFieldValue(_Fields field) {
531
    switch (field) {
648 chandransh 532
    case CART_ID:
3430 rajveer 533
      return Long.valueOf(getCartId());
553 chandransh 534
 
535
    case ITEM_ID:
3430 rajveer 536
      return Long.valueOf(getItemId());
553 chandransh 537
 
538
    case QUANTITY:
3430 rajveer 539
      return Double.valueOf(getQuantity());
553 chandransh 540
 
541
    case CREATED_ON:
3430 rajveer 542
      return Long.valueOf(getCreatedOn());
553 chandransh 543
 
544
    case UPDATED_ON:
3430 rajveer 545
      return Long.valueOf(getUpdatedOn());
553 chandransh 546
 
547
    case LINE_STATUS:
548
      return getLineStatus();
549
 
614 chandransh 550
    case ESTIMATE:
3430 rajveer 551
      return Integer.valueOf(getEstimate());
614 chandransh 552
 
1982 varun.gupt 553
    case ACTUAL_PRICE:
3430 rajveer 554
      return Double.valueOf(getActualPrice());
1982 varun.gupt 555
 
556
    case DISCOUNTED_PRICE:
3430 rajveer 557
      return Double.valueOf(getDiscountedPrice());
1982 varun.gupt 558
 
553 chandransh 559
    }
560
    throw new IllegalStateException();
561
  }
562
 
3430 rajveer 563
  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
564
  public boolean isSet(_Fields field) {
565
    if (field == null) {
566
      throw new IllegalArgumentException();
567
    }
553 chandransh 568
 
569
    switch (field) {
648 chandransh 570
    case CART_ID:
571
      return isSetCartId();
553 chandransh 572
    case ITEM_ID:
573
      return isSetItemId();
574
    case QUANTITY:
575
      return isSetQuantity();
576
    case CREATED_ON:
577
      return isSetCreatedOn();
578
    case UPDATED_ON:
579
      return isSetUpdatedOn();
580
    case LINE_STATUS:
581
      return isSetLineStatus();
614 chandransh 582
    case ESTIMATE:
583
      return isSetEstimate();
1982 varun.gupt 584
    case ACTUAL_PRICE:
585
      return isSetActualPrice();
586
    case DISCOUNTED_PRICE:
587
      return isSetDiscountedPrice();
553 chandransh 588
    }
589
    throw new IllegalStateException();
590
  }
591
 
592
  @Override
593
  public boolean equals(Object that) {
594
    if (that == null)
595
      return false;
596
    if (that instanceof Line)
597
      return this.equals((Line)that);
598
    return false;
599
  }
600
 
601
  public boolean equals(Line that) {
602
    if (that == null)
603
      return false;
604
 
648 chandransh 605
    boolean this_present_cartId = true;
606
    boolean that_present_cartId = true;
607
    if (this_present_cartId || that_present_cartId) {
608
      if (!(this_present_cartId && that_present_cartId))
553 chandransh 609
        return false;
648 chandransh 610
      if (this.cartId != that.cartId)
553 chandransh 611
        return false;
612
    }
613
 
614
    boolean this_present_itemId = true;
615
    boolean that_present_itemId = true;
616
    if (this_present_itemId || that_present_itemId) {
617
      if (!(this_present_itemId && that_present_itemId))
618
        return false;
619
      if (this.itemId != that.itemId)
620
        return false;
621
    }
622
 
623
    boolean this_present_quantity = true;
624
    boolean that_present_quantity = true;
625
    if (this_present_quantity || that_present_quantity) {
626
      if (!(this_present_quantity && that_present_quantity))
627
        return false;
628
      if (this.quantity != that.quantity)
629
        return false;
630
    }
631
 
632
    boolean this_present_createdOn = true;
633
    boolean that_present_createdOn = true;
634
    if (this_present_createdOn || that_present_createdOn) {
635
      if (!(this_present_createdOn && that_present_createdOn))
636
        return false;
637
      if (this.createdOn != that.createdOn)
638
        return false;
639
    }
640
 
641
    boolean this_present_updatedOn = true;
642
    boolean that_present_updatedOn = true;
643
    if (this_present_updatedOn || that_present_updatedOn) {
644
      if (!(this_present_updatedOn && that_present_updatedOn))
645
        return false;
646
      if (this.updatedOn != that.updatedOn)
647
        return false;
648
    }
649
 
650
    boolean this_present_lineStatus = true && this.isSetLineStatus();
651
    boolean that_present_lineStatus = true && that.isSetLineStatus();
652
    if (this_present_lineStatus || that_present_lineStatus) {
653
      if (!(this_present_lineStatus && that_present_lineStatus))
654
        return false;
655
      if (!this.lineStatus.equals(that.lineStatus))
656
        return false;
657
    }
658
 
614 chandransh 659
    boolean this_present_estimate = true;
660
    boolean that_present_estimate = true;
661
    if (this_present_estimate || that_present_estimate) {
662
      if (!(this_present_estimate && that_present_estimate))
663
        return false;
664
      if (this.estimate != that.estimate)
665
        return false;
666
    }
667
 
1982 varun.gupt 668
    boolean this_present_actualPrice = true;
669
    boolean that_present_actualPrice = true;
670
    if (this_present_actualPrice || that_present_actualPrice) {
671
      if (!(this_present_actualPrice && that_present_actualPrice))
672
        return false;
673
      if (this.actualPrice != that.actualPrice)
674
        return false;
675
    }
676
 
677
    boolean this_present_discountedPrice = true;
678
    boolean that_present_discountedPrice = true;
679
    if (this_present_discountedPrice || that_present_discountedPrice) {
680
      if (!(this_present_discountedPrice && that_present_discountedPrice))
681
        return false;
682
      if (this.discountedPrice != that.discountedPrice)
683
        return false;
684
    }
685
 
553 chandransh 686
    return true;
687
  }
688
 
689
  @Override
690
  public int hashCode() {
691
    return 0;
692
  }
693
 
694
  public int compareTo(Line other) {
695
    if (!getClass().equals(other.getClass())) {
696
      return getClass().getName().compareTo(other.getClass().getName());
697
    }
698
 
699
    int lastComparison = 0;
700
    Line typedOther = (Line)other;
701
 
3430 rajveer 702
    lastComparison = Boolean.valueOf(isSetCartId()).compareTo(typedOther.isSetCartId());
553 chandransh 703
    if (lastComparison != 0) {
704
      return lastComparison;
705
    }
3430 rajveer 706
    if (isSetCartId()) {
707
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cartId, typedOther.cartId);
708
      if (lastComparison != 0) {
709
        return lastComparison;
710
      }
553 chandransh 711
    }
3430 rajveer 712
    lastComparison = Boolean.valueOf(isSetItemId()).compareTo(typedOther.isSetItemId());
553 chandransh 713
    if (lastComparison != 0) {
714
      return lastComparison;
715
    }
3430 rajveer 716
    if (isSetItemId()) {
717
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.itemId, typedOther.itemId);
718
      if (lastComparison != 0) {
719
        return lastComparison;
720
      }
553 chandransh 721
    }
3430 rajveer 722
    lastComparison = Boolean.valueOf(isSetQuantity()).compareTo(typedOther.isSetQuantity());
553 chandransh 723
    if (lastComparison != 0) {
724
      return lastComparison;
725
    }
3430 rajveer 726
    if (isSetQuantity()) {
727
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.quantity, typedOther.quantity);
728
      if (lastComparison != 0) {
729
        return lastComparison;
730
      }
553 chandransh 731
    }
3430 rajveer 732
    lastComparison = Boolean.valueOf(isSetCreatedOn()).compareTo(typedOther.isSetCreatedOn());
553 chandransh 733
    if (lastComparison != 0) {
734
      return lastComparison;
735
    }
3430 rajveer 736
    if (isSetCreatedOn()) {
737
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.createdOn, typedOther.createdOn);
738
      if (lastComparison != 0) {
739
        return lastComparison;
740
      }
553 chandransh 741
    }
3430 rajveer 742
    lastComparison = Boolean.valueOf(isSetUpdatedOn()).compareTo(typedOther.isSetUpdatedOn());
553 chandransh 743
    if (lastComparison != 0) {
744
      return lastComparison;
745
    }
3430 rajveer 746
    if (isSetUpdatedOn()) {
747
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.updatedOn, typedOther.updatedOn);
748
      if (lastComparison != 0) {
749
        return lastComparison;
750
      }
553 chandransh 751
    }
3430 rajveer 752
    lastComparison = Boolean.valueOf(isSetLineStatus()).compareTo(typedOther.isSetLineStatus());
553 chandransh 753
    if (lastComparison != 0) {
754
      return lastComparison;
755
    }
3430 rajveer 756
    if (isSetLineStatus()) {
757
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.lineStatus, typedOther.lineStatus);
758
      if (lastComparison != 0) {
759
        return lastComparison;
760
      }
553 chandransh 761
    }
3430 rajveer 762
    lastComparison = Boolean.valueOf(isSetEstimate()).compareTo(typedOther.isSetEstimate());
614 chandransh 763
    if (lastComparison != 0) {
764
      return lastComparison;
765
    }
3430 rajveer 766
    if (isSetEstimate()) {
767
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.estimate, typedOther.estimate);
768
      if (lastComparison != 0) {
769
        return lastComparison;
770
      }
614 chandransh 771
    }
3430 rajveer 772
    lastComparison = Boolean.valueOf(isSetActualPrice()).compareTo(typedOther.isSetActualPrice());
1982 varun.gupt 773
    if (lastComparison != 0) {
774
      return lastComparison;
775
    }
3430 rajveer 776
    if (isSetActualPrice()) {
777
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.actualPrice, typedOther.actualPrice);
778
      if (lastComparison != 0) {
779
        return lastComparison;
780
      }
1982 varun.gupt 781
    }
3430 rajveer 782
    lastComparison = Boolean.valueOf(isSetDiscountedPrice()).compareTo(typedOther.isSetDiscountedPrice());
1982 varun.gupt 783
    if (lastComparison != 0) {
784
      return lastComparison;
785
    }
3430 rajveer 786
    if (isSetDiscountedPrice()) {
787
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.discountedPrice, typedOther.discountedPrice);
788
      if (lastComparison != 0) {
789
        return lastComparison;
790
      }
1982 varun.gupt 791
    }
553 chandransh 792
    return 0;
793
  }
794
 
3430 rajveer 795
  public _Fields fieldForId(int fieldId) {
796
    return _Fields.findByThriftId(fieldId);
797
  }
798
 
799
  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
800
    org.apache.thrift.protocol.TField field;
553 chandransh 801
    iprot.readStructBegin();
802
    while (true)
803
    {
804
      field = iprot.readFieldBegin();
3430 rajveer 805
      if (field.type == org.apache.thrift.protocol.TType.STOP) { 
553 chandransh 806
        break;
807
      }
3430 rajveer 808
      switch (field.id) {
809
        case 1: // CART_ID
810
          if (field.type == org.apache.thrift.protocol.TType.I64) {
811
            this.cartId = iprot.readI64();
812
            setCartIdIsSet(true);
813
          } else { 
814
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
815
          }
816
          break;
817
        case 2: // ITEM_ID
818
          if (field.type == org.apache.thrift.protocol.TType.I64) {
819
            this.itemId = iprot.readI64();
820
            setItemIdIsSet(true);
821
          } else { 
822
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
823
          }
824
          break;
825
        case 3: // QUANTITY
826
          if (field.type == org.apache.thrift.protocol.TType.DOUBLE) {
827
            this.quantity = iprot.readDouble();
828
            setQuantityIsSet(true);
829
          } else { 
830
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
831
          }
832
          break;
833
        case 4: // CREATED_ON
834
          if (field.type == org.apache.thrift.protocol.TType.I64) {
835
            this.createdOn = iprot.readI64();
836
            setCreatedOnIsSet(true);
837
          } else { 
838
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
839
          }
840
          break;
841
        case 5: // UPDATED_ON
842
          if (field.type == org.apache.thrift.protocol.TType.I64) {
843
            this.updatedOn = iprot.readI64();
844
            setUpdatedOnIsSet(true);
845
          } else { 
846
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
847
          }
848
          break;
849
        case 6: // LINE_STATUS
850
          if (field.type == org.apache.thrift.protocol.TType.I32) {
851
            this.lineStatus = LineStatus.findByValue(iprot.readI32());
852
          } else { 
853
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
854
          }
855
          break;
856
        case 7: // ESTIMATE
857
          if (field.type == org.apache.thrift.protocol.TType.I32) {
858
            this.estimate = iprot.readI32();
859
            setEstimateIsSet(true);
860
          } else { 
861
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
862
          }
863
          break;
864
        case 8: // ACTUAL_PRICE
865
          if (field.type == org.apache.thrift.protocol.TType.DOUBLE) {
866
            this.actualPrice = iprot.readDouble();
867
            setActualPriceIsSet(true);
868
          } else { 
869
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
870
          }
871
          break;
872
        case 9: // DISCOUNTED_PRICE
873
          if (field.type == org.apache.thrift.protocol.TType.DOUBLE) {
874
            this.discountedPrice = iprot.readDouble();
875
            setDiscountedPriceIsSet(true);
876
          } else { 
877
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
878
          }
879
          break;
880
        default:
881
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
553 chandransh 882
      }
3430 rajveer 883
      iprot.readFieldEnd();
553 chandransh 884
    }
885
    iprot.readStructEnd();
886
    validate();
887
  }
888
 
3430 rajveer 889
  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
553 chandransh 890
    validate();
891
 
892
    oprot.writeStructBegin(STRUCT_DESC);
648 chandransh 893
    oprot.writeFieldBegin(CART_ID_FIELD_DESC);
894
    oprot.writeI64(this.cartId);
553 chandransh 895
    oprot.writeFieldEnd();
896
    oprot.writeFieldBegin(ITEM_ID_FIELD_DESC);
897
    oprot.writeI64(this.itemId);
898
    oprot.writeFieldEnd();
899
    oprot.writeFieldBegin(QUANTITY_FIELD_DESC);
900
    oprot.writeDouble(this.quantity);
901
    oprot.writeFieldEnd();
902
    oprot.writeFieldBegin(CREATED_ON_FIELD_DESC);
903
    oprot.writeI64(this.createdOn);
904
    oprot.writeFieldEnd();
905
    oprot.writeFieldBegin(UPDATED_ON_FIELD_DESC);
906
    oprot.writeI64(this.updatedOn);
907
    oprot.writeFieldEnd();
908
    if (this.lineStatus != null) {
909
      oprot.writeFieldBegin(LINE_STATUS_FIELD_DESC);
910
      oprot.writeI32(this.lineStatus.getValue());
911
      oprot.writeFieldEnd();
912
    }
614 chandransh 913
    oprot.writeFieldBegin(ESTIMATE_FIELD_DESC);
914
    oprot.writeI32(this.estimate);
915
    oprot.writeFieldEnd();
1982 varun.gupt 916
    oprot.writeFieldBegin(ACTUAL_PRICE_FIELD_DESC);
917
    oprot.writeDouble(this.actualPrice);
918
    oprot.writeFieldEnd();
919
    oprot.writeFieldBegin(DISCOUNTED_PRICE_FIELD_DESC);
920
    oprot.writeDouble(this.discountedPrice);
921
    oprot.writeFieldEnd();
553 chandransh 922
    oprot.writeFieldStop();
923
    oprot.writeStructEnd();
924
  }
925
 
926
  @Override
927
  public String toString() {
928
    StringBuilder sb = new StringBuilder("Line(");
929
    boolean first = true;
930
 
648 chandransh 931
    sb.append("cartId:");
932
    sb.append(this.cartId);
553 chandransh 933
    first = false;
934
    if (!first) sb.append(", ");
935
    sb.append("itemId:");
936
    sb.append(this.itemId);
937
    first = false;
938
    if (!first) sb.append(", ");
939
    sb.append("quantity:");
940
    sb.append(this.quantity);
941
    first = false;
942
    if (!first) sb.append(", ");
943
    sb.append("createdOn:");
944
    sb.append(this.createdOn);
945
    first = false;
946
    if (!first) sb.append(", ");
947
    sb.append("updatedOn:");
948
    sb.append(this.updatedOn);
949
    first = false;
950
    if (!first) sb.append(", ");
951
    sb.append("lineStatus:");
952
    if (this.lineStatus == null) {
953
      sb.append("null");
954
    } else {
955
      sb.append(this.lineStatus);
956
    }
957
    first = false;
614 chandransh 958
    if (!first) sb.append(", ");
959
    sb.append("estimate:");
960
    sb.append(this.estimate);
961
    first = false;
1982 varun.gupt 962
    if (!first) sb.append(", ");
963
    sb.append("actualPrice:");
964
    sb.append(this.actualPrice);
965
    first = false;
966
    if (!first) sb.append(", ");
967
    sb.append("discountedPrice:");
968
    sb.append(this.discountedPrice);
969
    first = false;
553 chandransh 970
    sb.append(")");
971
    return sb.toString();
972
  }
973
 
3430 rajveer 974
  public void validate() throws org.apache.thrift.TException {
553 chandransh 975
    // check for required fields
976
  }
977
 
3430 rajveer 978
  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
979
    try {
980
      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
981
    } catch (org.apache.thrift.TException te) {
982
      throw new java.io.IOException(te);
983
    }
984
  }
985
 
986
  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
987
    try {
988
      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
989
      __isset_bit_vector = new BitSet(1);
990
      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
991
    } catch (org.apache.thrift.TException te) {
992
      throw new java.io.IOException(te);
993
    }
994
  }
995
 
553 chandransh 996
}
997