Subversion Repositories SmartDukaan

Rev

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

Rev 7092 Rev 7746
Line 27... Line 27...
27
   */
27
   */
28
  public interface Iface extends in.shop2020.generic.GenericService.Iface {
28
  public interface Iface extends in.shop2020.generic.GenericService.Iface {
29
 
29
 
30
    public void createPromotion(String name, String ruleExecutionSrc, long startOn, long endOn) throws PromotionException, org.apache.thrift.TException;
30
    public void createPromotion(String name, String ruleExecutionSrc, long startOn, long endOn) throws PromotionException, org.apache.thrift.TException;
31
 
31
 
-
 
32
    public long removeAllCouponsByPromotionId(long promotionId) throws PromotionException, org.apache.thrift.TException;
-
 
33
 
32
    public Coupon getCoupon(String couponCode) throws PromotionException, org.apache.thrift.TException;
34
    public Coupon getCoupon(String couponCode) throws PromotionException, org.apache.thrift.TException;
33
 
35
 
34
    public boolean isGiftVoucher(String couponCode) throws PromotionException, org.apache.thrift.TException;
36
    public boolean isGiftVoucher(String couponCode) throws PromotionException, org.apache.thrift.TException;
35
 
37
 
36
    public boolean isCodApplicable(String couponCode) throws PromotionException, org.apache.thrift.TException;
38
    public boolean isCodApplicable(String couponCode) throws PromotionException, org.apache.thrift.TException;
Line 101... Line 103...
101
 
103
 
102
  public interface AsyncIface extends in.shop2020.generic.GenericService .AsyncIface {
104
  public interface AsyncIface extends in.shop2020.generic.GenericService .AsyncIface {
103
 
105
 
104
    public void createPromotion(String name, String ruleExecutionSrc, long startOn, long endOn, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.createPromotion_call> resultHandler) throws org.apache.thrift.TException;
106
    public void createPromotion(String name, String ruleExecutionSrc, long startOn, long endOn, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.createPromotion_call> resultHandler) throws org.apache.thrift.TException;
105
 
107
 
-
 
108
    public void removeAllCouponsByPromotionId(long promotionId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.removeAllCouponsByPromotionId_call> resultHandler) throws org.apache.thrift.TException;
-
 
109
 
106
    public void getCoupon(String couponCode, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getCoupon_call> resultHandler) throws org.apache.thrift.TException;
110
    public void getCoupon(String couponCode, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getCoupon_call> resultHandler) throws org.apache.thrift.TException;
107
 
111
 
108
    public void isGiftVoucher(String couponCode, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.isGiftVoucher_call> resultHandler) throws org.apache.thrift.TException;
112
    public void isGiftVoucher(String couponCode, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.isGiftVoucher_call> resultHandler) throws org.apache.thrift.TException;
109
 
113
 
110
    public void isCodApplicable(String couponCode, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.isCodApplicable_call> resultHandler) throws org.apache.thrift.TException;
114
    public void isCodApplicable(String couponCode, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.isCodApplicable_call> resultHandler) throws org.apache.thrift.TException;
Line 195... Line 199...
195
        throw result.pex;
199
        throw result.pex;
196
      }
200
      }
197
      return;
201
      return;
198
    }
202
    }
199
 
203
 
-
 
204
    public long removeAllCouponsByPromotionId(long promotionId) throws PromotionException, org.apache.thrift.TException
-
 
205
    {
-
 
206
      send_removeAllCouponsByPromotionId(promotionId);
-
 
207
      return recv_removeAllCouponsByPromotionId();
-
 
208
    }
-
 
209
 
-
 
210
    public void send_removeAllCouponsByPromotionId(long promotionId) throws org.apache.thrift.TException
-
 
211
    {
-
 
212
      removeAllCouponsByPromotionId_args args = new removeAllCouponsByPromotionId_args();
-
 
213
      args.setPromotionId(promotionId);
-
 
214
      sendBase("removeAllCouponsByPromotionId", args);
-
 
215
    }
-
 
216
 
-
 
217
    public long recv_removeAllCouponsByPromotionId() throws PromotionException, org.apache.thrift.TException
-
 
218
    {
-
 
219
      removeAllCouponsByPromotionId_result result = new removeAllCouponsByPromotionId_result();
-
 
220
      receiveBase(result, "removeAllCouponsByPromotionId");
-
 
221
      if (result.isSetSuccess()) {
-
 
222
        return result.success;
-
 
223
      }
-
 
224
      if (result.pex != null) {
-
 
225
        throw result.pex;
-
 
226
      }
-
 
227
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "removeAllCouponsByPromotionId failed: unknown result");
-
 
228
    }
-
 
229
 
200
    public Coupon getCoupon(String couponCode) throws PromotionException, org.apache.thrift.TException
230
    public Coupon getCoupon(String couponCode) throws PromotionException, org.apache.thrift.TException
201
    {
231
    {
202
      send_getCoupon(couponCode);
232
      send_getCoupon(couponCode);
203
      return recv_getCoupon();
233
      return recv_getCoupon();
204
    }
234
    }
Line 838... Line 868...
838
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
868
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
839
        (new Client(prot)).recv_createPromotion();
869
        (new Client(prot)).recv_createPromotion();
840
      }
870
      }
841
    }
871
    }
842
 
872
 
-
 
873
    public void removeAllCouponsByPromotionId(long promotionId, org.apache.thrift.async.AsyncMethodCallback<removeAllCouponsByPromotionId_call> resultHandler) throws org.apache.thrift.TException {
-
 
874
      checkReady();
-
 
875
      removeAllCouponsByPromotionId_call method_call = new removeAllCouponsByPromotionId_call(promotionId, resultHandler, this, ___protocolFactory, ___transport);
-
 
876
      this.___currentMethod = method_call;
-
 
877
      ___manager.call(method_call);
-
 
878
    }
-
 
879
 
-
 
880
    public static class removeAllCouponsByPromotionId_call extends org.apache.thrift.async.TAsyncMethodCall {
-
 
881
      private long promotionId;
-
 
882
      public removeAllCouponsByPromotionId_call(long promotionId, org.apache.thrift.async.AsyncMethodCallback<removeAllCouponsByPromotionId_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 {
-
 
883
        super(client, protocolFactory, transport, resultHandler, false);
-
 
884
        this.promotionId = promotionId;
-
 
885
      }
-
 
886
 
-
 
887
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
-
 
888
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("removeAllCouponsByPromotionId", org.apache.thrift.protocol.TMessageType.CALL, 0));
-
 
889
        removeAllCouponsByPromotionId_args args = new removeAllCouponsByPromotionId_args();
-
 
890
        args.setPromotionId(promotionId);
-
 
891
        args.write(prot);
-
 
892
        prot.writeMessageEnd();
-
 
893
      }
-
 
894
 
-
 
895
      public long getResult() throws PromotionException, org.apache.thrift.TException {
-
 
896
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
-
 
897
          throw new IllegalStateException("Method call not finished!");
-
 
898
        }
-
 
899
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
-
 
900
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
-
 
901
        return (new Client(prot)).recv_removeAllCouponsByPromotionId();
-
 
902
      }
-
 
903
    }
-
 
904
 
843
    public void getCoupon(String couponCode, org.apache.thrift.async.AsyncMethodCallback<getCoupon_call> resultHandler) throws org.apache.thrift.TException {
905
    public void getCoupon(String couponCode, org.apache.thrift.async.AsyncMethodCallback<getCoupon_call> resultHandler) throws org.apache.thrift.TException {
844
      checkReady();
906
      checkReady();
845
      getCoupon_call method_call = new getCoupon_call(couponCode, resultHandler, this, ___protocolFactory, ___transport);
907
      getCoupon_call method_call = new getCoupon_call(couponCode, resultHandler, this, ___protocolFactory, ___transport);
846
      this.___currentMethod = method_call;
908
      this.___currentMethod = method_call;
847
      ___manager.call(method_call);
909
      ___manager.call(method_call);
Line 1627... Line 1689...
1627
      super(iface, getProcessMap(processMap));
1689
      super(iface, getProcessMap(processMap));
1628
    }
1690
    }
1629
 
1691
 
1630
    private static <I extends Iface> Map<String,  org.apache.thrift.ProcessFunction<I, ? extends  org.apache.thrift.TBase>> getProcessMap(Map<String,  org.apache.thrift.ProcessFunction<I, ? extends  org.apache.thrift.TBase>> processMap) {
1692
    private static <I extends Iface> Map<String,  org.apache.thrift.ProcessFunction<I, ? extends  org.apache.thrift.TBase>> getProcessMap(Map<String,  org.apache.thrift.ProcessFunction<I, ? extends  org.apache.thrift.TBase>> processMap) {
1631
      processMap.put("createPromotion", new createPromotion());
1693
      processMap.put("createPromotion", new createPromotion());
-
 
1694
      processMap.put("removeAllCouponsByPromotionId", new removeAllCouponsByPromotionId());
1632
      processMap.put("getCoupon", new getCoupon());
1695
      processMap.put("getCoupon", new getCoupon());
1633
      processMap.put("isGiftVoucher", new isGiftVoucher());
1696
      processMap.put("isGiftVoucher", new isGiftVoucher());
1634
      processMap.put("isCodApplicable", new isCodApplicable());
1697
      processMap.put("isCodApplicable", new isCodApplicable());
1635
      processMap.put("getAllPromotions", new getAllPromotions());
1698
      processMap.put("getAllPromotions", new getAllPromotions());
1636
      processMap.put("getPromotionById", new getPromotionById());
1699
      processMap.put("getPromotionById", new getPromotionById());
Line 1673... Line 1736...
1673
        }
1736
        }
1674
        return result;
1737
        return result;
1675
      }
1738
      }
1676
    }
1739
    }
1677
 
1740
 
-
 
1741
    private static class removeAllCouponsByPromotionId<I extends Iface> extends org.apache.thrift.ProcessFunction<I, removeAllCouponsByPromotionId_args> {
-
 
1742
      public removeAllCouponsByPromotionId() {
-
 
1743
        super("removeAllCouponsByPromotionId");
-
 
1744
      }
-
 
1745
 
-
 
1746
      protected removeAllCouponsByPromotionId_args getEmptyArgsInstance() {
-
 
1747
        return new removeAllCouponsByPromotionId_args();
-
 
1748
      }
-
 
1749
 
-
 
1750
      protected removeAllCouponsByPromotionId_result getResult(I iface, removeAllCouponsByPromotionId_args args) throws org.apache.thrift.TException {
-
 
1751
        removeAllCouponsByPromotionId_result result = new removeAllCouponsByPromotionId_result();
-
 
1752
        try {
-
 
1753
          result.success = iface.removeAllCouponsByPromotionId(args.promotionId);
-
 
1754
          result.setSuccessIsSet(true);
-
 
1755
        } catch (PromotionException pex) {
-
 
1756
          result.pex = pex;
-
 
1757
        }
-
 
1758
        return result;
-
 
1759
      }
-
 
1760
    }
-
 
1761
 
1678
    private static class getCoupon<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getCoupon_args> {
1762
    private static class getCoupon<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getCoupon_args> {
1679
      public getCoupon() {
1763
      public getCoupon() {
1680
        super("getCoupon");
1764
        super("getCoupon");
1681
      }
1765
      }
1682
 
1766
 
Line 2967... Line 3051...
2967
      }
3051
      }
2968
    }
3052
    }
2969
 
3053
 
2970
  }
3054
  }
2971
 
3055
 
-
 
3056
  public static class removeAllCouponsByPromotionId_args implements org.apache.thrift.TBase<removeAllCouponsByPromotionId_args, removeAllCouponsByPromotionId_args._Fields>, java.io.Serializable, Cloneable   {
-
 
3057
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("removeAllCouponsByPromotionId_args");
-
 
3058
 
-
 
3059
    private static final org.apache.thrift.protocol.TField PROMOTION_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("promotionId", org.apache.thrift.protocol.TType.I64, (short)1);
-
 
3060
 
-
 
3061
    private long promotionId; // required
-
 
3062
 
-
 
3063
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-
 
3064
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
-
 
3065
      PROMOTION_ID((short)1, "promotionId");
-
 
3066
 
-
 
3067
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
-
 
3068
 
-
 
3069
      static {
-
 
3070
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
-
 
3071
          byName.put(field.getFieldName(), field);
-
 
3072
        }
-
 
3073
      }
-
 
3074
 
-
 
3075
      /**
-
 
3076
       * Find the _Fields constant that matches fieldId, or null if its not found.
-
 
3077
       */
-
 
3078
      public static _Fields findByThriftId(int fieldId) {
-
 
3079
        switch(fieldId) {
-
 
3080
          case 1: // PROMOTION_ID
-
 
3081
            return PROMOTION_ID;
-
 
3082
          default:
-
 
3083
            return null;
-
 
3084
        }
-
 
3085
      }
-
 
3086
 
-
 
3087
      /**
-
 
3088
       * Find the _Fields constant that matches fieldId, throwing an exception
-
 
3089
       * if it is not found.
-
 
3090
       */
-
 
3091
      public static _Fields findByThriftIdOrThrow(int fieldId) {
-
 
3092
        _Fields fields = findByThriftId(fieldId);
-
 
3093
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
-
 
3094
        return fields;
-
 
3095
      }
-
 
3096
 
-
 
3097
      /**
-
 
3098
       * Find the _Fields constant that matches name, or null if its not found.
-
 
3099
       */
-
 
3100
      public static _Fields findByName(String name) {
-
 
3101
        return byName.get(name);
-
 
3102
      }
-
 
3103
 
-
 
3104
      private final short _thriftId;
-
 
3105
      private final String _fieldName;
-
 
3106
 
-
 
3107
      _Fields(short thriftId, String fieldName) {
-
 
3108
        _thriftId = thriftId;
-
 
3109
        _fieldName = fieldName;
-
 
3110
      }
-
 
3111
 
-
 
3112
      public short getThriftFieldId() {
-
 
3113
        return _thriftId;
-
 
3114
      }
-
 
3115
 
-
 
3116
      public String getFieldName() {
-
 
3117
        return _fieldName;
-
 
3118
      }
-
 
3119
    }
-
 
3120
 
-
 
3121
    // isset id assignments
-
 
3122
    private static final int __PROMOTIONID_ISSET_ID = 0;
-
 
3123
    private BitSet __isset_bit_vector = new BitSet(1);
-
 
3124
 
-
 
3125
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
-
 
3126
    static {
-
 
3127
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
-
 
3128
      tmpMap.put(_Fields.PROMOTION_ID, new org.apache.thrift.meta_data.FieldMetaData("promotionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
-
 
3129
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
-
 
3130
      metaDataMap = Collections.unmodifiableMap(tmpMap);
-
 
3131
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(removeAllCouponsByPromotionId_args.class, metaDataMap);
-
 
3132
    }
-
 
3133
 
-
 
3134
    public removeAllCouponsByPromotionId_args() {
-
 
3135
    }
-
 
3136
 
-
 
3137
    public removeAllCouponsByPromotionId_args(
-
 
3138
      long promotionId)
-
 
3139
    {
-
 
3140
      this();
-
 
3141
      this.promotionId = promotionId;
-
 
3142
      setPromotionIdIsSet(true);
-
 
3143
    }
-
 
3144
 
-
 
3145
    /**
-
 
3146
     * Performs a deep copy on <i>other</i>.
-
 
3147
     */
-
 
3148
    public removeAllCouponsByPromotionId_args(removeAllCouponsByPromotionId_args other) {
-
 
3149
      __isset_bit_vector.clear();
-
 
3150
      __isset_bit_vector.or(other.__isset_bit_vector);
-
 
3151
      this.promotionId = other.promotionId;
-
 
3152
    }
-
 
3153
 
-
 
3154
    public removeAllCouponsByPromotionId_args deepCopy() {
-
 
3155
      return new removeAllCouponsByPromotionId_args(this);
-
 
3156
    }
-
 
3157
 
-
 
3158
    @Override
-
 
3159
    public void clear() {
-
 
3160
      setPromotionIdIsSet(false);
-
 
3161
      this.promotionId = 0;
-
 
3162
    }
-
 
3163
 
-
 
3164
    public long getPromotionId() {
-
 
3165
      return this.promotionId;
-
 
3166
    }
-
 
3167
 
-
 
3168
    public void setPromotionId(long promotionId) {
-
 
3169
      this.promotionId = promotionId;
-
 
3170
      setPromotionIdIsSet(true);
-
 
3171
    }
-
 
3172
 
-
 
3173
    public void unsetPromotionId() {
-
 
3174
      __isset_bit_vector.clear(__PROMOTIONID_ISSET_ID);
-
 
3175
    }
-
 
3176
 
-
 
3177
    /** Returns true if field promotionId is set (has been assigned a value) and false otherwise */
-
 
3178
    public boolean isSetPromotionId() {
-
 
3179
      return __isset_bit_vector.get(__PROMOTIONID_ISSET_ID);
-
 
3180
    }
-
 
3181
 
-
 
3182
    public void setPromotionIdIsSet(boolean value) {
-
 
3183
      __isset_bit_vector.set(__PROMOTIONID_ISSET_ID, value);
-
 
3184
    }
-
 
3185
 
-
 
3186
    public void setFieldValue(_Fields field, Object value) {
-
 
3187
      switch (field) {
-
 
3188
      case PROMOTION_ID:
-
 
3189
        if (value == null) {
-
 
3190
          unsetPromotionId();
-
 
3191
        } else {
-
 
3192
          setPromotionId((Long)value);
-
 
3193
        }
-
 
3194
        break;
-
 
3195
 
-
 
3196
      }
-
 
3197
    }
-
 
3198
 
-
 
3199
    public Object getFieldValue(_Fields field) {
-
 
3200
      switch (field) {
-
 
3201
      case PROMOTION_ID:
-
 
3202
        return Long.valueOf(getPromotionId());
-
 
3203
 
-
 
3204
      }
-
 
3205
      throw new IllegalStateException();
-
 
3206
    }
-
 
3207
 
-
 
3208
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
-
 
3209
    public boolean isSet(_Fields field) {
-
 
3210
      if (field == null) {
-
 
3211
        throw new IllegalArgumentException();
-
 
3212
      }
-
 
3213
 
-
 
3214
      switch (field) {
-
 
3215
      case PROMOTION_ID:
-
 
3216
        return isSetPromotionId();
-
 
3217
      }
-
 
3218
      throw new IllegalStateException();
-
 
3219
    }
-
 
3220
 
-
 
3221
    @Override
-
 
3222
    public boolean equals(Object that) {
-
 
3223
      if (that == null)
-
 
3224
        return false;
-
 
3225
      if (that instanceof removeAllCouponsByPromotionId_args)
-
 
3226
        return this.equals((removeAllCouponsByPromotionId_args)that);
-
 
3227
      return false;
-
 
3228
    }
-
 
3229
 
-
 
3230
    public boolean equals(removeAllCouponsByPromotionId_args that) {
-
 
3231
      if (that == null)
-
 
3232
        return false;
-
 
3233
 
-
 
3234
      boolean this_present_promotionId = true;
-
 
3235
      boolean that_present_promotionId = true;
-
 
3236
      if (this_present_promotionId || that_present_promotionId) {
-
 
3237
        if (!(this_present_promotionId && that_present_promotionId))
-
 
3238
          return false;
-
 
3239
        if (this.promotionId != that.promotionId)
-
 
3240
          return false;
-
 
3241
      }
-
 
3242
 
-
 
3243
      return true;
-
 
3244
    }
-
 
3245
 
-
 
3246
    @Override
-
 
3247
    public int hashCode() {
-
 
3248
      return 0;
-
 
3249
    }
-
 
3250
 
-
 
3251
    public int compareTo(removeAllCouponsByPromotionId_args other) {
-
 
3252
      if (!getClass().equals(other.getClass())) {
-
 
3253
        return getClass().getName().compareTo(other.getClass().getName());
-
 
3254
      }
-
 
3255
 
-
 
3256
      int lastComparison = 0;
-
 
3257
      removeAllCouponsByPromotionId_args typedOther = (removeAllCouponsByPromotionId_args)other;
-
 
3258
 
-
 
3259
      lastComparison = Boolean.valueOf(isSetPromotionId()).compareTo(typedOther.isSetPromotionId());
-
 
3260
      if (lastComparison != 0) {
-
 
3261
        return lastComparison;
-
 
3262
      }
-
 
3263
      if (isSetPromotionId()) {
-
 
3264
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.promotionId, typedOther.promotionId);
-
 
3265
        if (lastComparison != 0) {
-
 
3266
          return lastComparison;
-
 
3267
        }
-
 
3268
      }
-
 
3269
      return 0;
-
 
3270
    }
-
 
3271
 
-
 
3272
    public _Fields fieldForId(int fieldId) {
-
 
3273
      return _Fields.findByThriftId(fieldId);
-
 
3274
    }
-
 
3275
 
-
 
3276
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
-
 
3277
      org.apache.thrift.protocol.TField field;
-
 
3278
      iprot.readStructBegin();
-
 
3279
      while (true)
-
 
3280
      {
-
 
3281
        field = iprot.readFieldBegin();
-
 
3282
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
-
 
3283
          break;
-
 
3284
        }
-
 
3285
        switch (field.id) {
-
 
3286
          case 1: // PROMOTION_ID
-
 
3287
            if (field.type == org.apache.thrift.protocol.TType.I64) {
-
 
3288
              this.promotionId = iprot.readI64();
-
 
3289
              setPromotionIdIsSet(true);
-
 
3290
            } else { 
-
 
3291
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
-
 
3292
            }
-
 
3293
            break;
-
 
3294
          default:
-
 
3295
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
-
 
3296
        }
-
 
3297
        iprot.readFieldEnd();
-
 
3298
      }
-
 
3299
      iprot.readStructEnd();
-
 
3300
      validate();
-
 
3301
    }
-
 
3302
 
-
 
3303
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
-
 
3304
      validate();
-
 
3305
 
-
 
3306
      oprot.writeStructBegin(STRUCT_DESC);
-
 
3307
      oprot.writeFieldBegin(PROMOTION_ID_FIELD_DESC);
-
 
3308
      oprot.writeI64(this.promotionId);
-
 
3309
      oprot.writeFieldEnd();
-
 
3310
      oprot.writeFieldStop();
-
 
3311
      oprot.writeStructEnd();
-
 
3312
    }
-
 
3313
 
-
 
3314
    @Override
-
 
3315
    public String toString() {
-
 
3316
      StringBuilder sb = new StringBuilder("removeAllCouponsByPromotionId_args(");
-
 
3317
      boolean first = true;
-
 
3318
 
-
 
3319
      sb.append("promotionId:");
-
 
3320
      sb.append(this.promotionId);
-
 
3321
      first = false;
-
 
3322
      sb.append(")");
-
 
3323
      return sb.toString();
-
 
3324
    }
-
 
3325
 
-
 
3326
    public void validate() throws org.apache.thrift.TException {
-
 
3327
      // check for required fields
-
 
3328
    }
-
 
3329
 
-
 
3330
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
-
 
3331
      try {
-
 
3332
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
-
 
3333
      } catch (org.apache.thrift.TException te) {
-
 
3334
        throw new java.io.IOException(te);
-
 
3335
      }
-
 
3336
    }
-
 
3337
 
-
 
3338
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
-
 
3339
      try {
-
 
3340
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
-
 
3341
        __isset_bit_vector = new BitSet(1);
-
 
3342
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
-
 
3343
      } catch (org.apache.thrift.TException te) {
-
 
3344
        throw new java.io.IOException(te);
-
 
3345
      }
-
 
3346
    }
-
 
3347
 
-
 
3348
  }
-
 
3349
 
-
 
3350
  public static class removeAllCouponsByPromotionId_result implements org.apache.thrift.TBase<removeAllCouponsByPromotionId_result, removeAllCouponsByPromotionId_result._Fields>, java.io.Serializable, Cloneable   {
-
 
3351
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("removeAllCouponsByPromotionId_result");
-
 
3352
 
-
 
3353
    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I64, (short)0);
-
 
3354
    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);
-
 
3355
 
-
 
3356
    private long success; // required
-
 
3357
    private PromotionException pex; // required
-
 
3358
 
-
 
3359
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-
 
3360
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
-
 
3361
      SUCCESS((short)0, "success"),
-
 
3362
      PEX((short)1, "pex");
-
 
3363
 
-
 
3364
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
-
 
3365
 
-
 
3366
      static {
-
 
3367
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
-
 
3368
          byName.put(field.getFieldName(), field);
-
 
3369
        }
-
 
3370
      }
-
 
3371
 
-
 
3372
      /**
-
 
3373
       * Find the _Fields constant that matches fieldId, or null if its not found.
-
 
3374
       */
-
 
3375
      public static _Fields findByThriftId(int fieldId) {
-
 
3376
        switch(fieldId) {
-
 
3377
          case 0: // SUCCESS
-
 
3378
            return SUCCESS;
-
 
3379
          case 1: // PEX
-
 
3380
            return PEX;
-
 
3381
          default:
-
 
3382
            return null;
-
 
3383
        }
-
 
3384
      }
-
 
3385
 
-
 
3386
      /**
-
 
3387
       * Find the _Fields constant that matches fieldId, throwing an exception
-
 
3388
       * if it is not found.
-
 
3389
       */
-
 
3390
      public static _Fields findByThriftIdOrThrow(int fieldId) {
-
 
3391
        _Fields fields = findByThriftId(fieldId);
-
 
3392
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
-
 
3393
        return fields;
-
 
3394
      }
-
 
3395
 
-
 
3396
      /**
-
 
3397
       * Find the _Fields constant that matches name, or null if its not found.
-
 
3398
       */
-
 
3399
      public static _Fields findByName(String name) {
-
 
3400
        return byName.get(name);
-
 
3401
      }
-
 
3402
 
-
 
3403
      private final short _thriftId;
-
 
3404
      private final String _fieldName;
-
 
3405
 
-
 
3406
      _Fields(short thriftId, String fieldName) {
-
 
3407
        _thriftId = thriftId;
-
 
3408
        _fieldName = fieldName;
-
 
3409
      }
-
 
3410
 
-
 
3411
      public short getThriftFieldId() {
-
 
3412
        return _thriftId;
-
 
3413
      }
-
 
3414
 
-
 
3415
      public String getFieldName() {
-
 
3416
        return _fieldName;
-
 
3417
      }
-
 
3418
    }
-
 
3419
 
-
 
3420
    // isset id assignments
-
 
3421
    private static final int __SUCCESS_ISSET_ID = 0;
-
 
3422
    private BitSet __isset_bit_vector = new BitSet(1);
-
 
3423
 
-
 
3424
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
-
 
3425
    static {
-
 
3426
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
-
 
3427
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
-
 
3428
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
-
 
3429
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
-
 
3430
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
-
 
3431
      metaDataMap = Collections.unmodifiableMap(tmpMap);
-
 
3432
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(removeAllCouponsByPromotionId_result.class, metaDataMap);
-
 
3433
    }
-
 
3434
 
-
 
3435
    public removeAllCouponsByPromotionId_result() {
-
 
3436
    }
-
 
3437
 
-
 
3438
    public removeAllCouponsByPromotionId_result(
-
 
3439
      long success,
-
 
3440
      PromotionException pex)
-
 
3441
    {
-
 
3442
      this();
-
 
3443
      this.success = success;
-
 
3444
      setSuccessIsSet(true);
-
 
3445
      this.pex = pex;
-
 
3446
    }
-
 
3447
 
-
 
3448
    /**
-
 
3449
     * Performs a deep copy on <i>other</i>.
-
 
3450
     */
-
 
3451
    public removeAllCouponsByPromotionId_result(removeAllCouponsByPromotionId_result other) {
-
 
3452
      __isset_bit_vector.clear();
-
 
3453
      __isset_bit_vector.or(other.__isset_bit_vector);
-
 
3454
      this.success = other.success;
-
 
3455
      if (other.isSetPex()) {
-
 
3456
        this.pex = new PromotionException(other.pex);
-
 
3457
      }
-
 
3458
    }
-
 
3459
 
-
 
3460
    public removeAllCouponsByPromotionId_result deepCopy() {
-
 
3461
      return new removeAllCouponsByPromotionId_result(this);
-
 
3462
    }
-
 
3463
 
-
 
3464
    @Override
-
 
3465
    public void clear() {
-
 
3466
      setSuccessIsSet(false);
-
 
3467
      this.success = 0;
-
 
3468
      this.pex = null;
-
 
3469
    }
-
 
3470
 
-
 
3471
    public long getSuccess() {
-
 
3472
      return this.success;
-
 
3473
    }
-
 
3474
 
-
 
3475
    public void setSuccess(long success) {
-
 
3476
      this.success = success;
-
 
3477
      setSuccessIsSet(true);
-
 
3478
    }
-
 
3479
 
-
 
3480
    public void unsetSuccess() {
-
 
3481
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
-
 
3482
    }
-
 
3483
 
-
 
3484
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
-
 
3485
    public boolean isSetSuccess() {
-
 
3486
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
-
 
3487
    }
-
 
3488
 
-
 
3489
    public void setSuccessIsSet(boolean value) {
-
 
3490
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
-
 
3491
    }
-
 
3492
 
-
 
3493
    public PromotionException getPex() {
-
 
3494
      return this.pex;
-
 
3495
    }
-
 
3496
 
-
 
3497
    public void setPex(PromotionException pex) {
-
 
3498
      this.pex = pex;
-
 
3499
    }
-
 
3500
 
-
 
3501
    public void unsetPex() {
-
 
3502
      this.pex = null;
-
 
3503
    }
-
 
3504
 
-
 
3505
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
-
 
3506
    public boolean isSetPex() {
-
 
3507
      return this.pex != null;
-
 
3508
    }
-
 
3509
 
-
 
3510
    public void setPexIsSet(boolean value) {
-
 
3511
      if (!value) {
-
 
3512
        this.pex = null;
-
 
3513
      }
-
 
3514
    }
-
 
3515
 
-
 
3516
    public void setFieldValue(_Fields field, Object value) {
-
 
3517
      switch (field) {
-
 
3518
      case SUCCESS:
-
 
3519
        if (value == null) {
-
 
3520
          unsetSuccess();
-
 
3521
        } else {
-
 
3522
          setSuccess((Long)value);
-
 
3523
        }
-
 
3524
        break;
-
 
3525
 
-
 
3526
      case PEX:
-
 
3527
        if (value == null) {
-
 
3528
          unsetPex();
-
 
3529
        } else {
-
 
3530
          setPex((PromotionException)value);
-
 
3531
        }
-
 
3532
        break;
-
 
3533
 
-
 
3534
      }
-
 
3535
    }
-
 
3536
 
-
 
3537
    public Object getFieldValue(_Fields field) {
-
 
3538
      switch (field) {
-
 
3539
      case SUCCESS:
-
 
3540
        return Long.valueOf(getSuccess());
-
 
3541
 
-
 
3542
      case PEX:
-
 
3543
        return getPex();
-
 
3544
 
-
 
3545
      }
-
 
3546
      throw new IllegalStateException();
-
 
3547
    }
-
 
3548
 
-
 
3549
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
-
 
3550
    public boolean isSet(_Fields field) {
-
 
3551
      if (field == null) {
-
 
3552
        throw new IllegalArgumentException();
-
 
3553
      }
-
 
3554
 
-
 
3555
      switch (field) {
-
 
3556
      case SUCCESS:
-
 
3557
        return isSetSuccess();
-
 
3558
      case PEX:
-
 
3559
        return isSetPex();
-
 
3560
      }
-
 
3561
      throw new IllegalStateException();
-
 
3562
    }
-
 
3563
 
-
 
3564
    @Override
-
 
3565
    public boolean equals(Object that) {
-
 
3566
      if (that == null)
-
 
3567
        return false;
-
 
3568
      if (that instanceof removeAllCouponsByPromotionId_result)
-
 
3569
        return this.equals((removeAllCouponsByPromotionId_result)that);
-
 
3570
      return false;
-
 
3571
    }
-
 
3572
 
-
 
3573
    public boolean equals(removeAllCouponsByPromotionId_result that) {
-
 
3574
      if (that == null)
-
 
3575
        return false;
-
 
3576
 
-
 
3577
      boolean this_present_success = true;
-
 
3578
      boolean that_present_success = true;
-
 
3579
      if (this_present_success || that_present_success) {
-
 
3580
        if (!(this_present_success && that_present_success))
-
 
3581
          return false;
-
 
3582
        if (this.success != that.success)
-
 
3583
          return false;
-
 
3584
      }
-
 
3585
 
-
 
3586
      boolean this_present_pex = true && this.isSetPex();
-
 
3587
      boolean that_present_pex = true && that.isSetPex();
-
 
3588
      if (this_present_pex || that_present_pex) {
-
 
3589
        if (!(this_present_pex && that_present_pex))
-
 
3590
          return false;
-
 
3591
        if (!this.pex.equals(that.pex))
-
 
3592
          return false;
-
 
3593
      }
-
 
3594
 
-
 
3595
      return true;
-
 
3596
    }
-
 
3597
 
-
 
3598
    @Override
-
 
3599
    public int hashCode() {
-
 
3600
      return 0;
-
 
3601
    }
-
 
3602
 
-
 
3603
    public int compareTo(removeAllCouponsByPromotionId_result other) {
-
 
3604
      if (!getClass().equals(other.getClass())) {
-
 
3605
        return getClass().getName().compareTo(other.getClass().getName());
-
 
3606
      }
-
 
3607
 
-
 
3608
      int lastComparison = 0;
-
 
3609
      removeAllCouponsByPromotionId_result typedOther = (removeAllCouponsByPromotionId_result)other;
-
 
3610
 
-
 
3611
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
-
 
3612
      if (lastComparison != 0) {
-
 
3613
        return lastComparison;
-
 
3614
      }
-
 
3615
      if (isSetSuccess()) {
-
 
3616
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
-
 
3617
        if (lastComparison != 0) {
-
 
3618
          return lastComparison;
-
 
3619
        }
-
 
3620
      }
-
 
3621
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
-
 
3622
      if (lastComparison != 0) {
-
 
3623
        return lastComparison;
-
 
3624
      }
-
 
3625
      if (isSetPex()) {
-
 
3626
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
-
 
3627
        if (lastComparison != 0) {
-
 
3628
          return lastComparison;
-
 
3629
        }
-
 
3630
      }
-
 
3631
      return 0;
-
 
3632
    }
-
 
3633
 
-
 
3634
    public _Fields fieldForId(int fieldId) {
-
 
3635
      return _Fields.findByThriftId(fieldId);
-
 
3636
    }
-
 
3637
 
-
 
3638
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
-
 
3639
      org.apache.thrift.protocol.TField field;
-
 
3640
      iprot.readStructBegin();
-
 
3641
      while (true)
-
 
3642
      {
-
 
3643
        field = iprot.readFieldBegin();
-
 
3644
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
-
 
3645
          break;
-
 
3646
        }
-
 
3647
        switch (field.id) {
-
 
3648
          case 0: // SUCCESS
-
 
3649
            if (field.type == org.apache.thrift.protocol.TType.I64) {
-
 
3650
              this.success = iprot.readI64();
-
 
3651
              setSuccessIsSet(true);
-
 
3652
            } else { 
-
 
3653
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
-
 
3654
            }
-
 
3655
            break;
-
 
3656
          case 1: // PEX
-
 
3657
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
-
 
3658
              this.pex = new PromotionException();
-
 
3659
              this.pex.read(iprot);
-
 
3660
            } else { 
-
 
3661
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
-
 
3662
            }
-
 
3663
            break;
-
 
3664
          default:
-
 
3665
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
-
 
3666
        }
-
 
3667
        iprot.readFieldEnd();
-
 
3668
      }
-
 
3669
      iprot.readStructEnd();
-
 
3670
      validate();
-
 
3671
    }
-
 
3672
 
-
 
3673
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
-
 
3674
      oprot.writeStructBegin(STRUCT_DESC);
-
 
3675
 
-
 
3676
      if (this.isSetSuccess()) {
-
 
3677
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
-
 
3678
        oprot.writeI64(this.success);
-
 
3679
        oprot.writeFieldEnd();
-
 
3680
      } else if (this.isSetPex()) {
-
 
3681
        oprot.writeFieldBegin(PEX_FIELD_DESC);
-
 
3682
        this.pex.write(oprot);
-
 
3683
        oprot.writeFieldEnd();
-
 
3684
      }
-
 
3685
      oprot.writeFieldStop();
-
 
3686
      oprot.writeStructEnd();
-
 
3687
    }
-
 
3688
 
-
 
3689
    @Override
-
 
3690
    public String toString() {
-
 
3691
      StringBuilder sb = new StringBuilder("removeAllCouponsByPromotionId_result(");
-
 
3692
      boolean first = true;
-
 
3693
 
-
 
3694
      sb.append("success:");
-
 
3695
      sb.append(this.success);
-
 
3696
      first = false;
-
 
3697
      if (!first) sb.append(", ");
-
 
3698
      sb.append("pex:");
-
 
3699
      if (this.pex == null) {
-
 
3700
        sb.append("null");
-
 
3701
      } else {
-
 
3702
        sb.append(this.pex);
-
 
3703
      }
-
 
3704
      first = false;
-
 
3705
      sb.append(")");
-
 
3706
      return sb.toString();
-
 
3707
    }
-
 
3708
 
-
 
3709
    public void validate() throws org.apache.thrift.TException {
-
 
3710
      // check for required fields
-
 
3711
    }
-
 
3712
 
-
 
3713
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
-
 
3714
      try {
-
 
3715
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
-
 
3716
      } catch (org.apache.thrift.TException te) {
-
 
3717
        throw new java.io.IOException(te);
-
 
3718
      }
-
 
3719
    }
-
 
3720
 
-
 
3721
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
-
 
3722
      try {
-
 
3723
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
-
 
3724
      } catch (org.apache.thrift.TException te) {
-
 
3725
        throw new java.io.IOException(te);
-
 
3726
      }
-
 
3727
    }
-
 
3728
 
-
 
3729
  }
-
 
3730
 
2972
  public static class getCoupon_args implements org.apache.thrift.TBase<getCoupon_args, getCoupon_args._Fields>, java.io.Serializable, Cloneable   {
3731
  public static class getCoupon_args implements org.apache.thrift.TBase<getCoupon_args, getCoupon_args._Fields>, java.io.Serializable, Cloneable   {
2973
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getCoupon_args");
3732
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getCoupon_args");
2974
 
3733
 
2975
    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);
3734
    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);
2976
 
3735
 
Line 14125... Line 14884...
14125
      }
14884
      }
14126
    }
14885
    }
14127
 
14886
 
14128
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
14887
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
14129
      try {
14888
      try {
14130
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
-
 
14131
        __isset_bit_vector = new BitSet(1);
-
 
14132
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
14889
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
14133
      } catch (org.apache.thrift.TException te) {
14890
      } catch (org.apache.thrift.TException te) {
14134
        throw new java.io.IOException(te);
14891
        throw new java.io.IOException(te);
14135
      }
14892
      }
14136
    }
14893
    }