Subversion Repositories SmartDukaan

Rev

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

Rev 4496 Rev 6821
Line 33... Line 33...
33
  private static final org.apache.thrift.protocol.TField UPDATED_AT_FIELD_DESC = new org.apache.thrift.protocol.TField("updatedAt", org.apache.thrift.protocol.TType.I64, (short)8);
33
  private static final org.apache.thrift.protocol.TField UPDATED_AT_FIELD_DESC = new org.apache.thrift.protocol.TField("updatedAt", org.apache.thrift.protocol.TType.I64, (short)8);
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
 
39
 
39
  private long id; // required
40
  private long id; // required
40
  private String poNumber; // required
41
  private String poNumber; // required
41
  private List<LineItem> lineitems; // required
42
  private List<LineItem> lineitems; // required
42
  private long supplierId; // required
43
  private long supplierId; // required
Line 46... Line 47...
46
  private long updatedAt; // required
47
  private long updatedAt; // required
47
  private double totalCost; // required
48
  private double totalCost; // required
48
  private double freightCharges; // required
49
  private double freightCharges; // required
49
  private double realizedCost; // required
50
  private double realizedCost; // required
50
  private double realizedFreightCharges; // required
51
  private double realizedFreightCharges; // required
-
 
52
  private POType type; // required
51
 
53
 
52
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
54
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
53
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
55
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
54
    ID((short)1, "id"),
56
    ID((short)1, "id"),
55
    PO_NUMBER((short)2, "poNumber"),
57
    PO_NUMBER((short)2, "poNumber"),
Line 64... Line 66...
64
    CREATED_AT((short)7, "createdAt"),
66
    CREATED_AT((short)7, "createdAt"),
65
    UPDATED_AT((short)8, "updatedAt"),
67
    UPDATED_AT((short)8, "updatedAt"),
66
    TOTAL_COST((short)9, "totalCost"),
68
    TOTAL_COST((short)9, "totalCost"),
67
    FREIGHT_CHARGES((short)10, "freightCharges"),
69
    FREIGHT_CHARGES((short)10, "freightCharges"),
68
    REALIZED_COST((short)11, "realizedCost"),
70
    REALIZED_COST((short)11, "realizedCost"),
69
    REALIZED_FREIGHT_CHARGES((short)12, "realizedFreightCharges");
71
    REALIZED_FREIGHT_CHARGES((short)12, "realizedFreightCharges"),
-
 
72
    /**
-
 
73
     * 
-
 
74
     * @see POType
-
 
75
     */
-
 
76
    TYPE((short)13, "type");
70
 
77
 
71
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
78
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
72
 
79
 
73
    static {
80
    static {
74
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
81
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
Line 103... Line 110...
103
          return FREIGHT_CHARGES;
110
          return FREIGHT_CHARGES;
104
        case 11: // REALIZED_COST
111
        case 11: // REALIZED_COST
105
          return REALIZED_COST;
112
          return REALIZED_COST;
106
        case 12: // REALIZED_FREIGHT_CHARGES
113
        case 12: // REALIZED_FREIGHT_CHARGES
107
          return REALIZED_FREIGHT_CHARGES;
114
          return REALIZED_FREIGHT_CHARGES;
-
 
115
        case 13: // TYPE
-
 
116
          return TYPE;
108
        default:
117
        default:
109
          return null;
118
          return null;
110
      }
119
      }
111
    }
120
    }
112
 
121
 
Line 182... Line 191...
182
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
191
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
183
    tmpMap.put(_Fields.REALIZED_COST, new org.apache.thrift.meta_data.FieldMetaData("realizedCost", org.apache.thrift.TFieldRequirementType.DEFAULT, 
192
    tmpMap.put(_Fields.REALIZED_COST, new org.apache.thrift.meta_data.FieldMetaData("realizedCost", org.apache.thrift.TFieldRequirementType.DEFAULT, 
184
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
193
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
185
    tmpMap.put(_Fields.REALIZED_FREIGHT_CHARGES, new org.apache.thrift.meta_data.FieldMetaData("realizedFreightCharges", org.apache.thrift.TFieldRequirementType.DEFAULT, 
194
    tmpMap.put(_Fields.REALIZED_FREIGHT_CHARGES, new org.apache.thrift.meta_data.FieldMetaData("realizedFreightCharges", org.apache.thrift.TFieldRequirementType.DEFAULT, 
186
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
195
        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, 
-
 
197
        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, POType.class)));
187
    metaDataMap = Collections.unmodifiableMap(tmpMap);
198
    metaDataMap = Collections.unmodifiableMap(tmpMap);
188
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(PurchaseOrder.class, metaDataMap);
199
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(PurchaseOrder.class, metaDataMap);
189
  }
200
  }
190
 
201
 
191
  public PurchaseOrder() {
202
  public PurchaseOrder() {
Line 201... Line 212...
201
    long createdAt,
212
    long createdAt,
202
    long updatedAt,
213
    long updatedAt,
203
    double totalCost,
214
    double totalCost,
204
    double freightCharges,
215
    double freightCharges,
205
    double realizedCost,
216
    double realizedCost,
206
    double realizedFreightCharges)
217
    double realizedFreightCharges,
-
 
218
    POType type)
207
  {
219
  {
208
    this();
220
    this();
209
    this.id = id;
221
    this.id = id;
210
    setIdIsSet(true);
222
    setIdIsSet(true);
211
    this.poNumber = poNumber;
223
    this.poNumber = poNumber;
Line 225... Line 237...
225
    setFreightChargesIsSet(true);
237
    setFreightChargesIsSet(true);
226
    this.realizedCost = realizedCost;
238
    this.realizedCost = realizedCost;
227
    setRealizedCostIsSet(true);
239
    setRealizedCostIsSet(true);
228
    this.realizedFreightCharges = realizedFreightCharges;
240
    this.realizedFreightCharges = realizedFreightCharges;
229
    setRealizedFreightChargesIsSet(true);
241
    setRealizedFreightChargesIsSet(true);
-
 
242
    this.type = type;
230
  }
243
  }
231
 
244
 
232
  /**
245
  /**
233
   * Performs a deep copy on <i>other</i>.
246
   * Performs a deep copy on <i>other</i>.
234
   */
247
   */
Line 255... Line 268...
255
    this.updatedAt = other.updatedAt;
268
    this.updatedAt = other.updatedAt;
256
    this.totalCost = other.totalCost;
269
    this.totalCost = other.totalCost;
257
    this.freightCharges = other.freightCharges;
270
    this.freightCharges = other.freightCharges;
258
    this.realizedCost = other.realizedCost;
271
    this.realizedCost = other.realizedCost;
259
    this.realizedFreightCharges = other.realizedFreightCharges;
272
    this.realizedFreightCharges = other.realizedFreightCharges;
-
 
273
    if (other.isSetType()) {
-
 
274
      this.type = other.type;
-
 
275
    }
260
  }
276
  }
261
 
277
 
262
  public PurchaseOrder deepCopy() {
278
  public PurchaseOrder deepCopy() {
263
    return new PurchaseOrder(this);
279
    return new PurchaseOrder(this);
264
  }
280
  }
Line 284... Line 300...
284
    this.freightCharges = 0.0;
300
    this.freightCharges = 0.0;
285
    setRealizedCostIsSet(false);
301
    setRealizedCostIsSet(false);
286
    this.realizedCost = 0.0;
302
    this.realizedCost = 0.0;
287
    setRealizedFreightChargesIsSet(false);
303
    setRealizedFreightChargesIsSet(false);
288
    this.realizedFreightCharges = 0.0;
304
    this.realizedFreightCharges = 0.0;
-
 
305
    this.type = null;
289
  }
306
  }
290
 
307
 
291
  public long getId() {
308
  public long getId() {
292
    return this.id;
309
    return this.id;
293
  }
310
  }
Line 576... Line 593...
576
 
593
 
577
  public void setRealizedFreightChargesIsSet(boolean value) {
594
  public void setRealizedFreightChargesIsSet(boolean value) {
578
    __isset_bit_vector.set(__REALIZEDFREIGHTCHARGES_ISSET_ID, value);
595
    __isset_bit_vector.set(__REALIZEDFREIGHTCHARGES_ISSET_ID, value);
579
  }
596
  }
580
 
597
 
-
 
598
  /**
-
 
599
   * 
-
 
600
   * @see POType
-
 
601
   */
-
 
602
  public POType getType() {
-
 
603
    return this.type;
-
 
604
  }
-
 
605
 
-
 
606
  /**
-
 
607
   * 
-
 
608
   * @see POType
-
 
609
   */
-
 
610
  public void setType(POType type) {
-
 
611
    this.type = type;
-
 
612
  }
-
 
613
 
-
 
614
  public void unsetType() {
-
 
615
    this.type = null;
-
 
616
  }
-
 
617
 
-
 
618
  /** Returns true if field type is set (has been assigned a value) and false otherwise */
-
 
619
  public boolean isSetType() {
-
 
620
    return this.type != null;
-
 
621
  }
-
 
622
 
-
 
623
  public void setTypeIsSet(boolean value) {
-
 
624
    if (!value) {
-
 
625
      this.type = null;
-
 
626
    }
-
 
627
  }
-
 
628
 
581
  public void setFieldValue(_Fields field, Object value) {
629
  public void setFieldValue(_Fields field, Object value) {
582
    switch (field) {
630
    switch (field) {
583
    case ID:
631
    case ID:
584
      if (value == null) {
632
      if (value == null) {
585
        unsetId();
633
        unsetId();
Line 674... Line 722...
674
      } else {
722
      } else {
675
        setRealizedFreightCharges((Double)value);
723
        setRealizedFreightCharges((Double)value);
676
      }
724
      }
677
      break;
725
      break;
678
 
726
 
-
 
727
    case TYPE:
-
 
728
      if (value == null) {
-
 
729
        unsetType();
-
 
730
      } else {
-
 
731
        setType((POType)value);
-
 
732
      }
-
 
733
      break;
-
 
734
 
679
    }
735
    }
680
  }
736
  }
681
 
737
 
682
  public Object getFieldValue(_Fields field) {
738
  public Object getFieldValue(_Fields field) {
683
    switch (field) {
739
    switch (field) {
Line 715... Line 771...
715
      return Double.valueOf(getRealizedCost());
771
      return Double.valueOf(getRealizedCost());
716
 
772
 
717
    case REALIZED_FREIGHT_CHARGES:
773
    case REALIZED_FREIGHT_CHARGES:
718
      return Double.valueOf(getRealizedFreightCharges());
774
      return Double.valueOf(getRealizedFreightCharges());
719
 
775
 
-
 
776
    case TYPE:
-
 
777
      return getType();
-
 
778
 
720
    }
779
    }
721
    throw new IllegalStateException();
780
    throw new IllegalStateException();
722
  }
781
  }
723
 
782
 
724
  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
783
  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
Line 750... Line 809...
750
      return isSetFreightCharges();
809
      return isSetFreightCharges();
751
    case REALIZED_COST:
810
    case REALIZED_COST:
752
      return isSetRealizedCost();
811
      return isSetRealizedCost();
753
    case REALIZED_FREIGHT_CHARGES:
812
    case REALIZED_FREIGHT_CHARGES:
754
      return isSetRealizedFreightCharges();
813
      return isSetRealizedFreightCharges();
-
 
814
    case TYPE:
-
 
815
      return isSetType();
755
    }
816
    }
756
    throw new IllegalStateException();
817
    throw new IllegalStateException();
757
  }
818
  }
758
 
819
 
759
  @Override
820
  @Override
Line 875... Line 936...
875
        return false;
936
        return false;
876
      if (this.realizedFreightCharges != that.realizedFreightCharges)
937
      if (this.realizedFreightCharges != that.realizedFreightCharges)
877
        return false;
938
        return false;
878
    }
939
    }
879
 
940
 
-
 
941
    boolean this_present_type = true && this.isSetType();
-
 
942
    boolean that_present_type = true && that.isSetType();
-
 
943
    if (this_present_type || that_present_type) {
-
 
944
      if (!(this_present_type && that_present_type))
-
 
945
        return false;
-
 
946
      if (!this.type.equals(that.type))
-
 
947
        return false;
-
 
948
    }
-
 
949
 
880
    return true;
950
    return true;
881
  }
951
  }
882
 
952
 
883
  @Override
953
  @Override
884
  public int hashCode() {
954
  public int hashCode() {
Line 1011... Line 1081...
1011
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.realizedFreightCharges, typedOther.realizedFreightCharges);
1081
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.realizedFreightCharges, typedOther.realizedFreightCharges);
1012
      if (lastComparison != 0) {
1082
      if (lastComparison != 0) {
1013
        return lastComparison;
1083
        return lastComparison;
1014
      }
1084
      }
1015
    }
1085
    }
-
 
1086
    lastComparison = Boolean.valueOf(isSetType()).compareTo(typedOther.isSetType());
-
 
1087
    if (lastComparison != 0) {
-
 
1088
      return lastComparison;
-
 
1089
    }
-
 
1090
    if (isSetType()) {
-
 
1091
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.type, typedOther.type);
-
 
1092
      if (lastComparison != 0) {
-
 
1093
        return lastComparison;
-
 
1094
      }
-
 
1095
    }
1016
    return 0;
1096
    return 0;
1017
  }
1097
  }
1018
 
1098
 
1019
  public _Fields fieldForId(int fieldId) {
1099
  public _Fields fieldForId(int fieldId) {
1020
    return _Fields.findByThriftId(fieldId);
1100
    return _Fields.findByThriftId(fieldId);
Line 1132... Line 1212...
1132
            setRealizedFreightChargesIsSet(true);
1212
            setRealizedFreightChargesIsSet(true);
1133
          } else { 
1213
          } else { 
1134
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1214
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1135
          }
1215
          }
1136
          break;
1216
          break;
-
 
1217
        case 13: // TYPE
-
 
1218
          if (field.type == org.apache.thrift.protocol.TType.I32) {
-
 
1219
            this.type = POType.findByValue(iprot.readI32());
-
 
1220
          } else { 
-
 
1221
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
-
 
1222
          }
-
 
1223
          break;
1137
        default:
1224
        default:
1138
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1225
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1139
      }
1226
      }
1140
      iprot.readFieldEnd();
1227
      iprot.readFieldEnd();
1141
    }
1228
    }
Line 1194... Line 1281...
1194
    oprot.writeDouble(this.realizedCost);
1281
    oprot.writeDouble(this.realizedCost);
1195
    oprot.writeFieldEnd();
1282
    oprot.writeFieldEnd();
1196
    oprot.writeFieldBegin(REALIZED_FREIGHT_CHARGES_FIELD_DESC);
1283
    oprot.writeFieldBegin(REALIZED_FREIGHT_CHARGES_FIELD_DESC);
1197
    oprot.writeDouble(this.realizedFreightCharges);
1284
    oprot.writeDouble(this.realizedFreightCharges);
1198
    oprot.writeFieldEnd();
1285
    oprot.writeFieldEnd();
-
 
1286
    if (this.type != null) {
-
 
1287
      oprot.writeFieldBegin(TYPE_FIELD_DESC);
-
 
1288
      oprot.writeI32(this.type.getValue());
-
 
1289
      oprot.writeFieldEnd();
-
 
1290
    }
1199
    oprot.writeFieldStop();
1291
    oprot.writeFieldStop();
1200
    oprot.writeStructEnd();
1292
    oprot.writeStructEnd();
1201
  }
1293
  }
1202
 
1294
 
1203
  @Override
1295
  @Override
Line 1262... Line 1354...
1262
    first = false;
1354
    first = false;
1263
    if (!first) sb.append(", ");
1355
    if (!first) sb.append(", ");
1264
    sb.append("realizedFreightCharges:");
1356
    sb.append("realizedFreightCharges:");
1265
    sb.append(this.realizedFreightCharges);
1357
    sb.append(this.realizedFreightCharges);
1266
    first = false;
1358
    first = false;
-
 
1359
    if (!first) sb.append(", ");
-
 
1360
    sb.append("type:");
-
 
1361
    if (this.type == null) {
-
 
1362
      sb.append("null");
-
 
1363
    } else {
-
 
1364
      sb.append(this.type);
-
 
1365
    }
-
 
1366
    first = false;
1267
    sb.append(")");
1367
    sb.append(")");
1268
    return sb.toString();
1368
    return sb.toString();
1269
  }
1369
  }
1270
 
1370
 
1271
  public void validate() throws org.apache.thrift.TException {
1371
  public void validate() throws org.apache.thrift.TException {