Subversion Repositories SmartDukaan

Rev

Rev 7410 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 7410 Rev 11219
Line 28... Line 28...
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);
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);
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);
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);
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
  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);
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);
-
 
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);
33
 
34
 
34
  private long id; // required
35
  private long id; // required
35
  private String invoiceNumber; // required
36
  private String invoiceNumber; // required
36
  private long date; // required
37
  private long date; // required
37
  private long numItems; // required
38
  private long numItems; // required
38
  private String receivedFrom; // required
39
  private String receivedFrom; // required
39
  private long supplierId; // required
40
  private long supplierId; // required
40
  private long warehouseId; // required
41
  private long warehouseId; // required
-
 
42
  private long invoiceDate; // required
41
 
43
 
42
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
44
  /** 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 {
45
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
44
    ID((short)1, "id"),
46
    ID((short)1, "id"),
45
    INVOICE_NUMBER((short)2, "invoiceNumber"),
47
    INVOICE_NUMBER((short)2, "invoiceNumber"),
46
    DATE((short)3, "date"),
48
    DATE((short)3, "date"),
47
    NUM_ITEMS((short)4, "numItems"),
49
    NUM_ITEMS((short)4, "numItems"),
48
    RECEIVED_FROM((short)5, "receivedFrom"),
50
    RECEIVED_FROM((short)5, "receivedFrom"),
49
    SUPPLIER_ID((short)6, "supplierId"),
51
    SUPPLIER_ID((short)6, "supplierId"),
50
    WAREHOUSE_ID((short)7, "warehouseId");
52
    WAREHOUSE_ID((short)7, "warehouseId"),
-
 
53
    INVOICE_DATE((short)8, "invoiceDate");
51
 
54
 
52
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
55
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
53
 
56
 
54
    static {
57
    static {
55
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
58
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
Line 74... Line 77...
74
          return RECEIVED_FROM;
77
          return RECEIVED_FROM;
75
        case 6: // SUPPLIER_ID
78
        case 6: // SUPPLIER_ID
76
          return SUPPLIER_ID;
79
          return SUPPLIER_ID;
77
        case 7: // WAREHOUSE_ID
80
        case 7: // WAREHOUSE_ID
78
          return WAREHOUSE_ID;
81
          return WAREHOUSE_ID;
-
 
82
        case 8: // INVOICE_DATE
-
 
83
          return INVOICE_DATE;
79
        default:
84
        default:
80
          return null;
85
          return null;
81
      }
86
      }
82
    }
87
    }
83
 
88
 
Line 119... Line 124...
119
  private static final int __ID_ISSET_ID = 0;
124
  private static final int __ID_ISSET_ID = 0;
120
  private static final int __DATE_ISSET_ID = 1;
125
  private static final int __DATE_ISSET_ID = 1;
121
  private static final int __NUMITEMS_ISSET_ID = 2;
126
  private static final int __NUMITEMS_ISSET_ID = 2;
122
  private static final int __SUPPLIERID_ISSET_ID = 3;
127
  private static final int __SUPPLIERID_ISSET_ID = 3;
123
  private static final int __WAREHOUSEID_ISSET_ID = 4;
128
  private static final int __WAREHOUSEID_ISSET_ID = 4;
-
 
129
  private static final int __INVOICEDATE_ISSET_ID = 5;
124
  private BitSet __isset_bit_vector = new BitSet(5);
130
  private BitSet __isset_bit_vector = new BitSet(6);
125
 
131
 
126
  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
132
  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
127
  static {
133
  static {
128
    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
134
    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, 
135
    tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
Line 138... Line 144...
138
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
144
        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, 
145
    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)));
146
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
141
    tmpMap.put(_Fields.WAREHOUSE_ID, new org.apache.thrift.meta_data.FieldMetaData("warehouseId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
147
    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)));
148
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
-
 
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)));
143
    metaDataMap = Collections.unmodifiableMap(tmpMap);
151
    metaDataMap = Collections.unmodifiableMap(tmpMap);
144
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Invoice.class, metaDataMap);
152
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Invoice.class, metaDataMap);
145
  }
153
  }
146
 
154
 
147
  public Invoice() {
155
  public Invoice() {
Line 152... Line 160...
152
    String invoiceNumber,
160
    String invoiceNumber,
153
    long date,
161
    long date,
154
    long numItems,
162
    long numItems,
155
    String receivedFrom,
163
    String receivedFrom,
156
    long supplierId,
164
    long supplierId,
157
    long warehouseId)
165
    long warehouseId,
-
 
166
    long invoiceDate)
158
  {
167
  {
159
    this();
168
    this();
160
    this.id = id;
169
    this.id = id;
161
    setIdIsSet(true);
170
    setIdIsSet(true);
162
    this.invoiceNumber = invoiceNumber;
171
    this.invoiceNumber = invoiceNumber;
Line 167... Line 176...
167
    this.receivedFrom = receivedFrom;
176
    this.receivedFrom = receivedFrom;
168
    this.supplierId = supplierId;
177
    this.supplierId = supplierId;
169
    setSupplierIdIsSet(true);
178
    setSupplierIdIsSet(true);
170
    this.warehouseId = warehouseId;
179
    this.warehouseId = warehouseId;
171
    setWarehouseIdIsSet(true);
180
    setWarehouseIdIsSet(true);
-
 
181
    this.invoiceDate = invoiceDate;
-
 
182
    setInvoiceDateIsSet(true);
172
  }
183
  }
173
 
184
 
174
  /**
185
  /**
175
   * Performs a deep copy on <i>other</i>.
186
   * Performs a deep copy on <i>other</i>.
176
   */
187
   */
Line 186... Line 197...
186
    if (other.isSetReceivedFrom()) {
197
    if (other.isSetReceivedFrom()) {
187
      this.receivedFrom = other.receivedFrom;
198
      this.receivedFrom = other.receivedFrom;
188
    }
199
    }
189
    this.supplierId = other.supplierId;
200
    this.supplierId = other.supplierId;
190
    this.warehouseId = other.warehouseId;
201
    this.warehouseId = other.warehouseId;
-
 
202
    this.invoiceDate = other.invoiceDate;
191
  }
203
  }
192
 
204
 
193
  public Invoice deepCopy() {
205
  public Invoice deepCopy() {
194
    return new Invoice(this);
206
    return new Invoice(this);
195
  }
207
  }
Line 206... Line 218...
206
    this.receivedFrom = null;
218
    this.receivedFrom = null;
207
    setSupplierIdIsSet(false);
219
    setSupplierIdIsSet(false);
208
    this.supplierId = 0;
220
    this.supplierId = 0;
209
    setWarehouseIdIsSet(false);
221
    setWarehouseIdIsSet(false);
210
    this.warehouseId = 0;
222
    this.warehouseId = 0;
-
 
223
    setInvoiceDateIsSet(false);
-
 
224
    this.invoiceDate = 0;
211
  }
225
  }
212
 
226
 
213
  public long getId() {
227
  public long getId() {
214
    return this.id;
228
    return this.id;
215
  }
229
  }
Line 364... Line 378...
364
 
378
 
365
  public void setWarehouseIdIsSet(boolean value) {
379
  public void setWarehouseIdIsSet(boolean value) {
366
    __isset_bit_vector.set(__WAREHOUSEID_ISSET_ID, value);
380
    __isset_bit_vector.set(__WAREHOUSEID_ISSET_ID, value);
367
  }
381
  }
368
 
382
 
-
 
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
 
369
  public void setFieldValue(_Fields field, Object value) {
405
  public void setFieldValue(_Fields field, Object value) {
370
    switch (field) {
406
    switch (field) {
371
    case ID:
407
    case ID:
372
      if (value == null) {
408
      if (value == null) {
373
        unsetId();
409
        unsetId();
Line 422... Line 458...
422
      } else {
458
      } else {
423
        setWarehouseId((Long)value);
459
        setWarehouseId((Long)value);
424
      }
460
      }
425
      break;
461
      break;
426
 
462
 
-
 
463
    case INVOICE_DATE:
-
 
464
      if (value == null) {
-
 
465
        unsetInvoiceDate();
-
 
466
      } else {
-
 
467
        setInvoiceDate((Long)value);
-
 
468
      }
-
 
469
      break;
-
 
470
 
427
    }
471
    }
428
  }
472
  }
429
 
473
 
430
  public Object getFieldValue(_Fields field) {
474
  public Object getFieldValue(_Fields field) {
431
    switch (field) {
475
    switch (field) {
Line 448... Line 492...
448
      return Long.valueOf(getSupplierId());
492
      return Long.valueOf(getSupplierId());
449
 
493
 
450
    case WAREHOUSE_ID:
494
    case WAREHOUSE_ID:
451
      return Long.valueOf(getWarehouseId());
495
      return Long.valueOf(getWarehouseId());
452
 
496
 
-
 
497
    case INVOICE_DATE:
-
 
498
      return Long.valueOf(getInvoiceDate());
-
 
499
 
453
    }
500
    }
454
    throw new IllegalStateException();
501
    throw new IllegalStateException();
455
  }
502
  }
456
 
503
 
457
  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
504
  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
Line 473... Line 520...
473
      return isSetReceivedFrom();
520
      return isSetReceivedFrom();
474
    case SUPPLIER_ID:
521
    case SUPPLIER_ID:
475
      return isSetSupplierId();
522
      return isSetSupplierId();
476
    case WAREHOUSE_ID:
523
    case WAREHOUSE_ID:
477
      return isSetWarehouseId();
524
      return isSetWarehouseId();
-
 
525
    case INVOICE_DATE:
-
 
526
      return isSetInvoiceDate();
478
    }
527
    }
479
    throw new IllegalStateException();
528
    throw new IllegalStateException();
480
  }
529
  }
481
 
530
 
482
  @Override
531
  @Override
Line 553... Line 602...
553
        return false;
602
        return false;
554
      if (this.warehouseId != that.warehouseId)
603
      if (this.warehouseId != that.warehouseId)
555
        return false;
604
        return false;
556
    }
605
    }
557
 
606
 
-
 
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
 
558
    return true;
616
    return true;
559
  }
617
  }
560
 
618
 
561
  @Override
619
  @Override
562
  public int hashCode() {
620
  public int hashCode() {
Line 639... Line 697...
639
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.warehouseId, typedOther.warehouseId);
697
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.warehouseId, typedOther.warehouseId);
640
      if (lastComparison != 0) {
698
      if (lastComparison != 0) {
641
        return lastComparison;
699
        return lastComparison;
642
      }
700
      }
643
    }
701
    }
-
 
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
    }
644
    return 0;
712
    return 0;
645
  }
713
  }
646
 
714
 
647
  public _Fields fieldForId(int fieldId) {
715
  public _Fields fieldForId(int fieldId) {
648
    return _Fields.findByThriftId(fieldId);
716
    return _Fields.findByThriftId(fieldId);
Line 710... Line 778...
710
            setWarehouseIdIsSet(true);
778
            setWarehouseIdIsSet(true);
711
          } else { 
779
          } else { 
712
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
780
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
713
          }
781
          }
714
          break;
782
          break;
-
 
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;
715
        default:
791
        default:
716
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
792
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
717
      }
793
      }
718
      iprot.readFieldEnd();
794
      iprot.readFieldEnd();
719
    }
795
    }
Line 748... Line 824...
748
    oprot.writeI64(this.supplierId);
824
    oprot.writeI64(this.supplierId);
749
    oprot.writeFieldEnd();
825
    oprot.writeFieldEnd();
750
    oprot.writeFieldBegin(WAREHOUSE_ID_FIELD_DESC);
826
    oprot.writeFieldBegin(WAREHOUSE_ID_FIELD_DESC);
751
    oprot.writeI64(this.warehouseId);
827
    oprot.writeI64(this.warehouseId);
752
    oprot.writeFieldEnd();
828
    oprot.writeFieldEnd();
-
 
829
    oprot.writeFieldBegin(INVOICE_DATE_FIELD_DESC);
-
 
830
    oprot.writeI64(this.invoiceDate);
-
 
831
    oprot.writeFieldEnd();
753
    oprot.writeFieldStop();
832
    oprot.writeFieldStop();
754
    oprot.writeStructEnd();
833
    oprot.writeStructEnd();
755
  }
834
  }
756
 
835
 
757
  @Override
836
  @Override
Line 792... Line 871...
792
    first = false;
871
    first = false;
793
    if (!first) sb.append(", ");
872
    if (!first) sb.append(", ");
794
    sb.append("warehouseId:");
873
    sb.append("warehouseId:");
795
    sb.append(this.warehouseId);
874
    sb.append(this.warehouseId);
796
    first = false;
875
    first = false;
-
 
876
    if (!first) sb.append(", ");
-
 
877
    sb.append("invoiceDate:");
-
 
878
    sb.append(this.invoiceDate);
-
 
879
    first = false;
797
    sb.append(")");
880
    sb.append(")");
798
    return sb.toString();
881
    return sb.toString();
799
  }
882
  }
800
 
883
 
801
  public void validate() throws org.apache.thrift.TException {
884
  public void validate() throws org.apache.thrift.TException {