Subversion Repositories SmartDukaan

Rev

Rev 6821 | Rev 9925 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6821 Rev 9416
Line 34... Line 34...
34
  private static final org.apache.thrift.protocol.TField TOTAL_COST_FIELD_DESC = new org.apache.thrift.protocol.TField("totalCost", org.apache.thrift.protocol.TType.DOUBLE, (short)9);
34
  private static final org.apache.thrift.protocol.TField TOTAL_COST_FIELD_DESC = new org.apache.thrift.protocol.TField("totalCost", org.apache.thrift.protocol.TType.DOUBLE, (short)9);
35
  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)10);
35
  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)10);
36
  private static final org.apache.thrift.protocol.TField REALIZED_COST_FIELD_DESC = new org.apache.thrift.protocol.TField("realizedCost", org.apache.thrift.protocol.TType.DOUBLE, (short)11);
36
  private static final org.apache.thrift.protocol.TField REALIZED_COST_FIELD_DESC = new org.apache.thrift.protocol.TField("realizedCost", org.apache.thrift.protocol.TType.DOUBLE, (short)11);
37
  private static final org.apache.thrift.protocol.TField REALIZED_FREIGHT_CHARGES_FIELD_DESC = new org.apache.thrift.protocol.TField("realizedFreightCharges", org.apache.thrift.protocol.TType.DOUBLE, (short)12);
37
  private static final org.apache.thrift.protocol.TField REALIZED_FREIGHT_CHARGES_FIELD_DESC = new org.apache.thrift.protocol.TField("realizedFreightCharges", org.apache.thrift.protocol.TType.DOUBLE, (short)12);
38
  private static final org.apache.thrift.protocol.TField TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("type", org.apache.thrift.protocol.TType.I32, (short)13);
38
  private static final org.apache.thrift.protocol.TField TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("type", org.apache.thrift.protocol.TType.I32, (short)13);
-
 
39
  private static final org.apache.thrift.protocol.TField TAX_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("taxType", org.apache.thrift.protocol.TType.I32, (short)14);
39
 
40
 
40
  private long id; // required
41
  private long id; // required
41
  private String poNumber; // required
42
  private String poNumber; // required
42
  private List<LineItem> lineitems; // required
43
  private List<LineItem> lineitems; // required
43
  private long supplierId; // required
44
  private long supplierId; // required
Line 48... Line 49...
48
  private double totalCost; // required
49
  private double totalCost; // required
49
  private double freightCharges; // required
50
  private double freightCharges; // required
50
  private double realizedCost; // required
51
  private double realizedCost; // required
51
  private double realizedFreightCharges; // required
52
  private double realizedFreightCharges; // required
52
  private POType type; // required
53
  private POType type; // required
-
 
54
  private TaxType taxType; // required
53
 
55
 
54
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
56
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
55
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
57
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
56
    ID((short)1, "id"),
58
    ID((short)1, "id"),
57
    PO_NUMBER((short)2, "poNumber"),
59
    PO_NUMBER((short)2, "poNumber"),
Line 71... Line 73...
71
    REALIZED_FREIGHT_CHARGES((short)12, "realizedFreightCharges"),
73
    REALIZED_FREIGHT_CHARGES((short)12, "realizedFreightCharges"),
72
    /**
74
    /**
73
     * 
75
     * 
74
     * @see POType
76
     * @see POType
75
     */
77
     */
76
    TYPE((short)13, "type");
78
    TYPE((short)13, "type"),
-
 
79
    /**
-
 
80
     * 
-
 
81
     * @see TaxType
-
 
82
     */
-
 
83
    TAX_TYPE((short)14, "taxType");
77
 
84
 
78
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
85
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
79
 
86
 
80
    static {
87
    static {
81
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
88
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
Line 112... Line 119...
112
          return REALIZED_COST;
119
          return REALIZED_COST;
113
        case 12: // REALIZED_FREIGHT_CHARGES
120
        case 12: // REALIZED_FREIGHT_CHARGES
114
          return REALIZED_FREIGHT_CHARGES;
121
          return REALIZED_FREIGHT_CHARGES;
115
        case 13: // TYPE
122
        case 13: // TYPE
116
          return TYPE;
123
          return TYPE;
-
 
124
        case 14: // TAX_TYPE
-
 
125
          return TAX_TYPE;
117
        default:
126
        default:
118
          return null;
127
          return null;
119
      }
128
      }
120
    }
129
    }
121
 
130
 
Line 193... Line 202...
193
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
202
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
194
    tmpMap.put(_Fields.REALIZED_FREIGHT_CHARGES, new org.apache.thrift.meta_data.FieldMetaData("realizedFreightCharges", org.apache.thrift.TFieldRequirementType.DEFAULT, 
203
    tmpMap.put(_Fields.REALIZED_FREIGHT_CHARGES, new org.apache.thrift.meta_data.FieldMetaData("realizedFreightCharges", org.apache.thrift.TFieldRequirementType.DEFAULT, 
195
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
204
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
196
    tmpMap.put(_Fields.TYPE, new org.apache.thrift.meta_data.FieldMetaData("type", org.apache.thrift.TFieldRequirementType.DEFAULT, 
205
    tmpMap.put(_Fields.TYPE, new org.apache.thrift.meta_data.FieldMetaData("type", org.apache.thrift.TFieldRequirementType.DEFAULT, 
197
        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, POType.class)));
206
        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, POType.class)));
-
 
207
    tmpMap.put(_Fields.TAX_TYPE, new org.apache.thrift.meta_data.FieldMetaData("taxType", org.apache.thrift.TFieldRequirementType.DEFAULT, 
-
 
208
        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TaxType.class)));
198
    metaDataMap = Collections.unmodifiableMap(tmpMap);
209
    metaDataMap = Collections.unmodifiableMap(tmpMap);
199
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(PurchaseOrder.class, metaDataMap);
210
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(PurchaseOrder.class, metaDataMap);
200
  }
211
  }
201
 
212
 
202
  public PurchaseOrder() {
213
  public PurchaseOrder() {
Line 213... Line 224...
213
    long updatedAt,
224
    long updatedAt,
214
    double totalCost,
225
    double totalCost,
215
    double freightCharges,
226
    double freightCharges,
216
    double realizedCost,
227
    double realizedCost,
217
    double realizedFreightCharges,
228
    double realizedFreightCharges,
218
    POType type)
229
    POType type,
-
 
230
    TaxType taxType)
219
  {
231
  {
220
    this();
232
    this();
221
    this.id = id;
233
    this.id = id;
222
    setIdIsSet(true);
234
    setIdIsSet(true);
223
    this.poNumber = poNumber;
235
    this.poNumber = poNumber;
Line 238... Line 250...
238
    this.realizedCost = realizedCost;
250
    this.realizedCost = realizedCost;
239
    setRealizedCostIsSet(true);
251
    setRealizedCostIsSet(true);
240
    this.realizedFreightCharges = realizedFreightCharges;
252
    this.realizedFreightCharges = realizedFreightCharges;
241
    setRealizedFreightChargesIsSet(true);
253
    setRealizedFreightChargesIsSet(true);
242
    this.type = type;
254
    this.type = type;
-
 
255
    this.taxType = taxType;
243
  }
256
  }
244
 
257
 
245
  /**
258
  /**
246
   * Performs a deep copy on <i>other</i>.
259
   * Performs a deep copy on <i>other</i>.
247
   */
260
   */
Line 271... Line 284...
271
    this.realizedCost = other.realizedCost;
284
    this.realizedCost = other.realizedCost;
272
    this.realizedFreightCharges = other.realizedFreightCharges;
285
    this.realizedFreightCharges = other.realizedFreightCharges;
273
    if (other.isSetType()) {
286
    if (other.isSetType()) {
274
      this.type = other.type;
287
      this.type = other.type;
275
    }
288
    }
-
 
289
    if (other.isSetTaxType()) {
-
 
290
      this.taxType = other.taxType;
-
 
291
    }
276
  }
292
  }
277
 
293
 
278
  public PurchaseOrder deepCopy() {
294
  public PurchaseOrder deepCopy() {
279
    return new PurchaseOrder(this);
295
    return new PurchaseOrder(this);
280
  }
296
  }
Line 301... Line 317...
301
    setRealizedCostIsSet(false);
317
    setRealizedCostIsSet(false);
302
    this.realizedCost = 0.0;
318
    this.realizedCost = 0.0;
303
    setRealizedFreightChargesIsSet(false);
319
    setRealizedFreightChargesIsSet(false);
304
    this.realizedFreightCharges = 0.0;
320
    this.realizedFreightCharges = 0.0;
305
    this.type = null;
321
    this.type = null;
-
 
322
    this.taxType = null;
306
  }
323
  }
307
 
324
 
308
  public long getId() {
325
  public long getId() {
309
    return this.id;
326
    return this.id;
310
  }
327
  }
Line 624... Line 641...
624
    if (!value) {
641
    if (!value) {
625
      this.type = null;
642
      this.type = null;
626
    }
643
    }
627
  }
644
  }
628
 
645
 
-
 
646
  /**
-
 
647
   * 
-
 
648
   * @see TaxType
-
 
649
   */
-
 
650
  public TaxType getTaxType() {
-
 
651
    return this.taxType;
-
 
652
  }
-
 
653
 
-
 
654
  /**
-
 
655
   * 
-
 
656
   * @see TaxType
-
 
657
   */
-
 
658
  public void setTaxType(TaxType taxType) {
-
 
659
    this.taxType = taxType;
-
 
660
  }
-
 
661
 
-
 
662
  public void unsetTaxType() {
-
 
663
    this.taxType = null;
-
 
664
  }
-
 
665
 
-
 
666
  /** Returns true if field taxType is set (has been assigned a value) and false otherwise */
-
 
667
  public boolean isSetTaxType() {
-
 
668
    return this.taxType != null;
-
 
669
  }
-
 
670
 
-
 
671
  public void setTaxTypeIsSet(boolean value) {
-
 
672
    if (!value) {
-
 
673
      this.taxType = null;
-
 
674
    }
-
 
675
  }
-
 
676
 
629
  public void setFieldValue(_Fields field, Object value) {
677
  public void setFieldValue(_Fields field, Object value) {
630
    switch (field) {
678
    switch (field) {
631
    case ID:
679
    case ID:
632
      if (value == null) {
680
      if (value == null) {
633
        unsetId();
681
        unsetId();
Line 730... Line 778...
730
      } else {
778
      } else {
731
        setType((POType)value);
779
        setType((POType)value);
732
      }
780
      }
733
      break;
781
      break;
734
 
782
 
-
 
783
    case TAX_TYPE:
-
 
784
      if (value == null) {
-
 
785
        unsetTaxType();
-
 
786
      } else {
-
 
787
        setTaxType((TaxType)value);
-
 
788
      }
-
 
789
      break;
-
 
790
 
735
    }
791
    }
736
  }
792
  }
737
 
793
 
738
  public Object getFieldValue(_Fields field) {
794
  public Object getFieldValue(_Fields field) {
739
    switch (field) {
795
    switch (field) {
Line 774... Line 830...
774
      return Double.valueOf(getRealizedFreightCharges());
830
      return Double.valueOf(getRealizedFreightCharges());
775
 
831
 
776
    case TYPE:
832
    case TYPE:
777
      return getType();
833
      return getType();
778
 
834
 
-
 
835
    case TAX_TYPE:
-
 
836
      return getTaxType();
-
 
837
 
779
    }
838
    }
780
    throw new IllegalStateException();
839
    throw new IllegalStateException();
781
  }
840
  }
782
 
841
 
783
  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
842
  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
Line 811... Line 870...
811
      return isSetRealizedCost();
870
      return isSetRealizedCost();
812
    case REALIZED_FREIGHT_CHARGES:
871
    case REALIZED_FREIGHT_CHARGES:
813
      return isSetRealizedFreightCharges();
872
      return isSetRealizedFreightCharges();
814
    case TYPE:
873
    case TYPE:
815
      return isSetType();
874
      return isSetType();
-
 
875
    case TAX_TYPE:
-
 
876
      return isSetTaxType();
816
    }
877
    }
817
    throw new IllegalStateException();
878
    throw new IllegalStateException();
818
  }
879
  }
819
 
880
 
820
  @Override
881
  @Override
Line 945... Line 1006...
945
        return false;
1006
        return false;
946
      if (!this.type.equals(that.type))
1007
      if (!this.type.equals(that.type))
947
        return false;
1008
        return false;
948
    }
1009
    }
949
 
1010
 
-
 
1011
    boolean this_present_taxType = true && this.isSetTaxType();
-
 
1012
    boolean that_present_taxType = true && that.isSetTaxType();
-
 
1013
    if (this_present_taxType || that_present_taxType) {
-
 
1014
      if (!(this_present_taxType && that_present_taxType))
-
 
1015
        return false;
-
 
1016
      if (!this.taxType.equals(that.taxType))
-
 
1017
        return false;
-
 
1018
    }
-
 
1019
 
950
    return true;
1020
    return true;
951
  }
1021
  }
952
 
1022
 
953
  @Override
1023
  @Override
954
  public int hashCode() {
1024
  public int hashCode() {
Line 1091... Line 1161...
1091
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.type, typedOther.type);
1161
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.type, typedOther.type);
1092
      if (lastComparison != 0) {
1162
      if (lastComparison != 0) {
1093
        return lastComparison;
1163
        return lastComparison;
1094
      }
1164
      }
1095
    }
1165
    }
-
 
1166
    lastComparison = Boolean.valueOf(isSetTaxType()).compareTo(typedOther.isSetTaxType());
-
 
1167
    if (lastComparison != 0) {
-
 
1168
      return lastComparison;
-
 
1169
    }
-
 
1170
    if (isSetTaxType()) {
-
 
1171
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.taxType, typedOther.taxType);
-
 
1172
      if (lastComparison != 0) {
-
 
1173
        return lastComparison;
-
 
1174
      }
-
 
1175
    }
1096
    return 0;
1176
    return 0;
1097
  }
1177
  }
1098
 
1178
 
1099
  public _Fields fieldForId(int fieldId) {
1179
  public _Fields fieldForId(int fieldId) {
1100
    return _Fields.findByThriftId(fieldId);
1180
    return _Fields.findByThriftId(fieldId);
Line 1219... Line 1299...
1219
            this.type = POType.findByValue(iprot.readI32());
1299
            this.type = POType.findByValue(iprot.readI32());
1220
          } else { 
1300
          } else { 
1221
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1301
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1222
          }
1302
          }
1223
          break;
1303
          break;
-
 
1304
        case 14: // TAX_TYPE
-
 
1305
          if (field.type == org.apache.thrift.protocol.TType.I32) {
-
 
1306
            this.taxType = TaxType.findByValue(iprot.readI32());
-
 
1307
          } else { 
-
 
1308
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
-
 
1309
          }
-
 
1310
          break;
1224
        default:
1311
        default:
1225
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1312
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1226
      }
1313
      }
1227
      iprot.readFieldEnd();
1314
      iprot.readFieldEnd();
1228
    }
1315
    }
Line 1286... Line 1373...
1286
    if (this.type != null) {
1373
    if (this.type != null) {
1287
      oprot.writeFieldBegin(TYPE_FIELD_DESC);
1374
      oprot.writeFieldBegin(TYPE_FIELD_DESC);
1288
      oprot.writeI32(this.type.getValue());
1375
      oprot.writeI32(this.type.getValue());
1289
      oprot.writeFieldEnd();
1376
      oprot.writeFieldEnd();
1290
    }
1377
    }
-
 
1378
    if (this.taxType != null) {
-
 
1379
      oprot.writeFieldBegin(TAX_TYPE_FIELD_DESC);
-
 
1380
      oprot.writeI32(this.taxType.getValue());
-
 
1381
      oprot.writeFieldEnd();
-
 
1382
    }
1291
    oprot.writeFieldStop();
1383
    oprot.writeFieldStop();
1292
    oprot.writeStructEnd();
1384
    oprot.writeStructEnd();
1293
  }
1385
  }
1294
 
1386
 
1295
  @Override
1387
  @Override
Line 1362... Line 1454...
1362
      sb.append("null");
1454
      sb.append("null");
1363
    } else {
1455
    } else {
1364
      sb.append(this.type);
1456
      sb.append(this.type);
1365
    }
1457
    }
1366
    first = false;
1458
    first = false;
-
 
1459
    if (!first) sb.append(", ");
-
 
1460
    sb.append("taxType:");
-
 
1461
    if (this.taxType == null) {
-
 
1462
      sb.append("null");
-
 
1463
    } else {
-
 
1464
      sb.append(this.taxType);
-
 
1465
    }
-
 
1466
    first = false;
1367
    sb.append(")");
1467
    sb.append(")");
1368
    return sb.toString();
1468
    return sb.toString();
1369
  }
1469
  }
1370
 
1470
 
1371
  public void validate() throws org.apache.thrift.TException {
1471
  public void validate() throws org.apache.thrift.TException {