Subversion Repositories SmartDukaan

Rev

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