Subversion Repositories SmartDukaan

Rev

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

Rev 6903 Rev 6922
Line 117... Line 117...
117
 
117
 
118
    public void addAddressToCart(long cartId, long addressId) throws ShoppingCartException, org.apache.thrift.TException;
118
    public void addAddressToCart(long cartId, long addressId) throws ShoppingCartException, org.apache.thrift.TException;
119
 
119
 
120
    public void addStoreToCart(long cartId, long storeId) throws ShoppingCartException, org.apache.thrift.TException;
120
    public void addStoreToCart(long cartId, long storeId) throws ShoppingCartException, org.apache.thrift.TException;
121
 
121
 
122
    public void applyCouponToCart(long cartId, String couponCode, double totalPrice, double discountedPrice) throws ShoppingCartException, org.apache.thrift.TException;
122
    public void applyCouponToCart(Cart cart, String couponCode) throws ShoppingCartException, org.apache.thrift.TException;
123
 
123
 
124
    public void removeCoupon(long cartId) throws ShoppingCartException, org.apache.thrift.TException;
124
    public void removeCoupon(long cartId) throws ShoppingCartException, org.apache.thrift.TException;
125
 
125
 
126
    /**
126
    /**
127
     * Deletes all the discounts associated with the cart
127
     * Deletes all the discounts associated with the cart
Line 420... Line 420...
420
 
420
 
421
    public void addAddressToCart(long cartId, long addressId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.addAddressToCart_call> resultHandler) throws org.apache.thrift.TException;
421
    public void addAddressToCart(long cartId, long addressId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.addAddressToCart_call> resultHandler) throws org.apache.thrift.TException;
422
 
422
 
423
    public void addStoreToCart(long cartId, long storeId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.addStoreToCart_call> resultHandler) throws org.apache.thrift.TException;
423
    public void addStoreToCart(long cartId, long storeId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.addStoreToCart_call> resultHandler) throws org.apache.thrift.TException;
424
 
424
 
425
    public void applyCouponToCart(long cartId, String couponCode, double totalPrice, double discountedPrice, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.applyCouponToCart_call> resultHandler) throws org.apache.thrift.TException;
425
    public void applyCouponToCart(Cart cart, String couponCode, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.applyCouponToCart_call> resultHandler) throws org.apache.thrift.TException;
426
 
426
 
427
    public void removeCoupon(long cartId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.removeCoupon_call> resultHandler) throws org.apache.thrift.TException;
427
    public void removeCoupon(long cartId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.removeCoupon_call> resultHandler) throws org.apache.thrift.TException;
428
 
428
 
429
    public void deleteDiscountsFromCart(long cartId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.deleteDiscountsFromCart_call> resultHandler) throws org.apache.thrift.TException;
429
    public void deleteDiscountsFromCart(long cartId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.deleteDiscountsFromCart_call> resultHandler) throws org.apache.thrift.TException;
430
 
430
 
Line 1714... Line 1714...
1714
        throw result.scx;
1714
        throw result.scx;
1715
      }
1715
      }
1716
      return;
1716
      return;
1717
    }
1717
    }
1718
 
1718
 
1719
    public void applyCouponToCart(long cartId, String couponCode, double totalPrice, double discountedPrice) throws ShoppingCartException, org.apache.thrift.TException
1719
    public void applyCouponToCart(Cart cart, String couponCode) throws ShoppingCartException, org.apache.thrift.TException
1720
    {
1720
    {
1721
      send_applyCouponToCart(cartId, couponCode, totalPrice, discountedPrice);
1721
      send_applyCouponToCart(cart, couponCode);
1722
      recv_applyCouponToCart();
1722
      recv_applyCouponToCart();
1723
    }
1723
    }
1724
 
1724
 
1725
    public void send_applyCouponToCart(long cartId, String couponCode, double totalPrice, double discountedPrice) throws org.apache.thrift.TException
1725
    public void send_applyCouponToCart(Cart cart, String couponCode) throws org.apache.thrift.TException
1726
    {
1726
    {
1727
      applyCouponToCart_args args = new applyCouponToCart_args();
1727
      applyCouponToCart_args args = new applyCouponToCart_args();
1728
      args.setCartId(cartId);
1728
      args.setCart(cart);
1729
      args.setCouponCode(couponCode);
1729
      args.setCouponCode(couponCode);
1730
      args.setTotalPrice(totalPrice);
-
 
1731
      args.setDiscountedPrice(discountedPrice);
-
 
1732
      sendBase("applyCouponToCart", args);
1730
      sendBase("applyCouponToCart", args);
1733
    }
1731
    }
1734
 
1732
 
1735
    public void recv_applyCouponToCart() throws ShoppingCartException, org.apache.thrift.TException
1733
    public void recv_applyCouponToCart() throws ShoppingCartException, org.apache.thrift.TException
1736
    {
1734
    {
Line 3941... Line 3939...
3941
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
3939
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
3942
        (new Client(prot)).recv_addStoreToCart();
3940
        (new Client(prot)).recv_addStoreToCart();
3943
      }
3941
      }
3944
    }
3942
    }
3945
 
3943
 
3946
    public void applyCouponToCart(long cartId, String couponCode, double totalPrice, double discountedPrice, org.apache.thrift.async.AsyncMethodCallback<applyCouponToCart_call> resultHandler) throws org.apache.thrift.TException {
3944
    public void applyCouponToCart(Cart cart, String couponCode, org.apache.thrift.async.AsyncMethodCallback<applyCouponToCart_call> resultHandler) throws org.apache.thrift.TException {
3947
      checkReady();
3945
      checkReady();
3948
      applyCouponToCart_call method_call = new applyCouponToCart_call(cartId, couponCode, totalPrice, discountedPrice, resultHandler, this, ___protocolFactory, ___transport);
3946
      applyCouponToCart_call method_call = new applyCouponToCart_call(cart, couponCode, resultHandler, this, ___protocolFactory, ___transport);
3949
      this.___currentMethod = method_call;
3947
      this.___currentMethod = method_call;
3950
      ___manager.call(method_call);
3948
      ___manager.call(method_call);
3951
    }
3949
    }
3952
 
3950
 
3953
    public static class applyCouponToCart_call extends org.apache.thrift.async.TAsyncMethodCall {
3951
    public static class applyCouponToCart_call extends org.apache.thrift.async.TAsyncMethodCall {
3954
      private long cartId;
3952
      private Cart cart;
3955
      private String couponCode;
3953
      private String couponCode;
3956
      private double totalPrice;
-
 
3957
      private double discountedPrice;
-
 
3958
      public applyCouponToCart_call(long cartId, String couponCode, double totalPrice, double discountedPrice, org.apache.thrift.async.AsyncMethodCallback<applyCouponToCart_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 {
3954
      public applyCouponToCart_call(Cart cart, String couponCode, org.apache.thrift.async.AsyncMethodCallback<applyCouponToCart_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 {
3959
        super(client, protocolFactory, transport, resultHandler, false);
3955
        super(client, protocolFactory, transport, resultHandler, false);
3960
        this.cartId = cartId;
3956
        this.cart = cart;
3961
        this.couponCode = couponCode;
3957
        this.couponCode = couponCode;
3962
        this.totalPrice = totalPrice;
-
 
3963
        this.discountedPrice = discountedPrice;
-
 
3964
      }
3958
      }
3965
 
3959
 
3966
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
3960
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
3967
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("applyCouponToCart", org.apache.thrift.protocol.TMessageType.CALL, 0));
3961
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("applyCouponToCart", org.apache.thrift.protocol.TMessageType.CALL, 0));
3968
        applyCouponToCart_args args = new applyCouponToCart_args();
3962
        applyCouponToCart_args args = new applyCouponToCart_args();
3969
        args.setCartId(cartId);
3963
        args.setCart(cart);
3970
        args.setCouponCode(couponCode);
3964
        args.setCouponCode(couponCode);
3971
        args.setTotalPrice(totalPrice);
-
 
3972
        args.setDiscountedPrice(discountedPrice);
-
 
3973
        args.write(prot);
3965
        args.write(prot);
3974
        prot.writeMessageEnd();
3966
        prot.writeMessageEnd();
3975
      }
3967
      }
3976
 
3968
 
3977
      public void getResult() throws ShoppingCartException, org.apache.thrift.TException {
3969
      public void getResult() throws ShoppingCartException, org.apache.thrift.TException {
Line 5884... Line 5876...
5884
      }
5876
      }
5885
 
5877
 
5886
      protected applyCouponToCart_result getResult(I iface, applyCouponToCart_args args) throws org.apache.thrift.TException {
5878
      protected applyCouponToCart_result getResult(I iface, applyCouponToCart_args args) throws org.apache.thrift.TException {
5887
        applyCouponToCart_result result = new applyCouponToCart_result();
5879
        applyCouponToCart_result result = new applyCouponToCart_result();
5888
        try {
5880
        try {
5889
          iface.applyCouponToCart(args.cartId, args.couponCode, args.totalPrice, args.discountedPrice);
5881
          iface.applyCouponToCart(args.cart, args.couponCode);
5890
        } catch (ShoppingCartException scx) {
5882
        } catch (ShoppingCartException scx) {
5891
          result.scx = scx;
5883
          result.scx = scx;
5892
        }
5884
        }
5893
        return result;
5885
        return result;
5894
      }
5886
      }
Line 40505... Line 40497...
40505
  }
40497
  }
40506
 
40498
 
40507
  public static class applyCouponToCart_args implements org.apache.thrift.TBase<applyCouponToCart_args, applyCouponToCart_args._Fields>, java.io.Serializable, Cloneable   {
40499
  public static class applyCouponToCart_args implements org.apache.thrift.TBase<applyCouponToCart_args, applyCouponToCart_args._Fields>, java.io.Serializable, Cloneable   {
40508
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("applyCouponToCart_args");
40500
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("applyCouponToCart_args");
40509
 
40501
 
40510
    private static final org.apache.thrift.protocol.TField CART_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("cartId", org.apache.thrift.protocol.TType.I64, (short)1);
40502
    private static final org.apache.thrift.protocol.TField CART_FIELD_DESC = new org.apache.thrift.protocol.TField("cart", org.apache.thrift.protocol.TType.STRUCT, (short)1);
40511
    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)2);
40503
    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)2);
40512
    private static final org.apache.thrift.protocol.TField TOTAL_PRICE_FIELD_DESC = new org.apache.thrift.protocol.TField("totalPrice", org.apache.thrift.protocol.TType.DOUBLE, (short)3);
-
 
40513
    private static final org.apache.thrift.protocol.TField DISCOUNTED_PRICE_FIELD_DESC = new org.apache.thrift.protocol.TField("discountedPrice", org.apache.thrift.protocol.TType.DOUBLE, (short)4);
-
 
40514
 
40504
 
40515
    private long cartId; // required
40505
    private Cart cart; // required
40516
    private String couponCode; // required
40506
    private String couponCode; // required
40517
    private double totalPrice; // required
-
 
40518
    private double discountedPrice; // required
-
 
40519
 
40507
 
40520
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
40508
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
40521
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
40509
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
40522
      CART_ID((short)1, "cartId"),
40510
      CART((short)1, "cart"),
40523
      COUPON_CODE((short)2, "couponCode"),
40511
      COUPON_CODE((short)2, "couponCode");
40524
      TOTAL_PRICE((short)3, "totalPrice"),
-
 
40525
      DISCOUNTED_PRICE((short)4, "discountedPrice");
-
 
40526
 
40512
 
40527
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
40513
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
40528
 
40514
 
40529
      static {
40515
      static {
40530
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
40516
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
Line 40535... Line 40521...
40535
      /**
40521
      /**
40536
       * Find the _Fields constant that matches fieldId, or null if its not found.
40522
       * Find the _Fields constant that matches fieldId, or null if its not found.
40537
       */
40523
       */
40538
      public static _Fields findByThriftId(int fieldId) {
40524
      public static _Fields findByThriftId(int fieldId) {
40539
        switch(fieldId) {
40525
        switch(fieldId) {
40540
          case 1: // CART_ID
40526
          case 1: // CART
40541
            return CART_ID;
40527
            return CART;
40542
          case 2: // COUPON_CODE
40528
          case 2: // COUPON_CODE
40543
            return COUPON_CODE;
40529
            return COUPON_CODE;
40544
          case 3: // TOTAL_PRICE
-
 
40545
            return TOTAL_PRICE;
-
 
40546
          case 4: // DISCOUNTED_PRICE
-
 
40547
            return DISCOUNTED_PRICE;
-
 
40548
          default:
40530
          default:
40549
            return null;
40531
            return null;
40550
        }
40532
        }
40551
      }
40533
      }
40552
 
40534
 
Line 40583... Line 40565...
40583
        return _fieldName;
40565
        return _fieldName;
40584
      }
40566
      }
40585
    }
40567
    }
40586
 
40568
 
40587
    // isset id assignments
40569
    // isset id assignments
40588
    private static final int __CARTID_ISSET_ID = 0;
-
 
40589
    private static final int __TOTALPRICE_ISSET_ID = 1;
-
 
40590
    private static final int __DISCOUNTEDPRICE_ISSET_ID = 2;
-
 
40591
    private BitSet __isset_bit_vector = new BitSet(3);
-
 
40592
 
40570
 
40593
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
40571
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
40594
    static {
40572
    static {
40595
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
40573
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
40596
      tmpMap.put(_Fields.CART_ID, new org.apache.thrift.meta_data.FieldMetaData("cartId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
40574
      tmpMap.put(_Fields.CART, new org.apache.thrift.meta_data.FieldMetaData("cart", org.apache.thrift.TFieldRequirementType.DEFAULT, 
40597
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
40575
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Cart.class)));
40598
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
40576
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
40599
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
40577
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
40600
      tmpMap.put(_Fields.TOTAL_PRICE, new org.apache.thrift.meta_data.FieldMetaData("totalPrice", org.apache.thrift.TFieldRequirementType.DEFAULT, 
-
 
40601
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
-
 
40602
      tmpMap.put(_Fields.DISCOUNTED_PRICE, new org.apache.thrift.meta_data.FieldMetaData("discountedPrice", org.apache.thrift.TFieldRequirementType.DEFAULT, 
-
 
40603
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
-
 
40604
      metaDataMap = Collections.unmodifiableMap(tmpMap);
40578
      metaDataMap = Collections.unmodifiableMap(tmpMap);
40605
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(applyCouponToCart_args.class, metaDataMap);
40579
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(applyCouponToCart_args.class, metaDataMap);
40606
    }
40580
    }
40607
 
40581
 
40608
    public applyCouponToCart_args() {
40582
    public applyCouponToCart_args() {
40609
    }
40583
    }
40610
 
40584
 
40611
    public applyCouponToCart_args(
40585
    public applyCouponToCart_args(
40612
      long cartId,
40586
      Cart cart,
40613
      String couponCode,
40587
      String couponCode)
40614
      double totalPrice,
-
 
40615
      double discountedPrice)
-
 
40616
    {
40588
    {
40617
      this();
40589
      this();
40618
      this.cartId = cartId;
40590
      this.cart = cart;
40619
      setCartIdIsSet(true);
-
 
40620
      this.couponCode = couponCode;
40591
      this.couponCode = couponCode;
40621
      this.totalPrice = totalPrice;
-
 
40622
      setTotalPriceIsSet(true);
-
 
40623
      this.discountedPrice = discountedPrice;
-
 
40624
      setDiscountedPriceIsSet(true);
-
 
40625
    }
40592
    }
40626
 
40593
 
40627
    /**
40594
    /**
40628
     * Performs a deep copy on <i>other</i>.
40595
     * Performs a deep copy on <i>other</i>.
40629
     */
40596
     */
40630
    public applyCouponToCart_args(applyCouponToCart_args other) {
40597
    public applyCouponToCart_args(applyCouponToCart_args other) {
40631
      __isset_bit_vector.clear();
40598
      if (other.isSetCart()) {
40632
      __isset_bit_vector.or(other.__isset_bit_vector);
-
 
40633
      this.cartId = other.cartId;
40599
        this.cart = new Cart(other.cart);
-
 
40600
      }
40634
      if (other.isSetCouponCode()) {
40601
      if (other.isSetCouponCode()) {
40635
        this.couponCode = other.couponCode;
40602
        this.couponCode = other.couponCode;
40636
      }
40603
      }
40637
      this.totalPrice = other.totalPrice;
-
 
40638
      this.discountedPrice = other.discountedPrice;
-
 
40639
    }
40604
    }
40640
 
40605
 
40641
    public applyCouponToCart_args deepCopy() {
40606
    public applyCouponToCart_args deepCopy() {
40642
      return new applyCouponToCart_args(this);
40607
      return new applyCouponToCart_args(this);
40643
    }
40608
    }
40644
 
40609
 
40645
    @Override
40610
    @Override
40646
    public void clear() {
40611
    public void clear() {
40647
      setCartIdIsSet(false);
-
 
40648
      this.cartId = 0;
40612
      this.cart = null;
40649
      this.couponCode = null;
40613
      this.couponCode = null;
40650
      setTotalPriceIsSet(false);
-
 
40651
      this.totalPrice = 0.0;
-
 
40652
      setDiscountedPriceIsSet(false);
-
 
40653
      this.discountedPrice = 0.0;
-
 
40654
    }
40614
    }
40655
 
40615
 
40656
    public long getCartId() {
40616
    public Cart getCart() {
40657
      return this.cartId;
40617
      return this.cart;
40658
    }
40618
    }
40659
 
40619
 
40660
    public void setCartId(long cartId) {
40620
    public void setCart(Cart cart) {
40661
      this.cartId = cartId;
40621
      this.cart = cart;
40662
      setCartIdIsSet(true);
-
 
40663
    }
40622
    }
40664
 
40623
 
40665
    public void unsetCartId() {
40624
    public void unsetCart() {
40666
      __isset_bit_vector.clear(__CARTID_ISSET_ID);
40625
      this.cart = null;
40667
    }
40626
    }
40668
 
40627
 
40669
    /** Returns true if field cartId is set (has been assigned a value) and false otherwise */
40628
    /** Returns true if field cart is set (has been assigned a value) and false otherwise */
40670
    public boolean isSetCartId() {
40629
    public boolean isSetCart() {
40671
      return __isset_bit_vector.get(__CARTID_ISSET_ID);
40630
      return this.cart != null;
40672
    }
40631
    }
40673
 
40632
 
40674
    public void setCartIdIsSet(boolean value) {
40633
    public void setCartIsSet(boolean value) {
-
 
40634
      if (!value) {
40675
      __isset_bit_vector.set(__CARTID_ISSET_ID, value);
40635
        this.cart = null;
-
 
40636
      }
40676
    }
40637
    }
40677
 
40638
 
40678
    public String getCouponCode() {
40639
    public String getCouponCode() {
40679
      return this.couponCode;
40640
      return this.couponCode;
40680
    }
40641
    }
Line 40696... Line 40657...
40696
      if (!value) {
40657
      if (!value) {
40697
        this.couponCode = null;
40658
        this.couponCode = null;
40698
      }
40659
      }
40699
    }
40660
    }
40700
 
40661
 
40701
    public double getTotalPrice() {
-
 
40702
      return this.totalPrice;
-
 
40703
    }
-
 
40704
 
-
 
40705
    public void setTotalPrice(double totalPrice) {
-
 
40706
      this.totalPrice = totalPrice;
-
 
40707
      setTotalPriceIsSet(true);
-
 
40708
    }
-
 
40709
 
-
 
40710
    public void unsetTotalPrice() {
-
 
40711
      __isset_bit_vector.clear(__TOTALPRICE_ISSET_ID);
-
 
40712
    }
-
 
40713
 
-
 
40714
    /** Returns true if field totalPrice is set (has been assigned a value) and false otherwise */
-
 
40715
    public boolean isSetTotalPrice() {
-
 
40716
      return __isset_bit_vector.get(__TOTALPRICE_ISSET_ID);
-
 
40717
    }
-
 
40718
 
-
 
40719
    public void setTotalPriceIsSet(boolean value) {
-
 
40720
      __isset_bit_vector.set(__TOTALPRICE_ISSET_ID, value);
-
 
40721
    }
-
 
40722
 
-
 
40723
    public double getDiscountedPrice() {
-
 
40724
      return this.discountedPrice;
-
 
40725
    }
-
 
40726
 
-
 
40727
    public void setDiscountedPrice(double discountedPrice) {
-
 
40728
      this.discountedPrice = discountedPrice;
-
 
40729
      setDiscountedPriceIsSet(true);
-
 
40730
    }
-
 
40731
 
-
 
40732
    public void unsetDiscountedPrice() {
-
 
40733
      __isset_bit_vector.clear(__DISCOUNTEDPRICE_ISSET_ID);
-
 
40734
    }
-
 
40735
 
-
 
40736
    /** Returns true if field discountedPrice is set (has been assigned a value) and false otherwise */
-
 
40737
    public boolean isSetDiscountedPrice() {
-
 
40738
      return __isset_bit_vector.get(__DISCOUNTEDPRICE_ISSET_ID);
-
 
40739
    }
-
 
40740
 
-
 
40741
    public void setDiscountedPriceIsSet(boolean value) {
-
 
40742
      __isset_bit_vector.set(__DISCOUNTEDPRICE_ISSET_ID, value);
-
 
40743
    }
-
 
40744
 
-
 
40745
    public void setFieldValue(_Fields field, Object value) {
40662
    public void setFieldValue(_Fields field, Object value) {
40746
      switch (field) {
40663
      switch (field) {
40747
      case CART_ID:
40664
      case CART:
40748
        if (value == null) {
40665
        if (value == null) {
40749
          unsetCartId();
40666
          unsetCart();
40750
        } else {
40667
        } else {
40751
          setCartId((Long)value);
40668
          setCart((Cart)value);
40752
        }
40669
        }
40753
        break;
40670
        break;
40754
 
40671
 
40755
      case COUPON_CODE:
40672
      case COUPON_CODE:
40756
        if (value == null) {
40673
        if (value == null) {
Line 40758... Line 40675...
40758
        } else {
40675
        } else {
40759
          setCouponCode((String)value);
40676
          setCouponCode((String)value);
40760
        }
40677
        }
40761
        break;
40678
        break;
40762
 
40679
 
40763
      case TOTAL_PRICE:
-
 
40764
        if (value == null) {
-
 
40765
          unsetTotalPrice();
-
 
40766
        } else {
-
 
40767
          setTotalPrice((Double)value);
-
 
40768
        }
-
 
40769
        break;
-
 
40770
 
-
 
40771
      case DISCOUNTED_PRICE:
-
 
40772
        if (value == null) {
-
 
40773
          unsetDiscountedPrice();
-
 
40774
        } else {
-
 
40775
          setDiscountedPrice((Double)value);
-
 
40776
        }
-
 
40777
        break;
-
 
40778
 
-
 
40779
      }
40680
      }
40780
    }
40681
    }
40781
 
40682
 
40782
    public Object getFieldValue(_Fields field) {
40683
    public Object getFieldValue(_Fields field) {
40783
      switch (field) {
40684
      switch (field) {
40784
      case CART_ID:
40685
      case CART:
40785
        return Long.valueOf(getCartId());
40686
        return getCart();
40786
 
40687
 
40787
      case COUPON_CODE:
40688
      case COUPON_CODE:
40788
        return getCouponCode();
40689
        return getCouponCode();
40789
 
40690
 
40790
      case TOTAL_PRICE:
-
 
40791
        return Double.valueOf(getTotalPrice());
-
 
40792
 
-
 
40793
      case DISCOUNTED_PRICE:
-
 
40794
        return Double.valueOf(getDiscountedPrice());
-
 
40795
 
-
 
40796
      }
40691
      }
40797
      throw new IllegalStateException();
40692
      throw new IllegalStateException();
40798
    }
40693
    }
40799
 
40694
 
40800
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
40695
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
Line 40802... Line 40697...
40802
      if (field == null) {
40697
      if (field == null) {
40803
        throw new IllegalArgumentException();
40698
        throw new IllegalArgumentException();
40804
      }
40699
      }
40805
 
40700
 
40806
      switch (field) {
40701
      switch (field) {
40807
      case CART_ID:
40702
      case CART:
40808
        return isSetCartId();
40703
        return isSetCart();
40809
      case COUPON_CODE:
40704
      case COUPON_CODE:
40810
        return isSetCouponCode();
40705
        return isSetCouponCode();
40811
      case TOTAL_PRICE:
-
 
40812
        return isSetTotalPrice();
-
 
40813
      case DISCOUNTED_PRICE:
-
 
40814
        return isSetDiscountedPrice();
-
 
40815
      }
40706
      }
40816
      throw new IllegalStateException();
40707
      throw new IllegalStateException();
40817
    }
40708
    }
40818
 
40709
 
40819
    @Override
40710
    @Override
Line 40827... Line 40718...
40827
 
40718
 
40828
    public boolean equals(applyCouponToCart_args that) {
40719
    public boolean equals(applyCouponToCart_args that) {
40829
      if (that == null)
40720
      if (that == null)
40830
        return false;
40721
        return false;
40831
 
40722
 
40832
      boolean this_present_cartId = true;
40723
      boolean this_present_cart = true && this.isSetCart();
40833
      boolean that_present_cartId = true;
40724
      boolean that_present_cart = true && that.isSetCart();
40834
      if (this_present_cartId || that_present_cartId) {
40725
      if (this_present_cart || that_present_cart) {
40835
        if (!(this_present_cartId && that_present_cartId))
40726
        if (!(this_present_cart && that_present_cart))
40836
          return false;
40727
          return false;
40837
        if (this.cartId != that.cartId)
40728
        if (!this.cart.equals(that.cart))
40838
          return false;
40729
          return false;
40839
      }
40730
      }
40840
 
40731
 
40841
      boolean this_present_couponCode = true && this.isSetCouponCode();
40732
      boolean this_present_couponCode = true && this.isSetCouponCode();
40842
      boolean that_present_couponCode = true && that.isSetCouponCode();
40733
      boolean that_present_couponCode = true && that.isSetCouponCode();
Line 40845... Line 40736...
40845
          return false;
40736
          return false;
40846
        if (!this.couponCode.equals(that.couponCode))
40737
        if (!this.couponCode.equals(that.couponCode))
40847
          return false;
40738
          return false;
40848
      }
40739
      }
40849
 
40740
 
40850
      boolean this_present_totalPrice = true;
-
 
40851
      boolean that_present_totalPrice = true;
-
 
40852
      if (this_present_totalPrice || that_present_totalPrice) {
-
 
40853
        if (!(this_present_totalPrice && that_present_totalPrice))
-
 
40854
          return false;
-
 
40855
        if (this.totalPrice != that.totalPrice)
-
 
40856
          return false;
-
 
40857
      }
-
 
40858
 
-
 
40859
      boolean this_present_discountedPrice = true;
-
 
40860
      boolean that_present_discountedPrice = true;
-
 
40861
      if (this_present_discountedPrice || that_present_discountedPrice) {
-
 
40862
        if (!(this_present_discountedPrice && that_present_discountedPrice))
-
 
40863
          return false;
-
 
40864
        if (this.discountedPrice != that.discountedPrice)
-
 
40865
          return false;
-
 
40866
      }
-
 
40867
 
-
 
40868
      return true;
40741
      return true;
40869
    }
40742
    }
40870
 
40743
 
40871
    @Override
40744
    @Override
40872
    public int hashCode() {
40745
    public int hashCode() {
Line 40879... Line 40752...
40879
      }
40752
      }
40880
 
40753
 
40881
      int lastComparison = 0;
40754
      int lastComparison = 0;
40882
      applyCouponToCart_args typedOther = (applyCouponToCart_args)other;
40755
      applyCouponToCart_args typedOther = (applyCouponToCart_args)other;
40883
 
40756
 
40884
      lastComparison = Boolean.valueOf(isSetCartId()).compareTo(typedOther.isSetCartId());
40757
      lastComparison = Boolean.valueOf(isSetCart()).compareTo(typedOther.isSetCart());
40885
      if (lastComparison != 0) {
40758
      if (lastComparison != 0) {
40886
        return lastComparison;
40759
        return lastComparison;
40887
      }
40760
      }
40888
      if (isSetCartId()) {
40761
      if (isSetCart()) {
40889
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cartId, typedOther.cartId);
40762
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cart, typedOther.cart);
40890
        if (lastComparison != 0) {
40763
        if (lastComparison != 0) {
40891
          return lastComparison;
40764
          return lastComparison;
40892
        }
40765
        }
40893
      }
40766
      }
40894
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
40767
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
Line 40899... Line 40772...
40899
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
40772
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
40900
        if (lastComparison != 0) {
40773
        if (lastComparison != 0) {
40901
          return lastComparison;
40774
          return lastComparison;
40902
        }
40775
        }
40903
      }
40776
      }
40904
      lastComparison = Boolean.valueOf(isSetTotalPrice()).compareTo(typedOther.isSetTotalPrice());
-
 
40905
      if (lastComparison != 0) {
-
 
40906
        return lastComparison;
-
 
40907
      }
-
 
40908
      if (isSetTotalPrice()) {
-
 
40909
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.totalPrice, typedOther.totalPrice);
-
 
40910
        if (lastComparison != 0) {
-
 
40911
          return lastComparison;
-
 
40912
        }
-
 
40913
      }
-
 
40914
      lastComparison = Boolean.valueOf(isSetDiscountedPrice()).compareTo(typedOther.isSetDiscountedPrice());
-
 
40915
      if (lastComparison != 0) {
-
 
40916
        return lastComparison;
-
 
40917
      }
-
 
40918
      if (isSetDiscountedPrice()) {
-
 
40919
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.discountedPrice, typedOther.discountedPrice);
-
 
40920
        if (lastComparison != 0) {
-
 
40921
          return lastComparison;
-
 
40922
        }
-
 
40923
      }
-
 
40924
      return 0;
40777
      return 0;
40925
    }
40778
    }
40926
 
40779
 
40927
    public _Fields fieldForId(int fieldId) {
40780
    public _Fields fieldForId(int fieldId) {
40928
      return _Fields.findByThriftId(fieldId);
40781
      return _Fields.findByThriftId(fieldId);
Line 40936... Line 40789...
40936
        field = iprot.readFieldBegin();
40789
        field = iprot.readFieldBegin();
40937
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
40790
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
40938
          break;
40791
          break;
40939
        }
40792
        }
40940
        switch (field.id) {
40793
        switch (field.id) {
40941
          case 1: // CART_ID
40794
          case 1: // CART
40942
            if (field.type == org.apache.thrift.protocol.TType.I64) {
40795
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
40943
              this.cartId = iprot.readI64();
40796
              this.cart = new Cart();
40944
              setCartIdIsSet(true);
40797
              this.cart.read(iprot);
40945
            } else { 
40798
            } else { 
40946
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
40799
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
40947
            }
40800
            }
40948
            break;
40801
            break;
40949
          case 2: // COUPON_CODE
40802
          case 2: // COUPON_CODE
Line 40951... Line 40804...
40951
              this.couponCode = iprot.readString();
40804
              this.couponCode = iprot.readString();
40952
            } else { 
40805
            } else { 
40953
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
40806
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
40954
            }
40807
            }
40955
            break;
40808
            break;
40956
          case 3: // TOTAL_PRICE
-
 
40957
            if (field.type == org.apache.thrift.protocol.TType.DOUBLE) {
-
 
40958
              this.totalPrice = iprot.readDouble();
-
 
40959
              setTotalPriceIsSet(true);
-
 
40960
            } else { 
-
 
40961
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
-
 
40962
            }
-
 
40963
            break;
-
 
40964
          case 4: // DISCOUNTED_PRICE
-
 
40965
            if (field.type == org.apache.thrift.protocol.TType.DOUBLE) {
-
 
40966
              this.discountedPrice = iprot.readDouble();
-
 
40967
              setDiscountedPriceIsSet(true);
-
 
40968
            } else { 
-
 
40969
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
-
 
40970
            }
-
 
40971
            break;
-
 
40972
          default:
40809
          default:
40973
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
40810
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
40974
        }
40811
        }
40975
        iprot.readFieldEnd();
40812
        iprot.readFieldEnd();
40976
      }
40813
      }
Line 40980... Line 40817...
40980
 
40817
 
40981
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
40818
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
40982
      validate();
40819
      validate();
40983
 
40820
 
40984
      oprot.writeStructBegin(STRUCT_DESC);
40821
      oprot.writeStructBegin(STRUCT_DESC);
-
 
40822
      if (this.cart != null) {
40985
      oprot.writeFieldBegin(CART_ID_FIELD_DESC);
40823
        oprot.writeFieldBegin(CART_FIELD_DESC);
40986
      oprot.writeI64(this.cartId);
40824
        this.cart.write(oprot);
40987
      oprot.writeFieldEnd();
40825
        oprot.writeFieldEnd();
-
 
40826
      }
40988
      if (this.couponCode != null) {
40827
      if (this.couponCode != null) {
40989
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
40828
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
40990
        oprot.writeString(this.couponCode);
40829
        oprot.writeString(this.couponCode);
40991
        oprot.writeFieldEnd();
40830
        oprot.writeFieldEnd();
40992
      }
40831
      }
40993
      oprot.writeFieldBegin(TOTAL_PRICE_FIELD_DESC);
-
 
40994
      oprot.writeDouble(this.totalPrice);
-
 
40995
      oprot.writeFieldEnd();
-
 
40996
      oprot.writeFieldBegin(DISCOUNTED_PRICE_FIELD_DESC);
-
 
40997
      oprot.writeDouble(this.discountedPrice);
-
 
40998
      oprot.writeFieldEnd();
-
 
40999
      oprot.writeFieldStop();
40832
      oprot.writeFieldStop();
41000
      oprot.writeStructEnd();
40833
      oprot.writeStructEnd();
41001
    }
40834
    }
41002
 
40835
 
41003
    @Override
40836
    @Override
41004
    public String toString() {
40837
    public String toString() {
41005
      StringBuilder sb = new StringBuilder("applyCouponToCart_args(");
40838
      StringBuilder sb = new StringBuilder("applyCouponToCart_args(");
41006
      boolean first = true;
40839
      boolean first = true;
41007
 
40840
 
41008
      sb.append("cartId:");
40841
      sb.append("cart:");
-
 
40842
      if (this.cart == null) {
-
 
40843
        sb.append("null");
-
 
40844
      } else {
41009
      sb.append(this.cartId);
40845
        sb.append(this.cart);
-
 
40846
      }
41010
      first = false;
40847
      first = false;
41011
      if (!first) sb.append(", ");
40848
      if (!first) sb.append(", ");
41012
      sb.append("couponCode:");
40849
      sb.append("couponCode:");
41013
      if (this.couponCode == null) {
40850
      if (this.couponCode == null) {
41014
        sb.append("null");
40851
        sb.append("null");
41015
      } else {
40852
      } else {
41016
        sb.append(this.couponCode);
40853
        sb.append(this.couponCode);
41017
      }
40854
      }
41018
      first = false;
40855
      first = false;
41019
      if (!first) sb.append(", ");
-
 
41020
      sb.append("totalPrice:");
-
 
41021
      sb.append(this.totalPrice);
-
 
41022
      first = false;
-
 
41023
      if (!first) sb.append(", ");
-
 
41024
      sb.append("discountedPrice:");
-
 
41025
      sb.append(this.discountedPrice);
-
 
41026
      first = false;
-
 
41027
      sb.append(")");
40856
      sb.append(")");
41028
      return sb.toString();
40857
      return sb.toString();
41029
    }
40858
    }
41030
 
40859
 
41031
    public void validate() throws org.apache.thrift.TException {
40860
    public void validate() throws org.apache.thrift.TException {
Line 41040... Line 40869...
41040
      }
40869
      }
41041
    }
40870
    }
41042
 
40871
 
41043
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
40872
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
41044
      try {
40873
      try {
41045
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
-
 
41046
        __isset_bit_vector = new BitSet(1);
-
 
41047
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
40874
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
41048
      } catch (org.apache.thrift.TException te) {
40875
      } catch (org.apache.thrift.TException te) {
41049
        throw new java.io.IOException(te);
40876
        throw new java.io.IOException(te);
41050
      }
40877
      }
41051
    }
40878
    }