Subversion Repositories SmartDukaan

Rev

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

Rev Author Line No. Line
6467 amar.kumar 1
/**
2
 * Autogenerated by Thrift Compiler (0.7.0)
3
 *
4
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
 */
6
package in.shop2020.purchase;
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.nio.ByteBuffer;
19
import java.util.Arrays;
20
import org.slf4j.Logger;
21
import org.slf4j.LoggerFactory;
22
 
23
public class PurchaseReturn implements org.apache.thrift.TBase<PurchaseReturn, PurchaseReturn._Fields>, java.io.Serializable, Cloneable {
24
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("PurchaseReturn");
25
 
26
  private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.I64, (short)1);
27
  private static final org.apache.thrift.protocol.TField VENDOR_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("vendorId", org.apache.thrift.protocol.TType.I64, (short)2);
28
  private static final org.apache.thrift.protocol.TField AMOUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("amount", org.apache.thrift.protocol.TType.I64, (short)3);
29
  private static final org.apache.thrift.protocol.TField RETURN_TIMESTAMP_FIELD_DESC = new org.apache.thrift.protocol.TField("returnTimestamp", org.apache.thrift.protocol.TType.I64, (short)4);
30
  private static final org.apache.thrift.protocol.TField IS_SETTLED_FIELD_DESC = new org.apache.thrift.protocol.TField("isSettled", org.apache.thrift.protocol.TType.BOOL, (short)5);
6821 amar.kumar 31
  private static final org.apache.thrift.protocol.TField TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("type", org.apache.thrift.protocol.TType.I32, (short)6);
10864 manish.sha 32
  private static final org.apache.thrift.protocol.TField RETURN_INVENTORY_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("returnInventoryType", org.apache.thrift.protocol.TType.I32, (short)7);
6467 amar.kumar 33
 
34
  private long id; // required
35
  private long vendorId; // required
36
  private long amount; // required
37
  private long returnTimestamp; // required
38
  private boolean isSettled; // required
6821 amar.kumar 39
  private PurchaseReturnType type; // required
10864 manish.sha 40
  private PurchaseReturnInventoryType returnInventoryType; // required
6467 amar.kumar 41
 
42
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
43
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
44
    ID((short)1, "id"),
45
    VENDOR_ID((short)2, "vendorId"),
46
    AMOUNT((short)3, "amount"),
47
    RETURN_TIMESTAMP((short)4, "returnTimestamp"),
6821 amar.kumar 48
    IS_SETTLED((short)5, "isSettled"),
49
    /**
50
     * 
51
     * @see PurchaseReturnType
52
     */
10864 manish.sha 53
    TYPE((short)6, "type"),
54
    /**
55
     * 
56
     * @see PurchaseReturnInventoryType
57
     */
58
    RETURN_INVENTORY_TYPE((short)7, "returnInventoryType");
6467 amar.kumar 59
 
60
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
61
 
62
    static {
63
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
64
        byName.put(field.getFieldName(), field);
65
      }
66
    }
67
 
68
    /**
69
     * Find the _Fields constant that matches fieldId, or null if its not found.
70
     */
71
    public static _Fields findByThriftId(int fieldId) {
72
      switch(fieldId) {
73
        case 1: // ID
74
          return ID;
75
        case 2: // VENDOR_ID
76
          return VENDOR_ID;
77
        case 3: // AMOUNT
78
          return AMOUNT;
79
        case 4: // RETURN_TIMESTAMP
80
          return RETURN_TIMESTAMP;
81
        case 5: // IS_SETTLED
82
          return IS_SETTLED;
6821 amar.kumar 83
        case 6: // TYPE
84
          return TYPE;
10864 manish.sha 85
        case 7: // RETURN_INVENTORY_TYPE
86
          return RETURN_INVENTORY_TYPE;
6467 amar.kumar 87
        default:
88
          return null;
89
      }
90
    }
91
 
92
    /**
93
     * Find the _Fields constant that matches fieldId, throwing an exception
94
     * if it is not found.
95
     */
96
    public static _Fields findByThriftIdOrThrow(int fieldId) {
97
      _Fields fields = findByThriftId(fieldId);
98
      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
99
      return fields;
100
    }
101
 
102
    /**
103
     * Find the _Fields constant that matches name, or null if its not found.
104
     */
105
    public static _Fields findByName(String name) {
106
      return byName.get(name);
107
    }
108
 
109
    private final short _thriftId;
110
    private final String _fieldName;
111
 
112
    _Fields(short thriftId, String fieldName) {
113
      _thriftId = thriftId;
114
      _fieldName = fieldName;
115
    }
116
 
117
    public short getThriftFieldId() {
118
      return _thriftId;
119
    }
120
 
121
    public String getFieldName() {
122
      return _fieldName;
123
    }
124
  }
125
 
126
  // isset id assignments
127
  private static final int __ID_ISSET_ID = 0;
128
  private static final int __VENDORID_ISSET_ID = 1;
129
  private static final int __AMOUNT_ISSET_ID = 2;
130
  private static final int __RETURNTIMESTAMP_ISSET_ID = 3;
131
  private static final int __ISSETTLED_ISSET_ID = 4;
132
  private BitSet __isset_bit_vector = new BitSet(5);
133
 
134
  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
135
  static {
136
    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
137
    tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
138
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
139
    tmpMap.put(_Fields.VENDOR_ID, new org.apache.thrift.meta_data.FieldMetaData("vendorId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
140
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
141
    tmpMap.put(_Fields.AMOUNT, new org.apache.thrift.meta_data.FieldMetaData("amount", org.apache.thrift.TFieldRequirementType.DEFAULT, 
142
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
143
    tmpMap.put(_Fields.RETURN_TIMESTAMP, new org.apache.thrift.meta_data.FieldMetaData("returnTimestamp", org.apache.thrift.TFieldRequirementType.DEFAULT, 
144
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
145
    tmpMap.put(_Fields.IS_SETTLED, new org.apache.thrift.meta_data.FieldMetaData("isSettled", org.apache.thrift.TFieldRequirementType.DEFAULT, 
146
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
6821 amar.kumar 147
    tmpMap.put(_Fields.TYPE, new org.apache.thrift.meta_data.FieldMetaData("type", org.apache.thrift.TFieldRequirementType.DEFAULT, 
148
        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, PurchaseReturnType.class)));
10864 manish.sha 149
    tmpMap.put(_Fields.RETURN_INVENTORY_TYPE, new org.apache.thrift.meta_data.FieldMetaData("returnInventoryType", org.apache.thrift.TFieldRequirementType.DEFAULT, 
150
        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, PurchaseReturnInventoryType.class)));
6467 amar.kumar 151
    metaDataMap = Collections.unmodifiableMap(tmpMap);
152
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(PurchaseReturn.class, metaDataMap);
153
  }
154
 
155
  public PurchaseReturn() {
156
  }
157
 
158
  public PurchaseReturn(
159
    long id,
160
    long vendorId,
161
    long amount,
162
    long returnTimestamp,
6821 amar.kumar 163
    boolean isSettled,
10864 manish.sha 164
    PurchaseReturnType type,
165
    PurchaseReturnInventoryType returnInventoryType)
6467 amar.kumar 166
  {
167
    this();
168
    this.id = id;
169
    setIdIsSet(true);
170
    this.vendorId = vendorId;
171
    setVendorIdIsSet(true);
172
    this.amount = amount;
173
    setAmountIsSet(true);
174
    this.returnTimestamp = returnTimestamp;
175
    setReturnTimestampIsSet(true);
176
    this.isSettled = isSettled;
177
    setIsSettledIsSet(true);
6821 amar.kumar 178
    this.type = type;
10864 manish.sha 179
    this.returnInventoryType = returnInventoryType;
6467 amar.kumar 180
  }
181
 
182
  /**
183
   * Performs a deep copy on <i>other</i>.
184
   */
185
  public PurchaseReturn(PurchaseReturn other) {
186
    __isset_bit_vector.clear();
187
    __isset_bit_vector.or(other.__isset_bit_vector);
188
    this.id = other.id;
189
    this.vendorId = other.vendorId;
190
    this.amount = other.amount;
191
    this.returnTimestamp = other.returnTimestamp;
192
    this.isSettled = other.isSettled;
6821 amar.kumar 193
    if (other.isSetType()) {
194
      this.type = other.type;
195
    }
10864 manish.sha 196
    if (other.isSetReturnInventoryType()) {
197
      this.returnInventoryType = other.returnInventoryType;
198
    }
6467 amar.kumar 199
  }
200
 
201
  public PurchaseReturn deepCopy() {
202
    return new PurchaseReturn(this);
203
  }
204
 
205
  @Override
206
  public void clear() {
207
    setIdIsSet(false);
208
    this.id = 0;
209
    setVendorIdIsSet(false);
210
    this.vendorId = 0;
211
    setAmountIsSet(false);
212
    this.amount = 0;
213
    setReturnTimestampIsSet(false);
214
    this.returnTimestamp = 0;
215
    setIsSettledIsSet(false);
216
    this.isSettled = false;
6821 amar.kumar 217
    this.type = null;
10864 manish.sha 218
    this.returnInventoryType = null;
6467 amar.kumar 219
  }
220
 
221
  public long getId() {
222
    return this.id;
223
  }
224
 
225
  public void setId(long id) {
226
    this.id = id;
227
    setIdIsSet(true);
228
  }
229
 
230
  public void unsetId() {
231
    __isset_bit_vector.clear(__ID_ISSET_ID);
232
  }
233
 
234
  /** Returns true if field id is set (has been assigned a value) and false otherwise */
235
  public boolean isSetId() {
236
    return __isset_bit_vector.get(__ID_ISSET_ID);
237
  }
238
 
239
  public void setIdIsSet(boolean value) {
240
    __isset_bit_vector.set(__ID_ISSET_ID, value);
241
  }
242
 
243
  public long getVendorId() {
244
    return this.vendorId;
245
  }
246
 
247
  public void setVendorId(long vendorId) {
248
    this.vendorId = vendorId;
249
    setVendorIdIsSet(true);
250
  }
251
 
252
  public void unsetVendorId() {
253
    __isset_bit_vector.clear(__VENDORID_ISSET_ID);
254
  }
255
 
256
  /** Returns true if field vendorId is set (has been assigned a value) and false otherwise */
257
  public boolean isSetVendorId() {
258
    return __isset_bit_vector.get(__VENDORID_ISSET_ID);
259
  }
260
 
261
  public void setVendorIdIsSet(boolean value) {
262
    __isset_bit_vector.set(__VENDORID_ISSET_ID, value);
263
  }
264
 
265
  public long getAmount() {
266
    return this.amount;
267
  }
268
 
269
  public void setAmount(long amount) {
270
    this.amount = amount;
271
    setAmountIsSet(true);
272
  }
273
 
274
  public void unsetAmount() {
275
    __isset_bit_vector.clear(__AMOUNT_ISSET_ID);
276
  }
277
 
278
  /** Returns true if field amount is set (has been assigned a value) and false otherwise */
279
  public boolean isSetAmount() {
280
    return __isset_bit_vector.get(__AMOUNT_ISSET_ID);
281
  }
282
 
283
  public void setAmountIsSet(boolean value) {
284
    __isset_bit_vector.set(__AMOUNT_ISSET_ID, value);
285
  }
286
 
287
  public long getReturnTimestamp() {
288
    return this.returnTimestamp;
289
  }
290
 
291
  public void setReturnTimestamp(long returnTimestamp) {
292
    this.returnTimestamp = returnTimestamp;
293
    setReturnTimestampIsSet(true);
294
  }
295
 
296
  public void unsetReturnTimestamp() {
297
    __isset_bit_vector.clear(__RETURNTIMESTAMP_ISSET_ID);
298
  }
299
 
300
  /** Returns true if field returnTimestamp is set (has been assigned a value) and false otherwise */
301
  public boolean isSetReturnTimestamp() {
302
    return __isset_bit_vector.get(__RETURNTIMESTAMP_ISSET_ID);
303
  }
304
 
305
  public void setReturnTimestampIsSet(boolean value) {
306
    __isset_bit_vector.set(__RETURNTIMESTAMP_ISSET_ID, value);
307
  }
308
 
309
  public boolean isIsSettled() {
310
    return this.isSettled;
311
  }
312
 
313
  public void setIsSettled(boolean isSettled) {
314
    this.isSettled = isSettled;
315
    setIsSettledIsSet(true);
316
  }
317
 
318
  public void unsetIsSettled() {
319
    __isset_bit_vector.clear(__ISSETTLED_ISSET_ID);
320
  }
321
 
322
  /** Returns true if field isSettled is set (has been assigned a value) and false otherwise */
323
  public boolean isSetIsSettled() {
324
    return __isset_bit_vector.get(__ISSETTLED_ISSET_ID);
325
  }
326
 
327
  public void setIsSettledIsSet(boolean value) {
328
    __isset_bit_vector.set(__ISSETTLED_ISSET_ID, value);
329
  }
330
 
6821 amar.kumar 331
  /**
332
   * 
333
   * @see PurchaseReturnType
334
   */
335
  public PurchaseReturnType getType() {
336
    return this.type;
337
  }
338
 
339
  /**
340
   * 
341
   * @see PurchaseReturnType
342
   */
343
  public void setType(PurchaseReturnType type) {
344
    this.type = type;
345
  }
346
 
347
  public void unsetType() {
348
    this.type = null;
349
  }
350
 
351
  /** Returns true if field type is set (has been assigned a value) and false otherwise */
352
  public boolean isSetType() {
353
    return this.type != null;
354
  }
355
 
356
  public void setTypeIsSet(boolean value) {
357
    if (!value) {
358
      this.type = null;
359
    }
360
  }
361
 
10864 manish.sha 362
  /**
363
   * 
364
   * @see PurchaseReturnInventoryType
365
   */
366
  public PurchaseReturnInventoryType getReturnInventoryType() {
367
    return this.returnInventoryType;
368
  }
369
 
370
  /**
371
   * 
372
   * @see PurchaseReturnInventoryType
373
   */
374
  public void setReturnInventoryType(PurchaseReturnInventoryType returnInventoryType) {
375
    this.returnInventoryType = returnInventoryType;
376
  }
377
 
378
  public void unsetReturnInventoryType() {
379
    this.returnInventoryType = null;
380
  }
381
 
382
  /** Returns true if field returnInventoryType is set (has been assigned a value) and false otherwise */
383
  public boolean isSetReturnInventoryType() {
384
    return this.returnInventoryType != null;
385
  }
386
 
387
  public void setReturnInventoryTypeIsSet(boolean value) {
388
    if (!value) {
389
      this.returnInventoryType = null;
390
    }
391
  }
392
 
6467 amar.kumar 393
  public void setFieldValue(_Fields field, Object value) {
394
    switch (field) {
395
    case ID:
396
      if (value == null) {
397
        unsetId();
398
      } else {
399
        setId((Long)value);
400
      }
401
      break;
402
 
403
    case VENDOR_ID:
404
      if (value == null) {
405
        unsetVendorId();
406
      } else {
407
        setVendorId((Long)value);
408
      }
409
      break;
410
 
411
    case AMOUNT:
412
      if (value == null) {
413
        unsetAmount();
414
      } else {
415
        setAmount((Long)value);
416
      }
417
      break;
418
 
419
    case RETURN_TIMESTAMP:
420
      if (value == null) {
421
        unsetReturnTimestamp();
422
      } else {
423
        setReturnTimestamp((Long)value);
424
      }
425
      break;
426
 
427
    case IS_SETTLED:
428
      if (value == null) {
429
        unsetIsSettled();
430
      } else {
431
        setIsSettled((Boolean)value);
432
      }
433
      break;
434
 
6821 amar.kumar 435
    case TYPE:
436
      if (value == null) {
437
        unsetType();
438
      } else {
439
        setType((PurchaseReturnType)value);
440
      }
441
      break;
442
 
10864 manish.sha 443
    case RETURN_INVENTORY_TYPE:
444
      if (value == null) {
445
        unsetReturnInventoryType();
446
      } else {
447
        setReturnInventoryType((PurchaseReturnInventoryType)value);
448
      }
449
      break;
450
 
6467 amar.kumar 451
    }
452
  }
453
 
454
  public Object getFieldValue(_Fields field) {
455
    switch (field) {
456
    case ID:
457
      return Long.valueOf(getId());
458
 
459
    case VENDOR_ID:
460
      return Long.valueOf(getVendorId());
461
 
462
    case AMOUNT:
463
      return Long.valueOf(getAmount());
464
 
465
    case RETURN_TIMESTAMP:
466
      return Long.valueOf(getReturnTimestamp());
467
 
468
    case IS_SETTLED:
469
      return Boolean.valueOf(isIsSettled());
470
 
6821 amar.kumar 471
    case TYPE:
472
      return getType();
473
 
10864 manish.sha 474
    case RETURN_INVENTORY_TYPE:
475
      return getReturnInventoryType();
476
 
6467 amar.kumar 477
    }
478
    throw new IllegalStateException();
479
  }
480
 
481
  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
482
  public boolean isSet(_Fields field) {
483
    if (field == null) {
484
      throw new IllegalArgumentException();
485
    }
486
 
487
    switch (field) {
488
    case ID:
489
      return isSetId();
490
    case VENDOR_ID:
491
      return isSetVendorId();
492
    case AMOUNT:
493
      return isSetAmount();
494
    case RETURN_TIMESTAMP:
495
      return isSetReturnTimestamp();
496
    case IS_SETTLED:
497
      return isSetIsSettled();
6821 amar.kumar 498
    case TYPE:
499
      return isSetType();
10864 manish.sha 500
    case RETURN_INVENTORY_TYPE:
501
      return isSetReturnInventoryType();
6467 amar.kumar 502
    }
503
    throw new IllegalStateException();
504
  }
505
 
506
  @Override
507
  public boolean equals(Object that) {
508
    if (that == null)
509
      return false;
510
    if (that instanceof PurchaseReturn)
511
      return this.equals((PurchaseReturn)that);
512
    return false;
513
  }
514
 
515
  public boolean equals(PurchaseReturn that) {
516
    if (that == null)
517
      return false;
518
 
519
    boolean this_present_id = true;
520
    boolean that_present_id = true;
521
    if (this_present_id || that_present_id) {
522
      if (!(this_present_id && that_present_id))
523
        return false;
524
      if (this.id != that.id)
525
        return false;
526
    }
527
 
528
    boolean this_present_vendorId = true;
529
    boolean that_present_vendorId = true;
530
    if (this_present_vendorId || that_present_vendorId) {
531
      if (!(this_present_vendorId && that_present_vendorId))
532
        return false;
533
      if (this.vendorId != that.vendorId)
534
        return false;
535
    }
536
 
537
    boolean this_present_amount = true;
538
    boolean that_present_amount = true;
539
    if (this_present_amount || that_present_amount) {
540
      if (!(this_present_amount && that_present_amount))
541
        return false;
542
      if (this.amount != that.amount)
543
        return false;
544
    }
545
 
546
    boolean this_present_returnTimestamp = true;
547
    boolean that_present_returnTimestamp = true;
548
    if (this_present_returnTimestamp || that_present_returnTimestamp) {
549
      if (!(this_present_returnTimestamp && that_present_returnTimestamp))
550
        return false;
551
      if (this.returnTimestamp != that.returnTimestamp)
552
        return false;
553
    }
554
 
555
    boolean this_present_isSettled = true;
556
    boolean that_present_isSettled = true;
557
    if (this_present_isSettled || that_present_isSettled) {
558
      if (!(this_present_isSettled && that_present_isSettled))
559
        return false;
560
      if (this.isSettled != that.isSettled)
561
        return false;
562
    }
563
 
6821 amar.kumar 564
    boolean this_present_type = true && this.isSetType();
565
    boolean that_present_type = true && that.isSetType();
566
    if (this_present_type || that_present_type) {
567
      if (!(this_present_type && that_present_type))
568
        return false;
569
      if (!this.type.equals(that.type))
570
        return false;
571
    }
572
 
10864 manish.sha 573
    boolean this_present_returnInventoryType = true && this.isSetReturnInventoryType();
574
    boolean that_present_returnInventoryType = true && that.isSetReturnInventoryType();
575
    if (this_present_returnInventoryType || that_present_returnInventoryType) {
576
      if (!(this_present_returnInventoryType && that_present_returnInventoryType))
577
        return false;
578
      if (!this.returnInventoryType.equals(that.returnInventoryType))
579
        return false;
580
    }
581
 
6467 amar.kumar 582
    return true;
583
  }
584
 
585
  @Override
586
  public int hashCode() {
587
    return 0;
588
  }
589
 
590
  public int compareTo(PurchaseReturn other) {
591
    if (!getClass().equals(other.getClass())) {
592
      return getClass().getName().compareTo(other.getClass().getName());
593
    }
594
 
595
    int lastComparison = 0;
596
    PurchaseReturn typedOther = (PurchaseReturn)other;
597
 
598
    lastComparison = Boolean.valueOf(isSetId()).compareTo(typedOther.isSetId());
599
    if (lastComparison != 0) {
600
      return lastComparison;
601
    }
602
    if (isSetId()) {
603
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, typedOther.id);
604
      if (lastComparison != 0) {
605
        return lastComparison;
606
      }
607
    }
608
    lastComparison = Boolean.valueOf(isSetVendorId()).compareTo(typedOther.isSetVendorId());
609
    if (lastComparison != 0) {
610
      return lastComparison;
611
    }
612
    if (isSetVendorId()) {
613
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.vendorId, typedOther.vendorId);
614
      if (lastComparison != 0) {
615
        return lastComparison;
616
      }
617
    }
618
    lastComparison = Boolean.valueOf(isSetAmount()).compareTo(typedOther.isSetAmount());
619
    if (lastComparison != 0) {
620
      return lastComparison;
621
    }
622
    if (isSetAmount()) {
623
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.amount, typedOther.amount);
624
      if (lastComparison != 0) {
625
        return lastComparison;
626
      }
627
    }
628
    lastComparison = Boolean.valueOf(isSetReturnTimestamp()).compareTo(typedOther.isSetReturnTimestamp());
629
    if (lastComparison != 0) {
630
      return lastComparison;
631
    }
632
    if (isSetReturnTimestamp()) {
633
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.returnTimestamp, typedOther.returnTimestamp);
634
      if (lastComparison != 0) {
635
        return lastComparison;
636
      }
637
    }
638
    lastComparison = Boolean.valueOf(isSetIsSettled()).compareTo(typedOther.isSetIsSettled());
639
    if (lastComparison != 0) {
640
      return lastComparison;
641
    }
642
    if (isSetIsSettled()) {
643
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.isSettled, typedOther.isSettled);
644
      if (lastComparison != 0) {
645
        return lastComparison;
646
      }
647
    }
6821 amar.kumar 648
    lastComparison = Boolean.valueOf(isSetType()).compareTo(typedOther.isSetType());
649
    if (lastComparison != 0) {
650
      return lastComparison;
651
    }
652
    if (isSetType()) {
653
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.type, typedOther.type);
654
      if (lastComparison != 0) {
655
        return lastComparison;
656
      }
657
    }
10864 manish.sha 658
    lastComparison = Boolean.valueOf(isSetReturnInventoryType()).compareTo(typedOther.isSetReturnInventoryType());
659
    if (lastComparison != 0) {
660
      return lastComparison;
661
    }
662
    if (isSetReturnInventoryType()) {
663
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.returnInventoryType, typedOther.returnInventoryType);
664
      if (lastComparison != 0) {
665
        return lastComparison;
666
      }
667
    }
6467 amar.kumar 668
    return 0;
669
  }
670
 
671
  public _Fields fieldForId(int fieldId) {
672
    return _Fields.findByThriftId(fieldId);
673
  }
674
 
675
  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
676
    org.apache.thrift.protocol.TField field;
677
    iprot.readStructBegin();
678
    while (true)
679
    {
680
      field = iprot.readFieldBegin();
681
      if (field.type == org.apache.thrift.protocol.TType.STOP) { 
682
        break;
683
      }
684
      switch (field.id) {
685
        case 1: // ID
686
          if (field.type == org.apache.thrift.protocol.TType.I64) {
687
            this.id = iprot.readI64();
688
            setIdIsSet(true);
689
          } else { 
690
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
691
          }
692
          break;
693
        case 2: // VENDOR_ID
694
          if (field.type == org.apache.thrift.protocol.TType.I64) {
695
            this.vendorId = iprot.readI64();
696
            setVendorIdIsSet(true);
697
          } else { 
698
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
699
          }
700
          break;
701
        case 3: // AMOUNT
702
          if (field.type == org.apache.thrift.protocol.TType.I64) {
703
            this.amount = iprot.readI64();
704
            setAmountIsSet(true);
705
          } else { 
706
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
707
          }
708
          break;
709
        case 4: // RETURN_TIMESTAMP
710
          if (field.type == org.apache.thrift.protocol.TType.I64) {
711
            this.returnTimestamp = iprot.readI64();
712
            setReturnTimestampIsSet(true);
713
          } else { 
714
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
715
          }
716
          break;
717
        case 5: // IS_SETTLED
718
          if (field.type == org.apache.thrift.protocol.TType.BOOL) {
719
            this.isSettled = iprot.readBool();
720
            setIsSettledIsSet(true);
721
          } else { 
722
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
723
          }
724
          break;
6821 amar.kumar 725
        case 6: // TYPE
726
          if (field.type == org.apache.thrift.protocol.TType.I32) {
727
            this.type = PurchaseReturnType.findByValue(iprot.readI32());
728
          } else { 
729
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
730
          }
731
          break;
10864 manish.sha 732
        case 7: // RETURN_INVENTORY_TYPE
733
          if (field.type == org.apache.thrift.protocol.TType.I32) {
734
            this.returnInventoryType = PurchaseReturnInventoryType.findByValue(iprot.readI32());
735
          } else { 
736
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
737
          }
738
          break;
6467 amar.kumar 739
        default:
740
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
741
      }
742
      iprot.readFieldEnd();
743
    }
744
    iprot.readStructEnd();
745
    validate();
746
  }
747
 
748
  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
749
    validate();
750
 
751
    oprot.writeStructBegin(STRUCT_DESC);
752
    oprot.writeFieldBegin(ID_FIELD_DESC);
753
    oprot.writeI64(this.id);
754
    oprot.writeFieldEnd();
755
    oprot.writeFieldBegin(VENDOR_ID_FIELD_DESC);
756
    oprot.writeI64(this.vendorId);
757
    oprot.writeFieldEnd();
758
    oprot.writeFieldBegin(AMOUNT_FIELD_DESC);
759
    oprot.writeI64(this.amount);
760
    oprot.writeFieldEnd();
761
    oprot.writeFieldBegin(RETURN_TIMESTAMP_FIELD_DESC);
762
    oprot.writeI64(this.returnTimestamp);
763
    oprot.writeFieldEnd();
764
    oprot.writeFieldBegin(IS_SETTLED_FIELD_DESC);
765
    oprot.writeBool(this.isSettled);
766
    oprot.writeFieldEnd();
6821 amar.kumar 767
    if (this.type != null) {
768
      oprot.writeFieldBegin(TYPE_FIELD_DESC);
769
      oprot.writeI32(this.type.getValue());
770
      oprot.writeFieldEnd();
771
    }
10864 manish.sha 772
    if (this.returnInventoryType != null) {
773
      oprot.writeFieldBegin(RETURN_INVENTORY_TYPE_FIELD_DESC);
774
      oprot.writeI32(this.returnInventoryType.getValue());
775
      oprot.writeFieldEnd();
776
    }
6467 amar.kumar 777
    oprot.writeFieldStop();
778
    oprot.writeStructEnd();
779
  }
780
 
781
  @Override
782
  public String toString() {
783
    StringBuilder sb = new StringBuilder("PurchaseReturn(");
784
    boolean first = true;
785
 
786
    sb.append("id:");
787
    sb.append(this.id);
788
    first = false;
789
    if (!first) sb.append(", ");
790
    sb.append("vendorId:");
791
    sb.append(this.vendorId);
792
    first = false;
793
    if (!first) sb.append(", ");
794
    sb.append("amount:");
795
    sb.append(this.amount);
796
    first = false;
797
    if (!first) sb.append(", ");
798
    sb.append("returnTimestamp:");
799
    sb.append(this.returnTimestamp);
800
    first = false;
801
    if (!first) sb.append(", ");
802
    sb.append("isSettled:");
803
    sb.append(this.isSettled);
804
    first = false;
6821 amar.kumar 805
    if (!first) sb.append(", ");
806
    sb.append("type:");
807
    if (this.type == null) {
808
      sb.append("null");
809
    } else {
810
      sb.append(this.type);
811
    }
812
    first = false;
10864 manish.sha 813
    if (!first) sb.append(", ");
814
    sb.append("returnInventoryType:");
815
    if (this.returnInventoryType == null) {
816
      sb.append("null");
817
    } else {
818
      sb.append(this.returnInventoryType);
819
    }
820
    first = false;
6467 amar.kumar 821
    sb.append(")");
822
    return sb.toString();
823
  }
824
 
825
  public void validate() throws org.apache.thrift.TException {
826
    // check for required fields
827
  }
828
 
829
  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
830
    try {
831
      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
832
    } catch (org.apache.thrift.TException te) {
833
      throw new java.io.IOException(te);
834
    }
835
  }
836
 
837
  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
838
    try {
839
      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
840
      __isset_bit_vector = new BitSet(1);
841
      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
842
    } catch (org.apache.thrift.TException te) {
843
      throw new java.io.IOException(te);
844
    }
845
  }
846
 
847
}
848