Subversion Repositories SmartDukaan

Rev

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

Rev 4496 Rev 11801
Line 26... Line 26...
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);
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 PO_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("poId", org.apache.thrift.protocol.TType.I64, (short)2);
27
  private static final org.apache.thrift.protocol.TField PO_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("poId", org.apache.thrift.protocol.TType.I64, (short)2);
28
  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)3);
28
  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)3);
29
  private static final org.apache.thrift.protocol.TField RECEIVED_ON_FIELD_DESC = new org.apache.thrift.protocol.TField("receivedOn", org.apache.thrift.protocol.TType.I64, (short)4);
29
  private static final org.apache.thrift.protocol.TField RECEIVED_ON_FIELD_DESC = new org.apache.thrift.protocol.TField("receivedOn", org.apache.thrift.protocol.TType.I64, (short)4);
30
  private static final org.apache.thrift.protocol.TField FREIGHT_CHARGES_FIELD_DESC = new org.apache.thrift.protocol.TField("freightCharges", org.apache.thrift.protocol.TType.DOUBLE, (short)5);
30
  private static final org.apache.thrift.protocol.TField FREIGHT_CHARGES_FIELD_DESC = new org.apache.thrift.protocol.TField("freightCharges", org.apache.thrift.protocol.TType.DOUBLE, (short)5);
-
 
31
  private static final org.apache.thrift.protocol.TField PURCHASE_COMMENTS_FIELD_DESC = new org.apache.thrift.protocol.TField("purchaseComments", org.apache.thrift.protocol.TType.STRING, (short)6);
31
 
32
 
32
  private long id; // required
33
  private long id; // required
33
  private long poId; // required
34
  private long poId; // required
34
  private String invoiceNumber; // required
35
  private String invoiceNumber; // required
35
  private long receivedOn; // required
36
  private long receivedOn; // required
36
  private double freightCharges; // required
37
  private double freightCharges; // required
-
 
38
  private String purchaseComments; // required
37
 
39
 
38
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
40
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
39
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
41
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
40
    ID((short)1, "id"),
42
    ID((short)1, "id"),
41
    PO_ID((short)2, "poId"),
43
    PO_ID((short)2, "poId"),
42
    INVOICE_NUMBER((short)3, "invoiceNumber"),
44
    INVOICE_NUMBER((short)3, "invoiceNumber"),
43
    RECEIVED_ON((short)4, "receivedOn"),
45
    RECEIVED_ON((short)4, "receivedOn"),
44
    FREIGHT_CHARGES((short)5, "freightCharges");
46
    FREIGHT_CHARGES((short)5, "freightCharges"),
-
 
47
    PURCHASE_COMMENTS((short)6, "purchaseComments");
45
 
48
 
46
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
49
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
47
 
50
 
48
    static {
51
    static {
49
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
52
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
Line 64... Line 67...
64
          return INVOICE_NUMBER;
67
          return INVOICE_NUMBER;
65
        case 4: // RECEIVED_ON
68
        case 4: // RECEIVED_ON
66
          return RECEIVED_ON;
69
          return RECEIVED_ON;
67
        case 5: // FREIGHT_CHARGES
70
        case 5: // FREIGHT_CHARGES
68
          return FREIGHT_CHARGES;
71
          return FREIGHT_CHARGES;
-
 
72
        case 6: // PURCHASE_COMMENTS
-
 
73
          return PURCHASE_COMMENTS;
69
        default:
74
        default:
70
          return null;
75
          return null;
71
      }
76
      }
72
    }
77
    }
73
 
78
 
Line 123... Line 128...
123
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
128
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
124
    tmpMap.put(_Fields.RECEIVED_ON, new org.apache.thrift.meta_data.FieldMetaData("receivedOn", org.apache.thrift.TFieldRequirementType.DEFAULT, 
129
    tmpMap.put(_Fields.RECEIVED_ON, new org.apache.thrift.meta_data.FieldMetaData("receivedOn", org.apache.thrift.TFieldRequirementType.DEFAULT, 
125
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
130
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
126
    tmpMap.put(_Fields.FREIGHT_CHARGES, new org.apache.thrift.meta_data.FieldMetaData("freightCharges", org.apache.thrift.TFieldRequirementType.DEFAULT, 
131
    tmpMap.put(_Fields.FREIGHT_CHARGES, new org.apache.thrift.meta_data.FieldMetaData("freightCharges", org.apache.thrift.TFieldRequirementType.DEFAULT, 
127
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
132
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
-
 
133
    tmpMap.put(_Fields.PURCHASE_COMMENTS, new org.apache.thrift.meta_data.FieldMetaData("purchaseComments", org.apache.thrift.TFieldRequirementType.DEFAULT, 
-
 
134
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
128
    metaDataMap = Collections.unmodifiableMap(tmpMap);
135
    metaDataMap = Collections.unmodifiableMap(tmpMap);
129
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Purchase.class, metaDataMap);
136
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Purchase.class, metaDataMap);
130
  }
137
  }
131
 
138
 
132
  public Purchase() {
139
  public Purchase() {
Line 135... Line 142...
135
  public Purchase(
142
  public Purchase(
136
    long id,
143
    long id,
137
    long poId,
144
    long poId,
138
    String invoiceNumber,
145
    String invoiceNumber,
139
    long receivedOn,
146
    long receivedOn,
140
    double freightCharges)
147
    double freightCharges,
-
 
148
    String purchaseComments)
141
  {
149
  {
142
    this();
150
    this();
143
    this.id = id;
151
    this.id = id;
144
    setIdIsSet(true);
152
    setIdIsSet(true);
145
    this.poId = poId;
153
    this.poId = poId;
Line 147... Line 155...
147
    this.invoiceNumber = invoiceNumber;
155
    this.invoiceNumber = invoiceNumber;
148
    this.receivedOn = receivedOn;
156
    this.receivedOn = receivedOn;
149
    setReceivedOnIsSet(true);
157
    setReceivedOnIsSet(true);
150
    this.freightCharges = freightCharges;
158
    this.freightCharges = freightCharges;
151
    setFreightChargesIsSet(true);
159
    setFreightChargesIsSet(true);
-
 
160
    this.purchaseComments = purchaseComments;
152
  }
161
  }
153
 
162
 
154
  /**
163
  /**
155
   * Performs a deep copy on <i>other</i>.
164
   * Performs a deep copy on <i>other</i>.
156
   */
165
   */
Line 162... Line 171...
162
    if (other.isSetInvoiceNumber()) {
171
    if (other.isSetInvoiceNumber()) {
163
      this.invoiceNumber = other.invoiceNumber;
172
      this.invoiceNumber = other.invoiceNumber;
164
    }
173
    }
165
    this.receivedOn = other.receivedOn;
174
    this.receivedOn = other.receivedOn;
166
    this.freightCharges = other.freightCharges;
175
    this.freightCharges = other.freightCharges;
-
 
176
    if (other.isSetPurchaseComments()) {
-
 
177
      this.purchaseComments = other.purchaseComments;
-
 
178
    }
167
  }
179
  }
168
 
180
 
169
  public Purchase deepCopy() {
181
  public Purchase deepCopy() {
170
    return new Purchase(this);
182
    return new Purchase(this);
171
  }
183
  }
Line 179... Line 191...
179
    this.invoiceNumber = null;
191
    this.invoiceNumber = null;
180
    setReceivedOnIsSet(false);
192
    setReceivedOnIsSet(false);
181
    this.receivedOn = 0;
193
    this.receivedOn = 0;
182
    setFreightChargesIsSet(false);
194
    setFreightChargesIsSet(false);
183
    this.freightCharges = 0.0;
195
    this.freightCharges = 0.0;
-
 
196
    this.purchaseComments = null;
184
  }
197
  }
185
 
198
 
186
  public long getId() {
199
  public long getId() {
187
    return this.id;
200
    return this.id;
188
  }
201
  }
Line 292... Line 305...
292
 
305
 
293
  public void setFreightChargesIsSet(boolean value) {
306
  public void setFreightChargesIsSet(boolean value) {
294
    __isset_bit_vector.set(__FREIGHTCHARGES_ISSET_ID, value);
307
    __isset_bit_vector.set(__FREIGHTCHARGES_ISSET_ID, value);
295
  }
308
  }
296
 
309
 
-
 
310
  public String getPurchaseComments() {
-
 
311
    return this.purchaseComments;
-
 
312
  }
-
 
313
 
-
 
314
  public void setPurchaseComments(String purchaseComments) {
-
 
315
    this.purchaseComments = purchaseComments;
-
 
316
  }
-
 
317
 
-
 
318
  public void unsetPurchaseComments() {
-
 
319
    this.purchaseComments = null;
-
 
320
  }
-
 
321
 
-
 
322
  /** Returns true if field purchaseComments is set (has been assigned a value) and false otherwise */
-
 
323
  public boolean isSetPurchaseComments() {
-
 
324
    return this.purchaseComments != null;
-
 
325
  }
-
 
326
 
-
 
327
  public void setPurchaseCommentsIsSet(boolean value) {
-
 
328
    if (!value) {
-
 
329
      this.purchaseComments = null;
-
 
330
    }
-
 
331
  }
-
 
332
 
297
  public void setFieldValue(_Fields field, Object value) {
333
  public void setFieldValue(_Fields field, Object value) {
298
    switch (field) {
334
    switch (field) {
299
    case ID:
335
    case ID:
300
      if (value == null) {
336
      if (value == null) {
301
        unsetId();
337
        unsetId();
Line 334... Line 370...
334
      } else {
370
      } else {
335
        setFreightCharges((Double)value);
371
        setFreightCharges((Double)value);
336
      }
372
      }
337
      break;
373
      break;
338
 
374
 
-
 
375
    case PURCHASE_COMMENTS:
-
 
376
      if (value == null) {
-
 
377
        unsetPurchaseComments();
-
 
378
      } else {
-
 
379
        setPurchaseComments((String)value);
-
 
380
      }
-
 
381
      break;
-
 
382
 
339
    }
383
    }
340
  }
384
  }
341
 
385
 
342
  public Object getFieldValue(_Fields field) {
386
  public Object getFieldValue(_Fields field) {
343
    switch (field) {
387
    switch (field) {
Line 354... Line 398...
354
      return Long.valueOf(getReceivedOn());
398
      return Long.valueOf(getReceivedOn());
355
 
399
 
356
    case FREIGHT_CHARGES:
400
    case FREIGHT_CHARGES:
357
      return Double.valueOf(getFreightCharges());
401
      return Double.valueOf(getFreightCharges());
358
 
402
 
-
 
403
    case PURCHASE_COMMENTS:
-
 
404
      return getPurchaseComments();
-
 
405
 
359
    }
406
    }
360
    throw new IllegalStateException();
407
    throw new IllegalStateException();
361
  }
408
  }
362
 
409
 
363
  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
410
  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
Line 375... Line 422...
375
      return isSetInvoiceNumber();
422
      return isSetInvoiceNumber();
376
    case RECEIVED_ON:
423
    case RECEIVED_ON:
377
      return isSetReceivedOn();
424
      return isSetReceivedOn();
378
    case FREIGHT_CHARGES:
425
    case FREIGHT_CHARGES:
379
      return isSetFreightCharges();
426
      return isSetFreightCharges();
-
 
427
    case PURCHASE_COMMENTS:
-
 
428
      return isSetPurchaseComments();
380
    }
429
    }
381
    throw new IllegalStateException();
430
    throw new IllegalStateException();
382
  }
431
  }
383
 
432
 
384
  @Override
433
  @Override
Line 437... Line 486...
437
        return false;
486
        return false;
438
      if (this.freightCharges != that.freightCharges)
487
      if (this.freightCharges != that.freightCharges)
439
        return false;
488
        return false;
440
    }
489
    }
441
 
490
 
-
 
491
    boolean this_present_purchaseComments = true && this.isSetPurchaseComments();
-
 
492
    boolean that_present_purchaseComments = true && that.isSetPurchaseComments();
-
 
493
    if (this_present_purchaseComments || that_present_purchaseComments) {
-
 
494
      if (!(this_present_purchaseComments && that_present_purchaseComments))
-
 
495
        return false;
-
 
496
      if (!this.purchaseComments.equals(that.purchaseComments))
-
 
497
        return false;
-
 
498
    }
-
 
499
 
442
    return true;
500
    return true;
443
  }
501
  }
444
 
502
 
445
  @Override
503
  @Override
446
  public int hashCode() {
504
  public int hashCode() {
Line 503... Line 561...
503
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.freightCharges, typedOther.freightCharges);
561
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.freightCharges, typedOther.freightCharges);
504
      if (lastComparison != 0) {
562
      if (lastComparison != 0) {
505
        return lastComparison;
563
        return lastComparison;
506
      }
564
      }
507
    }
565
    }
-
 
566
    lastComparison = Boolean.valueOf(isSetPurchaseComments()).compareTo(typedOther.isSetPurchaseComments());
-
 
567
    if (lastComparison != 0) {
-
 
568
      return lastComparison;
-
 
569
    }
-
 
570
    if (isSetPurchaseComments()) {
-
 
571
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.purchaseComments, typedOther.purchaseComments);
-
 
572
      if (lastComparison != 0) {
-
 
573
        return lastComparison;
-
 
574
      }
-
 
575
    }
508
    return 0;
576
    return 0;
509
  }
577
  }
510
 
578
 
511
  public _Fields fieldForId(int fieldId) {
579
  public _Fields fieldForId(int fieldId) {
512
    return _Fields.findByThriftId(fieldId);
580
    return _Fields.findByThriftId(fieldId);
Line 559... Line 627...
559
            setFreightChargesIsSet(true);
627
            setFreightChargesIsSet(true);
560
          } else { 
628
          } else { 
561
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
629
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
562
          }
630
          }
563
          break;
631
          break;
-
 
632
        case 6: // PURCHASE_COMMENTS
-
 
633
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
-
 
634
            this.purchaseComments = iprot.readString();
-
 
635
          } else { 
-
 
636
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
-
 
637
          }
-
 
638
          break;
564
        default:
639
        default:
565
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
640
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
566
      }
641
      }
567
      iprot.readFieldEnd();
642
      iprot.readFieldEnd();
568
    }
643
    }
Line 589... Line 664...
589
    oprot.writeI64(this.receivedOn);
664
    oprot.writeI64(this.receivedOn);
590
    oprot.writeFieldEnd();
665
    oprot.writeFieldEnd();
591
    oprot.writeFieldBegin(FREIGHT_CHARGES_FIELD_DESC);
666
    oprot.writeFieldBegin(FREIGHT_CHARGES_FIELD_DESC);
592
    oprot.writeDouble(this.freightCharges);
667
    oprot.writeDouble(this.freightCharges);
593
    oprot.writeFieldEnd();
668
    oprot.writeFieldEnd();
-
 
669
    if (this.purchaseComments != null) {
-
 
670
      oprot.writeFieldBegin(PURCHASE_COMMENTS_FIELD_DESC);
-
 
671
      oprot.writeString(this.purchaseComments);
-
 
672
      oprot.writeFieldEnd();
-
 
673
    }
594
    oprot.writeFieldStop();
674
    oprot.writeFieldStop();
595
    oprot.writeStructEnd();
675
    oprot.writeStructEnd();
596
  }
676
  }
597
 
677
 
598
  @Override
678
  @Override
Line 621... Line 701...
621
    first = false;
701
    first = false;
622
    if (!first) sb.append(", ");
702
    if (!first) sb.append(", ");
623
    sb.append("freightCharges:");
703
    sb.append("freightCharges:");
624
    sb.append(this.freightCharges);
704
    sb.append(this.freightCharges);
625
    first = false;
705
    first = false;
-
 
706
    if (!first) sb.append(", ");
-
 
707
    sb.append("purchaseComments:");
-
 
708
    if (this.purchaseComments == null) {
-
 
709
      sb.append("null");
-
 
710
    } else {
-
 
711
      sb.append(this.purchaseComments);
-
 
712
    }
-
 
713
    first = false;
626
    sb.append(")");
714
    sb.append(")");
627
    return sb.toString();
715
    return sb.toString();
628
  }
716
  }
629
 
717
 
630
  public void validate() throws org.apache.thrift.TException {
718
  public void validate() throws org.apache.thrift.TException {