Subversion Repositories SmartDukaan

Rev

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