Subversion Repositories SmartDukaan

Rev

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

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