Subversion Repositories SmartDukaan

Rev

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

Rev 6356 Rev 6433
Line 41... Line 41...
41
 
41
 
42
    public void generateCouponsForPromotion(long promotionId, String couponCode) throws PromotionException, org.apache.thrift.TException;
42
    public void generateCouponsForPromotion(long promotionId, String couponCode) throws PromotionException, org.apache.thrift.TException;
43
 
43
 
44
    public Cart applyCoupon(String couponCode, long cartId) throws PromotionException, org.apache.thrift.TException;
44
    public Cart applyCoupon(String couponCode, long cartId) throws PromotionException, org.apache.thrift.TException;
45
 
45
 
-
 
46
    public Map<Long,String> applyRechargeCoupon(String couponCode, long totalAmount, long userId) throws PromotionException, org.apache.thrift.TException;
-
 
47
 
46
    public void trackCouponUsage(String couponCode, long transactionId, long userId) throws PromotionException, org.apache.thrift.TException;
48
    public void trackCouponUsage(String couponCode, long transactionId, long userId) throws PromotionException, org.apache.thrift.TException;
47
 
49
 
48
    public long getCouponUsageCountByUser(String couponCode, long userId) throws PromotionException, org.apache.thrift.TException;
50
    public long getCouponUsageCountByUser(String couponCode, long userId) throws PromotionException, org.apache.thrift.TException;
49
 
51
 
50
    /**
52
    /**
Line 106... Line 108...
106
 
108
 
107
    public void generateCouponsForPromotion(long promotionId, String couponCode, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.generateCouponsForPromotion_call> resultHandler) throws org.apache.thrift.TException;
109
    public void generateCouponsForPromotion(long promotionId, String couponCode, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.generateCouponsForPromotion_call> resultHandler) throws org.apache.thrift.TException;
108
 
110
 
109
    public void applyCoupon(String couponCode, long cartId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.applyCoupon_call> resultHandler) throws org.apache.thrift.TException;
111
    public void applyCoupon(String couponCode, long cartId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.applyCoupon_call> resultHandler) throws org.apache.thrift.TException;
110
 
112
 
-
 
113
    public void applyRechargeCoupon(String couponCode, long totalAmount, long userId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.applyRechargeCoupon_call> resultHandler) throws org.apache.thrift.TException;
-
 
114
 
111
    public void trackCouponUsage(String couponCode, long transactionId, long userId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.trackCouponUsage_call> resultHandler) throws org.apache.thrift.TException;
115
    public void trackCouponUsage(String couponCode, long transactionId, long userId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.trackCouponUsage_call> resultHandler) throws org.apache.thrift.TException;
112
 
116
 
113
    public void getCouponUsageCountByUser(String couponCode, long userId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getCouponUsageCountByUser_call> resultHandler) throws org.apache.thrift.TException;
117
    public void getCouponUsageCountByUser(String couponCode, long userId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getCouponUsageCountByUser_call> resultHandler) throws org.apache.thrift.TException;
114
 
118
 
115
    public void getActiveCoupons(org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getActiveCoupons_call> resultHandler) throws org.apache.thrift.TException;
119
    public void getActiveCoupons(org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getActiveCoupons_call> resultHandler) throws org.apache.thrift.TException;
Line 356... Line 360...
356
        throw result.pex;
360
        throw result.pex;
357
      }
361
      }
358
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "applyCoupon failed: unknown result");
362
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "applyCoupon failed: unknown result");
359
    }
363
    }
360
 
364
 
-
 
365
    public Map<Long,String> applyRechargeCoupon(String couponCode, long totalAmount, long userId) throws PromotionException, org.apache.thrift.TException
-
 
366
    {
-
 
367
      send_applyRechargeCoupon(couponCode, totalAmount, userId);
-
 
368
      return recv_applyRechargeCoupon();
-
 
369
    }
-
 
370
 
-
 
371
    public void send_applyRechargeCoupon(String couponCode, long totalAmount, long userId) throws org.apache.thrift.TException
-
 
372
    {
-
 
373
      applyRechargeCoupon_args args = new applyRechargeCoupon_args();
-
 
374
      args.setCouponCode(couponCode);
-
 
375
      args.setTotalAmount(totalAmount);
-
 
376
      args.setUserId(userId);
-
 
377
      sendBase("applyRechargeCoupon", args);
-
 
378
    }
-
 
379
 
-
 
380
    public Map<Long,String> recv_applyRechargeCoupon() throws PromotionException, org.apache.thrift.TException
-
 
381
    {
-
 
382
      applyRechargeCoupon_result result = new applyRechargeCoupon_result();
-
 
383
      receiveBase(result, "applyRechargeCoupon");
-
 
384
      if (result.isSetSuccess()) {
-
 
385
        return result.success;
-
 
386
      }
-
 
387
      if (result.pex != null) {
-
 
388
        throw result.pex;
-
 
389
      }
-
 
390
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "applyRechargeCoupon failed: unknown result");
-
 
391
    }
-
 
392
 
361
    public void trackCouponUsage(String couponCode, long transactionId, long userId) throws PromotionException, org.apache.thrift.TException
393
    public void trackCouponUsage(String couponCode, long transactionId, long userId) throws PromotionException, org.apache.thrift.TException
362
    {
394
    {
363
      send_trackCouponUsage(couponCode, transactionId, userId);
395
      send_trackCouponUsage(couponCode, transactionId, userId);
364
      recv_trackCouponUsage();
396
      recv_trackCouponUsage();
365
    }
397
    }
Line 918... Line 950...
918
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
950
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
919
        return (new Client(prot)).recv_applyCoupon();
951
        return (new Client(prot)).recv_applyCoupon();
920
      }
952
      }
921
    }
953
    }
922
 
954
 
-
 
955
    public void applyRechargeCoupon(String couponCode, long totalAmount, long userId, org.apache.thrift.async.AsyncMethodCallback<applyRechargeCoupon_call> resultHandler) throws org.apache.thrift.TException {
-
 
956
      checkReady();
-
 
957
      applyRechargeCoupon_call method_call = new applyRechargeCoupon_call(couponCode, totalAmount, userId, resultHandler, this, ___protocolFactory, ___transport);
-
 
958
      this.___currentMethod = method_call;
-
 
959
      ___manager.call(method_call);
-
 
960
    }
-
 
961
 
-
 
962
    public static class applyRechargeCoupon_call extends org.apache.thrift.async.TAsyncMethodCall {
-
 
963
      private String couponCode;
-
 
964
      private long totalAmount;
-
 
965
      private long userId;
-
 
966
      public applyRechargeCoupon_call(String couponCode, long totalAmount, long userId, org.apache.thrift.async.AsyncMethodCallback<applyRechargeCoupon_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
-
 
967
        super(client, protocolFactory, transport, resultHandler, false);
-
 
968
        this.couponCode = couponCode;
-
 
969
        this.totalAmount = totalAmount;
-
 
970
        this.userId = userId;
-
 
971
      }
-
 
972
 
-
 
973
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
-
 
974
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("applyRechargeCoupon", org.apache.thrift.protocol.TMessageType.CALL, 0));
-
 
975
        applyRechargeCoupon_args args = new applyRechargeCoupon_args();
-
 
976
        args.setCouponCode(couponCode);
-
 
977
        args.setTotalAmount(totalAmount);
-
 
978
        args.setUserId(userId);
-
 
979
        args.write(prot);
-
 
980
        prot.writeMessageEnd();
-
 
981
      }
-
 
982
 
-
 
983
      public Map<Long,String> getResult() throws PromotionException, org.apache.thrift.TException {
-
 
984
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
-
 
985
          throw new IllegalStateException("Method call not finished!");
-
 
986
        }
-
 
987
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
-
 
988
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
-
 
989
        return (new Client(prot)).recv_applyRechargeCoupon();
-
 
990
      }
-
 
991
    }
-
 
992
 
923
    public void trackCouponUsage(String couponCode, long transactionId, long userId, org.apache.thrift.async.AsyncMethodCallback<trackCouponUsage_call> resultHandler) throws org.apache.thrift.TException {
993
    public void trackCouponUsage(String couponCode, long transactionId, long userId, org.apache.thrift.async.AsyncMethodCallback<trackCouponUsage_call> resultHandler) throws org.apache.thrift.TException {
924
      checkReady();
994
      checkReady();
925
      trackCouponUsage_call method_call = new trackCouponUsage_call(couponCode, transactionId, userId, resultHandler, this, ___protocolFactory, ___transport);
995
      trackCouponUsage_call method_call = new trackCouponUsage_call(couponCode, transactionId, userId, resultHandler, this, ___protocolFactory, ___transport);
926
      this.___currentMethod = method_call;
996
      this.___currentMethod = method_call;
927
      ___manager.call(method_call);
997
      ___manager.call(method_call);
Line 1324... Line 1394...
1324
      processMap.put("isCodApplicable", new isCodApplicable());
1394
      processMap.put("isCodApplicable", new isCodApplicable());
1325
      processMap.put("getAllPromotions", new getAllPromotions());
1395
      processMap.put("getAllPromotions", new getAllPromotions());
1326
      processMap.put("getPromotionById", new getPromotionById());
1396
      processMap.put("getPromotionById", new getPromotionById());
1327
      processMap.put("generateCouponsForPromotion", new generateCouponsForPromotion());
1397
      processMap.put("generateCouponsForPromotion", new generateCouponsForPromotion());
1328
      processMap.put("applyCoupon", new applyCoupon());
1398
      processMap.put("applyCoupon", new applyCoupon());
-
 
1399
      processMap.put("applyRechargeCoupon", new applyRechargeCoupon());
1329
      processMap.put("trackCouponUsage", new trackCouponUsage());
1400
      processMap.put("trackCouponUsage", new trackCouponUsage());
1330
      processMap.put("getCouponUsageCountByUser", new getCouponUsageCountByUser());
1401
      processMap.put("getCouponUsageCountByUser", new getCouponUsageCountByUser());
1331
      processMap.put("getActiveCoupons", new getActiveCoupons());
1402
      processMap.put("getActiveCoupons", new getActiveCoupons());
1332
      processMap.put("createCoupon", new createCoupon());
1403
      processMap.put("createCoupon", new createCoupon());
1333
      processMap.put("getSuccessfulPaymentCountForCoupon", new getSuccessfulPaymentCountForCoupon());
1404
      processMap.put("getSuccessfulPaymentCountForCoupon", new getSuccessfulPaymentCountForCoupon());
Line 1500... Line 1571...
1500
        }
1571
        }
1501
        return result;
1572
        return result;
1502
      }
1573
      }
1503
    }
1574
    }
1504
 
1575
 
-
 
1576
    private static class applyRechargeCoupon<I extends Iface> extends org.apache.thrift.ProcessFunction<I, applyRechargeCoupon_args> {
-
 
1577
      public applyRechargeCoupon() {
-
 
1578
        super("applyRechargeCoupon");
-
 
1579
      }
-
 
1580
 
-
 
1581
      protected applyRechargeCoupon_args getEmptyArgsInstance() {
-
 
1582
        return new applyRechargeCoupon_args();
-
 
1583
      }
-
 
1584
 
-
 
1585
      protected applyRechargeCoupon_result getResult(I iface, applyRechargeCoupon_args args) throws org.apache.thrift.TException {
-
 
1586
        applyRechargeCoupon_result result = new applyRechargeCoupon_result();
-
 
1587
        try {
-
 
1588
          result.success = iface.applyRechargeCoupon(args.couponCode, args.totalAmount, args.userId);
-
 
1589
        } catch (PromotionException pex) {
-
 
1590
          result.pex = pex;
-
 
1591
        }
-
 
1592
        return result;
-
 
1593
      }
-
 
1594
    }
-
 
1595
 
1505
    private static class trackCouponUsage<I extends Iface> extends org.apache.thrift.ProcessFunction<I, trackCouponUsage_args> {
1596
    private static class trackCouponUsage<I extends Iface> extends org.apache.thrift.ProcessFunction<I, trackCouponUsage_args> {
1506
      public trackCouponUsage() {
1597
      public trackCouponUsage() {
1507
        super("trackCouponUsage");
1598
        super("trackCouponUsage");
1508
      }
1599
      }
1509
 
1600
 
Line 7313... Line 7404...
7313
      }
7404
      }
7314
    }
7405
    }
7315
 
7406
 
7316
  }
7407
  }
7317
 
7408
 
-
 
7409
  public static class applyRechargeCoupon_args implements org.apache.thrift.TBase<applyRechargeCoupon_args, applyRechargeCoupon_args._Fields>, java.io.Serializable, Cloneable   {
-
 
7410
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("applyRechargeCoupon_args");
-
 
7411
 
-
 
7412
    private static final org.apache.thrift.protocol.TField COUPON_CODE_FIELD_DESC = new org.apache.thrift.protocol.TField("couponCode", org.apache.thrift.protocol.TType.STRING, (short)1);
-
 
7413
    private static final org.apache.thrift.protocol.TField TOTAL_AMOUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("totalAmount", org.apache.thrift.protocol.TType.I64, (short)2);
-
 
7414
    private static final org.apache.thrift.protocol.TField USER_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("userId", org.apache.thrift.protocol.TType.I64, (short)3);
-
 
7415
 
-
 
7416
    private String couponCode; // required
-
 
7417
    private long totalAmount; // required
-
 
7418
    private long userId; // required
-
 
7419
 
-
 
7420
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-
 
7421
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
-
 
7422
      COUPON_CODE((short)1, "couponCode"),
-
 
7423
      TOTAL_AMOUNT((short)2, "totalAmount"),
-
 
7424
      USER_ID((short)3, "userId");
-
 
7425
 
-
 
7426
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
-
 
7427
 
-
 
7428
      static {
-
 
7429
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
-
 
7430
          byName.put(field.getFieldName(), field);
-
 
7431
        }
-
 
7432
      }
-
 
7433
 
-
 
7434
      /**
-
 
7435
       * Find the _Fields constant that matches fieldId, or null if its not found.
-
 
7436
       */
-
 
7437
      public static _Fields findByThriftId(int fieldId) {
-
 
7438
        switch(fieldId) {
-
 
7439
          case 1: // COUPON_CODE
-
 
7440
            return COUPON_CODE;
-
 
7441
          case 2: // TOTAL_AMOUNT
-
 
7442
            return TOTAL_AMOUNT;
-
 
7443
          case 3: // USER_ID
-
 
7444
            return USER_ID;
-
 
7445
          default:
-
 
7446
            return null;
-
 
7447
        }
-
 
7448
      }
-
 
7449
 
-
 
7450
      /**
-
 
7451
       * Find the _Fields constant that matches fieldId, throwing an exception
-
 
7452
       * if it is not found.
-
 
7453
       */
-
 
7454
      public static _Fields findByThriftIdOrThrow(int fieldId) {
-
 
7455
        _Fields fields = findByThriftId(fieldId);
-
 
7456
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
-
 
7457
        return fields;
-
 
7458
      }
-
 
7459
 
-
 
7460
      /**
-
 
7461
       * Find the _Fields constant that matches name, or null if its not found.
-
 
7462
       */
-
 
7463
      public static _Fields findByName(String name) {
-
 
7464
        return byName.get(name);
-
 
7465
      }
-
 
7466
 
-
 
7467
      private final short _thriftId;
-
 
7468
      private final String _fieldName;
-
 
7469
 
-
 
7470
      _Fields(short thriftId, String fieldName) {
-
 
7471
        _thriftId = thriftId;
-
 
7472
        _fieldName = fieldName;
-
 
7473
      }
-
 
7474
 
-
 
7475
      public short getThriftFieldId() {
-
 
7476
        return _thriftId;
-
 
7477
      }
-
 
7478
 
-
 
7479
      public String getFieldName() {
-
 
7480
        return _fieldName;
-
 
7481
      }
-
 
7482
    }
-
 
7483
 
-
 
7484
    // isset id assignments
-
 
7485
    private static final int __TOTALAMOUNT_ISSET_ID = 0;
-
 
7486
    private static final int __USERID_ISSET_ID = 1;
-
 
7487
    private BitSet __isset_bit_vector = new BitSet(2);
-
 
7488
 
-
 
7489
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
-
 
7490
    static {
-
 
7491
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
-
 
7492
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
-
 
7493
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-
 
7494
      tmpMap.put(_Fields.TOTAL_AMOUNT, new org.apache.thrift.meta_data.FieldMetaData("totalAmount", org.apache.thrift.TFieldRequirementType.DEFAULT, 
-
 
7495
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
-
 
7496
      tmpMap.put(_Fields.USER_ID, new org.apache.thrift.meta_data.FieldMetaData("userId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
-
 
7497
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
-
 
7498
      metaDataMap = Collections.unmodifiableMap(tmpMap);
-
 
7499
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(applyRechargeCoupon_args.class, metaDataMap);
-
 
7500
    }
-
 
7501
 
-
 
7502
    public applyRechargeCoupon_args() {
-
 
7503
    }
-
 
7504
 
-
 
7505
    public applyRechargeCoupon_args(
-
 
7506
      String couponCode,
-
 
7507
      long totalAmount,
-
 
7508
      long userId)
-
 
7509
    {
-
 
7510
      this();
-
 
7511
      this.couponCode = couponCode;
-
 
7512
      this.totalAmount = totalAmount;
-
 
7513
      setTotalAmountIsSet(true);
-
 
7514
      this.userId = userId;
-
 
7515
      setUserIdIsSet(true);
-
 
7516
    }
-
 
7517
 
-
 
7518
    /**
-
 
7519
     * Performs a deep copy on <i>other</i>.
-
 
7520
     */
-
 
7521
    public applyRechargeCoupon_args(applyRechargeCoupon_args other) {
-
 
7522
      __isset_bit_vector.clear();
-
 
7523
      __isset_bit_vector.or(other.__isset_bit_vector);
-
 
7524
      if (other.isSetCouponCode()) {
-
 
7525
        this.couponCode = other.couponCode;
-
 
7526
      }
-
 
7527
      this.totalAmount = other.totalAmount;
-
 
7528
      this.userId = other.userId;
-
 
7529
    }
-
 
7530
 
-
 
7531
    public applyRechargeCoupon_args deepCopy() {
-
 
7532
      return new applyRechargeCoupon_args(this);
-
 
7533
    }
-
 
7534
 
-
 
7535
    @Override
-
 
7536
    public void clear() {
-
 
7537
      this.couponCode = null;
-
 
7538
      setTotalAmountIsSet(false);
-
 
7539
      this.totalAmount = 0;
-
 
7540
      setUserIdIsSet(false);
-
 
7541
      this.userId = 0;
-
 
7542
    }
-
 
7543
 
-
 
7544
    public String getCouponCode() {
-
 
7545
      return this.couponCode;
-
 
7546
    }
-
 
7547
 
-
 
7548
    public void setCouponCode(String couponCode) {
-
 
7549
      this.couponCode = couponCode;
-
 
7550
    }
-
 
7551
 
-
 
7552
    public void unsetCouponCode() {
-
 
7553
      this.couponCode = null;
-
 
7554
    }
-
 
7555
 
-
 
7556
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
-
 
7557
    public boolean isSetCouponCode() {
-
 
7558
      return this.couponCode != null;
-
 
7559
    }
-
 
7560
 
-
 
7561
    public void setCouponCodeIsSet(boolean value) {
-
 
7562
      if (!value) {
-
 
7563
        this.couponCode = null;
-
 
7564
      }
-
 
7565
    }
-
 
7566
 
-
 
7567
    public long getTotalAmount() {
-
 
7568
      return this.totalAmount;
-
 
7569
    }
-
 
7570
 
-
 
7571
    public void setTotalAmount(long totalAmount) {
-
 
7572
      this.totalAmount = totalAmount;
-
 
7573
      setTotalAmountIsSet(true);
-
 
7574
    }
-
 
7575
 
-
 
7576
    public void unsetTotalAmount() {
-
 
7577
      __isset_bit_vector.clear(__TOTALAMOUNT_ISSET_ID);
-
 
7578
    }
-
 
7579
 
-
 
7580
    /** Returns true if field totalAmount is set (has been assigned a value) and false otherwise */
-
 
7581
    public boolean isSetTotalAmount() {
-
 
7582
      return __isset_bit_vector.get(__TOTALAMOUNT_ISSET_ID);
-
 
7583
    }
-
 
7584
 
-
 
7585
    public void setTotalAmountIsSet(boolean value) {
-
 
7586
      __isset_bit_vector.set(__TOTALAMOUNT_ISSET_ID, value);
-
 
7587
    }
-
 
7588
 
-
 
7589
    public long getUserId() {
-
 
7590
      return this.userId;
-
 
7591
    }
-
 
7592
 
-
 
7593
    public void setUserId(long userId) {
-
 
7594
      this.userId = userId;
-
 
7595
      setUserIdIsSet(true);
-
 
7596
    }
-
 
7597
 
-
 
7598
    public void unsetUserId() {
-
 
7599
      __isset_bit_vector.clear(__USERID_ISSET_ID);
-
 
7600
    }
-
 
7601
 
-
 
7602
    /** Returns true if field userId is set (has been assigned a value) and false otherwise */
-
 
7603
    public boolean isSetUserId() {
-
 
7604
      return __isset_bit_vector.get(__USERID_ISSET_ID);
-
 
7605
    }
-
 
7606
 
-
 
7607
    public void setUserIdIsSet(boolean value) {
-
 
7608
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
-
 
7609
    }
-
 
7610
 
-
 
7611
    public void setFieldValue(_Fields field, Object value) {
-
 
7612
      switch (field) {
-
 
7613
      case COUPON_CODE:
-
 
7614
        if (value == null) {
-
 
7615
          unsetCouponCode();
-
 
7616
        } else {
-
 
7617
          setCouponCode((String)value);
-
 
7618
        }
-
 
7619
        break;
-
 
7620
 
-
 
7621
      case TOTAL_AMOUNT:
-
 
7622
        if (value == null) {
-
 
7623
          unsetTotalAmount();
-
 
7624
        } else {
-
 
7625
          setTotalAmount((Long)value);
-
 
7626
        }
-
 
7627
        break;
-
 
7628
 
-
 
7629
      case USER_ID:
-
 
7630
        if (value == null) {
-
 
7631
          unsetUserId();
-
 
7632
        } else {
-
 
7633
          setUserId((Long)value);
-
 
7634
        }
-
 
7635
        break;
-
 
7636
 
-
 
7637
      }
-
 
7638
    }
-
 
7639
 
-
 
7640
    public Object getFieldValue(_Fields field) {
-
 
7641
      switch (field) {
-
 
7642
      case COUPON_CODE:
-
 
7643
        return getCouponCode();
-
 
7644
 
-
 
7645
      case TOTAL_AMOUNT:
-
 
7646
        return Long.valueOf(getTotalAmount());
-
 
7647
 
-
 
7648
      case USER_ID:
-
 
7649
        return Long.valueOf(getUserId());
-
 
7650
 
-
 
7651
      }
-
 
7652
      throw new IllegalStateException();
-
 
7653
    }
-
 
7654
 
-
 
7655
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
-
 
7656
    public boolean isSet(_Fields field) {
-
 
7657
      if (field == null) {
-
 
7658
        throw new IllegalArgumentException();
-
 
7659
      }
-
 
7660
 
-
 
7661
      switch (field) {
-
 
7662
      case COUPON_CODE:
-
 
7663
        return isSetCouponCode();
-
 
7664
      case TOTAL_AMOUNT:
-
 
7665
        return isSetTotalAmount();
-
 
7666
      case USER_ID:
-
 
7667
        return isSetUserId();
-
 
7668
      }
-
 
7669
      throw new IllegalStateException();
-
 
7670
    }
-
 
7671
 
-
 
7672
    @Override
-
 
7673
    public boolean equals(Object that) {
-
 
7674
      if (that == null)
-
 
7675
        return false;
-
 
7676
      if (that instanceof applyRechargeCoupon_args)
-
 
7677
        return this.equals((applyRechargeCoupon_args)that);
-
 
7678
      return false;
-
 
7679
    }
-
 
7680
 
-
 
7681
    public boolean equals(applyRechargeCoupon_args that) {
-
 
7682
      if (that == null)
-
 
7683
        return false;
-
 
7684
 
-
 
7685
      boolean this_present_couponCode = true && this.isSetCouponCode();
-
 
7686
      boolean that_present_couponCode = true && that.isSetCouponCode();
-
 
7687
      if (this_present_couponCode || that_present_couponCode) {
-
 
7688
        if (!(this_present_couponCode && that_present_couponCode))
-
 
7689
          return false;
-
 
7690
        if (!this.couponCode.equals(that.couponCode))
-
 
7691
          return false;
-
 
7692
      }
-
 
7693
 
-
 
7694
      boolean this_present_totalAmount = true;
-
 
7695
      boolean that_present_totalAmount = true;
-
 
7696
      if (this_present_totalAmount || that_present_totalAmount) {
-
 
7697
        if (!(this_present_totalAmount && that_present_totalAmount))
-
 
7698
          return false;
-
 
7699
        if (this.totalAmount != that.totalAmount)
-
 
7700
          return false;
-
 
7701
      }
-
 
7702
 
-
 
7703
      boolean this_present_userId = true;
-
 
7704
      boolean that_present_userId = true;
-
 
7705
      if (this_present_userId || that_present_userId) {
-
 
7706
        if (!(this_present_userId && that_present_userId))
-
 
7707
          return false;
-
 
7708
        if (this.userId != that.userId)
-
 
7709
          return false;
-
 
7710
      }
-
 
7711
 
-
 
7712
      return true;
-
 
7713
    }
-
 
7714
 
-
 
7715
    @Override
-
 
7716
    public int hashCode() {
-
 
7717
      return 0;
-
 
7718
    }
-
 
7719
 
-
 
7720
    public int compareTo(applyRechargeCoupon_args other) {
-
 
7721
      if (!getClass().equals(other.getClass())) {
-
 
7722
        return getClass().getName().compareTo(other.getClass().getName());
-
 
7723
      }
-
 
7724
 
-
 
7725
      int lastComparison = 0;
-
 
7726
      applyRechargeCoupon_args typedOther = (applyRechargeCoupon_args)other;
-
 
7727
 
-
 
7728
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
-
 
7729
      if (lastComparison != 0) {
-
 
7730
        return lastComparison;
-
 
7731
      }
-
 
7732
      if (isSetCouponCode()) {
-
 
7733
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
-
 
7734
        if (lastComparison != 0) {
-
 
7735
          return lastComparison;
-
 
7736
        }
-
 
7737
      }
-
 
7738
      lastComparison = Boolean.valueOf(isSetTotalAmount()).compareTo(typedOther.isSetTotalAmount());
-
 
7739
      if (lastComparison != 0) {
-
 
7740
        return lastComparison;
-
 
7741
      }
-
 
7742
      if (isSetTotalAmount()) {
-
 
7743
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.totalAmount, typedOther.totalAmount);
-
 
7744
        if (lastComparison != 0) {
-
 
7745
          return lastComparison;
-
 
7746
        }
-
 
7747
      }
-
 
7748
      lastComparison = Boolean.valueOf(isSetUserId()).compareTo(typedOther.isSetUserId());
-
 
7749
      if (lastComparison != 0) {
-
 
7750
        return lastComparison;
-
 
7751
      }
-
 
7752
      if (isSetUserId()) {
-
 
7753
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userId, typedOther.userId);
-
 
7754
        if (lastComparison != 0) {
-
 
7755
          return lastComparison;
-
 
7756
        }
-
 
7757
      }
-
 
7758
      return 0;
-
 
7759
    }
-
 
7760
 
-
 
7761
    public _Fields fieldForId(int fieldId) {
-
 
7762
      return _Fields.findByThriftId(fieldId);
-
 
7763
    }
-
 
7764
 
-
 
7765
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
-
 
7766
      org.apache.thrift.protocol.TField field;
-
 
7767
      iprot.readStructBegin();
-
 
7768
      while (true)
-
 
7769
      {
-
 
7770
        field = iprot.readFieldBegin();
-
 
7771
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
-
 
7772
          break;
-
 
7773
        }
-
 
7774
        switch (field.id) {
-
 
7775
          case 1: // COUPON_CODE
-
 
7776
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
-
 
7777
              this.couponCode = iprot.readString();
-
 
7778
            } else { 
-
 
7779
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
-
 
7780
            }
-
 
7781
            break;
-
 
7782
          case 2: // TOTAL_AMOUNT
-
 
7783
            if (field.type == org.apache.thrift.protocol.TType.I64) {
-
 
7784
              this.totalAmount = iprot.readI64();
-
 
7785
              setTotalAmountIsSet(true);
-
 
7786
            } else { 
-
 
7787
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
-
 
7788
            }
-
 
7789
            break;
-
 
7790
          case 3: // USER_ID
-
 
7791
            if (field.type == org.apache.thrift.protocol.TType.I64) {
-
 
7792
              this.userId = iprot.readI64();
-
 
7793
              setUserIdIsSet(true);
-
 
7794
            } else { 
-
 
7795
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
-
 
7796
            }
-
 
7797
            break;
-
 
7798
          default:
-
 
7799
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
-
 
7800
        }
-
 
7801
        iprot.readFieldEnd();
-
 
7802
      }
-
 
7803
      iprot.readStructEnd();
-
 
7804
      validate();
-
 
7805
    }
-
 
7806
 
-
 
7807
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
-
 
7808
      validate();
-
 
7809
 
-
 
7810
      oprot.writeStructBegin(STRUCT_DESC);
-
 
7811
      if (this.couponCode != null) {
-
 
7812
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
-
 
7813
        oprot.writeString(this.couponCode);
-
 
7814
        oprot.writeFieldEnd();
-
 
7815
      }
-
 
7816
      oprot.writeFieldBegin(TOTAL_AMOUNT_FIELD_DESC);
-
 
7817
      oprot.writeI64(this.totalAmount);
-
 
7818
      oprot.writeFieldEnd();
-
 
7819
      oprot.writeFieldBegin(USER_ID_FIELD_DESC);
-
 
7820
      oprot.writeI64(this.userId);
-
 
7821
      oprot.writeFieldEnd();
-
 
7822
      oprot.writeFieldStop();
-
 
7823
      oprot.writeStructEnd();
-
 
7824
    }
-
 
7825
 
-
 
7826
    @Override
-
 
7827
    public String toString() {
-
 
7828
      StringBuilder sb = new StringBuilder("applyRechargeCoupon_args(");
-
 
7829
      boolean first = true;
-
 
7830
 
-
 
7831
      sb.append("couponCode:");
-
 
7832
      if (this.couponCode == null) {
-
 
7833
        sb.append("null");
-
 
7834
      } else {
-
 
7835
        sb.append(this.couponCode);
-
 
7836
      }
-
 
7837
      first = false;
-
 
7838
      if (!first) sb.append(", ");
-
 
7839
      sb.append("totalAmount:");
-
 
7840
      sb.append(this.totalAmount);
-
 
7841
      first = false;
-
 
7842
      if (!first) sb.append(", ");
-
 
7843
      sb.append("userId:");
-
 
7844
      sb.append(this.userId);
-
 
7845
      first = false;
-
 
7846
      sb.append(")");
-
 
7847
      return sb.toString();
-
 
7848
    }
-
 
7849
 
-
 
7850
    public void validate() throws org.apache.thrift.TException {
-
 
7851
      // check for required fields
-
 
7852
    }
-
 
7853
 
-
 
7854
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
-
 
7855
      try {
-
 
7856
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
-
 
7857
      } catch (org.apache.thrift.TException te) {
-
 
7858
        throw new java.io.IOException(te);
-
 
7859
      }
-
 
7860
    }
-
 
7861
 
-
 
7862
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
-
 
7863
      try {
-
 
7864
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
-
 
7865
        __isset_bit_vector = new BitSet(1);
-
 
7866
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
-
 
7867
      } catch (org.apache.thrift.TException te) {
-
 
7868
        throw new java.io.IOException(te);
-
 
7869
      }
-
 
7870
    }
-
 
7871
 
-
 
7872
  }
-
 
7873
 
-
 
7874
  public static class applyRechargeCoupon_result implements org.apache.thrift.TBase<applyRechargeCoupon_result, applyRechargeCoupon_result._Fields>, java.io.Serializable, Cloneable   {
-
 
7875
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("applyRechargeCoupon_result");
-
 
7876
 
-
 
7877
    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.MAP, (short)0);
-
 
7878
    private static final org.apache.thrift.protocol.TField PEX_FIELD_DESC = new org.apache.thrift.protocol.TField("pex", org.apache.thrift.protocol.TType.STRUCT, (short)1);
-
 
7879
 
-
 
7880
    private Map<Long,String> success; // required
-
 
7881
    private PromotionException pex; // required
-
 
7882
 
-
 
7883
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-
 
7884
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
-
 
7885
      SUCCESS((short)0, "success"),
-
 
7886
      PEX((short)1, "pex");
-
 
7887
 
-
 
7888
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
-
 
7889
 
-
 
7890
      static {
-
 
7891
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
-
 
7892
          byName.put(field.getFieldName(), field);
-
 
7893
        }
-
 
7894
      }
-
 
7895
 
-
 
7896
      /**
-
 
7897
       * Find the _Fields constant that matches fieldId, or null if its not found.
-
 
7898
       */
-
 
7899
      public static _Fields findByThriftId(int fieldId) {
-
 
7900
        switch(fieldId) {
-
 
7901
          case 0: // SUCCESS
-
 
7902
            return SUCCESS;
-
 
7903
          case 1: // PEX
-
 
7904
            return PEX;
-
 
7905
          default:
-
 
7906
            return null;
-
 
7907
        }
-
 
7908
      }
-
 
7909
 
-
 
7910
      /**
-
 
7911
       * Find the _Fields constant that matches fieldId, throwing an exception
-
 
7912
       * if it is not found.
-
 
7913
       */
-
 
7914
      public static _Fields findByThriftIdOrThrow(int fieldId) {
-
 
7915
        _Fields fields = findByThriftId(fieldId);
-
 
7916
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
-
 
7917
        return fields;
-
 
7918
      }
-
 
7919
 
-
 
7920
      /**
-
 
7921
       * Find the _Fields constant that matches name, or null if its not found.
-
 
7922
       */
-
 
7923
      public static _Fields findByName(String name) {
-
 
7924
        return byName.get(name);
-
 
7925
      }
-
 
7926
 
-
 
7927
      private final short _thriftId;
-
 
7928
      private final String _fieldName;
-
 
7929
 
-
 
7930
      _Fields(short thriftId, String fieldName) {
-
 
7931
        _thriftId = thriftId;
-
 
7932
        _fieldName = fieldName;
-
 
7933
      }
-
 
7934
 
-
 
7935
      public short getThriftFieldId() {
-
 
7936
        return _thriftId;
-
 
7937
      }
-
 
7938
 
-
 
7939
      public String getFieldName() {
-
 
7940
        return _fieldName;
-
 
7941
      }
-
 
7942
    }
-
 
7943
 
-
 
7944
    // isset id assignments
-
 
7945
 
-
 
7946
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
-
 
7947
    static {
-
 
7948
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
-
 
7949
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
-
 
7950
          new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, 
-
 
7951
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64), 
-
 
7952
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
-
 
7953
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
-
 
7954
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
-
 
7955
      metaDataMap = Collections.unmodifiableMap(tmpMap);
-
 
7956
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(applyRechargeCoupon_result.class, metaDataMap);
-
 
7957
    }
-
 
7958
 
-
 
7959
    public applyRechargeCoupon_result() {
-
 
7960
    }
-
 
7961
 
-
 
7962
    public applyRechargeCoupon_result(
-
 
7963
      Map<Long,String> success,
-
 
7964
      PromotionException pex)
-
 
7965
    {
-
 
7966
      this();
-
 
7967
      this.success = success;
-
 
7968
      this.pex = pex;
-
 
7969
    }
-
 
7970
 
-
 
7971
    /**
-
 
7972
     * Performs a deep copy on <i>other</i>.
-
 
7973
     */
-
 
7974
    public applyRechargeCoupon_result(applyRechargeCoupon_result other) {
-
 
7975
      if (other.isSetSuccess()) {
-
 
7976
        Map<Long,String> __this__success = new HashMap<Long,String>();
-
 
7977
        for (Map.Entry<Long, String> other_element : other.success.entrySet()) {
-
 
7978
 
-
 
7979
          Long other_element_key = other_element.getKey();
-
 
7980
          String other_element_value = other_element.getValue();
-
 
7981
 
-
 
7982
          Long __this__success_copy_key = other_element_key;
-
 
7983
 
-
 
7984
          String __this__success_copy_value = other_element_value;
-
 
7985
 
-
 
7986
          __this__success.put(__this__success_copy_key, __this__success_copy_value);
-
 
7987
        }
-
 
7988
        this.success = __this__success;
-
 
7989
      }
-
 
7990
      if (other.isSetPex()) {
-
 
7991
        this.pex = new PromotionException(other.pex);
-
 
7992
      }
-
 
7993
    }
-
 
7994
 
-
 
7995
    public applyRechargeCoupon_result deepCopy() {
-
 
7996
      return new applyRechargeCoupon_result(this);
-
 
7997
    }
-
 
7998
 
-
 
7999
    @Override
-
 
8000
    public void clear() {
-
 
8001
      this.success = null;
-
 
8002
      this.pex = null;
-
 
8003
    }
-
 
8004
 
-
 
8005
    public int getSuccessSize() {
-
 
8006
      return (this.success == null) ? 0 : this.success.size();
-
 
8007
    }
-
 
8008
 
-
 
8009
    public void putToSuccess(long key, String val) {
-
 
8010
      if (this.success == null) {
-
 
8011
        this.success = new HashMap<Long,String>();
-
 
8012
      }
-
 
8013
      this.success.put(key, val);
-
 
8014
    }
-
 
8015
 
-
 
8016
    public Map<Long,String> getSuccess() {
-
 
8017
      return this.success;
-
 
8018
    }
-
 
8019
 
-
 
8020
    public void setSuccess(Map<Long,String> success) {
-
 
8021
      this.success = success;
-
 
8022
    }
-
 
8023
 
-
 
8024
    public void unsetSuccess() {
-
 
8025
      this.success = null;
-
 
8026
    }
-
 
8027
 
-
 
8028
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
-
 
8029
    public boolean isSetSuccess() {
-
 
8030
      return this.success != null;
-
 
8031
    }
-
 
8032
 
-
 
8033
    public void setSuccessIsSet(boolean value) {
-
 
8034
      if (!value) {
-
 
8035
        this.success = null;
-
 
8036
      }
-
 
8037
    }
-
 
8038
 
-
 
8039
    public PromotionException getPex() {
-
 
8040
      return this.pex;
-
 
8041
    }
-
 
8042
 
-
 
8043
    public void setPex(PromotionException pex) {
-
 
8044
      this.pex = pex;
-
 
8045
    }
-
 
8046
 
-
 
8047
    public void unsetPex() {
-
 
8048
      this.pex = null;
-
 
8049
    }
-
 
8050
 
-
 
8051
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
-
 
8052
    public boolean isSetPex() {
-
 
8053
      return this.pex != null;
-
 
8054
    }
-
 
8055
 
-
 
8056
    public void setPexIsSet(boolean value) {
-
 
8057
      if (!value) {
-
 
8058
        this.pex = null;
-
 
8059
      }
-
 
8060
    }
-
 
8061
 
-
 
8062
    public void setFieldValue(_Fields field, Object value) {
-
 
8063
      switch (field) {
-
 
8064
      case SUCCESS:
-
 
8065
        if (value == null) {
-
 
8066
          unsetSuccess();
-
 
8067
        } else {
-
 
8068
          setSuccess((Map<Long,String>)value);
-
 
8069
        }
-
 
8070
        break;
-
 
8071
 
-
 
8072
      case PEX:
-
 
8073
        if (value == null) {
-
 
8074
          unsetPex();
-
 
8075
        } else {
-
 
8076
          setPex((PromotionException)value);
-
 
8077
        }
-
 
8078
        break;
-
 
8079
 
-
 
8080
      }
-
 
8081
    }
-
 
8082
 
-
 
8083
    public Object getFieldValue(_Fields field) {
-
 
8084
      switch (field) {
-
 
8085
      case SUCCESS:
-
 
8086
        return getSuccess();
-
 
8087
 
-
 
8088
      case PEX:
-
 
8089
        return getPex();
-
 
8090
 
-
 
8091
      }
-
 
8092
      throw new IllegalStateException();
-
 
8093
    }
-
 
8094
 
-
 
8095
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
-
 
8096
    public boolean isSet(_Fields field) {
-
 
8097
      if (field == null) {
-
 
8098
        throw new IllegalArgumentException();
-
 
8099
      }
-
 
8100
 
-
 
8101
      switch (field) {
-
 
8102
      case SUCCESS:
-
 
8103
        return isSetSuccess();
-
 
8104
      case PEX:
-
 
8105
        return isSetPex();
-
 
8106
      }
-
 
8107
      throw new IllegalStateException();
-
 
8108
    }
-
 
8109
 
-
 
8110
    @Override
-
 
8111
    public boolean equals(Object that) {
-
 
8112
      if (that == null)
-
 
8113
        return false;
-
 
8114
      if (that instanceof applyRechargeCoupon_result)
-
 
8115
        return this.equals((applyRechargeCoupon_result)that);
-
 
8116
      return false;
-
 
8117
    }
-
 
8118
 
-
 
8119
    public boolean equals(applyRechargeCoupon_result that) {
-
 
8120
      if (that == null)
-
 
8121
        return false;
-
 
8122
 
-
 
8123
      boolean this_present_success = true && this.isSetSuccess();
-
 
8124
      boolean that_present_success = true && that.isSetSuccess();
-
 
8125
      if (this_present_success || that_present_success) {
-
 
8126
        if (!(this_present_success && that_present_success))
-
 
8127
          return false;
-
 
8128
        if (!this.success.equals(that.success))
-
 
8129
          return false;
-
 
8130
      }
-
 
8131
 
-
 
8132
      boolean this_present_pex = true && this.isSetPex();
-
 
8133
      boolean that_present_pex = true && that.isSetPex();
-
 
8134
      if (this_present_pex || that_present_pex) {
-
 
8135
        if (!(this_present_pex && that_present_pex))
-
 
8136
          return false;
-
 
8137
        if (!this.pex.equals(that.pex))
-
 
8138
          return false;
-
 
8139
      }
-
 
8140
 
-
 
8141
      return true;
-
 
8142
    }
-
 
8143
 
-
 
8144
    @Override
-
 
8145
    public int hashCode() {
-
 
8146
      return 0;
-
 
8147
    }
-
 
8148
 
-
 
8149
    public int compareTo(applyRechargeCoupon_result other) {
-
 
8150
      if (!getClass().equals(other.getClass())) {
-
 
8151
        return getClass().getName().compareTo(other.getClass().getName());
-
 
8152
      }
-
 
8153
 
-
 
8154
      int lastComparison = 0;
-
 
8155
      applyRechargeCoupon_result typedOther = (applyRechargeCoupon_result)other;
-
 
8156
 
-
 
8157
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
-
 
8158
      if (lastComparison != 0) {
-
 
8159
        return lastComparison;
-
 
8160
      }
-
 
8161
      if (isSetSuccess()) {
-
 
8162
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
-
 
8163
        if (lastComparison != 0) {
-
 
8164
          return lastComparison;
-
 
8165
        }
-
 
8166
      }
-
 
8167
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
-
 
8168
      if (lastComparison != 0) {
-
 
8169
        return lastComparison;
-
 
8170
      }
-
 
8171
      if (isSetPex()) {
-
 
8172
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
-
 
8173
        if (lastComparison != 0) {
-
 
8174
          return lastComparison;
-
 
8175
        }
-
 
8176
      }
-
 
8177
      return 0;
-
 
8178
    }
-
 
8179
 
-
 
8180
    public _Fields fieldForId(int fieldId) {
-
 
8181
      return _Fields.findByThriftId(fieldId);
-
 
8182
    }
-
 
8183
 
-
 
8184
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
-
 
8185
      org.apache.thrift.protocol.TField field;
-
 
8186
      iprot.readStructBegin();
-
 
8187
      while (true)
-
 
8188
      {
-
 
8189
        field = iprot.readFieldBegin();
-
 
8190
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
-
 
8191
          break;
-
 
8192
        }
-
 
8193
        switch (field.id) {
-
 
8194
          case 0: // SUCCESS
-
 
8195
            if (field.type == org.apache.thrift.protocol.TType.MAP) {
-
 
8196
              {
-
 
8197
                org.apache.thrift.protocol.TMap _map16 = iprot.readMapBegin();
-
 
8198
                this.success = new HashMap<Long,String>(2*_map16.size);
-
 
8199
                for (int _i17 = 0; _i17 < _map16.size; ++_i17)
-
 
8200
                {
-
 
8201
                  long _key18; // required
-
 
8202
                  String _val19; // required
-
 
8203
                  _key18 = iprot.readI64();
-
 
8204
                  _val19 = iprot.readString();
-
 
8205
                  this.success.put(_key18, _val19);
-
 
8206
                }
-
 
8207
                iprot.readMapEnd();
-
 
8208
              }
-
 
8209
            } else { 
-
 
8210
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
-
 
8211
            }
-
 
8212
            break;
-
 
8213
          case 1: // PEX
-
 
8214
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
-
 
8215
              this.pex = new PromotionException();
-
 
8216
              this.pex.read(iprot);
-
 
8217
            } else { 
-
 
8218
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
-
 
8219
            }
-
 
8220
            break;
-
 
8221
          default:
-
 
8222
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
-
 
8223
        }
-
 
8224
        iprot.readFieldEnd();
-
 
8225
      }
-
 
8226
      iprot.readStructEnd();
-
 
8227
      validate();
-
 
8228
    }
-
 
8229
 
-
 
8230
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
-
 
8231
      oprot.writeStructBegin(STRUCT_DESC);
-
 
8232
 
-
 
8233
      if (this.isSetSuccess()) {
-
 
8234
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
-
 
8235
        {
-
 
8236
          oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I64, org.apache.thrift.protocol.TType.STRING, this.success.size()));
-
 
8237
          for (Map.Entry<Long, String> _iter20 : this.success.entrySet())
-
 
8238
          {
-
 
8239
            oprot.writeI64(_iter20.getKey());
-
 
8240
            oprot.writeString(_iter20.getValue());
-
 
8241
          }
-
 
8242
          oprot.writeMapEnd();
-
 
8243
        }
-
 
8244
        oprot.writeFieldEnd();
-
 
8245
      } else if (this.isSetPex()) {
-
 
8246
        oprot.writeFieldBegin(PEX_FIELD_DESC);
-
 
8247
        this.pex.write(oprot);
-
 
8248
        oprot.writeFieldEnd();
-
 
8249
      }
-
 
8250
      oprot.writeFieldStop();
-
 
8251
      oprot.writeStructEnd();
-
 
8252
    }
-
 
8253
 
-
 
8254
    @Override
-
 
8255
    public String toString() {
-
 
8256
      StringBuilder sb = new StringBuilder("applyRechargeCoupon_result(");
-
 
8257
      boolean first = true;
-
 
8258
 
-
 
8259
      sb.append("success:");
-
 
8260
      if (this.success == null) {
-
 
8261
        sb.append("null");
-
 
8262
      } else {
-
 
8263
        sb.append(this.success);
-
 
8264
      }
-
 
8265
      first = false;
-
 
8266
      if (!first) sb.append(", ");
-
 
8267
      sb.append("pex:");
-
 
8268
      if (this.pex == null) {
-
 
8269
        sb.append("null");
-
 
8270
      } else {
-
 
8271
        sb.append(this.pex);
-
 
8272
      }
-
 
8273
      first = false;
-
 
8274
      sb.append(")");
-
 
8275
      return sb.toString();
-
 
8276
    }
-
 
8277
 
-
 
8278
    public void validate() throws org.apache.thrift.TException {
-
 
8279
      // check for required fields
-
 
8280
    }
-
 
8281
 
-
 
8282
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
-
 
8283
      try {
-
 
8284
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
-
 
8285
      } catch (org.apache.thrift.TException te) {
-
 
8286
        throw new java.io.IOException(te);
-
 
8287
      }
-
 
8288
    }
-
 
8289
 
-
 
8290
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
-
 
8291
      try {
-
 
8292
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
-
 
8293
      } catch (org.apache.thrift.TException te) {
-
 
8294
        throw new java.io.IOException(te);
-
 
8295
      }
-
 
8296
    }
-
 
8297
 
-
 
8298
  }
-
 
8299
 
7318
  public static class trackCouponUsage_args implements org.apache.thrift.TBase<trackCouponUsage_args, trackCouponUsage_args._Fields>, java.io.Serializable, Cloneable   {
8300
  public static class trackCouponUsage_args implements org.apache.thrift.TBase<trackCouponUsage_args, trackCouponUsage_args._Fields>, java.io.Serializable, Cloneable   {
7319
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("trackCouponUsage_args");
8301
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("trackCouponUsage_args");
7320
 
8302
 
7321
    private static final org.apache.thrift.protocol.TField COUPON_CODE_FIELD_DESC = new org.apache.thrift.protocol.TField("couponCode", org.apache.thrift.protocol.TType.STRING, (short)1);
8303
    private static final org.apache.thrift.protocol.TField COUPON_CODE_FIELD_DESC = new org.apache.thrift.protocol.TField("couponCode", org.apache.thrift.protocol.TType.STRING, (short)1);
7322
    private static final org.apache.thrift.protocol.TField TRANSACTION_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("transactionId", org.apache.thrift.protocol.TType.I64, (short)2);
8304
    private static final org.apache.thrift.protocol.TField TRANSACTION_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("transactionId", org.apache.thrift.protocol.TType.I64, (short)2);
Line 9353... Line 10335...
9353
        }
10335
        }
9354
        switch (field.id) {
10336
        switch (field.id) {
9355
          case 0: // SUCCESS
10337
          case 0: // SUCCESS
9356
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
10338
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
9357
              {
10339
              {
9358
                org.apache.thrift.protocol.TList _list16 = iprot.readListBegin();
10340
                org.apache.thrift.protocol.TList _list21 = iprot.readListBegin();
9359
                this.success = new ArrayList<Coupon>(_list16.size);
10341
                this.success = new ArrayList<Coupon>(_list21.size);
9360
                for (int _i17 = 0; _i17 < _list16.size; ++_i17)
10342
                for (int _i22 = 0; _i22 < _list21.size; ++_i22)
9361
                {
10343
                {
9362
                  Coupon _elem18; // required
10344
                  Coupon _elem23; // required
9363
                  _elem18 = new Coupon();
10345
                  _elem23 = new Coupon();
9364
                  _elem18.read(iprot);
10346
                  _elem23.read(iprot);
9365
                  this.success.add(_elem18);
10347
                  this.success.add(_elem23);
9366
                }
10348
                }
9367
                iprot.readListEnd();
10349
                iprot.readListEnd();
9368
              }
10350
              }
9369
            } else { 
10351
            } else { 
9370
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10352
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
Line 9392... Line 10374...
9392
 
10374
 
9393
      if (this.isSetSuccess()) {
10375
      if (this.isSetSuccess()) {
9394
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
10376
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
9395
        {
10377
        {
9396
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
10378
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
9397
          for (Coupon _iter19 : this.success)
10379
          for (Coupon _iter24 : this.success)
9398
          {
10380
          {
9399
            _iter19.write(oprot);
10381
            _iter24.write(oprot);
9400
          }
10382
          }
9401
          oprot.writeListEnd();
10383
          oprot.writeListEnd();
9402
        }
10384
        }
9403
        oprot.writeFieldEnd();
10385
        oprot.writeFieldEnd();
9404
      } else if (this.isSetPex()) {
10386
      } else if (this.isSetPex()) {
Line 12059... Line 13041...
12059
        }
13041
        }
12060
        switch (field.id) {
13042
        switch (field.id) {
12061
          case 1: // ITEM_IDS
13043
          case 1: // ITEM_IDS
12062
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
13044
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
12063
              {
13045
              {
12064
                org.apache.thrift.protocol.TList _list20 = iprot.readListBegin();
13046
                org.apache.thrift.protocol.TList _list25 = iprot.readListBegin();
12065
                this.itemIds = new ArrayList<Long>(_list20.size);
13047
                this.itemIds = new ArrayList<Long>(_list25.size);
12066
                for (int _i21 = 0; _i21 < _list20.size; ++_i21)
13048
                for (int _i26 = 0; _i26 < _list25.size; ++_i26)
12067
                {
13049
                {
12068
                  long _elem22; // required
13050
                  long _elem27; // required
12069
                  _elem22 = iprot.readI64();
13051
                  _elem27 = iprot.readI64();
12070
                  this.itemIds.add(_elem22);
13052
                  this.itemIds.add(_elem27);
12071
                }
13053
                }
12072
                iprot.readListEnd();
13054
                iprot.readListEnd();
12073
              }
13055
              }
12074
            } else { 
13056
            } else { 
12075
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
13057
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
Line 12090... Line 13072...
12090
      oprot.writeStructBegin(STRUCT_DESC);
13072
      oprot.writeStructBegin(STRUCT_DESC);
12091
      if (this.itemIds != null) {
13073
      if (this.itemIds != null) {
12092
        oprot.writeFieldBegin(ITEM_IDS_FIELD_DESC);
13074
        oprot.writeFieldBegin(ITEM_IDS_FIELD_DESC);
12093
        {
13075
        {
12094
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, this.itemIds.size()));
13076
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, this.itemIds.size()));
12095
          for (long _iter23 : this.itemIds)
13077
          for (long _iter28 : this.itemIds)
12096
          {
13078
          {
12097
            oprot.writeI64(_iter23);
13079
            oprot.writeI64(_iter28);
12098
          }
13080
          }
12099
          oprot.writeListEnd();
13081
          oprot.writeListEnd();
12100
        }
13082
        }
12101
        oprot.writeFieldEnd();
13083
        oprot.writeFieldEnd();
12102
      }
13084
      }
Line 12458... Line 13440...
12458
        }
13440
        }
12459
        switch (field.id) {
13441
        switch (field.id) {
12460
          case 0: // SUCCESS
13442
          case 0: // SUCCESS
12461
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
13443
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
12462
              {
13444
              {
12463
                org.apache.thrift.protocol.TList _list24 = iprot.readListBegin();
13445
                org.apache.thrift.protocol.TList _list29 = iprot.readListBegin();
12464
                this.success = new ArrayList<ItemCouponDiscount>(_list24.size);
13446
                this.success = new ArrayList<ItemCouponDiscount>(_list29.size);
12465
                for (int _i25 = 0; _i25 < _list24.size; ++_i25)
13447
                for (int _i30 = 0; _i30 < _list29.size; ++_i30)
12466
                {
13448
                {
12467
                  ItemCouponDiscount _elem26; // required
13449
                  ItemCouponDiscount _elem31; // required
12468
                  _elem26 = new ItemCouponDiscount();
13450
                  _elem31 = new ItemCouponDiscount();
12469
                  _elem26.read(iprot);
13451
                  _elem31.read(iprot);
12470
                  this.success.add(_elem26);
13452
                  this.success.add(_elem31);
12471
                }
13453
                }
12472
                iprot.readListEnd();
13454
                iprot.readListEnd();
12473
              }
13455
              }
12474
            } else { 
13456
            } else { 
12475
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
13457
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
Line 12497... Line 13479...
12497
 
13479
 
12498
      if (this.isSetSuccess()) {
13480
      if (this.isSetSuccess()) {
12499
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
13481
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
12500
        {
13482
        {
12501
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
13483
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
12502
          for (ItemCouponDiscount _iter27 : this.success)
13484
          for (ItemCouponDiscount _iter32 : this.success)
12503
          {
13485
          {
12504
            _iter27.write(oprot);
13486
            _iter32.write(oprot);
12505
          }
13487
          }
12506
          oprot.writeListEnd();
13488
          oprot.writeListEnd();
12507
        }
13489
        }
12508
        oprot.writeFieldEnd();
13490
        oprot.writeFieldEnd();
12509
      } else if (this.isSetPex()) {
13491
      } else if (this.isSetPex()) {
Line 13108... Line 14090...
13108
        }
14090
        }
13109
        switch (field.id) {
14091
        switch (field.id) {
13110
          case 0: // SUCCESS
14092
          case 0: // SUCCESS
13111
            if (field.type == org.apache.thrift.protocol.TType.MAP) {
14093
            if (field.type == org.apache.thrift.protocol.TType.MAP) {
13112
              {
14094
              {
13113
                org.apache.thrift.protocol.TMap _map28 = iprot.readMapBegin();
14095
                org.apache.thrift.protocol.TMap _map33 = iprot.readMapBegin();
13114
                this.success = new HashMap<String,Double>(2*_map28.size);
14096
                this.success = new HashMap<String,Double>(2*_map33.size);
13115
                for (int _i29 = 0; _i29 < _map28.size; ++_i29)
14097
                for (int _i34 = 0; _i34 < _map33.size; ++_i34)
13116
                {
14098
                {
13117
                  String _key30; // required
14099
                  String _key35; // required
13118
                  double _val31; // required
14100
                  double _val36; // required
13119
                  _key30 = iprot.readString();
14101
                  _key35 = iprot.readString();
13120
                  _val31 = iprot.readDouble();
14102
                  _val36 = iprot.readDouble();
13121
                  this.success.put(_key30, _val31);
14103
                  this.success.put(_key35, _val36);
13122
                }
14104
                }
13123
                iprot.readMapEnd();
14105
                iprot.readMapEnd();
13124
              }
14106
              }
13125
            } else { 
14107
            } else { 
13126
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
14108
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
Line 13140... Line 14122...
13140
 
14122
 
13141
      if (this.isSetSuccess()) {
14123
      if (this.isSetSuccess()) {
13142
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
14124
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
13143
        {
14125
        {
13144
          oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.DOUBLE, this.success.size()));
14126
          oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.DOUBLE, this.success.size()));
13145
          for (Map.Entry<String, Double> _iter32 : this.success.entrySet())
14127
          for (Map.Entry<String, Double> _iter37 : this.success.entrySet())
13146
          {
14128
          {
13147
            oprot.writeString(_iter32.getKey());
14129
            oprot.writeString(_iter37.getKey());
13148
            oprot.writeDouble(_iter32.getValue());
14130
            oprot.writeDouble(_iter37.getValue());
13149
          }
14131
          }
13150
          oprot.writeMapEnd();
14132
          oprot.writeMapEnd();
13151
        }
14133
        }
13152
        oprot.writeFieldEnd();
14134
        oprot.writeFieldEnd();
13153
      }
14135
      }