Subversion Repositories SmartDukaan

Rev

Rev 3385 | Rev 3555 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1982 varun.gupt 1
/**
3430 rajveer 2
 * Autogenerated by Thrift Compiler (0.7.0)
1982 varun.gupt 3
 *
4
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
 */
6
package in.shop2020.model.v1.user;
7
 
8
import java.util.List;
9
import java.util.ArrayList;
10
import java.util.Map;
11
import java.util.HashMap;
12
import java.util.EnumMap;
13
import java.util.Set;
14
import java.util.HashSet;
15
import java.util.EnumSet;
16
import java.util.Collections;
17
import java.util.BitSet;
3430 rajveer 18
import java.nio.ByteBuffer;
1982 varun.gupt 19
import java.util.Arrays;
20
import org.slf4j.Logger;
21
import org.slf4j.LoggerFactory;
22
 
23
public class PromotionService {
24
 
25
  /**
26
   * Promotion Service
27
   */
3374 rajveer 28
  public interface Iface extends in.shop2020.generic.GenericService.Iface {
1982 varun.gupt 29
 
3430 rajveer 30
    public void createPromotion(String name, String ruleExecutionSrc, long startOn, long endOn) throws PromotionException, org.apache.thrift.TException;
1982 varun.gupt 31
 
3430 rajveer 32
    public List<Promotion> getAllPromotions() throws PromotionException, org.apache.thrift.TException;
1982 varun.gupt 33
 
3430 rajveer 34
    public Promotion getPromotionById(long promotionId) throws PromotionException, org.apache.thrift.TException;
1982 varun.gupt 35
 
3430 rajveer 36
    public void generateCouponsForPromotion(long promotionId, String couponCode) throws PromotionException, org.apache.thrift.TException;
1982 varun.gupt 37
 
3430 rajveer 38
    public Cart applyCoupon(String couponCode, long cartId) throws PromotionException, org.apache.thrift.TException;
1982 varun.gupt 39
 
3430 rajveer 40
    public void trackCouponUsage(String couponCode, long transactionId, long userId) throws PromotionException, org.apache.thrift.TException;
1982 varun.gupt 41
 
3430 rajveer 42
    public long getCouponUsageCountByUser(String couponCode, long userId) throws PromotionException, org.apache.thrift.TException;
1982 varun.gupt 43
 
3385 varun.gupt 44
    /**
45
     * Returns a list of active coupons
46
     */
3430 rajveer 47
    public List<Coupon> getActiveCoupons() throws PromotionException, org.apache.thrift.TException;
3385 varun.gupt 48
 
49
    /**
50
     * Returns the count of successful payments done using a given coupon
51
     * 
52
     * @param couponCode
53
     */
3430 rajveer 54
    public long getSuccessfulPaymentCountForCoupon(String couponCode) throws PromotionException, org.apache.thrift.TException;
3385 varun.gupt 55
 
56
    /**
57
     * Returns the doc string of the rule module
58
     * 
59
     * @param ruleName
60
     */
3430 rajveer 61
    public String getRuleDocString(String ruleName) throws org.apache.thrift.TException;
3385 varun.gupt 62
 
1982 varun.gupt 63
  }
64
 
3430 rajveer 65
  public interface AsyncIface extends in.shop2020.generic.GenericService .AsyncIface {
1982 varun.gupt 66
 
3430 rajveer 67
    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;
1982 varun.gupt 68
 
3430 rajveer 69
    public void getAllPromotions(org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getAllPromotions_call> resultHandler) throws org.apache.thrift.TException;
70
 
71
    public void getPromotionById(long promotionId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getPromotionById_call> resultHandler) throws org.apache.thrift.TException;
72
 
73
    public void generateCouponsForPromotion(long promotionId, String couponCode, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.generateCouponsForPromotion_call> resultHandler) throws org.apache.thrift.TException;
74
 
75
    public void applyCoupon(String couponCode, long cartId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.applyCoupon_call> resultHandler) throws org.apache.thrift.TException;
76
 
77
    public void trackCouponUsage(String couponCode, long transactionId, long userId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.trackCouponUsage_call> resultHandler) throws org.apache.thrift.TException;
78
 
79
    public void getCouponUsageCountByUser(String couponCode, long userId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getCouponUsageCountByUser_call> resultHandler) throws org.apache.thrift.TException;
80
 
81
    public void getActiveCoupons(org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getActiveCoupons_call> resultHandler) throws org.apache.thrift.TException;
82
 
83
    public void getSuccessfulPaymentCountForCoupon(String couponCode, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getSuccessfulPaymentCountForCoupon_call> resultHandler) throws org.apache.thrift.TException;
84
 
85
    public void getRuleDocString(String ruleName, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getRuleDocString_call> resultHandler) throws org.apache.thrift.TException;
86
 
87
  }
88
 
89
  public static class Client extends in.shop2020.generic.GenericService.Client implements Iface {
90
    public static class Factory implements org.apache.thrift.TServiceClientFactory<Client> {
91
      public Factory() {}
92
      public Client getClient(org.apache.thrift.protocol.TProtocol prot) {
93
        return new Client(prot);
94
      }
95
      public Client getClient(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
96
        return new Client(iprot, oprot);
97
      }
1982 varun.gupt 98
    }
99
 
3430 rajveer 100
    public Client(org.apache.thrift.protocol.TProtocol prot)
1982 varun.gupt 101
    {
3430 rajveer 102
      super(prot, prot);
1982 varun.gupt 103
    }
104
 
3430 rajveer 105
    public Client(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
106
      super(iprot, oprot);
1982 varun.gupt 107
    }
108
 
3430 rajveer 109
    public void createPromotion(String name, String ruleExecutionSrc, long startOn, long endOn) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 110
    {
111
      send_createPromotion(name, ruleExecutionSrc, startOn, endOn);
112
      recv_createPromotion();
113
    }
114
 
3430 rajveer 115
    public void send_createPromotion(String name, String ruleExecutionSrc, long startOn, long endOn) throws org.apache.thrift.TException
1982 varun.gupt 116
    {
117
      createPromotion_args args = new createPromotion_args();
3430 rajveer 118
      args.setName(name);
119
      args.setRuleExecutionSrc(ruleExecutionSrc);
120
      args.setStartOn(startOn);
121
      args.setEndOn(endOn);
122
      sendBase("createPromotion", args);
1982 varun.gupt 123
    }
124
 
3430 rajveer 125
    public void recv_createPromotion() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 126
    {
127
      createPromotion_result result = new createPromotion_result();
3430 rajveer 128
      receiveBase(result, "createPromotion");
1982 varun.gupt 129
      if (result.pex != null) {
130
        throw result.pex;
131
      }
132
      return;
133
    }
134
 
3430 rajveer 135
    public List<Promotion> getAllPromotions() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 136
    {
137
      send_getAllPromotions();
138
      return recv_getAllPromotions();
139
    }
140
 
3430 rajveer 141
    public void send_getAllPromotions() throws org.apache.thrift.TException
1982 varun.gupt 142
    {
143
      getAllPromotions_args args = new getAllPromotions_args();
3430 rajveer 144
      sendBase("getAllPromotions", args);
1982 varun.gupt 145
    }
146
 
3430 rajveer 147
    public List<Promotion> recv_getAllPromotions() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 148
    {
149
      getAllPromotions_result result = new getAllPromotions_result();
3430 rajveer 150
      receiveBase(result, "getAllPromotions");
1982 varun.gupt 151
      if (result.isSetSuccess()) {
152
        return result.success;
153
      }
154
      if (result.pex != null) {
155
        throw result.pex;
156
      }
3430 rajveer 157
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getAllPromotions failed: unknown result");
1982 varun.gupt 158
    }
159
 
3430 rajveer 160
    public Promotion getPromotionById(long promotionId) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 161
    {
162
      send_getPromotionById(promotionId);
163
      return recv_getPromotionById();
164
    }
165
 
3430 rajveer 166
    public void send_getPromotionById(long promotionId) throws org.apache.thrift.TException
1982 varun.gupt 167
    {
168
      getPromotionById_args args = new getPromotionById_args();
3430 rajveer 169
      args.setPromotionId(promotionId);
170
      sendBase("getPromotionById", args);
1982 varun.gupt 171
    }
172
 
3430 rajveer 173
    public Promotion recv_getPromotionById() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 174
    {
175
      getPromotionById_result result = new getPromotionById_result();
3430 rajveer 176
      receiveBase(result, "getPromotionById");
1982 varun.gupt 177
      if (result.isSetSuccess()) {
178
        return result.success;
179
      }
180
      if (result.pex != null) {
181
        throw result.pex;
182
      }
3430 rajveer 183
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getPromotionById failed: unknown result");
1982 varun.gupt 184
    }
185
 
3430 rajveer 186
    public void generateCouponsForPromotion(long promotionId, String couponCode) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 187
    {
188
      send_generateCouponsForPromotion(promotionId, couponCode);
189
      recv_generateCouponsForPromotion();
190
    }
191
 
3430 rajveer 192
    public void send_generateCouponsForPromotion(long promotionId, String couponCode) throws org.apache.thrift.TException
1982 varun.gupt 193
    {
194
      generateCouponsForPromotion_args args = new generateCouponsForPromotion_args();
3430 rajveer 195
      args.setPromotionId(promotionId);
196
      args.setCouponCode(couponCode);
197
      sendBase("generateCouponsForPromotion", args);
1982 varun.gupt 198
    }
199
 
3430 rajveer 200
    public void recv_generateCouponsForPromotion() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 201
    {
202
      generateCouponsForPromotion_result result = new generateCouponsForPromotion_result();
3430 rajveer 203
      receiveBase(result, "generateCouponsForPromotion");
1982 varun.gupt 204
      if (result.pex != null) {
205
        throw result.pex;
206
      }
207
      return;
208
    }
209
 
3430 rajveer 210
    public Cart applyCoupon(String couponCode, long cartId) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 211
    {
212
      send_applyCoupon(couponCode, cartId);
213
      return recv_applyCoupon();
214
    }
215
 
3430 rajveer 216
    public void send_applyCoupon(String couponCode, long cartId) throws org.apache.thrift.TException
1982 varun.gupt 217
    {
218
      applyCoupon_args args = new applyCoupon_args();
3430 rajveer 219
      args.setCouponCode(couponCode);
220
      args.setCartId(cartId);
221
      sendBase("applyCoupon", args);
1982 varun.gupt 222
    }
223
 
3430 rajveer 224
    public Cart recv_applyCoupon() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 225
    {
226
      applyCoupon_result result = new applyCoupon_result();
3430 rajveer 227
      receiveBase(result, "applyCoupon");
1982 varun.gupt 228
      if (result.isSetSuccess()) {
229
        return result.success;
230
      }
231
      if (result.pex != null) {
232
        throw result.pex;
233
      }
3430 rajveer 234
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "applyCoupon failed: unknown result");
1982 varun.gupt 235
    }
236
 
3430 rajveer 237
    public void trackCouponUsage(String couponCode, long transactionId, long userId) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 238
    {
239
      send_trackCouponUsage(couponCode, transactionId, userId);
240
      recv_trackCouponUsage();
241
    }
242
 
3430 rajveer 243
    public void send_trackCouponUsage(String couponCode, long transactionId, long userId) throws org.apache.thrift.TException
1982 varun.gupt 244
    {
245
      trackCouponUsage_args args = new trackCouponUsage_args();
3430 rajveer 246
      args.setCouponCode(couponCode);
247
      args.setTransactionId(transactionId);
248
      args.setUserId(userId);
249
      sendBase("trackCouponUsage", args);
1982 varun.gupt 250
    }
251
 
3430 rajveer 252
    public void recv_trackCouponUsage() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 253
    {
254
      trackCouponUsage_result result = new trackCouponUsage_result();
3430 rajveer 255
      receiveBase(result, "trackCouponUsage");
1982 varun.gupt 256
      if (result.pex != null) {
257
        throw result.pex;
258
      }
259
      return;
260
    }
261
 
3430 rajveer 262
    public long getCouponUsageCountByUser(String couponCode, long userId) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 263
    {
264
      send_getCouponUsageCountByUser(couponCode, userId);
265
      return recv_getCouponUsageCountByUser();
266
    }
267
 
3430 rajveer 268
    public void send_getCouponUsageCountByUser(String couponCode, long userId) throws org.apache.thrift.TException
1982 varun.gupt 269
    {
270
      getCouponUsageCountByUser_args args = new getCouponUsageCountByUser_args();
3430 rajveer 271
      args.setCouponCode(couponCode);
272
      args.setUserId(userId);
273
      sendBase("getCouponUsageCountByUser", args);
1982 varun.gupt 274
    }
275
 
3430 rajveer 276
    public long recv_getCouponUsageCountByUser() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 277
    {
278
      getCouponUsageCountByUser_result result = new getCouponUsageCountByUser_result();
3430 rajveer 279
      receiveBase(result, "getCouponUsageCountByUser");
1982 varun.gupt 280
      if (result.isSetSuccess()) {
281
        return result.success;
282
      }
283
      if (result.pex != null) {
284
        throw result.pex;
285
      }
3430 rajveer 286
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getCouponUsageCountByUser failed: unknown result");
1982 varun.gupt 287
    }
288
 
3430 rajveer 289
    public List<Coupon> getActiveCoupons() throws PromotionException, org.apache.thrift.TException
3385 varun.gupt 290
    {
291
      send_getActiveCoupons();
292
      return recv_getActiveCoupons();
293
    }
294
 
3430 rajveer 295
    public void send_getActiveCoupons() throws org.apache.thrift.TException
3385 varun.gupt 296
    {
297
      getActiveCoupons_args args = new getActiveCoupons_args();
3430 rajveer 298
      sendBase("getActiveCoupons", args);
3385 varun.gupt 299
    }
300
 
3430 rajveer 301
    public List<Coupon> recv_getActiveCoupons() throws PromotionException, org.apache.thrift.TException
3385 varun.gupt 302
    {
303
      getActiveCoupons_result result = new getActiveCoupons_result();
3430 rajveer 304
      receiveBase(result, "getActiveCoupons");
3385 varun.gupt 305
      if (result.isSetSuccess()) {
306
        return result.success;
307
      }
308
      if (result.pex != null) {
309
        throw result.pex;
310
      }
3430 rajveer 311
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getActiveCoupons failed: unknown result");
3385 varun.gupt 312
    }
313
 
3430 rajveer 314
    public long getSuccessfulPaymentCountForCoupon(String couponCode) throws PromotionException, org.apache.thrift.TException
3385 varun.gupt 315
    {
316
      send_getSuccessfulPaymentCountForCoupon(couponCode);
317
      return recv_getSuccessfulPaymentCountForCoupon();
318
    }
319
 
3430 rajveer 320
    public void send_getSuccessfulPaymentCountForCoupon(String couponCode) throws org.apache.thrift.TException
3385 varun.gupt 321
    {
322
      getSuccessfulPaymentCountForCoupon_args args = new getSuccessfulPaymentCountForCoupon_args();
3430 rajveer 323
      args.setCouponCode(couponCode);
324
      sendBase("getSuccessfulPaymentCountForCoupon", args);
3385 varun.gupt 325
    }
326
 
3430 rajveer 327
    public long recv_getSuccessfulPaymentCountForCoupon() throws PromotionException, org.apache.thrift.TException
3385 varun.gupt 328
    {
329
      getSuccessfulPaymentCountForCoupon_result result = new getSuccessfulPaymentCountForCoupon_result();
3430 rajveer 330
      receiveBase(result, "getSuccessfulPaymentCountForCoupon");
3385 varun.gupt 331
      if (result.isSetSuccess()) {
332
        return result.success;
333
      }
334
      if (result.pex != null) {
335
        throw result.pex;
336
      }
3430 rajveer 337
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getSuccessfulPaymentCountForCoupon failed: unknown result");
3385 varun.gupt 338
    }
339
 
3430 rajveer 340
    public String getRuleDocString(String ruleName) throws org.apache.thrift.TException
3385 varun.gupt 341
    {
342
      send_getRuleDocString(ruleName);
343
      return recv_getRuleDocString();
344
    }
345
 
3430 rajveer 346
    public void send_getRuleDocString(String ruleName) throws org.apache.thrift.TException
3385 varun.gupt 347
    {
348
      getRuleDocString_args args = new getRuleDocString_args();
3430 rajveer 349
      args.setRuleName(ruleName);
350
      sendBase("getRuleDocString", args);
3385 varun.gupt 351
    }
352
 
3430 rajveer 353
    public String recv_getRuleDocString() throws org.apache.thrift.TException
3385 varun.gupt 354
    {
355
      getRuleDocString_result result = new getRuleDocString_result();
3430 rajveer 356
      receiveBase(result, "getRuleDocString");
3385 varun.gupt 357
      if (result.isSetSuccess()) {
358
        return result.success;
359
      }
3430 rajveer 360
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getRuleDocString failed: unknown result");
3385 varun.gupt 361
    }
362
 
1982 varun.gupt 363
  }
3430 rajveer 364
  public static class AsyncClient extends in.shop2020.generic.GenericService.AsyncClient implements AsyncIface {
365
    public static class Factory implements org.apache.thrift.async.TAsyncClientFactory<AsyncClient> {
366
      private org.apache.thrift.async.TAsyncClientManager clientManager;
367
      private org.apache.thrift.protocol.TProtocolFactory protocolFactory;
368
      public Factory(org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.protocol.TProtocolFactory protocolFactory) {
369
        this.clientManager = clientManager;
370
        this.protocolFactory = protocolFactory;
371
      }
372
      public AsyncClient getAsyncClient(org.apache.thrift.transport.TNonblockingTransport transport) {
373
        return new AsyncClient(protocolFactory, clientManager, transport);
374
      }
1982 varun.gupt 375
    }
376
 
3430 rajveer 377
    public AsyncClient(org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.transport.TNonblockingTransport transport) {
378
      super(protocolFactory, clientManager, transport);
379
    }
1982 varun.gupt 380
 
3430 rajveer 381
    public void createPromotion(String name, String ruleExecutionSrc, long startOn, long endOn, org.apache.thrift.async.AsyncMethodCallback<createPromotion_call> resultHandler) throws org.apache.thrift.TException {
382
      checkReady();
383
      createPromotion_call method_call = new createPromotion_call(name, ruleExecutionSrc, startOn, endOn, resultHandler, this, ___protocolFactory, ___transport);
384
      this.___currentMethod = method_call;
385
      ___manager.call(method_call);
1982 varun.gupt 386
    }
387
 
3430 rajveer 388
    public static class createPromotion_call extends org.apache.thrift.async.TAsyncMethodCall {
389
      private String name;
390
      private String ruleExecutionSrc;
391
      private long startOn;
392
      private long endOn;
393
      public createPromotion_call(String name, String ruleExecutionSrc, long startOn, long endOn, org.apache.thrift.async.AsyncMethodCallback<createPromotion_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 {
394
        super(client, protocolFactory, transport, resultHandler, false);
395
        this.name = name;
396
        this.ruleExecutionSrc = ruleExecutionSrc;
397
        this.startOn = startOn;
398
        this.endOn = endOn;
1982 varun.gupt 399
      }
400
 
3430 rajveer 401
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
402
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("createPromotion", org.apache.thrift.protocol.TMessageType.CALL, 0));
1982 varun.gupt 403
        createPromotion_args args = new createPromotion_args();
3430 rajveer 404
        args.setName(name);
405
        args.setRuleExecutionSrc(ruleExecutionSrc);
406
        args.setStartOn(startOn);
407
        args.setEndOn(endOn);
408
        args.write(prot);
409
        prot.writeMessageEnd();
1982 varun.gupt 410
      }
411
 
3430 rajveer 412
      public void getResult() throws PromotionException, org.apache.thrift.TException {
413
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
414
          throw new IllegalStateException("Method call not finished!");
1982 varun.gupt 415
        }
3430 rajveer 416
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
417
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
418
        (new Client(prot)).recv_createPromotion();
1982 varun.gupt 419
      }
3430 rajveer 420
    }
1982 varun.gupt 421
 
3430 rajveer 422
    public void getAllPromotions(org.apache.thrift.async.AsyncMethodCallback<getAllPromotions_call> resultHandler) throws org.apache.thrift.TException {
423
      checkReady();
424
      getAllPromotions_call method_call = new getAllPromotions_call(resultHandler, this, ___protocolFactory, ___transport);
425
      this.___currentMethod = method_call;
426
      ___manager.call(method_call);
1982 varun.gupt 427
    }
428
 
3430 rajveer 429
    public static class getAllPromotions_call extends org.apache.thrift.async.TAsyncMethodCall {
430
      public getAllPromotions_call(org.apache.thrift.async.AsyncMethodCallback<getAllPromotions_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 {
431
        super(client, protocolFactory, transport, resultHandler, false);
1982 varun.gupt 432
      }
433
 
3430 rajveer 434
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
435
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getAllPromotions", org.apache.thrift.protocol.TMessageType.CALL, 0));
436
        getAllPromotions_args args = new getAllPromotions_args();
437
        args.write(prot);
438
        prot.writeMessageEnd();
439
      }
1982 varun.gupt 440
 
3430 rajveer 441
      public List<Promotion> getResult() throws PromotionException, org.apache.thrift.TException {
442
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
443
          throw new IllegalStateException("Method call not finished!");
1982 varun.gupt 444
        }
3430 rajveer 445
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
446
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
447
        return (new Client(prot)).recv_getAllPromotions();
1982 varun.gupt 448
      }
3430 rajveer 449
    }
1982 varun.gupt 450
 
3430 rajveer 451
    public void getPromotionById(long promotionId, org.apache.thrift.async.AsyncMethodCallback<getPromotionById_call> resultHandler) throws org.apache.thrift.TException {
452
      checkReady();
453
      getPromotionById_call method_call = new getPromotionById_call(promotionId, resultHandler, this, ___protocolFactory, ___transport);
454
      this.___currentMethod = method_call;
455
      ___manager.call(method_call);
1982 varun.gupt 456
    }
457
 
3430 rajveer 458
    public static class getPromotionById_call extends org.apache.thrift.async.TAsyncMethodCall {
459
      private long promotionId;
460
      public getPromotionById_call(long promotionId, org.apache.thrift.async.AsyncMethodCallback<getPromotionById_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 {
461
        super(client, protocolFactory, transport, resultHandler, false);
462
        this.promotionId = promotionId;
1982 varun.gupt 463
      }
464
 
3430 rajveer 465
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
466
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getPromotionById", org.apache.thrift.protocol.TMessageType.CALL, 0));
467
        getPromotionById_args args = new getPromotionById_args();
468
        args.setPromotionId(promotionId);
469
        args.write(prot);
470
        prot.writeMessageEnd();
471
      }
1982 varun.gupt 472
 
3430 rajveer 473
      public Promotion getResult() throws PromotionException, org.apache.thrift.TException {
474
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
475
          throw new IllegalStateException("Method call not finished!");
1982 varun.gupt 476
        }
3430 rajveer 477
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
478
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
479
        return (new Client(prot)).recv_getPromotionById();
1982 varun.gupt 480
      }
3430 rajveer 481
    }
1982 varun.gupt 482
 
3430 rajveer 483
    public void generateCouponsForPromotion(long promotionId, String couponCode, org.apache.thrift.async.AsyncMethodCallback<generateCouponsForPromotion_call> resultHandler) throws org.apache.thrift.TException {
484
      checkReady();
485
      generateCouponsForPromotion_call method_call = new generateCouponsForPromotion_call(promotionId, couponCode, resultHandler, this, ___protocolFactory, ___transport);
486
      this.___currentMethod = method_call;
487
      ___manager.call(method_call);
1982 varun.gupt 488
    }
489
 
3430 rajveer 490
    public static class generateCouponsForPromotion_call extends org.apache.thrift.async.TAsyncMethodCall {
491
      private long promotionId;
492
      private String couponCode;
493
      public generateCouponsForPromotion_call(long promotionId, String couponCode, org.apache.thrift.async.AsyncMethodCallback<generateCouponsForPromotion_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 {
494
        super(client, protocolFactory, transport, resultHandler, false);
495
        this.promotionId = promotionId;
496
        this.couponCode = couponCode;
1982 varun.gupt 497
      }
498
 
3430 rajveer 499
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
500
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("generateCouponsForPromotion", org.apache.thrift.protocol.TMessageType.CALL, 0));
501
        generateCouponsForPromotion_args args = new generateCouponsForPromotion_args();
502
        args.setPromotionId(promotionId);
503
        args.setCouponCode(couponCode);
504
        args.write(prot);
505
        prot.writeMessageEnd();
3385 varun.gupt 506
      }
507
 
3430 rajveer 508
      public void getResult() throws PromotionException, org.apache.thrift.TException {
509
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
510
          throw new IllegalStateException("Method call not finished!");
3385 varun.gupt 511
        }
3430 rajveer 512
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
513
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
514
        (new Client(prot)).recv_generateCouponsForPromotion();
3385 varun.gupt 515
      }
516
    }
517
 
3430 rajveer 518
    public void applyCoupon(String couponCode, long cartId, org.apache.thrift.async.AsyncMethodCallback<applyCoupon_call> resultHandler) throws org.apache.thrift.TException {
519
      checkReady();
520
      applyCoupon_call method_call = new applyCoupon_call(couponCode, cartId, resultHandler, this, ___protocolFactory, ___transport);
521
      this.___currentMethod = method_call;
522
      ___manager.call(method_call);
3385 varun.gupt 523
    }
524
 
3430 rajveer 525
    public static class applyCoupon_call extends org.apache.thrift.async.TAsyncMethodCall {
526
      private String couponCode;
527
      private long cartId;
528
      public applyCoupon_call(String couponCode, long cartId, org.apache.thrift.async.AsyncMethodCallback<applyCoupon_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 {
529
        super(client, protocolFactory, transport, resultHandler, false);
530
        this.couponCode = couponCode;
531
        this.cartId = cartId;
1982 varun.gupt 532
      }
533
 
3430 rajveer 534
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
535
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("applyCoupon", org.apache.thrift.protocol.TMessageType.CALL, 0));
536
        applyCoupon_args args = new applyCoupon_args();
537
        args.setCouponCode(couponCode);
538
        args.setCartId(cartId);
539
        args.write(prot);
540
        prot.writeMessageEnd();
1982 varun.gupt 541
      }
542
 
3430 rajveer 543
      public Cart getResult() throws PromotionException, org.apache.thrift.TException {
544
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
545
          throw new IllegalStateException("Method call not finished!");
546
        }
547
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
548
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
549
        return (new Client(prot)).recv_applyCoupon();
1982 varun.gupt 550
      }
3430 rajveer 551
    }
1982 varun.gupt 552
 
3430 rajveer 553
    public void trackCouponUsage(String couponCode, long transactionId, long userId, org.apache.thrift.async.AsyncMethodCallback<trackCouponUsage_call> resultHandler) throws org.apache.thrift.TException {
554
      checkReady();
555
      trackCouponUsage_call method_call = new trackCouponUsage_call(couponCode, transactionId, userId, resultHandler, this, ___protocolFactory, ___transport);
556
      this.___currentMethod = method_call;
557
      ___manager.call(method_call);
558
    }
1982 varun.gupt 559
 
3430 rajveer 560
    public static class trackCouponUsage_call extends org.apache.thrift.async.TAsyncMethodCall {
561
      private String couponCode;
562
      private long transactionId;
563
      private long userId;
564
      public trackCouponUsage_call(String couponCode, long transactionId, long userId, org.apache.thrift.async.AsyncMethodCallback<trackCouponUsage_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 {
565
        super(client, protocolFactory, transport, resultHandler, false);
566
        this.couponCode = couponCode;
567
        this.transactionId = transactionId;
568
        this.userId = userId;
1982 varun.gupt 569
      }
570
 
3430 rajveer 571
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
572
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("trackCouponUsage", org.apache.thrift.protocol.TMessageType.CALL, 0));
573
        trackCouponUsage_args args = new trackCouponUsage_args();
574
        args.setCouponCode(couponCode);
575
        args.setTransactionId(transactionId);
576
        args.setUserId(userId);
577
        args.write(prot);
578
        prot.writeMessageEnd();
1982 varun.gupt 579
      }
580
 
3430 rajveer 581
      public void getResult() throws PromotionException, org.apache.thrift.TException {
582
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
583
          throw new IllegalStateException("Method call not finished!");
584
        }
585
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
586
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
587
        (new Client(prot)).recv_trackCouponUsage();
1982 varun.gupt 588
      }
589
    }
590
 
3430 rajveer 591
    public void getCouponUsageCountByUser(String couponCode, long userId, org.apache.thrift.async.AsyncMethodCallback<getCouponUsageCountByUser_call> resultHandler) throws org.apache.thrift.TException {
592
      checkReady();
593
      getCouponUsageCountByUser_call method_call = new getCouponUsageCountByUser_call(couponCode, userId, resultHandler, this, ___protocolFactory, ___transport);
594
      this.___currentMethod = method_call;
595
      ___manager.call(method_call);
1982 varun.gupt 596
    }
597
 
3430 rajveer 598
    public static class getCouponUsageCountByUser_call extends org.apache.thrift.async.TAsyncMethodCall {
599
      private String couponCode;
600
      private long userId;
601
      public getCouponUsageCountByUser_call(String couponCode, long userId, org.apache.thrift.async.AsyncMethodCallback<getCouponUsageCountByUser_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 {
602
        super(client, protocolFactory, transport, resultHandler, false);
603
        this.couponCode = couponCode;
604
        this.userId = userId;
605
      }
1982 varun.gupt 606
 
3430 rajveer 607
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
608
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getCouponUsageCountByUser", org.apache.thrift.protocol.TMessageType.CALL, 0));
609
        getCouponUsageCountByUser_args args = new getCouponUsageCountByUser_args();
610
        args.setCouponCode(couponCode);
611
        args.setUserId(userId);
612
        args.write(prot);
613
        prot.writeMessageEnd();
614
      }
1982 varun.gupt 615
 
3430 rajveer 616
      public long getResult() throws PromotionException, org.apache.thrift.TException {
617
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
618
          throw new IllegalStateException("Method call not finished!");
619
        }
620
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
621
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
622
        return (new Client(prot)).recv_getCouponUsageCountByUser();
623
      }
1982 varun.gupt 624
    }
625
 
3430 rajveer 626
    public void getActiveCoupons(org.apache.thrift.async.AsyncMethodCallback<getActiveCoupons_call> resultHandler) throws org.apache.thrift.TException {
627
      checkReady();
628
      getActiveCoupons_call method_call = new getActiveCoupons_call(resultHandler, this, ___protocolFactory, ___transport);
629
      this.___currentMethod = method_call;
630
      ___manager.call(method_call);
1982 varun.gupt 631
    }
632
 
3430 rajveer 633
    public static class getActiveCoupons_call extends org.apache.thrift.async.TAsyncMethodCall {
634
      public getActiveCoupons_call(org.apache.thrift.async.AsyncMethodCallback<getActiveCoupons_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 {
635
        super(client, protocolFactory, transport, resultHandler, false);
1982 varun.gupt 636
      }
637
 
3430 rajveer 638
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
639
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getActiveCoupons", org.apache.thrift.protocol.TMessageType.CALL, 0));
640
        getActiveCoupons_args args = new getActiveCoupons_args();
641
        args.write(prot);
642
        prot.writeMessageEnd();
643
      }
1982 varun.gupt 644
 
3430 rajveer 645
      public List<Coupon> getResult() throws PromotionException, org.apache.thrift.TException {
646
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
647
          throw new IllegalStateException("Method call not finished!");
648
        }
649
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
650
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
651
        return (new Client(prot)).recv_getActiveCoupons();
1982 varun.gupt 652
      }
653
    }
654
 
3430 rajveer 655
    public void getSuccessfulPaymentCountForCoupon(String couponCode, org.apache.thrift.async.AsyncMethodCallback<getSuccessfulPaymentCountForCoupon_call> resultHandler) throws org.apache.thrift.TException {
656
      checkReady();
657
      getSuccessfulPaymentCountForCoupon_call method_call = new getSuccessfulPaymentCountForCoupon_call(couponCode, resultHandler, this, ___protocolFactory, ___transport);
658
      this.___currentMethod = method_call;
659
      ___manager.call(method_call);
1982 varun.gupt 660
    }
661
 
3430 rajveer 662
    public static class getSuccessfulPaymentCountForCoupon_call extends org.apache.thrift.async.TAsyncMethodCall {
663
      private String couponCode;
664
      public getSuccessfulPaymentCountForCoupon_call(String couponCode, org.apache.thrift.async.AsyncMethodCallback<getSuccessfulPaymentCountForCoupon_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 {
665
        super(client, protocolFactory, transport, resultHandler, false);
666
        this.couponCode = couponCode;
1982 varun.gupt 667
      }
668
 
3430 rajveer 669
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
670
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getSuccessfulPaymentCountForCoupon", org.apache.thrift.protocol.TMessageType.CALL, 0));
671
        getSuccessfulPaymentCountForCoupon_args args = new getSuccessfulPaymentCountForCoupon_args();
672
        args.setCouponCode(couponCode);
673
        args.write(prot);
674
        prot.writeMessageEnd();
675
      }
1982 varun.gupt 676
 
3430 rajveer 677
      public long getResult() throws PromotionException, org.apache.thrift.TException {
678
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
679
          throw new IllegalStateException("Method call not finished!");
680
        }
681
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
682
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
683
        return (new Client(prot)).recv_getSuccessfulPaymentCountForCoupon();
684
      }
1982 varun.gupt 685
    }
686
 
3430 rajveer 687
    public void getRuleDocString(String ruleName, org.apache.thrift.async.AsyncMethodCallback<getRuleDocString_call> resultHandler) throws org.apache.thrift.TException {
688
      checkReady();
689
      getRuleDocString_call method_call = new getRuleDocString_call(ruleName, resultHandler, this, ___protocolFactory, ___transport);
690
      this.___currentMethod = method_call;
691
      ___manager.call(method_call);
1982 varun.gupt 692
    }
693
 
3430 rajveer 694
    public static class getRuleDocString_call extends org.apache.thrift.async.TAsyncMethodCall {
695
      private String ruleName;
696
      public getRuleDocString_call(String ruleName, org.apache.thrift.async.AsyncMethodCallback<getRuleDocString_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 {
697
        super(client, protocolFactory, transport, resultHandler, false);
698
        this.ruleName = ruleName;
699
      }
1982 varun.gupt 700
 
3430 rajveer 701
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
702
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getRuleDocString", org.apache.thrift.protocol.TMessageType.CALL, 0));
703
        getRuleDocString_args args = new getRuleDocString_args();
704
        args.setRuleName(ruleName);
705
        args.write(prot);
706
        prot.writeMessageEnd();
1982 varun.gupt 707
      }
708
 
3430 rajveer 709
      public String getResult() throws org.apache.thrift.TException {
710
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
711
          throw new IllegalStateException("Method call not finished!");
1982 varun.gupt 712
        }
3430 rajveer 713
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
714
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
715
        return (new Client(prot)).recv_getRuleDocString();
1982 varun.gupt 716
      }
717
    }
718
 
3430 rajveer 719
  }
1982 varun.gupt 720
 
3430 rajveer 721
  public static class Processor<I extends Iface> extends in.shop2020.generic.GenericService.Processor implements org.apache.thrift.TProcessor {
722
    private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName());
723
    public Processor(I iface) {
724
      super(iface, getProcessMap(new HashMap<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>>()));
1982 varun.gupt 725
    }
726
 
3430 rajveer 727
    protected Processor(I iface, Map<String,  org.apache.thrift.ProcessFunction<I, ? extends  org.apache.thrift.TBase>> processMap) {
728
      super(iface, getProcessMap(processMap));
1982 varun.gupt 729
    }
730
 
3430 rajveer 731
    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) {
732
      processMap.put("createPromotion", new createPromotion());
733
      processMap.put("getAllPromotions", new getAllPromotions());
734
      processMap.put("getPromotionById", new getPromotionById());
735
      processMap.put("generateCouponsForPromotion", new generateCouponsForPromotion());
736
      processMap.put("applyCoupon", new applyCoupon());
737
      processMap.put("trackCouponUsage", new trackCouponUsage());
738
      processMap.put("getCouponUsageCountByUser", new getCouponUsageCountByUser());
739
      processMap.put("getActiveCoupons", new getActiveCoupons());
740
      processMap.put("getSuccessfulPaymentCountForCoupon", new getSuccessfulPaymentCountForCoupon());
741
      processMap.put("getRuleDocString", new getRuleDocString());
742
      return processMap;
1982 varun.gupt 743
    }
744
 
3430 rajveer 745
    private static class createPromotion<I extends Iface> extends org.apache.thrift.ProcessFunction<I, createPromotion_args> {
746
      public createPromotion() {
747
        super("createPromotion");
748
      }
1982 varun.gupt 749
 
3430 rajveer 750
      protected createPromotion_args getEmptyArgsInstance() {
751
        return new createPromotion_args();
752
      }
1982 varun.gupt 753
 
3430 rajveer 754
      protected createPromotion_result getResult(I iface, createPromotion_args args) throws org.apache.thrift.TException {
755
        createPromotion_result result = new createPromotion_result();
756
        try {
757
          iface.createPromotion(args.name, args.ruleExecutionSrc, args.startOn, args.endOn);
758
        } catch (PromotionException pex) {
759
          result.pex = pex;
1982 varun.gupt 760
        }
3430 rajveer 761
        return result;
1982 varun.gupt 762
      }
3430 rajveer 763
    }
1982 varun.gupt 764
 
3430 rajveer 765
    private static class getAllPromotions<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getAllPromotions_args> {
766
      public getAllPromotions() {
767
        super("getAllPromotions");
1982 varun.gupt 768
      }
769
 
3430 rajveer 770
      protected getAllPromotions_args getEmptyArgsInstance() {
771
        return new getAllPromotions_args();
1982 varun.gupt 772
      }
773
 
3430 rajveer 774
      protected getAllPromotions_result getResult(I iface, getAllPromotions_args args) throws org.apache.thrift.TException {
775
        getAllPromotions_result result = new getAllPromotions_result();
776
        try {
777
          result.success = iface.getAllPromotions();
778
        } catch (PromotionException pex) {
779
          result.pex = pex;
780
        }
781
        return result;
1982 varun.gupt 782
      }
3430 rajveer 783
    }
1982 varun.gupt 784
 
3430 rajveer 785
    private static class getPromotionById<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getPromotionById_args> {
786
      public getPromotionById() {
787
        super("getPromotionById");
1982 varun.gupt 788
      }
789
 
3430 rajveer 790
      protected getPromotionById_args getEmptyArgsInstance() {
791
        return new getPromotionById_args();
1982 varun.gupt 792
      }
793
 
3430 rajveer 794
      protected getPromotionById_result getResult(I iface, getPromotionById_args args) throws org.apache.thrift.TException {
795
        getPromotionById_result result = new getPromotionById_result();
796
        try {
797
          result.success = iface.getPromotionById(args.promotionId);
798
        } catch (PromotionException pex) {
799
          result.pex = pex;
800
        }
801
        return result;
1982 varun.gupt 802
      }
803
    }
804
 
3430 rajveer 805
    private static class generateCouponsForPromotion<I extends Iface> extends org.apache.thrift.ProcessFunction<I, generateCouponsForPromotion_args> {
806
      public generateCouponsForPromotion() {
807
        super("generateCouponsForPromotion");
808
      }
1982 varun.gupt 809
 
3430 rajveer 810
      protected generateCouponsForPromotion_args getEmptyArgsInstance() {
811
        return new generateCouponsForPromotion_args();
812
      }
1982 varun.gupt 813
 
3430 rajveer 814
      protected generateCouponsForPromotion_result getResult(I iface, generateCouponsForPromotion_args args) throws org.apache.thrift.TException {
815
        generateCouponsForPromotion_result result = new generateCouponsForPromotion_result();
816
        try {
817
          iface.generateCouponsForPromotion(args.promotionId, args.couponCode);
818
        } catch (PromotionException pex) {
819
          result.pex = pex;
820
        }
821
        return result;
822
      }
1982 varun.gupt 823
    }
824
 
3430 rajveer 825
    private static class applyCoupon<I extends Iface> extends org.apache.thrift.ProcessFunction<I, applyCoupon_args> {
826
      public applyCoupon() {
827
        super("applyCoupon");
828
      }
1982 varun.gupt 829
 
3430 rajveer 830
      protected applyCoupon_args getEmptyArgsInstance() {
831
        return new applyCoupon_args();
832
      }
1982 varun.gupt 833
 
3430 rajveer 834
      protected applyCoupon_result getResult(I iface, applyCoupon_args args) throws org.apache.thrift.TException {
835
        applyCoupon_result result = new applyCoupon_result();
836
        try {
837
          result.success = iface.applyCoupon(args.couponCode, args.cartId);
838
        } catch (PromotionException pex) {
839
          result.pex = pex;
840
        }
841
        return result;
1982 varun.gupt 842
      }
843
    }
844
 
3430 rajveer 845
    private static class trackCouponUsage<I extends Iface> extends org.apache.thrift.ProcessFunction<I, trackCouponUsage_args> {
846
      public trackCouponUsage() {
847
        super("trackCouponUsage");
848
      }
1982 varun.gupt 849
 
3430 rajveer 850
      protected trackCouponUsage_args getEmptyArgsInstance() {
851
        return new trackCouponUsage_args();
1982 varun.gupt 852
      }
853
 
3430 rajveer 854
      protected trackCouponUsage_result getResult(I iface, trackCouponUsage_args args) throws org.apache.thrift.TException {
855
        trackCouponUsage_result result = new trackCouponUsage_result();
856
        try {
857
          iface.trackCouponUsage(args.couponCode, args.transactionId, args.userId);
858
        } catch (PromotionException pex) {
859
          result.pex = pex;
860
        }
861
        return result;
862
      }
1982 varun.gupt 863
    }
864
 
3430 rajveer 865
    private static class getCouponUsageCountByUser<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getCouponUsageCountByUser_args> {
866
      public getCouponUsageCountByUser() {
867
        super("getCouponUsageCountByUser");
1982 varun.gupt 868
      }
869
 
3430 rajveer 870
      protected getCouponUsageCountByUser_args getEmptyArgsInstance() {
871
        return new getCouponUsageCountByUser_args();
872
      }
1982 varun.gupt 873
 
3430 rajveer 874
      protected getCouponUsageCountByUser_result getResult(I iface, getCouponUsageCountByUser_args args) throws org.apache.thrift.TException {
875
        getCouponUsageCountByUser_result result = new getCouponUsageCountByUser_result();
876
        try {
877
          result.success = iface.getCouponUsageCountByUser(args.couponCode, args.userId);
878
          result.setSuccessIsSet(true);
879
        } catch (PromotionException pex) {
880
          result.pex = pex;
881
        }
882
        return result;
883
      }
1982 varun.gupt 884
    }
885
 
3430 rajveer 886
    private static class getActiveCoupons<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getActiveCoupons_args> {
887
      public getActiveCoupons() {
888
        super("getActiveCoupons");
889
      }
1982 varun.gupt 890
 
3430 rajveer 891
      protected getActiveCoupons_args getEmptyArgsInstance() {
892
        return new getActiveCoupons_args();
893
      }
1982 varun.gupt 894
 
3430 rajveer 895
      protected getActiveCoupons_result getResult(I iface, getActiveCoupons_args args) throws org.apache.thrift.TException {
896
        getActiveCoupons_result result = new getActiveCoupons_result();
897
        try {
898
          result.success = iface.getActiveCoupons();
899
        } catch (PromotionException pex) {
900
          result.pex = pex;
901
        }
902
        return result;
903
      }
1982 varun.gupt 904
    }
905
 
3430 rajveer 906
    private static class getSuccessfulPaymentCountForCoupon<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getSuccessfulPaymentCountForCoupon_args> {
907
      public getSuccessfulPaymentCountForCoupon() {
908
        super("getSuccessfulPaymentCountForCoupon");
1982 varun.gupt 909
      }
910
 
3430 rajveer 911
      protected getSuccessfulPaymentCountForCoupon_args getEmptyArgsInstance() {
912
        return new getSuccessfulPaymentCountForCoupon_args();
913
      }
1982 varun.gupt 914
 
3430 rajveer 915
      protected getSuccessfulPaymentCountForCoupon_result getResult(I iface, getSuccessfulPaymentCountForCoupon_args args) throws org.apache.thrift.TException {
916
        getSuccessfulPaymentCountForCoupon_result result = new getSuccessfulPaymentCountForCoupon_result();
917
        try {
918
          result.success = iface.getSuccessfulPaymentCountForCoupon(args.couponCode);
919
          result.setSuccessIsSet(true);
920
        } catch (PromotionException pex) {
921
          result.pex = pex;
1982 varun.gupt 922
        }
3430 rajveer 923
        return result;
1982 varun.gupt 924
      }
925
    }
926
 
3430 rajveer 927
    private static class getRuleDocString<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getRuleDocString_args> {
928
      public getRuleDocString() {
929
        super("getRuleDocString");
930
      }
1982 varun.gupt 931
 
3430 rajveer 932
      protected getRuleDocString_args getEmptyArgsInstance() {
933
        return new getRuleDocString_args();
934
      }
1982 varun.gupt 935
 
3430 rajveer 936
      protected getRuleDocString_result getResult(I iface, getRuleDocString_args args) throws org.apache.thrift.TException {
937
        getRuleDocString_result result = new getRuleDocString_result();
938
        result.success = iface.getRuleDocString(args.ruleName);
939
        return result;
940
      }
1982 varun.gupt 941
    }
942
 
943
  }
944
 
3430 rajveer 945
  public static class createPromotion_args implements org.apache.thrift.TBase<createPromotion_args, createPromotion_args._Fields>, java.io.Serializable, Cloneable   {
946
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createPromotion_args");
1982 varun.gupt 947
 
3430 rajveer 948
    private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)1);
949
    private static final org.apache.thrift.protocol.TField RULE_EXECUTION_SRC_FIELD_DESC = new org.apache.thrift.protocol.TField("ruleExecutionSrc", org.apache.thrift.protocol.TType.STRING, (short)2);
950
    private static final org.apache.thrift.protocol.TField START_ON_FIELD_DESC = new org.apache.thrift.protocol.TField("startOn", org.apache.thrift.protocol.TType.I64, (short)3);
951
    private static final org.apache.thrift.protocol.TField END_ON_FIELD_DESC = new org.apache.thrift.protocol.TField("endOn", org.apache.thrift.protocol.TType.I64, (short)4);
1982 varun.gupt 952
 
3430 rajveer 953
    private String name; // required
954
    private String ruleExecutionSrc; // required
955
    private long startOn; // required
956
    private long endOn; // required
1982 varun.gupt 957
 
958
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 959
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 960
      NAME((short)1, "name"),
961
      RULE_EXECUTION_SRC((short)2, "ruleExecutionSrc"),
962
      START_ON((short)3, "startOn"),
963
      END_ON((short)4, "endOn");
964
 
965
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
966
 
967
      static {
968
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
969
          byName.put(field.getFieldName(), field);
970
        }
971
      }
972
 
973
      /**
974
       * Find the _Fields constant that matches fieldId, or null if its not found.
975
       */
976
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 977
        switch(fieldId) {
978
          case 1: // NAME
979
            return NAME;
980
          case 2: // RULE_EXECUTION_SRC
981
            return RULE_EXECUTION_SRC;
982
          case 3: // START_ON
983
            return START_ON;
984
          case 4: // END_ON
985
            return END_ON;
986
          default:
987
            return null;
988
        }
1982 varun.gupt 989
      }
990
 
991
      /**
992
       * Find the _Fields constant that matches fieldId, throwing an exception
993
       * if it is not found.
994
       */
995
      public static _Fields findByThriftIdOrThrow(int fieldId) {
996
        _Fields fields = findByThriftId(fieldId);
997
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
998
        return fields;
999
      }
1000
 
1001
      /**
1002
       * Find the _Fields constant that matches name, or null if its not found.
1003
       */
1004
      public static _Fields findByName(String name) {
1005
        return byName.get(name);
1006
      }
1007
 
1008
      private final short _thriftId;
1009
      private final String _fieldName;
1010
 
1011
      _Fields(short thriftId, String fieldName) {
1012
        _thriftId = thriftId;
1013
        _fieldName = fieldName;
1014
      }
1015
 
1016
      public short getThriftFieldId() {
1017
        return _thriftId;
1018
      }
1019
 
1020
      public String getFieldName() {
1021
        return _fieldName;
1022
      }
1023
    }
1024
 
1025
    // isset id assignments
1026
    private static final int __STARTON_ISSET_ID = 0;
1027
    private static final int __ENDON_ISSET_ID = 1;
1028
    private BitSet __isset_bit_vector = new BitSet(2);
1029
 
3430 rajveer 1030
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 1031
    static {
3430 rajveer 1032
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
1033
      tmpMap.put(_Fields.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.DEFAULT, 
1034
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
1035
      tmpMap.put(_Fields.RULE_EXECUTION_SRC, new org.apache.thrift.meta_data.FieldMetaData("ruleExecutionSrc", org.apache.thrift.TFieldRequirementType.DEFAULT, 
1036
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
1037
      tmpMap.put(_Fields.START_ON, new org.apache.thrift.meta_data.FieldMetaData("startOn", org.apache.thrift.TFieldRequirementType.DEFAULT, 
1038
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
1039
      tmpMap.put(_Fields.END_ON, new org.apache.thrift.meta_data.FieldMetaData("endOn", org.apache.thrift.TFieldRequirementType.DEFAULT, 
1040
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
1041
      metaDataMap = Collections.unmodifiableMap(tmpMap);
1042
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createPromotion_args.class, metaDataMap);
1982 varun.gupt 1043
    }
1044
 
1045
    public createPromotion_args() {
1046
    }
1047
 
1048
    public createPromotion_args(
1049
      String name,
1050
      String ruleExecutionSrc,
1051
      long startOn,
1052
      long endOn)
1053
    {
1054
      this();
1055
      this.name = name;
1056
      this.ruleExecutionSrc = ruleExecutionSrc;
1057
      this.startOn = startOn;
1058
      setStartOnIsSet(true);
1059
      this.endOn = endOn;
1060
      setEndOnIsSet(true);
1061
    }
1062
 
1063
    /**
1064
     * Performs a deep copy on <i>other</i>.
1065
     */
1066
    public createPromotion_args(createPromotion_args other) {
1067
      __isset_bit_vector.clear();
1068
      __isset_bit_vector.or(other.__isset_bit_vector);
1069
      if (other.isSetName()) {
1070
        this.name = other.name;
1071
      }
1072
      if (other.isSetRuleExecutionSrc()) {
1073
        this.ruleExecutionSrc = other.ruleExecutionSrc;
1074
      }
1075
      this.startOn = other.startOn;
1076
      this.endOn = other.endOn;
1077
    }
1078
 
1079
    public createPromotion_args deepCopy() {
1080
      return new createPromotion_args(this);
1081
    }
1082
 
3430 rajveer 1083
    @Override
1084
    public void clear() {
1085
      this.name = null;
1086
      this.ruleExecutionSrc = null;
1087
      setStartOnIsSet(false);
1088
      this.startOn = 0;
1089
      setEndOnIsSet(false);
1090
      this.endOn = 0;
1982 varun.gupt 1091
    }
1092
 
1093
    public String getName() {
1094
      return this.name;
1095
    }
1096
 
3430 rajveer 1097
    public void setName(String name) {
1982 varun.gupt 1098
      this.name = name;
1099
    }
1100
 
1101
    public void unsetName() {
1102
      this.name = null;
1103
    }
1104
 
3430 rajveer 1105
    /** Returns true if field name is set (has been assigned a value) and false otherwise */
1982 varun.gupt 1106
    public boolean isSetName() {
1107
      return this.name != null;
1108
    }
1109
 
1110
    public void setNameIsSet(boolean value) {
1111
      if (!value) {
1112
        this.name = null;
1113
      }
1114
    }
1115
 
1116
    public String getRuleExecutionSrc() {
1117
      return this.ruleExecutionSrc;
1118
    }
1119
 
3430 rajveer 1120
    public void setRuleExecutionSrc(String ruleExecutionSrc) {
1982 varun.gupt 1121
      this.ruleExecutionSrc = ruleExecutionSrc;
1122
    }
1123
 
1124
    public void unsetRuleExecutionSrc() {
1125
      this.ruleExecutionSrc = null;
1126
    }
1127
 
3430 rajveer 1128
    /** Returns true if field ruleExecutionSrc is set (has been assigned a value) and false otherwise */
1982 varun.gupt 1129
    public boolean isSetRuleExecutionSrc() {
1130
      return this.ruleExecutionSrc != null;
1131
    }
1132
 
1133
    public void setRuleExecutionSrcIsSet(boolean value) {
1134
      if (!value) {
1135
        this.ruleExecutionSrc = null;
1136
      }
1137
    }
1138
 
1139
    public long getStartOn() {
1140
      return this.startOn;
1141
    }
1142
 
3430 rajveer 1143
    public void setStartOn(long startOn) {
1982 varun.gupt 1144
      this.startOn = startOn;
1145
      setStartOnIsSet(true);
1146
    }
1147
 
1148
    public void unsetStartOn() {
1149
      __isset_bit_vector.clear(__STARTON_ISSET_ID);
1150
    }
1151
 
3430 rajveer 1152
    /** Returns true if field startOn is set (has been assigned a value) and false otherwise */
1982 varun.gupt 1153
    public boolean isSetStartOn() {
1154
      return __isset_bit_vector.get(__STARTON_ISSET_ID);
1155
    }
1156
 
1157
    public void setStartOnIsSet(boolean value) {
1158
      __isset_bit_vector.set(__STARTON_ISSET_ID, value);
1159
    }
1160
 
1161
    public long getEndOn() {
1162
      return this.endOn;
1163
    }
1164
 
3430 rajveer 1165
    public void setEndOn(long endOn) {
1982 varun.gupt 1166
      this.endOn = endOn;
1167
      setEndOnIsSet(true);
1168
    }
1169
 
1170
    public void unsetEndOn() {
1171
      __isset_bit_vector.clear(__ENDON_ISSET_ID);
1172
    }
1173
 
3430 rajveer 1174
    /** Returns true if field endOn is set (has been assigned a value) and false otherwise */
1982 varun.gupt 1175
    public boolean isSetEndOn() {
1176
      return __isset_bit_vector.get(__ENDON_ISSET_ID);
1177
    }
1178
 
1179
    public void setEndOnIsSet(boolean value) {
1180
      __isset_bit_vector.set(__ENDON_ISSET_ID, value);
1181
    }
1182
 
1183
    public void setFieldValue(_Fields field, Object value) {
1184
      switch (field) {
1185
      case NAME:
1186
        if (value == null) {
1187
          unsetName();
1188
        } else {
1189
          setName((String)value);
1190
        }
1191
        break;
1192
 
1193
      case RULE_EXECUTION_SRC:
1194
        if (value == null) {
1195
          unsetRuleExecutionSrc();
1196
        } else {
1197
          setRuleExecutionSrc((String)value);
1198
        }
1199
        break;
1200
 
1201
      case START_ON:
1202
        if (value == null) {
1203
          unsetStartOn();
1204
        } else {
1205
          setStartOn((Long)value);
1206
        }
1207
        break;
1208
 
1209
      case END_ON:
1210
        if (value == null) {
1211
          unsetEndOn();
1212
        } else {
1213
          setEndOn((Long)value);
1214
        }
1215
        break;
1216
 
1217
      }
1218
    }
1219
 
1220
    public Object getFieldValue(_Fields field) {
1221
      switch (field) {
1222
      case NAME:
1223
        return getName();
1224
 
1225
      case RULE_EXECUTION_SRC:
1226
        return getRuleExecutionSrc();
1227
 
1228
      case START_ON:
3430 rajveer 1229
        return Long.valueOf(getStartOn());
1982 varun.gupt 1230
 
1231
      case END_ON:
3430 rajveer 1232
        return Long.valueOf(getEndOn());
1982 varun.gupt 1233
 
1234
      }
1235
      throw new IllegalStateException();
1236
    }
1237
 
3430 rajveer 1238
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
1239
    public boolean isSet(_Fields field) {
1240
      if (field == null) {
1241
        throw new IllegalArgumentException();
1242
      }
1982 varun.gupt 1243
 
1244
      switch (field) {
1245
      case NAME:
1246
        return isSetName();
1247
      case RULE_EXECUTION_SRC:
1248
        return isSetRuleExecutionSrc();
1249
      case START_ON:
1250
        return isSetStartOn();
1251
      case END_ON:
1252
        return isSetEndOn();
1253
      }
1254
      throw new IllegalStateException();
1255
    }
1256
 
1257
    @Override
1258
    public boolean equals(Object that) {
1259
      if (that == null)
1260
        return false;
1261
      if (that instanceof createPromotion_args)
1262
        return this.equals((createPromotion_args)that);
1263
      return false;
1264
    }
1265
 
1266
    public boolean equals(createPromotion_args that) {
1267
      if (that == null)
1268
        return false;
1269
 
1270
      boolean this_present_name = true && this.isSetName();
1271
      boolean that_present_name = true && that.isSetName();
1272
      if (this_present_name || that_present_name) {
1273
        if (!(this_present_name && that_present_name))
1274
          return false;
1275
        if (!this.name.equals(that.name))
1276
          return false;
1277
      }
1278
 
1279
      boolean this_present_ruleExecutionSrc = true && this.isSetRuleExecutionSrc();
1280
      boolean that_present_ruleExecutionSrc = true && that.isSetRuleExecutionSrc();
1281
      if (this_present_ruleExecutionSrc || that_present_ruleExecutionSrc) {
1282
        if (!(this_present_ruleExecutionSrc && that_present_ruleExecutionSrc))
1283
          return false;
1284
        if (!this.ruleExecutionSrc.equals(that.ruleExecutionSrc))
1285
          return false;
1286
      }
1287
 
1288
      boolean this_present_startOn = true;
1289
      boolean that_present_startOn = true;
1290
      if (this_present_startOn || that_present_startOn) {
1291
        if (!(this_present_startOn && that_present_startOn))
1292
          return false;
1293
        if (this.startOn != that.startOn)
1294
          return false;
1295
      }
1296
 
1297
      boolean this_present_endOn = true;
1298
      boolean that_present_endOn = true;
1299
      if (this_present_endOn || that_present_endOn) {
1300
        if (!(this_present_endOn && that_present_endOn))
1301
          return false;
1302
        if (this.endOn != that.endOn)
1303
          return false;
1304
      }
1305
 
1306
      return true;
1307
    }
1308
 
1309
    @Override
1310
    public int hashCode() {
1311
      return 0;
1312
    }
1313
 
1314
    public int compareTo(createPromotion_args other) {
1315
      if (!getClass().equals(other.getClass())) {
1316
        return getClass().getName().compareTo(other.getClass().getName());
1317
      }
1318
 
1319
      int lastComparison = 0;
1320
      createPromotion_args typedOther = (createPromotion_args)other;
1321
 
3430 rajveer 1322
      lastComparison = Boolean.valueOf(isSetName()).compareTo(typedOther.isSetName());
1982 varun.gupt 1323
      if (lastComparison != 0) {
1324
        return lastComparison;
1325
      }
3430 rajveer 1326
      if (isSetName()) {
1327
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, typedOther.name);
1328
        if (lastComparison != 0) {
1329
          return lastComparison;
1330
        }
1982 varun.gupt 1331
      }
3430 rajveer 1332
      lastComparison = Boolean.valueOf(isSetRuleExecutionSrc()).compareTo(typedOther.isSetRuleExecutionSrc());
1982 varun.gupt 1333
      if (lastComparison != 0) {
1334
        return lastComparison;
1335
      }
3430 rajveer 1336
      if (isSetRuleExecutionSrc()) {
1337
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ruleExecutionSrc, typedOther.ruleExecutionSrc);
1338
        if (lastComparison != 0) {
1339
          return lastComparison;
1340
        }
1982 varun.gupt 1341
      }
3430 rajveer 1342
      lastComparison = Boolean.valueOf(isSetStartOn()).compareTo(typedOther.isSetStartOn());
1982 varun.gupt 1343
      if (lastComparison != 0) {
1344
        return lastComparison;
1345
      }
3430 rajveer 1346
      if (isSetStartOn()) {
1347
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.startOn, typedOther.startOn);
1348
        if (lastComparison != 0) {
1349
          return lastComparison;
1350
        }
1982 varun.gupt 1351
      }
3430 rajveer 1352
      lastComparison = Boolean.valueOf(isSetEndOn()).compareTo(typedOther.isSetEndOn());
1982 varun.gupt 1353
      if (lastComparison != 0) {
1354
        return lastComparison;
1355
      }
3430 rajveer 1356
      if (isSetEndOn()) {
1357
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.endOn, typedOther.endOn);
1358
        if (lastComparison != 0) {
1359
          return lastComparison;
1360
        }
1982 varun.gupt 1361
      }
1362
      return 0;
1363
    }
1364
 
3430 rajveer 1365
    public _Fields fieldForId(int fieldId) {
1366
      return _Fields.findByThriftId(fieldId);
1367
    }
1368
 
1369
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
1370
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 1371
      iprot.readStructBegin();
1372
      while (true)
1373
      {
1374
        field = iprot.readFieldBegin();
3430 rajveer 1375
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 1376
          break;
1377
        }
3430 rajveer 1378
        switch (field.id) {
1379
          case 1: // NAME
1380
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
1381
              this.name = iprot.readString();
1382
            } else { 
1383
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1384
            }
1385
            break;
1386
          case 2: // RULE_EXECUTION_SRC
1387
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
1388
              this.ruleExecutionSrc = iprot.readString();
1389
            } else { 
1390
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1391
            }
1392
            break;
1393
          case 3: // START_ON
1394
            if (field.type == org.apache.thrift.protocol.TType.I64) {
1395
              this.startOn = iprot.readI64();
1396
              setStartOnIsSet(true);
1397
            } else { 
1398
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1399
            }
1400
            break;
1401
          case 4: // END_ON
1402
            if (field.type == org.apache.thrift.protocol.TType.I64) {
1403
              this.endOn = iprot.readI64();
1404
              setEndOnIsSet(true);
1405
            } else { 
1406
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1407
            }
1408
            break;
1409
          default:
1410
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 1411
        }
3430 rajveer 1412
        iprot.readFieldEnd();
1982 varun.gupt 1413
      }
1414
      iprot.readStructEnd();
1415
      validate();
1416
    }
1417
 
3430 rajveer 1418
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 1419
      validate();
1420
 
1421
      oprot.writeStructBegin(STRUCT_DESC);
1422
      if (this.name != null) {
1423
        oprot.writeFieldBegin(NAME_FIELD_DESC);
1424
        oprot.writeString(this.name);
1425
        oprot.writeFieldEnd();
1426
      }
1427
      if (this.ruleExecutionSrc != null) {
1428
        oprot.writeFieldBegin(RULE_EXECUTION_SRC_FIELD_DESC);
1429
        oprot.writeString(this.ruleExecutionSrc);
1430
        oprot.writeFieldEnd();
1431
      }
1432
      oprot.writeFieldBegin(START_ON_FIELD_DESC);
1433
      oprot.writeI64(this.startOn);
1434
      oprot.writeFieldEnd();
1435
      oprot.writeFieldBegin(END_ON_FIELD_DESC);
1436
      oprot.writeI64(this.endOn);
1437
      oprot.writeFieldEnd();
1438
      oprot.writeFieldStop();
1439
      oprot.writeStructEnd();
1440
    }
1441
 
1442
    @Override
1443
    public String toString() {
1444
      StringBuilder sb = new StringBuilder("createPromotion_args(");
1445
      boolean first = true;
1446
 
1447
      sb.append("name:");
1448
      if (this.name == null) {
1449
        sb.append("null");
1450
      } else {
1451
        sb.append(this.name);
1452
      }
1453
      first = false;
1454
      if (!first) sb.append(", ");
1455
      sb.append("ruleExecutionSrc:");
1456
      if (this.ruleExecutionSrc == null) {
1457
        sb.append("null");
1458
      } else {
1459
        sb.append(this.ruleExecutionSrc);
1460
      }
1461
      first = false;
1462
      if (!first) sb.append(", ");
1463
      sb.append("startOn:");
1464
      sb.append(this.startOn);
1465
      first = false;
1466
      if (!first) sb.append(", ");
1467
      sb.append("endOn:");
1468
      sb.append(this.endOn);
1469
      first = false;
1470
      sb.append(")");
1471
      return sb.toString();
1472
    }
1473
 
3430 rajveer 1474
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 1475
      // check for required fields
1476
    }
1477
 
3430 rajveer 1478
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
1479
      try {
1480
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
1481
      } catch (org.apache.thrift.TException te) {
1482
        throw new java.io.IOException(te);
1483
      }
1484
    }
1485
 
1486
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
1487
      try {
1488
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
1489
        __isset_bit_vector = new BitSet(1);
1490
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
1491
      } catch (org.apache.thrift.TException te) {
1492
        throw new java.io.IOException(te);
1493
      }
1494
    }
1495
 
1982 varun.gupt 1496
  }
1497
 
3430 rajveer 1498
  public static class createPromotion_result implements org.apache.thrift.TBase<createPromotion_result, createPromotion_result._Fields>, java.io.Serializable, Cloneable   {
1499
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createPromotion_result");
1982 varun.gupt 1500
 
3430 rajveer 1501
    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);
1982 varun.gupt 1502
 
3430 rajveer 1503
    private PromotionException pex; // required
1982 varun.gupt 1504
 
1505
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 1506
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 1507
      PEX((short)1, "pex");
1508
 
1509
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
1510
 
1511
      static {
1512
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
1513
          byName.put(field.getFieldName(), field);
1514
        }
1515
      }
1516
 
1517
      /**
1518
       * Find the _Fields constant that matches fieldId, or null if its not found.
1519
       */
1520
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 1521
        switch(fieldId) {
1522
          case 1: // PEX
1523
            return PEX;
1524
          default:
1525
            return null;
1526
        }
1982 varun.gupt 1527
      }
1528
 
1529
      /**
1530
       * Find the _Fields constant that matches fieldId, throwing an exception
1531
       * if it is not found.
1532
       */
1533
      public static _Fields findByThriftIdOrThrow(int fieldId) {
1534
        _Fields fields = findByThriftId(fieldId);
1535
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
1536
        return fields;
1537
      }
1538
 
1539
      /**
1540
       * Find the _Fields constant that matches name, or null if its not found.
1541
       */
1542
      public static _Fields findByName(String name) {
1543
        return byName.get(name);
1544
      }
1545
 
1546
      private final short _thriftId;
1547
      private final String _fieldName;
1548
 
1549
      _Fields(short thriftId, String fieldName) {
1550
        _thriftId = thriftId;
1551
        _fieldName = fieldName;
1552
      }
1553
 
1554
      public short getThriftFieldId() {
1555
        return _thriftId;
1556
      }
1557
 
1558
      public String getFieldName() {
1559
        return _fieldName;
1560
      }
1561
    }
1562
 
1563
    // isset id assignments
1564
 
3430 rajveer 1565
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 1566
    static {
3430 rajveer 1567
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
1568
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
1569
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
1570
      metaDataMap = Collections.unmodifiableMap(tmpMap);
1571
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createPromotion_result.class, metaDataMap);
1982 varun.gupt 1572
    }
1573
 
1574
    public createPromotion_result() {
1575
    }
1576
 
1577
    public createPromotion_result(
1578
      PromotionException pex)
1579
    {
1580
      this();
1581
      this.pex = pex;
1582
    }
1583
 
1584
    /**
1585
     * Performs a deep copy on <i>other</i>.
1586
     */
1587
    public createPromotion_result(createPromotion_result other) {
1588
      if (other.isSetPex()) {
1589
        this.pex = new PromotionException(other.pex);
1590
      }
1591
    }
1592
 
1593
    public createPromotion_result deepCopy() {
1594
      return new createPromotion_result(this);
1595
    }
1596
 
3430 rajveer 1597
    @Override
1598
    public void clear() {
1599
      this.pex = null;
1982 varun.gupt 1600
    }
1601
 
1602
    public PromotionException getPex() {
1603
      return this.pex;
1604
    }
1605
 
3430 rajveer 1606
    public void setPex(PromotionException pex) {
1982 varun.gupt 1607
      this.pex = pex;
1608
    }
1609
 
1610
    public void unsetPex() {
1611
      this.pex = null;
1612
    }
1613
 
3430 rajveer 1614
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 1615
    public boolean isSetPex() {
1616
      return this.pex != null;
1617
    }
1618
 
1619
    public void setPexIsSet(boolean value) {
1620
      if (!value) {
1621
        this.pex = null;
1622
      }
1623
    }
1624
 
1625
    public void setFieldValue(_Fields field, Object value) {
1626
      switch (field) {
1627
      case PEX:
1628
        if (value == null) {
1629
          unsetPex();
1630
        } else {
1631
          setPex((PromotionException)value);
1632
        }
1633
        break;
1634
 
1635
      }
1636
    }
1637
 
1638
    public Object getFieldValue(_Fields field) {
1639
      switch (field) {
1640
      case PEX:
1641
        return getPex();
1642
 
1643
      }
1644
      throw new IllegalStateException();
1645
    }
1646
 
3430 rajveer 1647
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
1648
    public boolean isSet(_Fields field) {
1649
      if (field == null) {
1650
        throw new IllegalArgumentException();
1651
      }
1982 varun.gupt 1652
 
1653
      switch (field) {
1654
      case PEX:
1655
        return isSetPex();
1656
      }
1657
      throw new IllegalStateException();
1658
    }
1659
 
1660
    @Override
1661
    public boolean equals(Object that) {
1662
      if (that == null)
1663
        return false;
1664
      if (that instanceof createPromotion_result)
1665
        return this.equals((createPromotion_result)that);
1666
      return false;
1667
    }
1668
 
1669
    public boolean equals(createPromotion_result that) {
1670
      if (that == null)
1671
        return false;
1672
 
1673
      boolean this_present_pex = true && this.isSetPex();
1674
      boolean that_present_pex = true && that.isSetPex();
1675
      if (this_present_pex || that_present_pex) {
1676
        if (!(this_present_pex && that_present_pex))
1677
          return false;
1678
        if (!this.pex.equals(that.pex))
1679
          return false;
1680
      }
1681
 
1682
      return true;
1683
    }
1684
 
1685
    @Override
1686
    public int hashCode() {
1687
      return 0;
1688
    }
1689
 
1690
    public int compareTo(createPromotion_result other) {
1691
      if (!getClass().equals(other.getClass())) {
1692
        return getClass().getName().compareTo(other.getClass().getName());
1693
      }
1694
 
1695
      int lastComparison = 0;
1696
      createPromotion_result typedOther = (createPromotion_result)other;
1697
 
3430 rajveer 1698
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 1699
      if (lastComparison != 0) {
1700
        return lastComparison;
1701
      }
3430 rajveer 1702
      if (isSetPex()) {
1703
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
1704
        if (lastComparison != 0) {
1705
          return lastComparison;
1706
        }
1982 varun.gupt 1707
      }
1708
      return 0;
1709
    }
1710
 
3430 rajveer 1711
    public _Fields fieldForId(int fieldId) {
1712
      return _Fields.findByThriftId(fieldId);
1713
    }
1714
 
1715
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
1716
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 1717
      iprot.readStructBegin();
1718
      while (true)
1719
      {
1720
        field = iprot.readFieldBegin();
3430 rajveer 1721
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 1722
          break;
1723
        }
3430 rajveer 1724
        switch (field.id) {
1725
          case 1: // PEX
1726
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
1727
              this.pex = new PromotionException();
1728
              this.pex.read(iprot);
1729
            } else { 
1730
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1731
            }
1732
            break;
1733
          default:
1734
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 1735
        }
3430 rajveer 1736
        iprot.readFieldEnd();
1982 varun.gupt 1737
      }
1738
      iprot.readStructEnd();
1739
      validate();
1740
    }
1741
 
3430 rajveer 1742
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 1743
      oprot.writeStructBegin(STRUCT_DESC);
1744
 
1745
      if (this.isSetPex()) {
1746
        oprot.writeFieldBegin(PEX_FIELD_DESC);
1747
        this.pex.write(oprot);
1748
        oprot.writeFieldEnd();
1749
      }
1750
      oprot.writeFieldStop();
1751
      oprot.writeStructEnd();
1752
    }
1753
 
1754
    @Override
1755
    public String toString() {
1756
      StringBuilder sb = new StringBuilder("createPromotion_result(");
1757
      boolean first = true;
1758
 
1759
      sb.append("pex:");
1760
      if (this.pex == null) {
1761
        sb.append("null");
1762
      } else {
1763
        sb.append(this.pex);
1764
      }
1765
      first = false;
1766
      sb.append(")");
1767
      return sb.toString();
1768
    }
1769
 
3430 rajveer 1770
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 1771
      // check for required fields
1772
    }
1773
 
3430 rajveer 1774
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
1775
      try {
1776
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
1777
      } catch (org.apache.thrift.TException te) {
1778
        throw new java.io.IOException(te);
1779
      }
1780
    }
1781
 
1782
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
1783
      try {
1784
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
1785
      } catch (org.apache.thrift.TException te) {
1786
        throw new java.io.IOException(te);
1787
      }
1788
    }
1789
 
1982 varun.gupt 1790
  }
1791
 
3430 rajveer 1792
  public static class getAllPromotions_args implements org.apache.thrift.TBase<getAllPromotions_args, getAllPromotions_args._Fields>, java.io.Serializable, Cloneable   {
1793
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllPromotions_args");
1982 varun.gupt 1794
 
1795
 
1796
 
1797
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 1798
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 1799
;
1800
 
1801
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
1802
 
1803
      static {
1804
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
1805
          byName.put(field.getFieldName(), field);
1806
        }
1807
      }
1808
 
1809
      /**
1810
       * Find the _Fields constant that matches fieldId, or null if its not found.
1811
       */
1812
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 1813
        switch(fieldId) {
1814
          default:
1815
            return null;
1816
        }
1982 varun.gupt 1817
      }
1818
 
1819
      /**
1820
       * Find the _Fields constant that matches fieldId, throwing an exception
1821
       * if it is not found.
1822
       */
1823
      public static _Fields findByThriftIdOrThrow(int fieldId) {
1824
        _Fields fields = findByThriftId(fieldId);
1825
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
1826
        return fields;
1827
      }
1828
 
1829
      /**
1830
       * Find the _Fields constant that matches name, or null if its not found.
1831
       */
1832
      public static _Fields findByName(String name) {
1833
        return byName.get(name);
1834
      }
1835
 
1836
      private final short _thriftId;
1837
      private final String _fieldName;
1838
 
1839
      _Fields(short thriftId, String fieldName) {
1840
        _thriftId = thriftId;
1841
        _fieldName = fieldName;
1842
      }
1843
 
1844
      public short getThriftFieldId() {
1845
        return _thriftId;
1846
      }
1847
 
1848
      public String getFieldName() {
1849
        return _fieldName;
1850
      }
1851
    }
3430 rajveer 1852
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 1853
    static {
3430 rajveer 1854
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
1855
      metaDataMap = Collections.unmodifiableMap(tmpMap);
1856
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllPromotions_args.class, metaDataMap);
1982 varun.gupt 1857
    }
1858
 
1859
    public getAllPromotions_args() {
1860
    }
1861
 
1862
    /**
1863
     * Performs a deep copy on <i>other</i>.
1864
     */
1865
    public getAllPromotions_args(getAllPromotions_args other) {
1866
    }
1867
 
1868
    public getAllPromotions_args deepCopy() {
1869
      return new getAllPromotions_args(this);
1870
    }
1871
 
3430 rajveer 1872
    @Override
1873
    public void clear() {
1982 varun.gupt 1874
    }
1875
 
1876
    public void setFieldValue(_Fields field, Object value) {
1877
      switch (field) {
1878
      }
1879
    }
1880
 
1881
    public Object getFieldValue(_Fields field) {
1882
      switch (field) {
1883
      }
1884
      throw new IllegalStateException();
1885
    }
1886
 
3430 rajveer 1887
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
1888
    public boolean isSet(_Fields field) {
1889
      if (field == null) {
1890
        throw new IllegalArgumentException();
1891
      }
1982 varun.gupt 1892
 
1893
      switch (field) {
1894
      }
1895
      throw new IllegalStateException();
1896
    }
1897
 
1898
    @Override
1899
    public boolean equals(Object that) {
1900
      if (that == null)
1901
        return false;
1902
      if (that instanceof getAllPromotions_args)
1903
        return this.equals((getAllPromotions_args)that);
1904
      return false;
1905
    }
1906
 
1907
    public boolean equals(getAllPromotions_args that) {
1908
      if (that == null)
1909
        return false;
1910
 
1911
      return true;
1912
    }
1913
 
1914
    @Override
1915
    public int hashCode() {
1916
      return 0;
1917
    }
1918
 
1919
    public int compareTo(getAllPromotions_args other) {
1920
      if (!getClass().equals(other.getClass())) {
1921
        return getClass().getName().compareTo(other.getClass().getName());
1922
      }
1923
 
1924
      int lastComparison = 0;
1925
      getAllPromotions_args typedOther = (getAllPromotions_args)other;
1926
 
1927
      return 0;
1928
    }
1929
 
3430 rajveer 1930
    public _Fields fieldForId(int fieldId) {
1931
      return _Fields.findByThriftId(fieldId);
1932
    }
1933
 
1934
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
1935
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 1936
      iprot.readStructBegin();
1937
      while (true)
1938
      {
1939
        field = iprot.readFieldBegin();
3430 rajveer 1940
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 1941
          break;
1942
        }
3430 rajveer 1943
        switch (field.id) {
1944
          default:
1945
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 1946
        }
3430 rajveer 1947
        iprot.readFieldEnd();
1982 varun.gupt 1948
      }
1949
      iprot.readStructEnd();
1950
      validate();
1951
    }
1952
 
3430 rajveer 1953
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 1954
      validate();
1955
 
1956
      oprot.writeStructBegin(STRUCT_DESC);
1957
      oprot.writeFieldStop();
1958
      oprot.writeStructEnd();
1959
    }
1960
 
1961
    @Override
1962
    public String toString() {
1963
      StringBuilder sb = new StringBuilder("getAllPromotions_args(");
1964
      boolean first = true;
1965
 
1966
      sb.append(")");
1967
      return sb.toString();
1968
    }
1969
 
3430 rajveer 1970
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 1971
      // check for required fields
1972
    }
1973
 
3430 rajveer 1974
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
1975
      try {
1976
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
1977
      } catch (org.apache.thrift.TException te) {
1978
        throw new java.io.IOException(te);
1979
      }
1980
    }
1981
 
1982
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
1983
      try {
1984
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
1985
      } catch (org.apache.thrift.TException te) {
1986
        throw new java.io.IOException(te);
1987
      }
1988
    }
1989
 
1982 varun.gupt 1990
  }
1991
 
3430 rajveer 1992
  public static class getAllPromotions_result implements org.apache.thrift.TBase<getAllPromotions_result, getAllPromotions_result._Fields>, java.io.Serializable, Cloneable   {
1993
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllPromotions_result");
1982 varun.gupt 1994
 
3430 rajveer 1995
    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0);
1996
    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);
1982 varun.gupt 1997
 
3430 rajveer 1998
    private List<Promotion> success; // required
1999
    private PromotionException pex; // required
1982 varun.gupt 2000
 
2001
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 2002
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 2003
      SUCCESS((short)0, "success"),
2004
      PEX((short)1, "pex");
2005
 
2006
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
2007
 
2008
      static {
2009
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
2010
          byName.put(field.getFieldName(), field);
2011
        }
2012
      }
2013
 
2014
      /**
2015
       * Find the _Fields constant that matches fieldId, or null if its not found.
2016
       */
2017
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 2018
        switch(fieldId) {
2019
          case 0: // SUCCESS
2020
            return SUCCESS;
2021
          case 1: // PEX
2022
            return PEX;
2023
          default:
2024
            return null;
2025
        }
1982 varun.gupt 2026
      }
2027
 
2028
      /**
2029
       * Find the _Fields constant that matches fieldId, throwing an exception
2030
       * if it is not found.
2031
       */
2032
      public static _Fields findByThriftIdOrThrow(int fieldId) {
2033
        _Fields fields = findByThriftId(fieldId);
2034
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
2035
        return fields;
2036
      }
2037
 
2038
      /**
2039
       * Find the _Fields constant that matches name, or null if its not found.
2040
       */
2041
      public static _Fields findByName(String name) {
2042
        return byName.get(name);
2043
      }
2044
 
2045
      private final short _thriftId;
2046
      private final String _fieldName;
2047
 
2048
      _Fields(short thriftId, String fieldName) {
2049
        _thriftId = thriftId;
2050
        _fieldName = fieldName;
2051
      }
2052
 
2053
      public short getThriftFieldId() {
2054
        return _thriftId;
2055
      }
2056
 
2057
      public String getFieldName() {
2058
        return _fieldName;
2059
      }
2060
    }
2061
 
2062
    // isset id assignments
2063
 
3430 rajveer 2064
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 2065
    static {
3430 rajveer 2066
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
2067
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
2068
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
2069
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Promotion.class))));
2070
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
2071
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
2072
      metaDataMap = Collections.unmodifiableMap(tmpMap);
2073
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllPromotions_result.class, metaDataMap);
1982 varun.gupt 2074
    }
2075
 
2076
    public getAllPromotions_result() {
2077
    }
2078
 
2079
    public getAllPromotions_result(
2080
      List<Promotion> success,
2081
      PromotionException pex)
2082
    {
2083
      this();
2084
      this.success = success;
2085
      this.pex = pex;
2086
    }
2087
 
2088
    /**
2089
     * Performs a deep copy on <i>other</i>.
2090
     */
2091
    public getAllPromotions_result(getAllPromotions_result other) {
2092
      if (other.isSetSuccess()) {
2093
        List<Promotion> __this__success = new ArrayList<Promotion>();
2094
        for (Promotion other_element : other.success) {
2095
          __this__success.add(new Promotion(other_element));
2096
        }
2097
        this.success = __this__success;
2098
      }
2099
      if (other.isSetPex()) {
2100
        this.pex = new PromotionException(other.pex);
2101
      }
2102
    }
2103
 
2104
    public getAllPromotions_result deepCopy() {
2105
      return new getAllPromotions_result(this);
2106
    }
2107
 
3430 rajveer 2108
    @Override
2109
    public void clear() {
2110
      this.success = null;
2111
      this.pex = null;
1982 varun.gupt 2112
    }
2113
 
2114
    public int getSuccessSize() {
2115
      return (this.success == null) ? 0 : this.success.size();
2116
    }
2117
 
2118
    public java.util.Iterator<Promotion> getSuccessIterator() {
2119
      return (this.success == null) ? null : this.success.iterator();
2120
    }
2121
 
2122
    public void addToSuccess(Promotion elem) {
2123
      if (this.success == null) {
2124
        this.success = new ArrayList<Promotion>();
2125
      }
2126
      this.success.add(elem);
2127
    }
2128
 
2129
    public List<Promotion> getSuccess() {
2130
      return this.success;
2131
    }
2132
 
3430 rajveer 2133
    public void setSuccess(List<Promotion> success) {
1982 varun.gupt 2134
      this.success = success;
2135
    }
2136
 
2137
    public void unsetSuccess() {
2138
      this.success = null;
2139
    }
2140
 
3430 rajveer 2141
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
1982 varun.gupt 2142
    public boolean isSetSuccess() {
2143
      return this.success != null;
2144
    }
2145
 
2146
    public void setSuccessIsSet(boolean value) {
2147
      if (!value) {
2148
        this.success = null;
2149
      }
2150
    }
2151
 
2152
    public PromotionException getPex() {
2153
      return this.pex;
2154
    }
2155
 
3430 rajveer 2156
    public void setPex(PromotionException pex) {
1982 varun.gupt 2157
      this.pex = pex;
2158
    }
2159
 
2160
    public void unsetPex() {
2161
      this.pex = null;
2162
    }
2163
 
3430 rajveer 2164
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 2165
    public boolean isSetPex() {
2166
      return this.pex != null;
2167
    }
2168
 
2169
    public void setPexIsSet(boolean value) {
2170
      if (!value) {
2171
        this.pex = null;
2172
      }
2173
    }
2174
 
2175
    public void setFieldValue(_Fields field, Object value) {
2176
      switch (field) {
2177
      case SUCCESS:
2178
        if (value == null) {
2179
          unsetSuccess();
2180
        } else {
2181
          setSuccess((List<Promotion>)value);
2182
        }
2183
        break;
2184
 
2185
      case PEX:
2186
        if (value == null) {
2187
          unsetPex();
2188
        } else {
2189
          setPex((PromotionException)value);
2190
        }
2191
        break;
2192
 
2193
      }
2194
    }
2195
 
2196
    public Object getFieldValue(_Fields field) {
2197
      switch (field) {
2198
      case SUCCESS:
2199
        return getSuccess();
2200
 
2201
      case PEX:
2202
        return getPex();
2203
 
2204
      }
2205
      throw new IllegalStateException();
2206
    }
2207
 
3430 rajveer 2208
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
2209
    public boolean isSet(_Fields field) {
2210
      if (field == null) {
2211
        throw new IllegalArgumentException();
2212
      }
1982 varun.gupt 2213
 
2214
      switch (field) {
2215
      case SUCCESS:
2216
        return isSetSuccess();
2217
      case PEX:
2218
        return isSetPex();
2219
      }
2220
      throw new IllegalStateException();
2221
    }
2222
 
2223
    @Override
2224
    public boolean equals(Object that) {
2225
      if (that == null)
2226
        return false;
2227
      if (that instanceof getAllPromotions_result)
2228
        return this.equals((getAllPromotions_result)that);
2229
      return false;
2230
    }
2231
 
2232
    public boolean equals(getAllPromotions_result that) {
2233
      if (that == null)
2234
        return false;
2235
 
2236
      boolean this_present_success = true && this.isSetSuccess();
2237
      boolean that_present_success = true && that.isSetSuccess();
2238
      if (this_present_success || that_present_success) {
2239
        if (!(this_present_success && that_present_success))
2240
          return false;
2241
        if (!this.success.equals(that.success))
2242
          return false;
2243
      }
2244
 
2245
      boolean this_present_pex = true && this.isSetPex();
2246
      boolean that_present_pex = true && that.isSetPex();
2247
      if (this_present_pex || that_present_pex) {
2248
        if (!(this_present_pex && that_present_pex))
2249
          return false;
2250
        if (!this.pex.equals(that.pex))
2251
          return false;
2252
      }
2253
 
2254
      return true;
2255
    }
2256
 
2257
    @Override
2258
    public int hashCode() {
2259
      return 0;
2260
    }
2261
 
2262
    public int compareTo(getAllPromotions_result other) {
2263
      if (!getClass().equals(other.getClass())) {
2264
        return getClass().getName().compareTo(other.getClass().getName());
2265
      }
2266
 
2267
      int lastComparison = 0;
2268
      getAllPromotions_result typedOther = (getAllPromotions_result)other;
2269
 
3430 rajveer 2270
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
1982 varun.gupt 2271
      if (lastComparison != 0) {
2272
        return lastComparison;
2273
      }
3430 rajveer 2274
      if (isSetSuccess()) {
2275
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
2276
        if (lastComparison != 0) {
2277
          return lastComparison;
2278
        }
1982 varun.gupt 2279
      }
3430 rajveer 2280
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 2281
      if (lastComparison != 0) {
2282
        return lastComparison;
2283
      }
3430 rajveer 2284
      if (isSetPex()) {
2285
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
2286
        if (lastComparison != 0) {
2287
          return lastComparison;
2288
        }
1982 varun.gupt 2289
      }
2290
      return 0;
2291
    }
2292
 
3430 rajveer 2293
    public _Fields fieldForId(int fieldId) {
2294
      return _Fields.findByThriftId(fieldId);
2295
    }
2296
 
2297
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
2298
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 2299
      iprot.readStructBegin();
2300
      while (true)
2301
      {
2302
        field = iprot.readFieldBegin();
3430 rajveer 2303
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 2304
          break;
2305
        }
3430 rajveer 2306
        switch (field.id) {
2307
          case 0: // SUCCESS
2308
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
2309
              {
2310
                org.apache.thrift.protocol.TList _list12 = iprot.readListBegin();
2311
                this.success = new ArrayList<Promotion>(_list12.size);
2312
                for (int _i13 = 0; _i13 < _list12.size; ++_i13)
1982 varun.gupt 2313
                {
3430 rajveer 2314
                  Promotion _elem14; // required
2315
                  _elem14 = new Promotion();
2316
                  _elem14.read(iprot);
2317
                  this.success.add(_elem14);
1982 varun.gupt 2318
                }
3430 rajveer 2319
                iprot.readListEnd();
1982 varun.gupt 2320
              }
3430 rajveer 2321
            } else { 
2322
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2323
            }
2324
            break;
2325
          case 1: // PEX
2326
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
2327
              this.pex = new PromotionException();
2328
              this.pex.read(iprot);
2329
            } else { 
2330
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2331
            }
2332
            break;
2333
          default:
2334
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 2335
        }
3430 rajveer 2336
        iprot.readFieldEnd();
1982 varun.gupt 2337
      }
2338
      iprot.readStructEnd();
2339
      validate();
2340
    }
2341
 
3430 rajveer 2342
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 2343
      oprot.writeStructBegin(STRUCT_DESC);
2344
 
2345
      if (this.isSetSuccess()) {
2346
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
2347
        {
3430 rajveer 2348
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
2981 rajveer 2349
          for (Promotion _iter15 : this.success)
1982 varun.gupt 2350
          {
2981 rajveer 2351
            _iter15.write(oprot);
1982 varun.gupt 2352
          }
2353
          oprot.writeListEnd();
2354
        }
2355
        oprot.writeFieldEnd();
2356
      } else if (this.isSetPex()) {
2357
        oprot.writeFieldBegin(PEX_FIELD_DESC);
2358
        this.pex.write(oprot);
2359
        oprot.writeFieldEnd();
2360
      }
2361
      oprot.writeFieldStop();
2362
      oprot.writeStructEnd();
2363
    }
2364
 
2365
    @Override
2366
    public String toString() {
2367
      StringBuilder sb = new StringBuilder("getAllPromotions_result(");
2368
      boolean first = true;
2369
 
2370
      sb.append("success:");
2371
      if (this.success == null) {
2372
        sb.append("null");
2373
      } else {
2374
        sb.append(this.success);
2375
      }
2376
      first = false;
2377
      if (!first) sb.append(", ");
2378
      sb.append("pex:");
2379
      if (this.pex == null) {
2380
        sb.append("null");
2381
      } else {
2382
        sb.append(this.pex);
2383
      }
2384
      first = false;
2385
      sb.append(")");
2386
      return sb.toString();
2387
    }
2388
 
3430 rajveer 2389
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 2390
      // check for required fields
2391
    }
2392
 
3430 rajveer 2393
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
2394
      try {
2395
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
2396
      } catch (org.apache.thrift.TException te) {
2397
        throw new java.io.IOException(te);
2398
      }
2399
    }
2400
 
2401
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
2402
      try {
2403
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
2404
      } catch (org.apache.thrift.TException te) {
2405
        throw new java.io.IOException(te);
2406
      }
2407
    }
2408
 
1982 varun.gupt 2409
  }
2410
 
3430 rajveer 2411
  public static class getPromotionById_args implements org.apache.thrift.TBase<getPromotionById_args, getPromotionById_args._Fields>, java.io.Serializable, Cloneable   {
2412
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getPromotionById_args");
1982 varun.gupt 2413
 
3430 rajveer 2414
    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);
1982 varun.gupt 2415
 
3430 rajveer 2416
    private long promotionId; // required
1982 varun.gupt 2417
 
2418
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 2419
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 2420
      PROMOTION_ID((short)1, "promotionId");
2421
 
2422
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
2423
 
2424
      static {
2425
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
2426
          byName.put(field.getFieldName(), field);
2427
        }
2428
      }
2429
 
2430
      /**
2431
       * Find the _Fields constant that matches fieldId, or null if its not found.
2432
       */
2433
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 2434
        switch(fieldId) {
2435
          case 1: // PROMOTION_ID
2436
            return PROMOTION_ID;
2437
          default:
2438
            return null;
2439
        }
1982 varun.gupt 2440
      }
2441
 
2442
      /**
2443
       * Find the _Fields constant that matches fieldId, throwing an exception
2444
       * if it is not found.
2445
       */
2446
      public static _Fields findByThriftIdOrThrow(int fieldId) {
2447
        _Fields fields = findByThriftId(fieldId);
2448
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
2449
        return fields;
2450
      }
2451
 
2452
      /**
2453
       * Find the _Fields constant that matches name, or null if its not found.
2454
       */
2455
      public static _Fields findByName(String name) {
2456
        return byName.get(name);
2457
      }
2458
 
2459
      private final short _thriftId;
2460
      private final String _fieldName;
2461
 
2462
      _Fields(short thriftId, String fieldName) {
2463
        _thriftId = thriftId;
2464
        _fieldName = fieldName;
2465
      }
2466
 
2467
      public short getThriftFieldId() {
2468
        return _thriftId;
2469
      }
2470
 
2471
      public String getFieldName() {
2472
        return _fieldName;
2473
      }
2474
    }
2475
 
2476
    // isset id assignments
2477
    private static final int __PROMOTIONID_ISSET_ID = 0;
2478
    private BitSet __isset_bit_vector = new BitSet(1);
2479
 
3430 rajveer 2480
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 2481
    static {
3430 rajveer 2482
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
2483
      tmpMap.put(_Fields.PROMOTION_ID, new org.apache.thrift.meta_data.FieldMetaData("promotionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
2484
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
2485
      metaDataMap = Collections.unmodifiableMap(tmpMap);
2486
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPromotionById_args.class, metaDataMap);
1982 varun.gupt 2487
    }
2488
 
2489
    public getPromotionById_args() {
2490
    }
2491
 
2492
    public getPromotionById_args(
2493
      long promotionId)
2494
    {
2495
      this();
2496
      this.promotionId = promotionId;
2497
      setPromotionIdIsSet(true);
2498
    }
2499
 
2500
    /**
2501
     * Performs a deep copy on <i>other</i>.
2502
     */
2503
    public getPromotionById_args(getPromotionById_args other) {
2504
      __isset_bit_vector.clear();
2505
      __isset_bit_vector.or(other.__isset_bit_vector);
2506
      this.promotionId = other.promotionId;
2507
    }
2508
 
2509
    public getPromotionById_args deepCopy() {
2510
      return new getPromotionById_args(this);
2511
    }
2512
 
3430 rajveer 2513
    @Override
2514
    public void clear() {
2515
      setPromotionIdIsSet(false);
2516
      this.promotionId = 0;
1982 varun.gupt 2517
    }
2518
 
2519
    public long getPromotionId() {
2520
      return this.promotionId;
2521
    }
2522
 
3430 rajveer 2523
    public void setPromotionId(long promotionId) {
1982 varun.gupt 2524
      this.promotionId = promotionId;
2525
      setPromotionIdIsSet(true);
2526
    }
2527
 
2528
    public void unsetPromotionId() {
2529
      __isset_bit_vector.clear(__PROMOTIONID_ISSET_ID);
2530
    }
2531
 
3430 rajveer 2532
    /** Returns true if field promotionId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 2533
    public boolean isSetPromotionId() {
2534
      return __isset_bit_vector.get(__PROMOTIONID_ISSET_ID);
2535
    }
2536
 
2537
    public void setPromotionIdIsSet(boolean value) {
2538
      __isset_bit_vector.set(__PROMOTIONID_ISSET_ID, value);
2539
    }
2540
 
2541
    public void setFieldValue(_Fields field, Object value) {
2542
      switch (field) {
2543
      case PROMOTION_ID:
2544
        if (value == null) {
2545
          unsetPromotionId();
2546
        } else {
2547
          setPromotionId((Long)value);
2548
        }
2549
        break;
2550
 
2551
      }
2552
    }
2553
 
2554
    public Object getFieldValue(_Fields field) {
2555
      switch (field) {
2556
      case PROMOTION_ID:
3430 rajveer 2557
        return Long.valueOf(getPromotionId());
1982 varun.gupt 2558
 
2559
      }
2560
      throw new IllegalStateException();
2561
    }
2562
 
3430 rajveer 2563
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
2564
    public boolean isSet(_Fields field) {
2565
      if (field == null) {
2566
        throw new IllegalArgumentException();
2567
      }
1982 varun.gupt 2568
 
2569
      switch (field) {
2570
      case PROMOTION_ID:
2571
        return isSetPromotionId();
2572
      }
2573
      throw new IllegalStateException();
2574
    }
2575
 
2576
    @Override
2577
    public boolean equals(Object that) {
2578
      if (that == null)
2579
        return false;
2580
      if (that instanceof getPromotionById_args)
2581
        return this.equals((getPromotionById_args)that);
2582
      return false;
2583
    }
2584
 
2585
    public boolean equals(getPromotionById_args that) {
2586
      if (that == null)
2587
        return false;
2588
 
2589
      boolean this_present_promotionId = true;
2590
      boolean that_present_promotionId = true;
2591
      if (this_present_promotionId || that_present_promotionId) {
2592
        if (!(this_present_promotionId && that_present_promotionId))
2593
          return false;
2594
        if (this.promotionId != that.promotionId)
2595
          return false;
2596
      }
2597
 
2598
      return true;
2599
    }
2600
 
2601
    @Override
2602
    public int hashCode() {
2603
      return 0;
2604
    }
2605
 
2606
    public int compareTo(getPromotionById_args other) {
2607
      if (!getClass().equals(other.getClass())) {
2608
        return getClass().getName().compareTo(other.getClass().getName());
2609
      }
2610
 
2611
      int lastComparison = 0;
2612
      getPromotionById_args typedOther = (getPromotionById_args)other;
2613
 
3430 rajveer 2614
      lastComparison = Boolean.valueOf(isSetPromotionId()).compareTo(typedOther.isSetPromotionId());
1982 varun.gupt 2615
      if (lastComparison != 0) {
2616
        return lastComparison;
2617
      }
3430 rajveer 2618
      if (isSetPromotionId()) {
2619
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.promotionId, typedOther.promotionId);
2620
        if (lastComparison != 0) {
2621
          return lastComparison;
2622
        }
1982 varun.gupt 2623
      }
2624
      return 0;
2625
    }
2626
 
3430 rajveer 2627
    public _Fields fieldForId(int fieldId) {
2628
      return _Fields.findByThriftId(fieldId);
2629
    }
2630
 
2631
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
2632
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 2633
      iprot.readStructBegin();
2634
      while (true)
2635
      {
2636
        field = iprot.readFieldBegin();
3430 rajveer 2637
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 2638
          break;
2639
        }
3430 rajveer 2640
        switch (field.id) {
2641
          case 1: // PROMOTION_ID
2642
            if (field.type == org.apache.thrift.protocol.TType.I64) {
2643
              this.promotionId = iprot.readI64();
2644
              setPromotionIdIsSet(true);
2645
            } else { 
2646
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2647
            }
2648
            break;
2649
          default:
2650
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 2651
        }
3430 rajveer 2652
        iprot.readFieldEnd();
1982 varun.gupt 2653
      }
2654
      iprot.readStructEnd();
2655
      validate();
2656
    }
2657
 
3430 rajveer 2658
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 2659
      validate();
2660
 
2661
      oprot.writeStructBegin(STRUCT_DESC);
2662
      oprot.writeFieldBegin(PROMOTION_ID_FIELD_DESC);
2663
      oprot.writeI64(this.promotionId);
2664
      oprot.writeFieldEnd();
2665
      oprot.writeFieldStop();
2666
      oprot.writeStructEnd();
2667
    }
2668
 
2669
    @Override
2670
    public String toString() {
2671
      StringBuilder sb = new StringBuilder("getPromotionById_args(");
2672
      boolean first = true;
2673
 
2674
      sb.append("promotionId:");
2675
      sb.append(this.promotionId);
2676
      first = false;
2677
      sb.append(")");
2678
      return sb.toString();
2679
    }
2680
 
3430 rajveer 2681
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 2682
      // check for required fields
2683
    }
2684
 
3430 rajveer 2685
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
2686
      try {
2687
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
2688
      } catch (org.apache.thrift.TException te) {
2689
        throw new java.io.IOException(te);
2690
      }
2691
    }
2692
 
2693
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
2694
      try {
2695
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
2696
        __isset_bit_vector = new BitSet(1);
2697
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
2698
      } catch (org.apache.thrift.TException te) {
2699
        throw new java.io.IOException(te);
2700
      }
2701
    }
2702
 
1982 varun.gupt 2703
  }
2704
 
3430 rajveer 2705
  public static class getPromotionById_result implements org.apache.thrift.TBase<getPromotionById_result, getPromotionById_result._Fields>, java.io.Serializable, Cloneable   {
2706
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getPromotionById_result");
1982 varun.gupt 2707
 
3430 rajveer 2708
    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0);
2709
    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);
1982 varun.gupt 2710
 
3430 rajveer 2711
    private Promotion success; // required
2712
    private PromotionException pex; // required
1982 varun.gupt 2713
 
2714
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 2715
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 2716
      SUCCESS((short)0, "success"),
2717
      PEX((short)1, "pex");
2718
 
2719
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
2720
 
2721
      static {
2722
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
2723
          byName.put(field.getFieldName(), field);
2724
        }
2725
      }
2726
 
2727
      /**
2728
       * Find the _Fields constant that matches fieldId, or null if its not found.
2729
       */
2730
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 2731
        switch(fieldId) {
2732
          case 0: // SUCCESS
2733
            return SUCCESS;
2734
          case 1: // PEX
2735
            return PEX;
2736
          default:
2737
            return null;
2738
        }
1982 varun.gupt 2739
      }
2740
 
2741
      /**
2742
       * Find the _Fields constant that matches fieldId, throwing an exception
2743
       * if it is not found.
2744
       */
2745
      public static _Fields findByThriftIdOrThrow(int fieldId) {
2746
        _Fields fields = findByThriftId(fieldId);
2747
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
2748
        return fields;
2749
      }
2750
 
2751
      /**
2752
       * Find the _Fields constant that matches name, or null if its not found.
2753
       */
2754
      public static _Fields findByName(String name) {
2755
        return byName.get(name);
2756
      }
2757
 
2758
      private final short _thriftId;
2759
      private final String _fieldName;
2760
 
2761
      _Fields(short thriftId, String fieldName) {
2762
        _thriftId = thriftId;
2763
        _fieldName = fieldName;
2764
      }
2765
 
2766
      public short getThriftFieldId() {
2767
        return _thriftId;
2768
      }
2769
 
2770
      public String getFieldName() {
2771
        return _fieldName;
2772
      }
2773
    }
2774
 
2775
    // isset id assignments
2776
 
3430 rajveer 2777
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 2778
    static {
3430 rajveer 2779
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
2780
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
2781
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Promotion.class)));
2782
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
2783
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
2784
      metaDataMap = Collections.unmodifiableMap(tmpMap);
2785
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPromotionById_result.class, metaDataMap);
1982 varun.gupt 2786
    }
2787
 
2788
    public getPromotionById_result() {
2789
    }
2790
 
2791
    public getPromotionById_result(
2792
      Promotion success,
2793
      PromotionException pex)
2794
    {
2795
      this();
2796
      this.success = success;
2797
      this.pex = pex;
2798
    }
2799
 
2800
    /**
2801
     * Performs a deep copy on <i>other</i>.
2802
     */
2803
    public getPromotionById_result(getPromotionById_result other) {
2804
      if (other.isSetSuccess()) {
2805
        this.success = new Promotion(other.success);
2806
      }
2807
      if (other.isSetPex()) {
2808
        this.pex = new PromotionException(other.pex);
2809
      }
2810
    }
2811
 
2812
    public getPromotionById_result deepCopy() {
2813
      return new getPromotionById_result(this);
2814
    }
2815
 
3430 rajveer 2816
    @Override
2817
    public void clear() {
2818
      this.success = null;
2819
      this.pex = null;
1982 varun.gupt 2820
    }
2821
 
2822
    public Promotion getSuccess() {
2823
      return this.success;
2824
    }
2825
 
3430 rajveer 2826
    public void setSuccess(Promotion success) {
1982 varun.gupt 2827
      this.success = success;
2828
    }
2829
 
2830
    public void unsetSuccess() {
2831
      this.success = null;
2832
    }
2833
 
3430 rajveer 2834
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
1982 varun.gupt 2835
    public boolean isSetSuccess() {
2836
      return this.success != null;
2837
    }
2838
 
2839
    public void setSuccessIsSet(boolean value) {
2840
      if (!value) {
2841
        this.success = null;
2842
      }
2843
    }
2844
 
2845
    public PromotionException getPex() {
2846
      return this.pex;
2847
    }
2848
 
3430 rajveer 2849
    public void setPex(PromotionException pex) {
1982 varun.gupt 2850
      this.pex = pex;
2851
    }
2852
 
2853
    public void unsetPex() {
2854
      this.pex = null;
2855
    }
2856
 
3430 rajveer 2857
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 2858
    public boolean isSetPex() {
2859
      return this.pex != null;
2860
    }
2861
 
2862
    public void setPexIsSet(boolean value) {
2863
      if (!value) {
2864
        this.pex = null;
2865
      }
2866
    }
2867
 
2868
    public void setFieldValue(_Fields field, Object value) {
2869
      switch (field) {
2870
      case SUCCESS:
2871
        if (value == null) {
2872
          unsetSuccess();
2873
        } else {
2874
          setSuccess((Promotion)value);
2875
        }
2876
        break;
2877
 
2878
      case PEX:
2879
        if (value == null) {
2880
          unsetPex();
2881
        } else {
2882
          setPex((PromotionException)value);
2883
        }
2884
        break;
2885
 
2886
      }
2887
    }
2888
 
2889
    public Object getFieldValue(_Fields field) {
2890
      switch (field) {
2891
      case SUCCESS:
2892
        return getSuccess();
2893
 
2894
      case PEX:
2895
        return getPex();
2896
 
2897
      }
2898
      throw new IllegalStateException();
2899
    }
2900
 
3430 rajveer 2901
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
2902
    public boolean isSet(_Fields field) {
2903
      if (field == null) {
2904
        throw new IllegalArgumentException();
2905
      }
1982 varun.gupt 2906
 
2907
      switch (field) {
2908
      case SUCCESS:
2909
        return isSetSuccess();
2910
      case PEX:
2911
        return isSetPex();
2912
      }
2913
      throw new IllegalStateException();
2914
    }
2915
 
2916
    @Override
2917
    public boolean equals(Object that) {
2918
      if (that == null)
2919
        return false;
2920
      if (that instanceof getPromotionById_result)
2921
        return this.equals((getPromotionById_result)that);
2922
      return false;
2923
    }
2924
 
2925
    public boolean equals(getPromotionById_result that) {
2926
      if (that == null)
2927
        return false;
2928
 
2929
      boolean this_present_success = true && this.isSetSuccess();
2930
      boolean that_present_success = true && that.isSetSuccess();
2931
      if (this_present_success || that_present_success) {
2932
        if (!(this_present_success && that_present_success))
2933
          return false;
2934
        if (!this.success.equals(that.success))
2935
          return false;
2936
      }
2937
 
2938
      boolean this_present_pex = true && this.isSetPex();
2939
      boolean that_present_pex = true && that.isSetPex();
2940
      if (this_present_pex || that_present_pex) {
2941
        if (!(this_present_pex && that_present_pex))
2942
          return false;
2943
        if (!this.pex.equals(that.pex))
2944
          return false;
2945
      }
2946
 
2947
      return true;
2948
    }
2949
 
2950
    @Override
2951
    public int hashCode() {
2952
      return 0;
2953
    }
2954
 
2955
    public int compareTo(getPromotionById_result other) {
2956
      if (!getClass().equals(other.getClass())) {
2957
        return getClass().getName().compareTo(other.getClass().getName());
2958
      }
2959
 
2960
      int lastComparison = 0;
2961
      getPromotionById_result typedOther = (getPromotionById_result)other;
2962
 
3430 rajveer 2963
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
1982 varun.gupt 2964
      if (lastComparison != 0) {
2965
        return lastComparison;
2966
      }
3430 rajveer 2967
      if (isSetSuccess()) {
2968
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
2969
        if (lastComparison != 0) {
2970
          return lastComparison;
2971
        }
1982 varun.gupt 2972
      }
3430 rajveer 2973
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 2974
      if (lastComparison != 0) {
2975
        return lastComparison;
2976
      }
3430 rajveer 2977
      if (isSetPex()) {
2978
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
2979
        if (lastComparison != 0) {
2980
          return lastComparison;
2981
        }
1982 varun.gupt 2982
      }
2983
      return 0;
2984
    }
2985
 
3430 rajveer 2986
    public _Fields fieldForId(int fieldId) {
2987
      return _Fields.findByThriftId(fieldId);
2988
    }
2989
 
2990
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
2991
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 2992
      iprot.readStructBegin();
2993
      while (true)
2994
      {
2995
        field = iprot.readFieldBegin();
3430 rajveer 2996
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 2997
          break;
2998
        }
3430 rajveer 2999
        switch (field.id) {
3000
          case 0: // SUCCESS
3001
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
3002
              this.success = new Promotion();
3003
              this.success.read(iprot);
3004
            } else { 
3005
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3006
            }
3007
            break;
3008
          case 1: // PEX
3009
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
3010
              this.pex = new PromotionException();
3011
              this.pex.read(iprot);
3012
            } else { 
3013
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3014
            }
3015
            break;
3016
          default:
3017
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 3018
        }
3430 rajveer 3019
        iprot.readFieldEnd();
1982 varun.gupt 3020
      }
3021
      iprot.readStructEnd();
3022
      validate();
3023
    }
3024
 
3430 rajveer 3025
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 3026
      oprot.writeStructBegin(STRUCT_DESC);
3027
 
3028
      if (this.isSetSuccess()) {
3029
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
3030
        this.success.write(oprot);
3031
        oprot.writeFieldEnd();
3032
      } else if (this.isSetPex()) {
3033
        oprot.writeFieldBegin(PEX_FIELD_DESC);
3034
        this.pex.write(oprot);
3035
        oprot.writeFieldEnd();
3036
      }
3037
      oprot.writeFieldStop();
3038
      oprot.writeStructEnd();
3039
    }
3040
 
3041
    @Override
3042
    public String toString() {
3043
      StringBuilder sb = new StringBuilder("getPromotionById_result(");
3044
      boolean first = true;
3045
 
3046
      sb.append("success:");
3047
      if (this.success == null) {
3048
        sb.append("null");
3049
      } else {
3050
        sb.append(this.success);
3051
      }
3052
      first = false;
3053
      if (!first) sb.append(", ");
3054
      sb.append("pex:");
3055
      if (this.pex == null) {
3056
        sb.append("null");
3057
      } else {
3058
        sb.append(this.pex);
3059
      }
3060
      first = false;
3061
      sb.append(")");
3062
      return sb.toString();
3063
    }
3064
 
3430 rajveer 3065
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 3066
      // check for required fields
3067
    }
3068
 
3430 rajveer 3069
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
3070
      try {
3071
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
3072
      } catch (org.apache.thrift.TException te) {
3073
        throw new java.io.IOException(te);
3074
      }
3075
    }
3076
 
3077
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
3078
      try {
3079
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
3080
      } catch (org.apache.thrift.TException te) {
3081
        throw new java.io.IOException(te);
3082
      }
3083
    }
3084
 
1982 varun.gupt 3085
  }
3086
 
3430 rajveer 3087
  public static class generateCouponsForPromotion_args implements org.apache.thrift.TBase<generateCouponsForPromotion_args, generateCouponsForPromotion_args._Fields>, java.io.Serializable, Cloneable   {
3088
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("generateCouponsForPromotion_args");
1982 varun.gupt 3089
 
3430 rajveer 3090
    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);
3091
    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);
1982 varun.gupt 3092
 
3430 rajveer 3093
    private long promotionId; // required
3094
    private String couponCode; // required
1982 varun.gupt 3095
 
3096
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 3097
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 3098
      PROMOTION_ID((short)1, "promotionId"),
3099
      COUPON_CODE((short)2, "couponCode");
3100
 
3101
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
3102
 
3103
      static {
3104
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
3105
          byName.put(field.getFieldName(), field);
3106
        }
3107
      }
3108
 
3109
      /**
3110
       * Find the _Fields constant that matches fieldId, or null if its not found.
3111
       */
3112
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 3113
        switch(fieldId) {
3114
          case 1: // PROMOTION_ID
3115
            return PROMOTION_ID;
3116
          case 2: // COUPON_CODE
3117
            return COUPON_CODE;
3118
          default:
3119
            return null;
3120
        }
1982 varun.gupt 3121
      }
3122
 
3123
      /**
3124
       * Find the _Fields constant that matches fieldId, throwing an exception
3125
       * if it is not found.
3126
       */
3127
      public static _Fields findByThriftIdOrThrow(int fieldId) {
3128
        _Fields fields = findByThriftId(fieldId);
3129
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
3130
        return fields;
3131
      }
3132
 
3133
      /**
3134
       * Find the _Fields constant that matches name, or null if its not found.
3135
       */
3136
      public static _Fields findByName(String name) {
3137
        return byName.get(name);
3138
      }
3139
 
3140
      private final short _thriftId;
3141
      private final String _fieldName;
3142
 
3143
      _Fields(short thriftId, String fieldName) {
3144
        _thriftId = thriftId;
3145
        _fieldName = fieldName;
3146
      }
3147
 
3148
      public short getThriftFieldId() {
3149
        return _thriftId;
3150
      }
3151
 
3152
      public String getFieldName() {
3153
        return _fieldName;
3154
      }
3155
    }
3156
 
3157
    // isset id assignments
3158
    private static final int __PROMOTIONID_ISSET_ID = 0;
3159
    private BitSet __isset_bit_vector = new BitSet(1);
3160
 
3430 rajveer 3161
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 3162
    static {
3430 rajveer 3163
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
3164
      tmpMap.put(_Fields.PROMOTION_ID, new org.apache.thrift.meta_data.FieldMetaData("promotionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
3165
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
3166
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
3167
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
3168
      metaDataMap = Collections.unmodifiableMap(tmpMap);
3169
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(generateCouponsForPromotion_args.class, metaDataMap);
1982 varun.gupt 3170
    }
3171
 
3172
    public generateCouponsForPromotion_args() {
3173
    }
3174
 
3175
    public generateCouponsForPromotion_args(
3176
      long promotionId,
3177
      String couponCode)
3178
    {
3179
      this();
3180
      this.promotionId = promotionId;
3181
      setPromotionIdIsSet(true);
3182
      this.couponCode = couponCode;
3183
    }
3184
 
3185
    /**
3186
     * Performs a deep copy on <i>other</i>.
3187
     */
3188
    public generateCouponsForPromotion_args(generateCouponsForPromotion_args other) {
3189
      __isset_bit_vector.clear();
3190
      __isset_bit_vector.or(other.__isset_bit_vector);
3191
      this.promotionId = other.promotionId;
3192
      if (other.isSetCouponCode()) {
3193
        this.couponCode = other.couponCode;
3194
      }
3195
    }
3196
 
3197
    public generateCouponsForPromotion_args deepCopy() {
3198
      return new generateCouponsForPromotion_args(this);
3199
    }
3200
 
3430 rajveer 3201
    @Override
3202
    public void clear() {
3203
      setPromotionIdIsSet(false);
3204
      this.promotionId = 0;
3205
      this.couponCode = null;
1982 varun.gupt 3206
    }
3207
 
3208
    public long getPromotionId() {
3209
      return this.promotionId;
3210
    }
3211
 
3430 rajveer 3212
    public void setPromotionId(long promotionId) {
1982 varun.gupt 3213
      this.promotionId = promotionId;
3214
      setPromotionIdIsSet(true);
3215
    }
3216
 
3217
    public void unsetPromotionId() {
3218
      __isset_bit_vector.clear(__PROMOTIONID_ISSET_ID);
3219
    }
3220
 
3430 rajveer 3221
    /** Returns true if field promotionId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 3222
    public boolean isSetPromotionId() {
3223
      return __isset_bit_vector.get(__PROMOTIONID_ISSET_ID);
3224
    }
3225
 
3226
    public void setPromotionIdIsSet(boolean value) {
3227
      __isset_bit_vector.set(__PROMOTIONID_ISSET_ID, value);
3228
    }
3229
 
3230
    public String getCouponCode() {
3231
      return this.couponCode;
3232
    }
3233
 
3430 rajveer 3234
    public void setCouponCode(String couponCode) {
1982 varun.gupt 3235
      this.couponCode = couponCode;
3236
    }
3237
 
3238
    public void unsetCouponCode() {
3239
      this.couponCode = null;
3240
    }
3241
 
3430 rajveer 3242
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
1982 varun.gupt 3243
    public boolean isSetCouponCode() {
3244
      return this.couponCode != null;
3245
    }
3246
 
3247
    public void setCouponCodeIsSet(boolean value) {
3248
      if (!value) {
3249
        this.couponCode = null;
3250
      }
3251
    }
3252
 
3253
    public void setFieldValue(_Fields field, Object value) {
3254
      switch (field) {
3255
      case PROMOTION_ID:
3256
        if (value == null) {
3257
          unsetPromotionId();
3258
        } else {
3259
          setPromotionId((Long)value);
3260
        }
3261
        break;
3262
 
3263
      case COUPON_CODE:
3264
        if (value == null) {
3265
          unsetCouponCode();
3266
        } else {
3267
          setCouponCode((String)value);
3268
        }
3269
        break;
3270
 
3271
      }
3272
    }
3273
 
3274
    public Object getFieldValue(_Fields field) {
3275
      switch (field) {
3276
      case PROMOTION_ID:
3430 rajveer 3277
        return Long.valueOf(getPromotionId());
1982 varun.gupt 3278
 
3279
      case COUPON_CODE:
3280
        return getCouponCode();
3281
 
3282
      }
3283
      throw new IllegalStateException();
3284
    }
3285
 
3430 rajveer 3286
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
3287
    public boolean isSet(_Fields field) {
3288
      if (field == null) {
3289
        throw new IllegalArgumentException();
3290
      }
1982 varun.gupt 3291
 
3292
      switch (field) {
3293
      case PROMOTION_ID:
3294
        return isSetPromotionId();
3295
      case COUPON_CODE:
3296
        return isSetCouponCode();
3297
      }
3298
      throw new IllegalStateException();
3299
    }
3300
 
3301
    @Override
3302
    public boolean equals(Object that) {
3303
      if (that == null)
3304
        return false;
3305
      if (that instanceof generateCouponsForPromotion_args)
3306
        return this.equals((generateCouponsForPromotion_args)that);
3307
      return false;
3308
    }
3309
 
3310
    public boolean equals(generateCouponsForPromotion_args that) {
3311
      if (that == null)
3312
        return false;
3313
 
3314
      boolean this_present_promotionId = true;
3315
      boolean that_present_promotionId = true;
3316
      if (this_present_promotionId || that_present_promotionId) {
3317
        if (!(this_present_promotionId && that_present_promotionId))
3318
          return false;
3319
        if (this.promotionId != that.promotionId)
3320
          return false;
3321
      }
3322
 
3323
      boolean this_present_couponCode = true && this.isSetCouponCode();
3324
      boolean that_present_couponCode = true && that.isSetCouponCode();
3325
      if (this_present_couponCode || that_present_couponCode) {
3326
        if (!(this_present_couponCode && that_present_couponCode))
3327
          return false;
3328
        if (!this.couponCode.equals(that.couponCode))
3329
          return false;
3330
      }
3331
 
3332
      return true;
3333
    }
3334
 
3335
    @Override
3336
    public int hashCode() {
3337
      return 0;
3338
    }
3339
 
3340
    public int compareTo(generateCouponsForPromotion_args other) {
3341
      if (!getClass().equals(other.getClass())) {
3342
        return getClass().getName().compareTo(other.getClass().getName());
3343
      }
3344
 
3345
      int lastComparison = 0;
3346
      generateCouponsForPromotion_args typedOther = (generateCouponsForPromotion_args)other;
3347
 
3430 rajveer 3348
      lastComparison = Boolean.valueOf(isSetPromotionId()).compareTo(typedOther.isSetPromotionId());
1982 varun.gupt 3349
      if (lastComparison != 0) {
3350
        return lastComparison;
3351
      }
3430 rajveer 3352
      if (isSetPromotionId()) {
3353
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.promotionId, typedOther.promotionId);
3354
        if (lastComparison != 0) {
3355
          return lastComparison;
3356
        }
1982 varun.gupt 3357
      }
3430 rajveer 3358
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
1982 varun.gupt 3359
      if (lastComparison != 0) {
3360
        return lastComparison;
3361
      }
3430 rajveer 3362
      if (isSetCouponCode()) {
3363
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
3364
        if (lastComparison != 0) {
3365
          return lastComparison;
3366
        }
1982 varun.gupt 3367
      }
3368
      return 0;
3369
    }
3370
 
3430 rajveer 3371
    public _Fields fieldForId(int fieldId) {
3372
      return _Fields.findByThriftId(fieldId);
3373
    }
3374
 
3375
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
3376
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 3377
      iprot.readStructBegin();
3378
      while (true)
3379
      {
3380
        field = iprot.readFieldBegin();
3430 rajveer 3381
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 3382
          break;
3383
        }
3430 rajveer 3384
        switch (field.id) {
3385
          case 1: // PROMOTION_ID
3386
            if (field.type == org.apache.thrift.protocol.TType.I64) {
3387
              this.promotionId = iprot.readI64();
3388
              setPromotionIdIsSet(true);
3389
            } else { 
3390
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3391
            }
3392
            break;
3393
          case 2: // COUPON_CODE
3394
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
3395
              this.couponCode = iprot.readString();
3396
            } else { 
3397
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3398
            }
3399
            break;
3400
          default:
3401
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 3402
        }
3430 rajveer 3403
        iprot.readFieldEnd();
1982 varun.gupt 3404
      }
3405
      iprot.readStructEnd();
3406
      validate();
3407
    }
3408
 
3430 rajveer 3409
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 3410
      validate();
3411
 
3412
      oprot.writeStructBegin(STRUCT_DESC);
3413
      oprot.writeFieldBegin(PROMOTION_ID_FIELD_DESC);
3414
      oprot.writeI64(this.promotionId);
3415
      oprot.writeFieldEnd();
3416
      if (this.couponCode != null) {
3417
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
3418
        oprot.writeString(this.couponCode);
3419
        oprot.writeFieldEnd();
3420
      }
3421
      oprot.writeFieldStop();
3422
      oprot.writeStructEnd();
3423
    }
3424
 
3425
    @Override
3426
    public String toString() {
3427
      StringBuilder sb = new StringBuilder("generateCouponsForPromotion_args(");
3428
      boolean first = true;
3429
 
3430
      sb.append("promotionId:");
3431
      sb.append(this.promotionId);
3432
      first = false;
3433
      if (!first) sb.append(", ");
3434
      sb.append("couponCode:");
3435
      if (this.couponCode == null) {
3436
        sb.append("null");
3437
      } else {
3438
        sb.append(this.couponCode);
3439
      }
3440
      first = false;
3441
      sb.append(")");
3442
      return sb.toString();
3443
    }
3444
 
3430 rajveer 3445
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 3446
      // check for required fields
3447
    }
3448
 
3430 rajveer 3449
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
3450
      try {
3451
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
3452
      } catch (org.apache.thrift.TException te) {
3453
        throw new java.io.IOException(te);
3454
      }
3455
    }
3456
 
3457
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
3458
      try {
3459
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
3460
        __isset_bit_vector = new BitSet(1);
3461
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
3462
      } catch (org.apache.thrift.TException te) {
3463
        throw new java.io.IOException(te);
3464
      }
3465
    }
3466
 
1982 varun.gupt 3467
  }
3468
 
3430 rajveer 3469
  public static class generateCouponsForPromotion_result implements org.apache.thrift.TBase<generateCouponsForPromotion_result, generateCouponsForPromotion_result._Fields>, java.io.Serializable, Cloneable   {
3470
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("generateCouponsForPromotion_result");
1982 varun.gupt 3471
 
3430 rajveer 3472
    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);
1982 varun.gupt 3473
 
3430 rajveer 3474
    private PromotionException pex; // required
1982 varun.gupt 3475
 
3476
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 3477
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 3478
      PEX((short)1, "pex");
3479
 
3480
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
3481
 
3482
      static {
3483
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
3484
          byName.put(field.getFieldName(), field);
3485
        }
3486
      }
3487
 
3488
      /**
3489
       * Find the _Fields constant that matches fieldId, or null if its not found.
3490
       */
3491
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 3492
        switch(fieldId) {
3493
          case 1: // PEX
3494
            return PEX;
3495
          default:
3496
            return null;
3497
        }
1982 varun.gupt 3498
      }
3499
 
3500
      /**
3501
       * Find the _Fields constant that matches fieldId, throwing an exception
3502
       * if it is not found.
3503
       */
3504
      public static _Fields findByThriftIdOrThrow(int fieldId) {
3505
        _Fields fields = findByThriftId(fieldId);
3506
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
3507
        return fields;
3508
      }
3509
 
3510
      /**
3511
       * Find the _Fields constant that matches name, or null if its not found.
3512
       */
3513
      public static _Fields findByName(String name) {
3514
        return byName.get(name);
3515
      }
3516
 
3517
      private final short _thriftId;
3518
      private final String _fieldName;
3519
 
3520
      _Fields(short thriftId, String fieldName) {
3521
        _thriftId = thriftId;
3522
        _fieldName = fieldName;
3523
      }
3524
 
3525
      public short getThriftFieldId() {
3526
        return _thriftId;
3527
      }
3528
 
3529
      public String getFieldName() {
3530
        return _fieldName;
3531
      }
3532
    }
3533
 
3534
    // isset id assignments
3535
 
3430 rajveer 3536
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 3537
    static {
3430 rajveer 3538
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
3539
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
3540
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
3541
      metaDataMap = Collections.unmodifiableMap(tmpMap);
3542
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(generateCouponsForPromotion_result.class, metaDataMap);
1982 varun.gupt 3543
    }
3544
 
3545
    public generateCouponsForPromotion_result() {
3546
    }
3547
 
3548
    public generateCouponsForPromotion_result(
3549
      PromotionException pex)
3550
    {
3551
      this();
3552
      this.pex = pex;
3553
    }
3554
 
3555
    /**
3556
     * Performs a deep copy on <i>other</i>.
3557
     */
3558
    public generateCouponsForPromotion_result(generateCouponsForPromotion_result other) {
3559
      if (other.isSetPex()) {
3560
        this.pex = new PromotionException(other.pex);
3561
      }
3562
    }
3563
 
3564
    public generateCouponsForPromotion_result deepCopy() {
3565
      return new generateCouponsForPromotion_result(this);
3566
    }
3567
 
3430 rajveer 3568
    @Override
3569
    public void clear() {
3570
      this.pex = null;
1982 varun.gupt 3571
    }
3572
 
3573
    public PromotionException getPex() {
3574
      return this.pex;
3575
    }
3576
 
3430 rajveer 3577
    public void setPex(PromotionException pex) {
1982 varun.gupt 3578
      this.pex = pex;
3579
    }
3580
 
3581
    public void unsetPex() {
3582
      this.pex = null;
3583
    }
3584
 
3430 rajveer 3585
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 3586
    public boolean isSetPex() {
3587
      return this.pex != null;
3588
    }
3589
 
3590
    public void setPexIsSet(boolean value) {
3591
      if (!value) {
3592
        this.pex = null;
3593
      }
3594
    }
3595
 
3596
    public void setFieldValue(_Fields field, Object value) {
3597
      switch (field) {
3598
      case PEX:
3599
        if (value == null) {
3600
          unsetPex();
3601
        } else {
3602
          setPex((PromotionException)value);
3603
        }
3604
        break;
3605
 
3606
      }
3607
    }
3608
 
3609
    public Object getFieldValue(_Fields field) {
3610
      switch (field) {
3611
      case PEX:
3612
        return getPex();
3613
 
3614
      }
3615
      throw new IllegalStateException();
3616
    }
3617
 
3430 rajveer 3618
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
3619
    public boolean isSet(_Fields field) {
3620
      if (field == null) {
3621
        throw new IllegalArgumentException();
3622
      }
1982 varun.gupt 3623
 
3624
      switch (field) {
3625
      case PEX:
3626
        return isSetPex();
3627
      }
3628
      throw new IllegalStateException();
3629
    }
3630
 
3631
    @Override
3632
    public boolean equals(Object that) {
3633
      if (that == null)
3634
        return false;
3635
      if (that instanceof generateCouponsForPromotion_result)
3636
        return this.equals((generateCouponsForPromotion_result)that);
3637
      return false;
3638
    }
3639
 
3640
    public boolean equals(generateCouponsForPromotion_result that) {
3641
      if (that == null)
3642
        return false;
3643
 
3644
      boolean this_present_pex = true && this.isSetPex();
3645
      boolean that_present_pex = true && that.isSetPex();
3646
      if (this_present_pex || that_present_pex) {
3647
        if (!(this_present_pex && that_present_pex))
3648
          return false;
3649
        if (!this.pex.equals(that.pex))
3650
          return false;
3651
      }
3652
 
3653
      return true;
3654
    }
3655
 
3656
    @Override
3657
    public int hashCode() {
3658
      return 0;
3659
    }
3660
 
3661
    public int compareTo(generateCouponsForPromotion_result other) {
3662
      if (!getClass().equals(other.getClass())) {
3663
        return getClass().getName().compareTo(other.getClass().getName());
3664
      }
3665
 
3666
      int lastComparison = 0;
3667
      generateCouponsForPromotion_result typedOther = (generateCouponsForPromotion_result)other;
3668
 
3430 rajveer 3669
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 3670
      if (lastComparison != 0) {
3671
        return lastComparison;
3672
      }
3430 rajveer 3673
      if (isSetPex()) {
3674
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
3675
        if (lastComparison != 0) {
3676
          return lastComparison;
3677
        }
1982 varun.gupt 3678
      }
3679
      return 0;
3680
    }
3681
 
3430 rajveer 3682
    public _Fields fieldForId(int fieldId) {
3683
      return _Fields.findByThriftId(fieldId);
3684
    }
3685
 
3686
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
3687
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 3688
      iprot.readStructBegin();
3689
      while (true)
3690
      {
3691
        field = iprot.readFieldBegin();
3430 rajveer 3692
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 3693
          break;
3694
        }
3430 rajveer 3695
        switch (field.id) {
3696
          case 1: // PEX
3697
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
3698
              this.pex = new PromotionException();
3699
              this.pex.read(iprot);
3700
            } else { 
3701
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3702
            }
3703
            break;
3704
          default:
3705
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 3706
        }
3430 rajveer 3707
        iprot.readFieldEnd();
1982 varun.gupt 3708
      }
3709
      iprot.readStructEnd();
3710
      validate();
3711
    }
3712
 
3430 rajveer 3713
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 3714
      oprot.writeStructBegin(STRUCT_DESC);
3715
 
3716
      if (this.isSetPex()) {
3717
        oprot.writeFieldBegin(PEX_FIELD_DESC);
3718
        this.pex.write(oprot);
3719
        oprot.writeFieldEnd();
3720
      }
3721
      oprot.writeFieldStop();
3722
      oprot.writeStructEnd();
3723
    }
3724
 
3725
    @Override
3726
    public String toString() {
3727
      StringBuilder sb = new StringBuilder("generateCouponsForPromotion_result(");
3728
      boolean first = true;
3729
 
3730
      sb.append("pex:");
3731
      if (this.pex == null) {
3732
        sb.append("null");
3733
      } else {
3734
        sb.append(this.pex);
3735
      }
3736
      first = false;
3737
      sb.append(")");
3738
      return sb.toString();
3739
    }
3740
 
3430 rajveer 3741
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 3742
      // check for required fields
3743
    }
3744
 
3430 rajveer 3745
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
3746
      try {
3747
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
3748
      } catch (org.apache.thrift.TException te) {
3749
        throw new java.io.IOException(te);
3750
      }
3751
    }
3752
 
3753
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
3754
      try {
3755
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
3756
      } catch (org.apache.thrift.TException te) {
3757
        throw new java.io.IOException(te);
3758
      }
3759
    }
3760
 
1982 varun.gupt 3761
  }
3762
 
3430 rajveer 3763
  public static class applyCoupon_args implements org.apache.thrift.TBase<applyCoupon_args, applyCoupon_args._Fields>, java.io.Serializable, Cloneable   {
3764
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("applyCoupon_args");
1982 varun.gupt 3765
 
3430 rajveer 3766
    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);
3767
    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)2);
1982 varun.gupt 3768
 
3430 rajveer 3769
    private String couponCode; // required
3770
    private long cartId; // required
1982 varun.gupt 3771
 
3772
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 3773
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 3774
      COUPON_CODE((short)1, "couponCode"),
3775
      CART_ID((short)2, "cartId");
3776
 
3777
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
3778
 
3779
      static {
3780
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
3781
          byName.put(field.getFieldName(), field);
3782
        }
3783
      }
3784
 
3785
      /**
3786
       * Find the _Fields constant that matches fieldId, or null if its not found.
3787
       */
3788
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 3789
        switch(fieldId) {
3790
          case 1: // COUPON_CODE
3791
            return COUPON_CODE;
3792
          case 2: // CART_ID
3793
            return CART_ID;
3794
          default:
3795
            return null;
3796
        }
1982 varun.gupt 3797
      }
3798
 
3799
      /**
3800
       * Find the _Fields constant that matches fieldId, throwing an exception
3801
       * if it is not found.
3802
       */
3803
      public static _Fields findByThriftIdOrThrow(int fieldId) {
3804
        _Fields fields = findByThriftId(fieldId);
3805
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
3806
        return fields;
3807
      }
3808
 
3809
      /**
3810
       * Find the _Fields constant that matches name, or null if its not found.
3811
       */
3812
      public static _Fields findByName(String name) {
3813
        return byName.get(name);
3814
      }
3815
 
3816
      private final short _thriftId;
3817
      private final String _fieldName;
3818
 
3819
      _Fields(short thriftId, String fieldName) {
3820
        _thriftId = thriftId;
3821
        _fieldName = fieldName;
3822
      }
3823
 
3824
      public short getThriftFieldId() {
3825
        return _thriftId;
3826
      }
3827
 
3828
      public String getFieldName() {
3829
        return _fieldName;
3830
      }
3831
    }
3832
 
3833
    // isset id assignments
3834
    private static final int __CARTID_ISSET_ID = 0;
3835
    private BitSet __isset_bit_vector = new BitSet(1);
3836
 
3430 rajveer 3837
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 3838
    static {
3430 rajveer 3839
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
3840
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
3841
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
3842
      tmpMap.put(_Fields.CART_ID, new org.apache.thrift.meta_data.FieldMetaData("cartId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
3843
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
3844
      metaDataMap = Collections.unmodifiableMap(tmpMap);
3845
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(applyCoupon_args.class, metaDataMap);
1982 varun.gupt 3846
    }
3847
 
3848
    public applyCoupon_args() {
3849
    }
3850
 
3851
    public applyCoupon_args(
3852
      String couponCode,
3853
      long cartId)
3854
    {
3855
      this();
3856
      this.couponCode = couponCode;
3857
      this.cartId = cartId;
3858
      setCartIdIsSet(true);
3859
    }
3860
 
3861
    /**
3862
     * Performs a deep copy on <i>other</i>.
3863
     */
3864
    public applyCoupon_args(applyCoupon_args other) {
3865
      __isset_bit_vector.clear();
3866
      __isset_bit_vector.or(other.__isset_bit_vector);
3867
      if (other.isSetCouponCode()) {
3868
        this.couponCode = other.couponCode;
3869
      }
3870
      this.cartId = other.cartId;
3871
    }
3872
 
3873
    public applyCoupon_args deepCopy() {
3874
      return new applyCoupon_args(this);
3875
    }
3876
 
3430 rajveer 3877
    @Override
3878
    public void clear() {
3879
      this.couponCode = null;
3880
      setCartIdIsSet(false);
3881
      this.cartId = 0;
1982 varun.gupt 3882
    }
3883
 
3884
    public String getCouponCode() {
3885
      return this.couponCode;
3886
    }
3887
 
3430 rajveer 3888
    public void setCouponCode(String couponCode) {
1982 varun.gupt 3889
      this.couponCode = couponCode;
3890
    }
3891
 
3892
    public void unsetCouponCode() {
3893
      this.couponCode = null;
3894
    }
3895
 
3430 rajveer 3896
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
1982 varun.gupt 3897
    public boolean isSetCouponCode() {
3898
      return this.couponCode != null;
3899
    }
3900
 
3901
    public void setCouponCodeIsSet(boolean value) {
3902
      if (!value) {
3903
        this.couponCode = null;
3904
      }
3905
    }
3906
 
3907
    public long getCartId() {
3908
      return this.cartId;
3909
    }
3910
 
3430 rajveer 3911
    public void setCartId(long cartId) {
1982 varun.gupt 3912
      this.cartId = cartId;
3913
      setCartIdIsSet(true);
3914
    }
3915
 
3916
    public void unsetCartId() {
3917
      __isset_bit_vector.clear(__CARTID_ISSET_ID);
3918
    }
3919
 
3430 rajveer 3920
    /** Returns true if field cartId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 3921
    public boolean isSetCartId() {
3922
      return __isset_bit_vector.get(__CARTID_ISSET_ID);
3923
    }
3924
 
3925
    public void setCartIdIsSet(boolean value) {
3926
      __isset_bit_vector.set(__CARTID_ISSET_ID, value);
3927
    }
3928
 
3929
    public void setFieldValue(_Fields field, Object value) {
3930
      switch (field) {
3931
      case COUPON_CODE:
3932
        if (value == null) {
3933
          unsetCouponCode();
3934
        } else {
3935
          setCouponCode((String)value);
3936
        }
3937
        break;
3938
 
3939
      case CART_ID:
3940
        if (value == null) {
3941
          unsetCartId();
3942
        } else {
3943
          setCartId((Long)value);
3944
        }
3945
        break;
3946
 
3947
      }
3948
    }
3949
 
3950
    public Object getFieldValue(_Fields field) {
3951
      switch (field) {
3952
      case COUPON_CODE:
3953
        return getCouponCode();
3954
 
3955
      case CART_ID:
3430 rajveer 3956
        return Long.valueOf(getCartId());
1982 varun.gupt 3957
 
3958
      }
3959
      throw new IllegalStateException();
3960
    }
3961
 
3430 rajveer 3962
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
3963
    public boolean isSet(_Fields field) {
3964
      if (field == null) {
3965
        throw new IllegalArgumentException();
3966
      }
1982 varun.gupt 3967
 
3968
      switch (field) {
3969
      case COUPON_CODE:
3970
        return isSetCouponCode();
3971
      case CART_ID:
3972
        return isSetCartId();
3973
      }
3974
      throw new IllegalStateException();
3975
    }
3976
 
3977
    @Override
3978
    public boolean equals(Object that) {
3979
      if (that == null)
3980
        return false;
3981
      if (that instanceof applyCoupon_args)
3982
        return this.equals((applyCoupon_args)that);
3983
      return false;
3984
    }
3985
 
3986
    public boolean equals(applyCoupon_args that) {
3987
      if (that == null)
3988
        return false;
3989
 
3990
      boolean this_present_couponCode = true && this.isSetCouponCode();
3991
      boolean that_present_couponCode = true && that.isSetCouponCode();
3992
      if (this_present_couponCode || that_present_couponCode) {
3993
        if (!(this_present_couponCode && that_present_couponCode))
3994
          return false;
3995
        if (!this.couponCode.equals(that.couponCode))
3996
          return false;
3997
      }
3998
 
3999
      boolean this_present_cartId = true;
4000
      boolean that_present_cartId = true;
4001
      if (this_present_cartId || that_present_cartId) {
4002
        if (!(this_present_cartId && that_present_cartId))
4003
          return false;
4004
        if (this.cartId != that.cartId)
4005
          return false;
4006
      }
4007
 
4008
      return true;
4009
    }
4010
 
4011
    @Override
4012
    public int hashCode() {
4013
      return 0;
4014
    }
4015
 
4016
    public int compareTo(applyCoupon_args other) {
4017
      if (!getClass().equals(other.getClass())) {
4018
        return getClass().getName().compareTo(other.getClass().getName());
4019
      }
4020
 
4021
      int lastComparison = 0;
4022
      applyCoupon_args typedOther = (applyCoupon_args)other;
4023
 
3430 rajveer 4024
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
1982 varun.gupt 4025
      if (lastComparison != 0) {
4026
        return lastComparison;
4027
      }
3430 rajveer 4028
      if (isSetCouponCode()) {
4029
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
4030
        if (lastComparison != 0) {
4031
          return lastComparison;
4032
        }
1982 varun.gupt 4033
      }
3430 rajveer 4034
      lastComparison = Boolean.valueOf(isSetCartId()).compareTo(typedOther.isSetCartId());
1982 varun.gupt 4035
      if (lastComparison != 0) {
4036
        return lastComparison;
4037
      }
3430 rajveer 4038
      if (isSetCartId()) {
4039
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cartId, typedOther.cartId);
4040
        if (lastComparison != 0) {
4041
          return lastComparison;
4042
        }
1982 varun.gupt 4043
      }
4044
      return 0;
4045
    }
4046
 
3430 rajveer 4047
    public _Fields fieldForId(int fieldId) {
4048
      return _Fields.findByThriftId(fieldId);
4049
    }
4050
 
4051
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
4052
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 4053
      iprot.readStructBegin();
4054
      while (true)
4055
      {
4056
        field = iprot.readFieldBegin();
3430 rajveer 4057
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 4058
          break;
4059
        }
3430 rajveer 4060
        switch (field.id) {
4061
          case 1: // COUPON_CODE
4062
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
4063
              this.couponCode = iprot.readString();
4064
            } else { 
4065
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4066
            }
4067
            break;
4068
          case 2: // CART_ID
4069
            if (field.type == org.apache.thrift.protocol.TType.I64) {
4070
              this.cartId = iprot.readI64();
4071
              setCartIdIsSet(true);
4072
            } else { 
4073
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4074
            }
4075
            break;
4076
          default:
4077
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 4078
        }
3430 rajveer 4079
        iprot.readFieldEnd();
1982 varun.gupt 4080
      }
4081
      iprot.readStructEnd();
4082
      validate();
4083
    }
4084
 
3430 rajveer 4085
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 4086
      validate();
4087
 
4088
      oprot.writeStructBegin(STRUCT_DESC);
4089
      if (this.couponCode != null) {
4090
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
4091
        oprot.writeString(this.couponCode);
4092
        oprot.writeFieldEnd();
4093
      }
4094
      oprot.writeFieldBegin(CART_ID_FIELD_DESC);
4095
      oprot.writeI64(this.cartId);
4096
      oprot.writeFieldEnd();
4097
      oprot.writeFieldStop();
4098
      oprot.writeStructEnd();
4099
    }
4100
 
4101
    @Override
4102
    public String toString() {
4103
      StringBuilder sb = new StringBuilder("applyCoupon_args(");
4104
      boolean first = true;
4105
 
4106
      sb.append("couponCode:");
4107
      if (this.couponCode == null) {
4108
        sb.append("null");
4109
      } else {
4110
        sb.append(this.couponCode);
4111
      }
4112
      first = false;
4113
      if (!first) sb.append(", ");
4114
      sb.append("cartId:");
4115
      sb.append(this.cartId);
4116
      first = false;
4117
      sb.append(")");
4118
      return sb.toString();
4119
    }
4120
 
3430 rajveer 4121
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 4122
      // check for required fields
4123
    }
4124
 
3430 rajveer 4125
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
4126
      try {
4127
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
4128
      } catch (org.apache.thrift.TException te) {
4129
        throw new java.io.IOException(te);
4130
      }
4131
    }
4132
 
4133
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
4134
      try {
4135
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
4136
        __isset_bit_vector = new BitSet(1);
4137
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
4138
      } catch (org.apache.thrift.TException te) {
4139
        throw new java.io.IOException(te);
4140
      }
4141
    }
4142
 
1982 varun.gupt 4143
  }
4144
 
3430 rajveer 4145
  public static class applyCoupon_result implements org.apache.thrift.TBase<applyCoupon_result, applyCoupon_result._Fields>, java.io.Serializable, Cloneable   {
4146
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("applyCoupon_result");
1982 varun.gupt 4147
 
3430 rajveer 4148
    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0);
4149
    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);
1982 varun.gupt 4150
 
3430 rajveer 4151
    private Cart success; // required
4152
    private PromotionException pex; // required
1982 varun.gupt 4153
 
4154
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 4155
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 4156
      SUCCESS((short)0, "success"),
4157
      PEX((short)1, "pex");
4158
 
4159
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
4160
 
4161
      static {
4162
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
4163
          byName.put(field.getFieldName(), field);
4164
        }
4165
      }
4166
 
4167
      /**
4168
       * Find the _Fields constant that matches fieldId, or null if its not found.
4169
       */
4170
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 4171
        switch(fieldId) {
4172
          case 0: // SUCCESS
4173
            return SUCCESS;
4174
          case 1: // PEX
4175
            return PEX;
4176
          default:
4177
            return null;
4178
        }
1982 varun.gupt 4179
      }
4180
 
4181
      /**
4182
       * Find the _Fields constant that matches fieldId, throwing an exception
4183
       * if it is not found.
4184
       */
4185
      public static _Fields findByThriftIdOrThrow(int fieldId) {
4186
        _Fields fields = findByThriftId(fieldId);
4187
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
4188
        return fields;
4189
      }
4190
 
4191
      /**
4192
       * Find the _Fields constant that matches name, or null if its not found.
4193
       */
4194
      public static _Fields findByName(String name) {
4195
        return byName.get(name);
4196
      }
4197
 
4198
      private final short _thriftId;
4199
      private final String _fieldName;
4200
 
4201
      _Fields(short thriftId, String fieldName) {
4202
        _thriftId = thriftId;
4203
        _fieldName = fieldName;
4204
      }
4205
 
4206
      public short getThriftFieldId() {
4207
        return _thriftId;
4208
      }
4209
 
4210
      public String getFieldName() {
4211
        return _fieldName;
4212
      }
4213
    }
4214
 
4215
    // isset id assignments
4216
 
3430 rajveer 4217
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 4218
    static {
3430 rajveer 4219
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
4220
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
4221
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Cart.class)));
4222
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
4223
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
4224
      metaDataMap = Collections.unmodifiableMap(tmpMap);
4225
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(applyCoupon_result.class, metaDataMap);
1982 varun.gupt 4226
    }
4227
 
4228
    public applyCoupon_result() {
4229
    }
4230
 
4231
    public applyCoupon_result(
4232
      Cart success,
4233
      PromotionException pex)
4234
    {
4235
      this();
4236
      this.success = success;
4237
      this.pex = pex;
4238
    }
4239
 
4240
    /**
4241
     * Performs a deep copy on <i>other</i>.
4242
     */
4243
    public applyCoupon_result(applyCoupon_result other) {
4244
      if (other.isSetSuccess()) {
4245
        this.success = new Cart(other.success);
4246
      }
4247
      if (other.isSetPex()) {
4248
        this.pex = new PromotionException(other.pex);
4249
      }
4250
    }
4251
 
4252
    public applyCoupon_result deepCopy() {
4253
      return new applyCoupon_result(this);
4254
    }
4255
 
3430 rajveer 4256
    @Override
4257
    public void clear() {
4258
      this.success = null;
4259
      this.pex = null;
1982 varun.gupt 4260
    }
4261
 
4262
    public Cart getSuccess() {
4263
      return this.success;
4264
    }
4265
 
3430 rajveer 4266
    public void setSuccess(Cart success) {
1982 varun.gupt 4267
      this.success = success;
4268
    }
4269
 
4270
    public void unsetSuccess() {
4271
      this.success = null;
4272
    }
4273
 
3430 rajveer 4274
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
1982 varun.gupt 4275
    public boolean isSetSuccess() {
4276
      return this.success != null;
4277
    }
4278
 
4279
    public void setSuccessIsSet(boolean value) {
4280
      if (!value) {
4281
        this.success = null;
4282
      }
4283
    }
4284
 
4285
    public PromotionException getPex() {
4286
      return this.pex;
4287
    }
4288
 
3430 rajveer 4289
    public void setPex(PromotionException pex) {
1982 varun.gupt 4290
      this.pex = pex;
4291
    }
4292
 
4293
    public void unsetPex() {
4294
      this.pex = null;
4295
    }
4296
 
3430 rajveer 4297
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 4298
    public boolean isSetPex() {
4299
      return this.pex != null;
4300
    }
4301
 
4302
    public void setPexIsSet(boolean value) {
4303
      if (!value) {
4304
        this.pex = null;
4305
      }
4306
    }
4307
 
4308
    public void setFieldValue(_Fields field, Object value) {
4309
      switch (field) {
4310
      case SUCCESS:
4311
        if (value == null) {
4312
          unsetSuccess();
4313
        } else {
4314
          setSuccess((Cart)value);
4315
        }
4316
        break;
4317
 
4318
      case PEX:
4319
        if (value == null) {
4320
          unsetPex();
4321
        } else {
4322
          setPex((PromotionException)value);
4323
        }
4324
        break;
4325
 
4326
      }
4327
    }
4328
 
4329
    public Object getFieldValue(_Fields field) {
4330
      switch (field) {
4331
      case SUCCESS:
4332
        return getSuccess();
4333
 
4334
      case PEX:
4335
        return getPex();
4336
 
4337
      }
4338
      throw new IllegalStateException();
4339
    }
4340
 
3430 rajveer 4341
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
4342
    public boolean isSet(_Fields field) {
4343
      if (field == null) {
4344
        throw new IllegalArgumentException();
4345
      }
1982 varun.gupt 4346
 
4347
      switch (field) {
4348
      case SUCCESS:
4349
        return isSetSuccess();
4350
      case PEX:
4351
        return isSetPex();
4352
      }
4353
      throw new IllegalStateException();
4354
    }
4355
 
4356
    @Override
4357
    public boolean equals(Object that) {
4358
      if (that == null)
4359
        return false;
4360
      if (that instanceof applyCoupon_result)
4361
        return this.equals((applyCoupon_result)that);
4362
      return false;
4363
    }
4364
 
4365
    public boolean equals(applyCoupon_result that) {
4366
      if (that == null)
4367
        return false;
4368
 
4369
      boolean this_present_success = true && this.isSetSuccess();
4370
      boolean that_present_success = true && that.isSetSuccess();
4371
      if (this_present_success || that_present_success) {
4372
        if (!(this_present_success && that_present_success))
4373
          return false;
4374
        if (!this.success.equals(that.success))
4375
          return false;
4376
      }
4377
 
4378
      boolean this_present_pex = true && this.isSetPex();
4379
      boolean that_present_pex = true && that.isSetPex();
4380
      if (this_present_pex || that_present_pex) {
4381
        if (!(this_present_pex && that_present_pex))
4382
          return false;
4383
        if (!this.pex.equals(that.pex))
4384
          return false;
4385
      }
4386
 
4387
      return true;
4388
    }
4389
 
4390
    @Override
4391
    public int hashCode() {
4392
      return 0;
4393
    }
4394
 
4395
    public int compareTo(applyCoupon_result other) {
4396
      if (!getClass().equals(other.getClass())) {
4397
        return getClass().getName().compareTo(other.getClass().getName());
4398
      }
4399
 
4400
      int lastComparison = 0;
4401
      applyCoupon_result typedOther = (applyCoupon_result)other;
4402
 
3430 rajveer 4403
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
1982 varun.gupt 4404
      if (lastComparison != 0) {
4405
        return lastComparison;
4406
      }
3430 rajveer 4407
      if (isSetSuccess()) {
4408
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
4409
        if (lastComparison != 0) {
4410
          return lastComparison;
4411
        }
1982 varun.gupt 4412
      }
3430 rajveer 4413
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 4414
      if (lastComparison != 0) {
4415
        return lastComparison;
4416
      }
3430 rajveer 4417
      if (isSetPex()) {
4418
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
4419
        if (lastComparison != 0) {
4420
          return lastComparison;
4421
        }
1982 varun.gupt 4422
      }
4423
      return 0;
4424
    }
4425
 
3430 rajveer 4426
    public _Fields fieldForId(int fieldId) {
4427
      return _Fields.findByThriftId(fieldId);
4428
    }
4429
 
4430
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
4431
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 4432
      iprot.readStructBegin();
4433
      while (true)
4434
      {
4435
        field = iprot.readFieldBegin();
3430 rajveer 4436
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 4437
          break;
4438
        }
3430 rajveer 4439
        switch (field.id) {
4440
          case 0: // SUCCESS
4441
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
4442
              this.success = new Cart();
4443
              this.success.read(iprot);
4444
            } else { 
4445
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4446
            }
4447
            break;
4448
          case 1: // PEX
4449
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
4450
              this.pex = new PromotionException();
4451
              this.pex.read(iprot);
4452
            } else { 
4453
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4454
            }
4455
            break;
4456
          default:
4457
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 4458
        }
3430 rajveer 4459
        iprot.readFieldEnd();
1982 varun.gupt 4460
      }
4461
      iprot.readStructEnd();
4462
      validate();
4463
    }
4464
 
3430 rajveer 4465
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 4466
      oprot.writeStructBegin(STRUCT_DESC);
4467
 
4468
      if (this.isSetSuccess()) {
4469
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
4470
        this.success.write(oprot);
4471
        oprot.writeFieldEnd();
4472
      } else if (this.isSetPex()) {
4473
        oprot.writeFieldBegin(PEX_FIELD_DESC);
4474
        this.pex.write(oprot);
4475
        oprot.writeFieldEnd();
4476
      }
4477
      oprot.writeFieldStop();
4478
      oprot.writeStructEnd();
4479
    }
4480
 
4481
    @Override
4482
    public String toString() {
4483
      StringBuilder sb = new StringBuilder("applyCoupon_result(");
4484
      boolean first = true;
4485
 
4486
      sb.append("success:");
4487
      if (this.success == null) {
4488
        sb.append("null");
4489
      } else {
4490
        sb.append(this.success);
4491
      }
4492
      first = false;
4493
      if (!first) sb.append(", ");
4494
      sb.append("pex:");
4495
      if (this.pex == null) {
4496
        sb.append("null");
4497
      } else {
4498
        sb.append(this.pex);
4499
      }
4500
      first = false;
4501
      sb.append(")");
4502
      return sb.toString();
4503
    }
4504
 
3430 rajveer 4505
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 4506
      // check for required fields
4507
    }
4508
 
3430 rajveer 4509
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
4510
      try {
4511
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
4512
      } catch (org.apache.thrift.TException te) {
4513
        throw new java.io.IOException(te);
4514
      }
4515
    }
4516
 
4517
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
4518
      try {
4519
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
4520
      } catch (org.apache.thrift.TException te) {
4521
        throw new java.io.IOException(te);
4522
      }
4523
    }
4524
 
1982 varun.gupt 4525
  }
4526
 
3430 rajveer 4527
  public static class trackCouponUsage_args implements org.apache.thrift.TBase<trackCouponUsage_args, trackCouponUsage_args._Fields>, java.io.Serializable, Cloneable   {
4528
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("trackCouponUsage_args");
1982 varun.gupt 4529
 
3430 rajveer 4530
    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);
4531
    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);
4532
    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);
1982 varun.gupt 4533
 
3430 rajveer 4534
    private String couponCode; // required
4535
    private long transactionId; // required
4536
    private long userId; // required
1982 varun.gupt 4537
 
4538
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 4539
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 4540
      COUPON_CODE((short)1, "couponCode"),
4541
      TRANSACTION_ID((short)2, "transactionId"),
4542
      USER_ID((short)3, "userId");
4543
 
4544
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
4545
 
4546
      static {
4547
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
4548
          byName.put(field.getFieldName(), field);
4549
        }
4550
      }
4551
 
4552
      /**
4553
       * Find the _Fields constant that matches fieldId, or null if its not found.
4554
       */
4555
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 4556
        switch(fieldId) {
4557
          case 1: // COUPON_CODE
4558
            return COUPON_CODE;
4559
          case 2: // TRANSACTION_ID
4560
            return TRANSACTION_ID;
4561
          case 3: // USER_ID
4562
            return USER_ID;
4563
          default:
4564
            return null;
4565
        }
1982 varun.gupt 4566
      }
4567
 
4568
      /**
4569
       * Find the _Fields constant that matches fieldId, throwing an exception
4570
       * if it is not found.
4571
       */
4572
      public static _Fields findByThriftIdOrThrow(int fieldId) {
4573
        _Fields fields = findByThriftId(fieldId);
4574
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
4575
        return fields;
4576
      }
4577
 
4578
      /**
4579
       * Find the _Fields constant that matches name, or null if its not found.
4580
       */
4581
      public static _Fields findByName(String name) {
4582
        return byName.get(name);
4583
      }
4584
 
4585
      private final short _thriftId;
4586
      private final String _fieldName;
4587
 
4588
      _Fields(short thriftId, String fieldName) {
4589
        _thriftId = thriftId;
4590
        _fieldName = fieldName;
4591
      }
4592
 
4593
      public short getThriftFieldId() {
4594
        return _thriftId;
4595
      }
4596
 
4597
      public String getFieldName() {
4598
        return _fieldName;
4599
      }
4600
    }
4601
 
4602
    // isset id assignments
4603
    private static final int __TRANSACTIONID_ISSET_ID = 0;
4604
    private static final int __USERID_ISSET_ID = 1;
4605
    private BitSet __isset_bit_vector = new BitSet(2);
4606
 
3430 rajveer 4607
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 4608
    static {
3430 rajveer 4609
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
4610
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
4611
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
4612
      tmpMap.put(_Fields.TRANSACTION_ID, new org.apache.thrift.meta_data.FieldMetaData("transactionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
4613
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
4614
      tmpMap.put(_Fields.USER_ID, new org.apache.thrift.meta_data.FieldMetaData("userId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
4615
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
4616
      metaDataMap = Collections.unmodifiableMap(tmpMap);
4617
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(trackCouponUsage_args.class, metaDataMap);
1982 varun.gupt 4618
    }
4619
 
4620
    public trackCouponUsage_args() {
4621
    }
4622
 
4623
    public trackCouponUsage_args(
4624
      String couponCode,
4625
      long transactionId,
4626
      long userId)
4627
    {
4628
      this();
4629
      this.couponCode = couponCode;
4630
      this.transactionId = transactionId;
4631
      setTransactionIdIsSet(true);
4632
      this.userId = userId;
4633
      setUserIdIsSet(true);
4634
    }
4635
 
4636
    /**
4637
     * Performs a deep copy on <i>other</i>.
4638
     */
4639
    public trackCouponUsage_args(trackCouponUsage_args other) {
4640
      __isset_bit_vector.clear();
4641
      __isset_bit_vector.or(other.__isset_bit_vector);
4642
      if (other.isSetCouponCode()) {
4643
        this.couponCode = other.couponCode;
4644
      }
4645
      this.transactionId = other.transactionId;
4646
      this.userId = other.userId;
4647
    }
4648
 
4649
    public trackCouponUsage_args deepCopy() {
4650
      return new trackCouponUsage_args(this);
4651
    }
4652
 
3430 rajveer 4653
    @Override
4654
    public void clear() {
4655
      this.couponCode = null;
4656
      setTransactionIdIsSet(false);
4657
      this.transactionId = 0;
4658
      setUserIdIsSet(false);
4659
      this.userId = 0;
1982 varun.gupt 4660
    }
4661
 
4662
    public String getCouponCode() {
4663
      return this.couponCode;
4664
    }
4665
 
3430 rajveer 4666
    public void setCouponCode(String couponCode) {
1982 varun.gupt 4667
      this.couponCode = couponCode;
4668
    }
4669
 
4670
    public void unsetCouponCode() {
4671
      this.couponCode = null;
4672
    }
4673
 
3430 rajveer 4674
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
1982 varun.gupt 4675
    public boolean isSetCouponCode() {
4676
      return this.couponCode != null;
4677
    }
4678
 
4679
    public void setCouponCodeIsSet(boolean value) {
4680
      if (!value) {
4681
        this.couponCode = null;
4682
      }
4683
    }
4684
 
4685
    public long getTransactionId() {
4686
      return this.transactionId;
4687
    }
4688
 
3430 rajveer 4689
    public void setTransactionId(long transactionId) {
1982 varun.gupt 4690
      this.transactionId = transactionId;
4691
      setTransactionIdIsSet(true);
4692
    }
4693
 
4694
    public void unsetTransactionId() {
4695
      __isset_bit_vector.clear(__TRANSACTIONID_ISSET_ID);
4696
    }
4697
 
3430 rajveer 4698
    /** Returns true if field transactionId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 4699
    public boolean isSetTransactionId() {
4700
      return __isset_bit_vector.get(__TRANSACTIONID_ISSET_ID);
4701
    }
4702
 
4703
    public void setTransactionIdIsSet(boolean value) {
4704
      __isset_bit_vector.set(__TRANSACTIONID_ISSET_ID, value);
4705
    }
4706
 
4707
    public long getUserId() {
4708
      return this.userId;
4709
    }
4710
 
3430 rajveer 4711
    public void setUserId(long userId) {
1982 varun.gupt 4712
      this.userId = userId;
4713
      setUserIdIsSet(true);
4714
    }
4715
 
4716
    public void unsetUserId() {
4717
      __isset_bit_vector.clear(__USERID_ISSET_ID);
4718
    }
4719
 
3430 rajveer 4720
    /** Returns true if field userId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 4721
    public boolean isSetUserId() {
4722
      return __isset_bit_vector.get(__USERID_ISSET_ID);
4723
    }
4724
 
4725
    public void setUserIdIsSet(boolean value) {
4726
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
4727
    }
4728
 
4729
    public void setFieldValue(_Fields field, Object value) {
4730
      switch (field) {
4731
      case COUPON_CODE:
4732
        if (value == null) {
4733
          unsetCouponCode();
4734
        } else {
4735
          setCouponCode((String)value);
4736
        }
4737
        break;
4738
 
4739
      case TRANSACTION_ID:
4740
        if (value == null) {
4741
          unsetTransactionId();
4742
        } else {
4743
          setTransactionId((Long)value);
4744
        }
4745
        break;
4746
 
4747
      case USER_ID:
4748
        if (value == null) {
4749
          unsetUserId();
4750
        } else {
4751
          setUserId((Long)value);
4752
        }
4753
        break;
4754
 
4755
      }
4756
    }
4757
 
4758
    public Object getFieldValue(_Fields field) {
4759
      switch (field) {
4760
      case COUPON_CODE:
4761
        return getCouponCode();
4762
 
4763
      case TRANSACTION_ID:
3430 rajveer 4764
        return Long.valueOf(getTransactionId());
1982 varun.gupt 4765
 
4766
      case USER_ID:
3430 rajveer 4767
        return Long.valueOf(getUserId());
1982 varun.gupt 4768
 
4769
      }
4770
      throw new IllegalStateException();
4771
    }
4772
 
3430 rajveer 4773
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
4774
    public boolean isSet(_Fields field) {
4775
      if (field == null) {
4776
        throw new IllegalArgumentException();
4777
      }
1982 varun.gupt 4778
 
4779
      switch (field) {
4780
      case COUPON_CODE:
4781
        return isSetCouponCode();
4782
      case TRANSACTION_ID:
4783
        return isSetTransactionId();
4784
      case USER_ID:
4785
        return isSetUserId();
4786
      }
4787
      throw new IllegalStateException();
4788
    }
4789
 
4790
    @Override
4791
    public boolean equals(Object that) {
4792
      if (that == null)
4793
        return false;
4794
      if (that instanceof trackCouponUsage_args)
4795
        return this.equals((trackCouponUsage_args)that);
4796
      return false;
4797
    }
4798
 
4799
    public boolean equals(trackCouponUsage_args that) {
4800
      if (that == null)
4801
        return false;
4802
 
4803
      boolean this_present_couponCode = true && this.isSetCouponCode();
4804
      boolean that_present_couponCode = true && that.isSetCouponCode();
4805
      if (this_present_couponCode || that_present_couponCode) {
4806
        if (!(this_present_couponCode && that_present_couponCode))
4807
          return false;
4808
        if (!this.couponCode.equals(that.couponCode))
4809
          return false;
4810
      }
4811
 
4812
      boolean this_present_transactionId = true;
4813
      boolean that_present_transactionId = true;
4814
      if (this_present_transactionId || that_present_transactionId) {
4815
        if (!(this_present_transactionId && that_present_transactionId))
4816
          return false;
4817
        if (this.transactionId != that.transactionId)
4818
          return false;
4819
      }
4820
 
4821
      boolean this_present_userId = true;
4822
      boolean that_present_userId = true;
4823
      if (this_present_userId || that_present_userId) {
4824
        if (!(this_present_userId && that_present_userId))
4825
          return false;
4826
        if (this.userId != that.userId)
4827
          return false;
4828
      }
4829
 
4830
      return true;
4831
    }
4832
 
4833
    @Override
4834
    public int hashCode() {
4835
      return 0;
4836
    }
4837
 
4838
    public int compareTo(trackCouponUsage_args other) {
4839
      if (!getClass().equals(other.getClass())) {
4840
        return getClass().getName().compareTo(other.getClass().getName());
4841
      }
4842
 
4843
      int lastComparison = 0;
4844
      trackCouponUsage_args typedOther = (trackCouponUsage_args)other;
4845
 
3430 rajveer 4846
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
1982 varun.gupt 4847
      if (lastComparison != 0) {
4848
        return lastComparison;
4849
      }
3430 rajveer 4850
      if (isSetCouponCode()) {
4851
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
4852
        if (lastComparison != 0) {
4853
          return lastComparison;
4854
        }
1982 varun.gupt 4855
      }
3430 rajveer 4856
      lastComparison = Boolean.valueOf(isSetTransactionId()).compareTo(typedOther.isSetTransactionId());
1982 varun.gupt 4857
      if (lastComparison != 0) {
4858
        return lastComparison;
4859
      }
3430 rajveer 4860
      if (isSetTransactionId()) {
4861
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.transactionId, typedOther.transactionId);
4862
        if (lastComparison != 0) {
4863
          return lastComparison;
4864
        }
1982 varun.gupt 4865
      }
3430 rajveer 4866
      lastComparison = Boolean.valueOf(isSetUserId()).compareTo(typedOther.isSetUserId());
1982 varun.gupt 4867
      if (lastComparison != 0) {
4868
        return lastComparison;
4869
      }
3430 rajveer 4870
      if (isSetUserId()) {
4871
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userId, typedOther.userId);
4872
        if (lastComparison != 0) {
4873
          return lastComparison;
4874
        }
1982 varun.gupt 4875
      }
4876
      return 0;
4877
    }
4878
 
3430 rajveer 4879
    public _Fields fieldForId(int fieldId) {
4880
      return _Fields.findByThriftId(fieldId);
4881
    }
4882
 
4883
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
4884
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 4885
      iprot.readStructBegin();
4886
      while (true)
4887
      {
4888
        field = iprot.readFieldBegin();
3430 rajveer 4889
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 4890
          break;
4891
        }
3430 rajveer 4892
        switch (field.id) {
4893
          case 1: // COUPON_CODE
4894
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
4895
              this.couponCode = iprot.readString();
4896
            } else { 
4897
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4898
            }
4899
            break;
4900
          case 2: // TRANSACTION_ID
4901
            if (field.type == org.apache.thrift.protocol.TType.I64) {
4902
              this.transactionId = iprot.readI64();
4903
              setTransactionIdIsSet(true);
4904
            } else { 
4905
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4906
            }
4907
            break;
4908
          case 3: // USER_ID
4909
            if (field.type == org.apache.thrift.protocol.TType.I64) {
4910
              this.userId = iprot.readI64();
4911
              setUserIdIsSet(true);
4912
            } else { 
4913
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4914
            }
4915
            break;
4916
          default:
4917
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 4918
        }
3430 rajveer 4919
        iprot.readFieldEnd();
1982 varun.gupt 4920
      }
4921
      iprot.readStructEnd();
4922
      validate();
4923
    }
4924
 
3430 rajveer 4925
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 4926
      validate();
4927
 
4928
      oprot.writeStructBegin(STRUCT_DESC);
4929
      if (this.couponCode != null) {
4930
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
4931
        oprot.writeString(this.couponCode);
4932
        oprot.writeFieldEnd();
4933
      }
4934
      oprot.writeFieldBegin(TRANSACTION_ID_FIELD_DESC);
4935
      oprot.writeI64(this.transactionId);
4936
      oprot.writeFieldEnd();
4937
      oprot.writeFieldBegin(USER_ID_FIELD_DESC);
4938
      oprot.writeI64(this.userId);
4939
      oprot.writeFieldEnd();
4940
      oprot.writeFieldStop();
4941
      oprot.writeStructEnd();
4942
    }
4943
 
4944
    @Override
4945
    public String toString() {
4946
      StringBuilder sb = new StringBuilder("trackCouponUsage_args(");
4947
      boolean first = true;
4948
 
4949
      sb.append("couponCode:");
4950
      if (this.couponCode == null) {
4951
        sb.append("null");
4952
      } else {
4953
        sb.append(this.couponCode);
4954
      }
4955
      first = false;
4956
      if (!first) sb.append(", ");
4957
      sb.append("transactionId:");
4958
      sb.append(this.transactionId);
4959
      first = false;
4960
      if (!first) sb.append(", ");
4961
      sb.append("userId:");
4962
      sb.append(this.userId);
4963
      first = false;
4964
      sb.append(")");
4965
      return sb.toString();
4966
    }
4967
 
3430 rajveer 4968
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 4969
      // check for required fields
4970
    }
4971
 
3430 rajveer 4972
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
4973
      try {
4974
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
4975
      } catch (org.apache.thrift.TException te) {
4976
        throw new java.io.IOException(te);
4977
      }
4978
    }
4979
 
4980
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
4981
      try {
4982
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
4983
        __isset_bit_vector = new BitSet(1);
4984
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
4985
      } catch (org.apache.thrift.TException te) {
4986
        throw new java.io.IOException(te);
4987
      }
4988
    }
4989
 
1982 varun.gupt 4990
  }
4991
 
3430 rajveer 4992
  public static class trackCouponUsage_result implements org.apache.thrift.TBase<trackCouponUsage_result, trackCouponUsage_result._Fields>, java.io.Serializable, Cloneable   {
4993
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("trackCouponUsage_result");
1982 varun.gupt 4994
 
3430 rajveer 4995
    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);
1982 varun.gupt 4996
 
3430 rajveer 4997
    private PromotionException pex; // required
1982 varun.gupt 4998
 
4999
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 5000
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 5001
      PEX((short)1, "pex");
5002
 
5003
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
5004
 
5005
      static {
5006
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
5007
          byName.put(field.getFieldName(), field);
5008
        }
5009
      }
5010
 
5011
      /**
5012
       * Find the _Fields constant that matches fieldId, or null if its not found.
5013
       */
5014
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 5015
        switch(fieldId) {
5016
          case 1: // PEX
5017
            return PEX;
5018
          default:
5019
            return null;
5020
        }
1982 varun.gupt 5021
      }
5022
 
5023
      /**
5024
       * Find the _Fields constant that matches fieldId, throwing an exception
5025
       * if it is not found.
5026
       */
5027
      public static _Fields findByThriftIdOrThrow(int fieldId) {
5028
        _Fields fields = findByThriftId(fieldId);
5029
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
5030
        return fields;
5031
      }
5032
 
5033
      /**
5034
       * Find the _Fields constant that matches name, or null if its not found.
5035
       */
5036
      public static _Fields findByName(String name) {
5037
        return byName.get(name);
5038
      }
5039
 
5040
      private final short _thriftId;
5041
      private final String _fieldName;
5042
 
5043
      _Fields(short thriftId, String fieldName) {
5044
        _thriftId = thriftId;
5045
        _fieldName = fieldName;
5046
      }
5047
 
5048
      public short getThriftFieldId() {
5049
        return _thriftId;
5050
      }
5051
 
5052
      public String getFieldName() {
5053
        return _fieldName;
5054
      }
5055
    }
5056
 
5057
    // isset id assignments
5058
 
3430 rajveer 5059
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 5060
    static {
3430 rajveer 5061
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
5062
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
5063
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
5064
      metaDataMap = Collections.unmodifiableMap(tmpMap);
5065
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(trackCouponUsage_result.class, metaDataMap);
1982 varun.gupt 5066
    }
5067
 
5068
    public trackCouponUsage_result() {
5069
    }
5070
 
5071
    public trackCouponUsage_result(
5072
      PromotionException pex)
5073
    {
5074
      this();
5075
      this.pex = pex;
5076
    }
5077
 
5078
    /**
5079
     * Performs a deep copy on <i>other</i>.
5080
     */
5081
    public trackCouponUsage_result(trackCouponUsage_result other) {
5082
      if (other.isSetPex()) {
5083
        this.pex = new PromotionException(other.pex);
5084
      }
5085
    }
5086
 
5087
    public trackCouponUsage_result deepCopy() {
5088
      return new trackCouponUsage_result(this);
5089
    }
5090
 
3430 rajveer 5091
    @Override
5092
    public void clear() {
5093
      this.pex = null;
1982 varun.gupt 5094
    }
5095
 
5096
    public PromotionException getPex() {
5097
      return this.pex;
5098
    }
5099
 
3430 rajveer 5100
    public void setPex(PromotionException pex) {
1982 varun.gupt 5101
      this.pex = pex;
5102
    }
5103
 
5104
    public void unsetPex() {
5105
      this.pex = null;
5106
    }
5107
 
3430 rajveer 5108
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 5109
    public boolean isSetPex() {
5110
      return this.pex != null;
5111
    }
5112
 
5113
    public void setPexIsSet(boolean value) {
5114
      if (!value) {
5115
        this.pex = null;
5116
      }
5117
    }
5118
 
5119
    public void setFieldValue(_Fields field, Object value) {
5120
      switch (field) {
5121
      case PEX:
5122
        if (value == null) {
5123
          unsetPex();
5124
        } else {
5125
          setPex((PromotionException)value);
5126
        }
5127
        break;
5128
 
5129
      }
5130
    }
5131
 
5132
    public Object getFieldValue(_Fields field) {
5133
      switch (field) {
5134
      case PEX:
5135
        return getPex();
5136
 
5137
      }
5138
      throw new IllegalStateException();
5139
    }
5140
 
3430 rajveer 5141
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
5142
    public boolean isSet(_Fields field) {
5143
      if (field == null) {
5144
        throw new IllegalArgumentException();
5145
      }
1982 varun.gupt 5146
 
5147
      switch (field) {
5148
      case PEX:
5149
        return isSetPex();
5150
      }
5151
      throw new IllegalStateException();
5152
    }
5153
 
5154
    @Override
5155
    public boolean equals(Object that) {
5156
      if (that == null)
5157
        return false;
5158
      if (that instanceof trackCouponUsage_result)
5159
        return this.equals((trackCouponUsage_result)that);
5160
      return false;
5161
    }
5162
 
5163
    public boolean equals(trackCouponUsage_result that) {
5164
      if (that == null)
5165
        return false;
5166
 
5167
      boolean this_present_pex = true && this.isSetPex();
5168
      boolean that_present_pex = true && that.isSetPex();
5169
      if (this_present_pex || that_present_pex) {
5170
        if (!(this_present_pex && that_present_pex))
5171
          return false;
5172
        if (!this.pex.equals(that.pex))
5173
          return false;
5174
      }
5175
 
5176
      return true;
5177
    }
5178
 
5179
    @Override
5180
    public int hashCode() {
5181
      return 0;
5182
    }
5183
 
5184
    public int compareTo(trackCouponUsage_result other) {
5185
      if (!getClass().equals(other.getClass())) {
5186
        return getClass().getName().compareTo(other.getClass().getName());
5187
      }
5188
 
5189
      int lastComparison = 0;
5190
      trackCouponUsage_result typedOther = (trackCouponUsage_result)other;
5191
 
3430 rajveer 5192
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 5193
      if (lastComparison != 0) {
5194
        return lastComparison;
5195
      }
3430 rajveer 5196
      if (isSetPex()) {
5197
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
5198
        if (lastComparison != 0) {
5199
          return lastComparison;
5200
        }
1982 varun.gupt 5201
      }
5202
      return 0;
5203
    }
5204
 
3430 rajveer 5205
    public _Fields fieldForId(int fieldId) {
5206
      return _Fields.findByThriftId(fieldId);
5207
    }
5208
 
5209
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
5210
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 5211
      iprot.readStructBegin();
5212
      while (true)
5213
      {
5214
        field = iprot.readFieldBegin();
3430 rajveer 5215
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 5216
          break;
5217
        }
3430 rajveer 5218
        switch (field.id) {
5219
          case 1: // PEX
5220
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
5221
              this.pex = new PromotionException();
5222
              this.pex.read(iprot);
5223
            } else { 
5224
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5225
            }
5226
            break;
5227
          default:
5228
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 5229
        }
3430 rajveer 5230
        iprot.readFieldEnd();
1982 varun.gupt 5231
      }
5232
      iprot.readStructEnd();
5233
      validate();
5234
    }
5235
 
3430 rajveer 5236
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 5237
      oprot.writeStructBegin(STRUCT_DESC);
5238
 
5239
      if (this.isSetPex()) {
5240
        oprot.writeFieldBegin(PEX_FIELD_DESC);
5241
        this.pex.write(oprot);
5242
        oprot.writeFieldEnd();
5243
      }
5244
      oprot.writeFieldStop();
5245
      oprot.writeStructEnd();
5246
    }
5247
 
5248
    @Override
5249
    public String toString() {
5250
      StringBuilder sb = new StringBuilder("trackCouponUsage_result(");
5251
      boolean first = true;
5252
 
5253
      sb.append("pex:");
5254
      if (this.pex == null) {
5255
        sb.append("null");
5256
      } else {
5257
        sb.append(this.pex);
5258
      }
5259
      first = false;
5260
      sb.append(")");
5261
      return sb.toString();
5262
    }
5263
 
3430 rajveer 5264
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 5265
      // check for required fields
5266
    }
5267
 
3430 rajveer 5268
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
5269
      try {
5270
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
5271
      } catch (org.apache.thrift.TException te) {
5272
        throw new java.io.IOException(te);
5273
      }
5274
    }
5275
 
5276
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
5277
      try {
5278
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
5279
      } catch (org.apache.thrift.TException te) {
5280
        throw new java.io.IOException(te);
5281
      }
5282
    }
5283
 
1982 varun.gupt 5284
  }
5285
 
3430 rajveer 5286
  public static class getCouponUsageCountByUser_args implements org.apache.thrift.TBase<getCouponUsageCountByUser_args, getCouponUsageCountByUser_args._Fields>, java.io.Serializable, Cloneable   {
5287
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getCouponUsageCountByUser_args");
1982 varun.gupt 5288
 
3430 rajveer 5289
    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);
5290
    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)2);
1982 varun.gupt 5291
 
3430 rajveer 5292
    private String couponCode; // required
5293
    private long userId; // required
1982 varun.gupt 5294
 
5295
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 5296
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 5297
      COUPON_CODE((short)1, "couponCode"),
5298
      USER_ID((short)2, "userId");
5299
 
5300
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
5301
 
5302
      static {
5303
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
5304
          byName.put(field.getFieldName(), field);
5305
        }
5306
      }
5307
 
5308
      /**
5309
       * Find the _Fields constant that matches fieldId, or null if its not found.
5310
       */
5311
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 5312
        switch(fieldId) {
5313
          case 1: // COUPON_CODE
5314
            return COUPON_CODE;
5315
          case 2: // USER_ID
5316
            return USER_ID;
5317
          default:
5318
            return null;
5319
        }
1982 varun.gupt 5320
      }
5321
 
5322
      /**
5323
       * Find the _Fields constant that matches fieldId, throwing an exception
5324
       * if it is not found.
5325
       */
5326
      public static _Fields findByThriftIdOrThrow(int fieldId) {
5327
        _Fields fields = findByThriftId(fieldId);
5328
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
5329
        return fields;
5330
      }
5331
 
5332
      /**
5333
       * Find the _Fields constant that matches name, or null if its not found.
5334
       */
5335
      public static _Fields findByName(String name) {
5336
        return byName.get(name);
5337
      }
5338
 
5339
      private final short _thriftId;
5340
      private final String _fieldName;
5341
 
5342
      _Fields(short thriftId, String fieldName) {
5343
        _thriftId = thriftId;
5344
        _fieldName = fieldName;
5345
      }
5346
 
5347
      public short getThriftFieldId() {
5348
        return _thriftId;
5349
      }
5350
 
5351
      public String getFieldName() {
5352
        return _fieldName;
5353
      }
5354
    }
5355
 
5356
    // isset id assignments
5357
    private static final int __USERID_ISSET_ID = 0;
5358
    private BitSet __isset_bit_vector = new BitSet(1);
5359
 
3430 rajveer 5360
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 5361
    static {
3430 rajveer 5362
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
5363
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
5364
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
5365
      tmpMap.put(_Fields.USER_ID, new org.apache.thrift.meta_data.FieldMetaData("userId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
5366
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
5367
      metaDataMap = Collections.unmodifiableMap(tmpMap);
5368
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCouponUsageCountByUser_args.class, metaDataMap);
1982 varun.gupt 5369
    }
5370
 
5371
    public getCouponUsageCountByUser_args() {
5372
    }
5373
 
5374
    public getCouponUsageCountByUser_args(
5375
      String couponCode,
5376
      long userId)
5377
    {
5378
      this();
5379
      this.couponCode = couponCode;
5380
      this.userId = userId;
5381
      setUserIdIsSet(true);
5382
    }
5383
 
5384
    /**
5385
     * Performs a deep copy on <i>other</i>.
5386
     */
5387
    public getCouponUsageCountByUser_args(getCouponUsageCountByUser_args other) {
5388
      __isset_bit_vector.clear();
5389
      __isset_bit_vector.or(other.__isset_bit_vector);
5390
      if (other.isSetCouponCode()) {
5391
        this.couponCode = other.couponCode;
5392
      }
5393
      this.userId = other.userId;
5394
    }
5395
 
5396
    public getCouponUsageCountByUser_args deepCopy() {
5397
      return new getCouponUsageCountByUser_args(this);
5398
    }
5399
 
3430 rajveer 5400
    @Override
5401
    public void clear() {
5402
      this.couponCode = null;
5403
      setUserIdIsSet(false);
5404
      this.userId = 0;
1982 varun.gupt 5405
    }
5406
 
5407
    public String getCouponCode() {
5408
      return this.couponCode;
5409
    }
5410
 
3430 rajveer 5411
    public void setCouponCode(String couponCode) {
1982 varun.gupt 5412
      this.couponCode = couponCode;
5413
    }
5414
 
5415
    public void unsetCouponCode() {
5416
      this.couponCode = null;
5417
    }
5418
 
3430 rajveer 5419
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
1982 varun.gupt 5420
    public boolean isSetCouponCode() {
5421
      return this.couponCode != null;
5422
    }
5423
 
5424
    public void setCouponCodeIsSet(boolean value) {
5425
      if (!value) {
5426
        this.couponCode = null;
5427
      }
5428
    }
5429
 
5430
    public long getUserId() {
5431
      return this.userId;
5432
    }
5433
 
3430 rajveer 5434
    public void setUserId(long userId) {
1982 varun.gupt 5435
      this.userId = userId;
5436
      setUserIdIsSet(true);
5437
    }
5438
 
5439
    public void unsetUserId() {
5440
      __isset_bit_vector.clear(__USERID_ISSET_ID);
5441
    }
5442
 
3430 rajveer 5443
    /** Returns true if field userId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 5444
    public boolean isSetUserId() {
5445
      return __isset_bit_vector.get(__USERID_ISSET_ID);
5446
    }
5447
 
5448
    public void setUserIdIsSet(boolean value) {
5449
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
5450
    }
5451
 
5452
    public void setFieldValue(_Fields field, Object value) {
5453
      switch (field) {
5454
      case COUPON_CODE:
5455
        if (value == null) {
5456
          unsetCouponCode();
5457
        } else {
5458
          setCouponCode((String)value);
5459
        }
5460
        break;
5461
 
5462
      case USER_ID:
5463
        if (value == null) {
5464
          unsetUserId();
5465
        } else {
5466
          setUserId((Long)value);
5467
        }
5468
        break;
5469
 
5470
      }
5471
    }
5472
 
5473
    public Object getFieldValue(_Fields field) {
5474
      switch (field) {
5475
      case COUPON_CODE:
5476
        return getCouponCode();
5477
 
5478
      case USER_ID:
3430 rajveer 5479
        return Long.valueOf(getUserId());
1982 varun.gupt 5480
 
5481
      }
5482
      throw new IllegalStateException();
5483
    }
5484
 
3430 rajveer 5485
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
5486
    public boolean isSet(_Fields field) {
5487
      if (field == null) {
5488
        throw new IllegalArgumentException();
5489
      }
1982 varun.gupt 5490
 
5491
      switch (field) {
5492
      case COUPON_CODE:
5493
        return isSetCouponCode();
5494
      case USER_ID:
5495
        return isSetUserId();
5496
      }
5497
      throw new IllegalStateException();
5498
    }
5499
 
5500
    @Override
5501
    public boolean equals(Object that) {
5502
      if (that == null)
5503
        return false;
5504
      if (that instanceof getCouponUsageCountByUser_args)
5505
        return this.equals((getCouponUsageCountByUser_args)that);
5506
      return false;
5507
    }
5508
 
5509
    public boolean equals(getCouponUsageCountByUser_args that) {
5510
      if (that == null)
5511
        return false;
5512
 
5513
      boolean this_present_couponCode = true && this.isSetCouponCode();
5514
      boolean that_present_couponCode = true && that.isSetCouponCode();
5515
      if (this_present_couponCode || that_present_couponCode) {
5516
        if (!(this_present_couponCode && that_present_couponCode))
5517
          return false;
5518
        if (!this.couponCode.equals(that.couponCode))
5519
          return false;
5520
      }
5521
 
5522
      boolean this_present_userId = true;
5523
      boolean that_present_userId = true;
5524
      if (this_present_userId || that_present_userId) {
5525
        if (!(this_present_userId && that_present_userId))
5526
          return false;
5527
        if (this.userId != that.userId)
5528
          return false;
5529
      }
5530
 
5531
      return true;
5532
    }
5533
 
5534
    @Override
5535
    public int hashCode() {
5536
      return 0;
5537
    }
5538
 
5539
    public int compareTo(getCouponUsageCountByUser_args other) {
5540
      if (!getClass().equals(other.getClass())) {
5541
        return getClass().getName().compareTo(other.getClass().getName());
5542
      }
5543
 
5544
      int lastComparison = 0;
5545
      getCouponUsageCountByUser_args typedOther = (getCouponUsageCountByUser_args)other;
5546
 
3430 rajveer 5547
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
1982 varun.gupt 5548
      if (lastComparison != 0) {
5549
        return lastComparison;
5550
      }
3430 rajveer 5551
      if (isSetCouponCode()) {
5552
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
5553
        if (lastComparison != 0) {
5554
          return lastComparison;
5555
        }
1982 varun.gupt 5556
      }
3430 rajveer 5557
      lastComparison = Boolean.valueOf(isSetUserId()).compareTo(typedOther.isSetUserId());
1982 varun.gupt 5558
      if (lastComparison != 0) {
5559
        return lastComparison;
5560
      }
3430 rajveer 5561
      if (isSetUserId()) {
5562
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userId, typedOther.userId);
5563
        if (lastComparison != 0) {
5564
          return lastComparison;
5565
        }
1982 varun.gupt 5566
      }
5567
      return 0;
5568
    }
5569
 
3430 rajveer 5570
    public _Fields fieldForId(int fieldId) {
5571
      return _Fields.findByThriftId(fieldId);
5572
    }
5573
 
5574
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
5575
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 5576
      iprot.readStructBegin();
5577
      while (true)
5578
      {
5579
        field = iprot.readFieldBegin();
3430 rajveer 5580
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 5581
          break;
5582
        }
3430 rajveer 5583
        switch (field.id) {
5584
          case 1: // COUPON_CODE
5585
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
5586
              this.couponCode = iprot.readString();
5587
            } else { 
5588
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5589
            }
5590
            break;
5591
          case 2: // USER_ID
5592
            if (field.type == org.apache.thrift.protocol.TType.I64) {
5593
              this.userId = iprot.readI64();
5594
              setUserIdIsSet(true);
5595
            } else { 
5596
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5597
            }
5598
            break;
5599
          default:
5600
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 5601
        }
3430 rajveer 5602
        iprot.readFieldEnd();
1982 varun.gupt 5603
      }
5604
      iprot.readStructEnd();
5605
      validate();
5606
    }
5607
 
3430 rajveer 5608
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 5609
      validate();
5610
 
5611
      oprot.writeStructBegin(STRUCT_DESC);
5612
      if (this.couponCode != null) {
5613
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
5614
        oprot.writeString(this.couponCode);
5615
        oprot.writeFieldEnd();
5616
      }
5617
      oprot.writeFieldBegin(USER_ID_FIELD_DESC);
5618
      oprot.writeI64(this.userId);
5619
      oprot.writeFieldEnd();
5620
      oprot.writeFieldStop();
5621
      oprot.writeStructEnd();
5622
    }
5623
 
5624
    @Override
5625
    public String toString() {
5626
      StringBuilder sb = new StringBuilder("getCouponUsageCountByUser_args(");
5627
      boolean first = true;
5628
 
5629
      sb.append("couponCode:");
5630
      if (this.couponCode == null) {
5631
        sb.append("null");
5632
      } else {
5633
        sb.append(this.couponCode);
5634
      }
5635
      first = false;
5636
      if (!first) sb.append(", ");
5637
      sb.append("userId:");
5638
      sb.append(this.userId);
5639
      first = false;
5640
      sb.append(")");
5641
      return sb.toString();
5642
    }
5643
 
3430 rajveer 5644
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 5645
      // check for required fields
5646
    }
5647
 
3430 rajveer 5648
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
5649
      try {
5650
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
5651
      } catch (org.apache.thrift.TException te) {
5652
        throw new java.io.IOException(te);
5653
      }
5654
    }
5655
 
5656
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
5657
      try {
5658
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
5659
        __isset_bit_vector = new BitSet(1);
5660
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
5661
      } catch (org.apache.thrift.TException te) {
5662
        throw new java.io.IOException(te);
5663
      }
5664
    }
5665
 
1982 varun.gupt 5666
  }
5667
 
3430 rajveer 5668
  public static class getCouponUsageCountByUser_result implements org.apache.thrift.TBase<getCouponUsageCountByUser_result, getCouponUsageCountByUser_result._Fields>, java.io.Serializable, Cloneable   {
5669
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getCouponUsageCountByUser_result");
1982 varun.gupt 5670
 
3430 rajveer 5671
    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);
5672
    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);
1982 varun.gupt 5673
 
3430 rajveer 5674
    private long success; // required
5675
    private PromotionException pex; // required
1982 varun.gupt 5676
 
5677
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 5678
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 5679
      SUCCESS((short)0, "success"),
5680
      PEX((short)1, "pex");
5681
 
5682
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
5683
 
5684
      static {
5685
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
5686
          byName.put(field.getFieldName(), field);
5687
        }
5688
      }
5689
 
5690
      /**
5691
       * Find the _Fields constant that matches fieldId, or null if its not found.
5692
       */
5693
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 5694
        switch(fieldId) {
5695
          case 0: // SUCCESS
5696
            return SUCCESS;
5697
          case 1: // PEX
5698
            return PEX;
5699
          default:
5700
            return null;
5701
        }
1982 varun.gupt 5702
      }
5703
 
5704
      /**
5705
       * Find the _Fields constant that matches fieldId, throwing an exception
5706
       * if it is not found.
5707
       */
5708
      public static _Fields findByThriftIdOrThrow(int fieldId) {
5709
        _Fields fields = findByThriftId(fieldId);
5710
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
5711
        return fields;
5712
      }
5713
 
5714
      /**
5715
       * Find the _Fields constant that matches name, or null if its not found.
5716
       */
5717
      public static _Fields findByName(String name) {
5718
        return byName.get(name);
5719
      }
5720
 
5721
      private final short _thriftId;
5722
      private final String _fieldName;
5723
 
5724
      _Fields(short thriftId, String fieldName) {
5725
        _thriftId = thriftId;
5726
        _fieldName = fieldName;
5727
      }
5728
 
5729
      public short getThriftFieldId() {
5730
        return _thriftId;
5731
      }
5732
 
5733
      public String getFieldName() {
5734
        return _fieldName;
5735
      }
5736
    }
5737
 
5738
    // isset id assignments
5739
    private static final int __SUCCESS_ISSET_ID = 0;
5740
    private BitSet __isset_bit_vector = new BitSet(1);
5741
 
3430 rajveer 5742
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 5743
    static {
3430 rajveer 5744
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
5745
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
5746
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
5747
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
5748
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
5749
      metaDataMap = Collections.unmodifiableMap(tmpMap);
5750
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCouponUsageCountByUser_result.class, metaDataMap);
1982 varun.gupt 5751
    }
5752
 
5753
    public getCouponUsageCountByUser_result() {
5754
    }
5755
 
5756
    public getCouponUsageCountByUser_result(
5757
      long success,
5758
      PromotionException pex)
5759
    {
5760
      this();
5761
      this.success = success;
5762
      setSuccessIsSet(true);
5763
      this.pex = pex;
5764
    }
5765
 
5766
    /**
5767
     * Performs a deep copy on <i>other</i>.
5768
     */
5769
    public getCouponUsageCountByUser_result(getCouponUsageCountByUser_result other) {
5770
      __isset_bit_vector.clear();
5771
      __isset_bit_vector.or(other.__isset_bit_vector);
5772
      this.success = other.success;
5773
      if (other.isSetPex()) {
5774
        this.pex = new PromotionException(other.pex);
5775
      }
5776
    }
5777
 
5778
    public getCouponUsageCountByUser_result deepCopy() {
5779
      return new getCouponUsageCountByUser_result(this);
5780
    }
5781
 
3430 rajveer 5782
    @Override
5783
    public void clear() {
5784
      setSuccessIsSet(false);
5785
      this.success = 0;
5786
      this.pex = null;
1982 varun.gupt 5787
    }
5788
 
5789
    public long getSuccess() {
5790
      return this.success;
5791
    }
5792
 
3430 rajveer 5793
    public void setSuccess(long success) {
1982 varun.gupt 5794
      this.success = success;
5795
      setSuccessIsSet(true);
5796
    }
5797
 
5798
    public void unsetSuccess() {
5799
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
5800
    }
5801
 
3430 rajveer 5802
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
1982 varun.gupt 5803
    public boolean isSetSuccess() {
5804
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
5805
    }
5806
 
5807
    public void setSuccessIsSet(boolean value) {
5808
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
5809
    }
5810
 
5811
    public PromotionException getPex() {
5812
      return this.pex;
5813
    }
5814
 
3430 rajveer 5815
    public void setPex(PromotionException pex) {
1982 varun.gupt 5816
      this.pex = pex;
5817
    }
5818
 
5819
    public void unsetPex() {
5820
      this.pex = null;
5821
    }
5822
 
3430 rajveer 5823
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 5824
    public boolean isSetPex() {
5825
      return this.pex != null;
5826
    }
5827
 
5828
    public void setPexIsSet(boolean value) {
5829
      if (!value) {
5830
        this.pex = null;
5831
      }
5832
    }
5833
 
5834
    public void setFieldValue(_Fields field, Object value) {
5835
      switch (field) {
5836
      case SUCCESS:
5837
        if (value == null) {
5838
          unsetSuccess();
5839
        } else {
5840
          setSuccess((Long)value);
5841
        }
5842
        break;
5843
 
5844
      case PEX:
5845
        if (value == null) {
5846
          unsetPex();
5847
        } else {
5848
          setPex((PromotionException)value);
5849
        }
5850
        break;
5851
 
5852
      }
5853
    }
5854
 
5855
    public Object getFieldValue(_Fields field) {
5856
      switch (field) {
5857
      case SUCCESS:
3430 rajveer 5858
        return Long.valueOf(getSuccess());
1982 varun.gupt 5859
 
5860
      case PEX:
5861
        return getPex();
5862
 
5863
      }
5864
      throw new IllegalStateException();
5865
    }
5866
 
3430 rajveer 5867
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
5868
    public boolean isSet(_Fields field) {
5869
      if (field == null) {
5870
        throw new IllegalArgumentException();
5871
      }
1982 varun.gupt 5872
 
5873
      switch (field) {
5874
      case SUCCESS:
5875
        return isSetSuccess();
5876
      case PEX:
5877
        return isSetPex();
5878
      }
5879
      throw new IllegalStateException();
5880
    }
5881
 
5882
    @Override
5883
    public boolean equals(Object that) {
5884
      if (that == null)
5885
        return false;
5886
      if (that instanceof getCouponUsageCountByUser_result)
5887
        return this.equals((getCouponUsageCountByUser_result)that);
5888
      return false;
5889
    }
5890
 
5891
    public boolean equals(getCouponUsageCountByUser_result that) {
5892
      if (that == null)
5893
        return false;
5894
 
5895
      boolean this_present_success = true;
5896
      boolean that_present_success = true;
5897
      if (this_present_success || that_present_success) {
5898
        if (!(this_present_success && that_present_success))
5899
          return false;
5900
        if (this.success != that.success)
5901
          return false;
5902
      }
5903
 
5904
      boolean this_present_pex = true && this.isSetPex();
5905
      boolean that_present_pex = true && that.isSetPex();
5906
      if (this_present_pex || that_present_pex) {
5907
        if (!(this_present_pex && that_present_pex))
5908
          return false;
5909
        if (!this.pex.equals(that.pex))
5910
          return false;
5911
      }
5912
 
5913
      return true;
5914
    }
5915
 
5916
    @Override
5917
    public int hashCode() {
5918
      return 0;
5919
    }
5920
 
5921
    public int compareTo(getCouponUsageCountByUser_result other) {
5922
      if (!getClass().equals(other.getClass())) {
5923
        return getClass().getName().compareTo(other.getClass().getName());
5924
      }
5925
 
5926
      int lastComparison = 0;
5927
      getCouponUsageCountByUser_result typedOther = (getCouponUsageCountByUser_result)other;
5928
 
3430 rajveer 5929
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
1982 varun.gupt 5930
      if (lastComparison != 0) {
5931
        return lastComparison;
5932
      }
3430 rajveer 5933
      if (isSetSuccess()) {
5934
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
5935
        if (lastComparison != 0) {
5936
          return lastComparison;
5937
        }
1982 varun.gupt 5938
      }
3430 rajveer 5939
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 5940
      if (lastComparison != 0) {
5941
        return lastComparison;
5942
      }
3430 rajveer 5943
      if (isSetPex()) {
5944
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
5945
        if (lastComparison != 0) {
5946
          return lastComparison;
5947
        }
1982 varun.gupt 5948
      }
5949
      return 0;
5950
    }
5951
 
3430 rajveer 5952
    public _Fields fieldForId(int fieldId) {
5953
      return _Fields.findByThriftId(fieldId);
5954
    }
5955
 
5956
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
5957
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 5958
      iprot.readStructBegin();
5959
      while (true)
5960
      {
5961
        field = iprot.readFieldBegin();
3430 rajveer 5962
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 5963
          break;
5964
        }
3430 rajveer 5965
        switch (field.id) {
5966
          case 0: // SUCCESS
5967
            if (field.type == org.apache.thrift.protocol.TType.I64) {
5968
              this.success = iprot.readI64();
5969
              setSuccessIsSet(true);
5970
            } else { 
5971
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5972
            }
5973
            break;
5974
          case 1: // PEX
5975
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
5976
              this.pex = new PromotionException();
5977
              this.pex.read(iprot);
5978
            } else { 
5979
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5980
            }
5981
            break;
5982
          default:
5983
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 5984
        }
3430 rajveer 5985
        iprot.readFieldEnd();
1982 varun.gupt 5986
      }
5987
      iprot.readStructEnd();
5988
      validate();
5989
    }
5990
 
3430 rajveer 5991
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 5992
      oprot.writeStructBegin(STRUCT_DESC);
5993
 
5994
      if (this.isSetSuccess()) {
5995
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
5996
        oprot.writeI64(this.success);
5997
        oprot.writeFieldEnd();
5998
      } else if (this.isSetPex()) {
5999
        oprot.writeFieldBegin(PEX_FIELD_DESC);
6000
        this.pex.write(oprot);
6001
        oprot.writeFieldEnd();
6002
      }
6003
      oprot.writeFieldStop();
6004
      oprot.writeStructEnd();
6005
    }
6006
 
6007
    @Override
6008
    public String toString() {
6009
      StringBuilder sb = new StringBuilder("getCouponUsageCountByUser_result(");
6010
      boolean first = true;
6011
 
6012
      sb.append("success:");
6013
      sb.append(this.success);
6014
      first = false;
6015
      if (!first) sb.append(", ");
6016
      sb.append("pex:");
6017
      if (this.pex == null) {
6018
        sb.append("null");
6019
      } else {
6020
        sb.append(this.pex);
6021
      }
6022
      first = false;
6023
      sb.append(")");
6024
      return sb.toString();
6025
    }
6026
 
3430 rajveer 6027
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 6028
      // check for required fields
6029
    }
6030
 
3430 rajveer 6031
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
6032
      try {
6033
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
6034
      } catch (org.apache.thrift.TException te) {
6035
        throw new java.io.IOException(te);
6036
      }
6037
    }
6038
 
6039
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
6040
      try {
6041
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
6042
      } catch (org.apache.thrift.TException te) {
6043
        throw new java.io.IOException(te);
6044
      }
6045
    }
6046
 
1982 varun.gupt 6047
  }
6048
 
3430 rajveer 6049
  public static class getActiveCoupons_args implements org.apache.thrift.TBase<getActiveCoupons_args, getActiveCoupons_args._Fields>, java.io.Serializable, Cloneable   {
6050
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getActiveCoupons_args");
3385 varun.gupt 6051
 
6052
 
6053
 
6054
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 6055
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 6056
;
6057
 
6058
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
6059
 
6060
      static {
6061
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
6062
          byName.put(field.getFieldName(), field);
6063
        }
6064
      }
6065
 
6066
      /**
6067
       * Find the _Fields constant that matches fieldId, or null if its not found.
6068
       */
6069
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 6070
        switch(fieldId) {
6071
          default:
6072
            return null;
6073
        }
3385 varun.gupt 6074
      }
6075
 
6076
      /**
6077
       * Find the _Fields constant that matches fieldId, throwing an exception
6078
       * if it is not found.
6079
       */
6080
      public static _Fields findByThriftIdOrThrow(int fieldId) {
6081
        _Fields fields = findByThriftId(fieldId);
6082
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
6083
        return fields;
6084
      }
6085
 
6086
      /**
6087
       * Find the _Fields constant that matches name, or null if its not found.
6088
       */
6089
      public static _Fields findByName(String name) {
6090
        return byName.get(name);
6091
      }
6092
 
6093
      private final short _thriftId;
6094
      private final String _fieldName;
6095
 
6096
      _Fields(short thriftId, String fieldName) {
6097
        _thriftId = thriftId;
6098
        _fieldName = fieldName;
6099
      }
6100
 
6101
      public short getThriftFieldId() {
6102
        return _thriftId;
6103
      }
6104
 
6105
      public String getFieldName() {
6106
        return _fieldName;
6107
      }
6108
    }
3430 rajveer 6109
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 6110
    static {
3430 rajveer 6111
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
6112
      metaDataMap = Collections.unmodifiableMap(tmpMap);
6113
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getActiveCoupons_args.class, metaDataMap);
3385 varun.gupt 6114
    }
6115
 
6116
    public getActiveCoupons_args() {
6117
    }
6118
 
6119
    /**
6120
     * Performs a deep copy on <i>other</i>.
6121
     */
6122
    public getActiveCoupons_args(getActiveCoupons_args other) {
6123
    }
6124
 
6125
    public getActiveCoupons_args deepCopy() {
6126
      return new getActiveCoupons_args(this);
6127
    }
6128
 
3430 rajveer 6129
    @Override
6130
    public void clear() {
3385 varun.gupt 6131
    }
6132
 
6133
    public void setFieldValue(_Fields field, Object value) {
6134
      switch (field) {
6135
      }
6136
    }
6137
 
6138
    public Object getFieldValue(_Fields field) {
6139
      switch (field) {
6140
      }
6141
      throw new IllegalStateException();
6142
    }
6143
 
3430 rajveer 6144
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
6145
    public boolean isSet(_Fields field) {
6146
      if (field == null) {
6147
        throw new IllegalArgumentException();
6148
      }
3385 varun.gupt 6149
 
6150
      switch (field) {
6151
      }
6152
      throw new IllegalStateException();
6153
    }
6154
 
6155
    @Override
6156
    public boolean equals(Object that) {
6157
      if (that == null)
6158
        return false;
6159
      if (that instanceof getActiveCoupons_args)
6160
        return this.equals((getActiveCoupons_args)that);
6161
      return false;
6162
    }
6163
 
6164
    public boolean equals(getActiveCoupons_args that) {
6165
      if (that == null)
6166
        return false;
6167
 
6168
      return true;
6169
    }
6170
 
6171
    @Override
6172
    public int hashCode() {
6173
      return 0;
6174
    }
6175
 
6176
    public int compareTo(getActiveCoupons_args other) {
6177
      if (!getClass().equals(other.getClass())) {
6178
        return getClass().getName().compareTo(other.getClass().getName());
6179
      }
6180
 
6181
      int lastComparison = 0;
6182
      getActiveCoupons_args typedOther = (getActiveCoupons_args)other;
6183
 
6184
      return 0;
6185
    }
6186
 
3430 rajveer 6187
    public _Fields fieldForId(int fieldId) {
6188
      return _Fields.findByThriftId(fieldId);
6189
    }
6190
 
6191
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
6192
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 6193
      iprot.readStructBegin();
6194
      while (true)
6195
      {
6196
        field = iprot.readFieldBegin();
3430 rajveer 6197
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 6198
          break;
6199
        }
3430 rajveer 6200
        switch (field.id) {
6201
          default:
6202
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 6203
        }
3430 rajveer 6204
        iprot.readFieldEnd();
3385 varun.gupt 6205
      }
6206
      iprot.readStructEnd();
6207
      validate();
6208
    }
6209
 
3430 rajveer 6210
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 6211
      validate();
6212
 
6213
      oprot.writeStructBegin(STRUCT_DESC);
6214
      oprot.writeFieldStop();
6215
      oprot.writeStructEnd();
6216
    }
6217
 
6218
    @Override
6219
    public String toString() {
6220
      StringBuilder sb = new StringBuilder("getActiveCoupons_args(");
6221
      boolean first = true;
6222
 
6223
      sb.append(")");
6224
      return sb.toString();
6225
    }
6226
 
3430 rajveer 6227
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 6228
      // check for required fields
6229
    }
6230
 
3430 rajveer 6231
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
6232
      try {
6233
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
6234
      } catch (org.apache.thrift.TException te) {
6235
        throw new java.io.IOException(te);
6236
      }
6237
    }
6238
 
6239
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
6240
      try {
6241
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
6242
      } catch (org.apache.thrift.TException te) {
6243
        throw new java.io.IOException(te);
6244
      }
6245
    }
6246
 
3385 varun.gupt 6247
  }
6248
 
3430 rajveer 6249
  public static class getActiveCoupons_result implements org.apache.thrift.TBase<getActiveCoupons_result, getActiveCoupons_result._Fields>, java.io.Serializable, Cloneable   {
6250
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getActiveCoupons_result");
3385 varun.gupt 6251
 
3430 rajveer 6252
    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0);
6253
    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);
3385 varun.gupt 6254
 
3430 rajveer 6255
    private List<Coupon> success; // required
6256
    private PromotionException pex; // required
3385 varun.gupt 6257
 
6258
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 6259
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 6260
      SUCCESS((short)0, "success"),
6261
      PEX((short)1, "pex");
6262
 
6263
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
6264
 
6265
      static {
6266
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
6267
          byName.put(field.getFieldName(), field);
6268
        }
6269
      }
6270
 
6271
      /**
6272
       * Find the _Fields constant that matches fieldId, or null if its not found.
6273
       */
6274
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 6275
        switch(fieldId) {
6276
          case 0: // SUCCESS
6277
            return SUCCESS;
6278
          case 1: // PEX
6279
            return PEX;
6280
          default:
6281
            return null;
6282
        }
3385 varun.gupt 6283
      }
6284
 
6285
      /**
6286
       * Find the _Fields constant that matches fieldId, throwing an exception
6287
       * if it is not found.
6288
       */
6289
      public static _Fields findByThriftIdOrThrow(int fieldId) {
6290
        _Fields fields = findByThriftId(fieldId);
6291
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
6292
        return fields;
6293
      }
6294
 
6295
      /**
6296
       * Find the _Fields constant that matches name, or null if its not found.
6297
       */
6298
      public static _Fields findByName(String name) {
6299
        return byName.get(name);
6300
      }
6301
 
6302
      private final short _thriftId;
6303
      private final String _fieldName;
6304
 
6305
      _Fields(short thriftId, String fieldName) {
6306
        _thriftId = thriftId;
6307
        _fieldName = fieldName;
6308
      }
6309
 
6310
      public short getThriftFieldId() {
6311
        return _thriftId;
6312
      }
6313
 
6314
      public String getFieldName() {
6315
        return _fieldName;
6316
      }
6317
    }
6318
 
6319
    // isset id assignments
6320
 
3430 rajveer 6321
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 6322
    static {
3430 rajveer 6323
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
6324
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
6325
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
6326
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Coupon.class))));
6327
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
6328
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
6329
      metaDataMap = Collections.unmodifiableMap(tmpMap);
6330
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getActiveCoupons_result.class, metaDataMap);
3385 varun.gupt 6331
    }
6332
 
6333
    public getActiveCoupons_result() {
6334
    }
6335
 
6336
    public getActiveCoupons_result(
6337
      List<Coupon> success,
6338
      PromotionException pex)
6339
    {
6340
      this();
6341
      this.success = success;
6342
      this.pex = pex;
6343
    }
6344
 
6345
    /**
6346
     * Performs a deep copy on <i>other</i>.
6347
     */
6348
    public getActiveCoupons_result(getActiveCoupons_result other) {
6349
      if (other.isSetSuccess()) {
6350
        List<Coupon> __this__success = new ArrayList<Coupon>();
6351
        for (Coupon other_element : other.success) {
6352
          __this__success.add(new Coupon(other_element));
6353
        }
6354
        this.success = __this__success;
6355
      }
6356
      if (other.isSetPex()) {
6357
        this.pex = new PromotionException(other.pex);
6358
      }
6359
    }
6360
 
6361
    public getActiveCoupons_result deepCopy() {
6362
      return new getActiveCoupons_result(this);
6363
    }
6364
 
3430 rajveer 6365
    @Override
6366
    public void clear() {
6367
      this.success = null;
6368
      this.pex = null;
3385 varun.gupt 6369
    }
6370
 
6371
    public int getSuccessSize() {
6372
      return (this.success == null) ? 0 : this.success.size();
6373
    }
6374
 
6375
    public java.util.Iterator<Coupon> getSuccessIterator() {
6376
      return (this.success == null) ? null : this.success.iterator();
6377
    }
6378
 
6379
    public void addToSuccess(Coupon elem) {
6380
      if (this.success == null) {
6381
        this.success = new ArrayList<Coupon>();
6382
      }
6383
      this.success.add(elem);
6384
    }
6385
 
6386
    public List<Coupon> getSuccess() {
6387
      return this.success;
6388
    }
6389
 
3430 rajveer 6390
    public void setSuccess(List<Coupon> success) {
3385 varun.gupt 6391
      this.success = success;
6392
    }
6393
 
6394
    public void unsetSuccess() {
6395
      this.success = null;
6396
    }
6397
 
3430 rajveer 6398
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
3385 varun.gupt 6399
    public boolean isSetSuccess() {
6400
      return this.success != null;
6401
    }
6402
 
6403
    public void setSuccessIsSet(boolean value) {
6404
      if (!value) {
6405
        this.success = null;
6406
      }
6407
    }
6408
 
6409
    public PromotionException getPex() {
6410
      return this.pex;
6411
    }
6412
 
3430 rajveer 6413
    public void setPex(PromotionException pex) {
3385 varun.gupt 6414
      this.pex = pex;
6415
    }
6416
 
6417
    public void unsetPex() {
6418
      this.pex = null;
6419
    }
6420
 
3430 rajveer 6421
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
3385 varun.gupt 6422
    public boolean isSetPex() {
6423
      return this.pex != null;
6424
    }
6425
 
6426
    public void setPexIsSet(boolean value) {
6427
      if (!value) {
6428
        this.pex = null;
6429
      }
6430
    }
6431
 
6432
    public void setFieldValue(_Fields field, Object value) {
6433
      switch (field) {
6434
      case SUCCESS:
6435
        if (value == null) {
6436
          unsetSuccess();
6437
        } else {
6438
          setSuccess((List<Coupon>)value);
6439
        }
6440
        break;
6441
 
6442
      case PEX:
6443
        if (value == null) {
6444
          unsetPex();
6445
        } else {
6446
          setPex((PromotionException)value);
6447
        }
6448
        break;
6449
 
6450
      }
6451
    }
6452
 
6453
    public Object getFieldValue(_Fields field) {
6454
      switch (field) {
6455
      case SUCCESS:
6456
        return getSuccess();
6457
 
6458
      case PEX:
6459
        return getPex();
6460
 
6461
      }
6462
      throw new IllegalStateException();
6463
    }
6464
 
3430 rajveer 6465
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
6466
    public boolean isSet(_Fields field) {
6467
      if (field == null) {
6468
        throw new IllegalArgumentException();
6469
      }
3385 varun.gupt 6470
 
6471
      switch (field) {
6472
      case SUCCESS:
6473
        return isSetSuccess();
6474
      case PEX:
6475
        return isSetPex();
6476
      }
6477
      throw new IllegalStateException();
6478
    }
6479
 
6480
    @Override
6481
    public boolean equals(Object that) {
6482
      if (that == null)
6483
        return false;
6484
      if (that instanceof getActiveCoupons_result)
6485
        return this.equals((getActiveCoupons_result)that);
6486
      return false;
6487
    }
6488
 
6489
    public boolean equals(getActiveCoupons_result that) {
6490
      if (that == null)
6491
        return false;
6492
 
6493
      boolean this_present_success = true && this.isSetSuccess();
6494
      boolean that_present_success = true && that.isSetSuccess();
6495
      if (this_present_success || that_present_success) {
6496
        if (!(this_present_success && that_present_success))
6497
          return false;
6498
        if (!this.success.equals(that.success))
6499
          return false;
6500
      }
6501
 
6502
      boolean this_present_pex = true && this.isSetPex();
6503
      boolean that_present_pex = true && that.isSetPex();
6504
      if (this_present_pex || that_present_pex) {
6505
        if (!(this_present_pex && that_present_pex))
6506
          return false;
6507
        if (!this.pex.equals(that.pex))
6508
          return false;
6509
      }
6510
 
6511
      return true;
6512
    }
6513
 
6514
    @Override
6515
    public int hashCode() {
6516
      return 0;
6517
    }
6518
 
6519
    public int compareTo(getActiveCoupons_result other) {
6520
      if (!getClass().equals(other.getClass())) {
6521
        return getClass().getName().compareTo(other.getClass().getName());
6522
      }
6523
 
6524
      int lastComparison = 0;
6525
      getActiveCoupons_result typedOther = (getActiveCoupons_result)other;
6526
 
3430 rajveer 6527
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
3385 varun.gupt 6528
      if (lastComparison != 0) {
6529
        return lastComparison;
6530
      }
3430 rajveer 6531
      if (isSetSuccess()) {
6532
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
6533
        if (lastComparison != 0) {
6534
          return lastComparison;
6535
        }
3385 varun.gupt 6536
      }
3430 rajveer 6537
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
3385 varun.gupt 6538
      if (lastComparison != 0) {
6539
        return lastComparison;
6540
      }
3430 rajveer 6541
      if (isSetPex()) {
6542
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
6543
        if (lastComparison != 0) {
6544
          return lastComparison;
6545
        }
3385 varun.gupt 6546
      }
6547
      return 0;
6548
    }
6549
 
3430 rajveer 6550
    public _Fields fieldForId(int fieldId) {
6551
      return _Fields.findByThriftId(fieldId);
6552
    }
6553
 
6554
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
6555
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 6556
      iprot.readStructBegin();
6557
      while (true)
6558
      {
6559
        field = iprot.readFieldBegin();
3430 rajveer 6560
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 6561
          break;
6562
        }
3430 rajveer 6563
        switch (field.id) {
6564
          case 0: // SUCCESS
6565
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
6566
              {
6567
                org.apache.thrift.protocol.TList _list16 = iprot.readListBegin();
6568
                this.success = new ArrayList<Coupon>(_list16.size);
6569
                for (int _i17 = 0; _i17 < _list16.size; ++_i17)
3385 varun.gupt 6570
                {
3430 rajveer 6571
                  Coupon _elem18; // required
6572
                  _elem18 = new Coupon();
6573
                  _elem18.read(iprot);
6574
                  this.success.add(_elem18);
3385 varun.gupt 6575
                }
3430 rajveer 6576
                iprot.readListEnd();
3385 varun.gupt 6577
              }
3430 rajveer 6578
            } else { 
6579
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6580
            }
6581
            break;
6582
          case 1: // PEX
6583
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
6584
              this.pex = new PromotionException();
6585
              this.pex.read(iprot);
6586
            } else { 
6587
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6588
            }
6589
            break;
6590
          default:
6591
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 6592
        }
3430 rajveer 6593
        iprot.readFieldEnd();
3385 varun.gupt 6594
      }
6595
      iprot.readStructEnd();
6596
      validate();
6597
    }
6598
 
3430 rajveer 6599
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 6600
      oprot.writeStructBegin(STRUCT_DESC);
6601
 
6602
      if (this.isSetSuccess()) {
6603
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
6604
        {
3430 rajveer 6605
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
3385 varun.gupt 6606
          for (Coupon _iter19 : this.success)
6607
          {
6608
            _iter19.write(oprot);
6609
          }
6610
          oprot.writeListEnd();
6611
        }
6612
        oprot.writeFieldEnd();
6613
      } else if (this.isSetPex()) {
6614
        oprot.writeFieldBegin(PEX_FIELD_DESC);
6615
        this.pex.write(oprot);
6616
        oprot.writeFieldEnd();
6617
      }
6618
      oprot.writeFieldStop();
6619
      oprot.writeStructEnd();
6620
    }
6621
 
6622
    @Override
6623
    public String toString() {
6624
      StringBuilder sb = new StringBuilder("getActiveCoupons_result(");
6625
      boolean first = true;
6626
 
6627
      sb.append("success:");
6628
      if (this.success == null) {
6629
        sb.append("null");
6630
      } else {
6631
        sb.append(this.success);
6632
      }
6633
      first = false;
6634
      if (!first) sb.append(", ");
6635
      sb.append("pex:");
6636
      if (this.pex == null) {
6637
        sb.append("null");
6638
      } else {
6639
        sb.append(this.pex);
6640
      }
6641
      first = false;
6642
      sb.append(")");
6643
      return sb.toString();
6644
    }
6645
 
3430 rajveer 6646
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 6647
      // check for required fields
6648
    }
6649
 
3430 rajveer 6650
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
6651
      try {
6652
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
6653
      } catch (org.apache.thrift.TException te) {
6654
        throw new java.io.IOException(te);
6655
      }
6656
    }
6657
 
6658
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
6659
      try {
6660
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
6661
      } catch (org.apache.thrift.TException te) {
6662
        throw new java.io.IOException(te);
6663
      }
6664
    }
6665
 
3385 varun.gupt 6666
  }
6667
 
3430 rajveer 6668
  public static class getSuccessfulPaymentCountForCoupon_args implements org.apache.thrift.TBase<getSuccessfulPaymentCountForCoupon_args, getSuccessfulPaymentCountForCoupon_args._Fields>, java.io.Serializable, Cloneable   {
6669
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getSuccessfulPaymentCountForCoupon_args");
3385 varun.gupt 6670
 
3430 rajveer 6671
    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);
3385 varun.gupt 6672
 
3430 rajveer 6673
    private String couponCode; // required
3385 varun.gupt 6674
 
6675
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 6676
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 6677
      COUPON_CODE((short)1, "couponCode");
6678
 
6679
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
6680
 
6681
      static {
6682
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
6683
          byName.put(field.getFieldName(), field);
6684
        }
6685
      }
6686
 
6687
      /**
6688
       * Find the _Fields constant that matches fieldId, or null if its not found.
6689
       */
6690
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 6691
        switch(fieldId) {
6692
          case 1: // COUPON_CODE
6693
            return COUPON_CODE;
6694
          default:
6695
            return null;
6696
        }
3385 varun.gupt 6697
      }
6698
 
6699
      /**
6700
       * Find the _Fields constant that matches fieldId, throwing an exception
6701
       * if it is not found.
6702
       */
6703
      public static _Fields findByThriftIdOrThrow(int fieldId) {
6704
        _Fields fields = findByThriftId(fieldId);
6705
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
6706
        return fields;
6707
      }
6708
 
6709
      /**
6710
       * Find the _Fields constant that matches name, or null if its not found.
6711
       */
6712
      public static _Fields findByName(String name) {
6713
        return byName.get(name);
6714
      }
6715
 
6716
      private final short _thriftId;
6717
      private final String _fieldName;
6718
 
6719
      _Fields(short thriftId, String fieldName) {
6720
        _thriftId = thriftId;
6721
        _fieldName = fieldName;
6722
      }
6723
 
6724
      public short getThriftFieldId() {
6725
        return _thriftId;
6726
      }
6727
 
6728
      public String getFieldName() {
6729
        return _fieldName;
6730
      }
6731
    }
6732
 
6733
    // isset id assignments
6734
 
3430 rajveer 6735
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 6736
    static {
3430 rajveer 6737
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
6738
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
6739
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
6740
      metaDataMap = Collections.unmodifiableMap(tmpMap);
6741
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getSuccessfulPaymentCountForCoupon_args.class, metaDataMap);
3385 varun.gupt 6742
    }
6743
 
6744
    public getSuccessfulPaymentCountForCoupon_args() {
6745
    }
6746
 
6747
    public getSuccessfulPaymentCountForCoupon_args(
6748
      String couponCode)
6749
    {
6750
      this();
6751
      this.couponCode = couponCode;
6752
    }
6753
 
6754
    /**
6755
     * Performs a deep copy on <i>other</i>.
6756
     */
6757
    public getSuccessfulPaymentCountForCoupon_args(getSuccessfulPaymentCountForCoupon_args other) {
6758
      if (other.isSetCouponCode()) {
6759
        this.couponCode = other.couponCode;
6760
      }
6761
    }
6762
 
6763
    public getSuccessfulPaymentCountForCoupon_args deepCopy() {
6764
      return new getSuccessfulPaymentCountForCoupon_args(this);
6765
    }
6766
 
3430 rajveer 6767
    @Override
6768
    public void clear() {
6769
      this.couponCode = null;
3385 varun.gupt 6770
    }
6771
 
6772
    public String getCouponCode() {
6773
      return this.couponCode;
6774
    }
6775
 
3430 rajveer 6776
    public void setCouponCode(String couponCode) {
3385 varun.gupt 6777
      this.couponCode = couponCode;
6778
    }
6779
 
6780
    public void unsetCouponCode() {
6781
      this.couponCode = null;
6782
    }
6783
 
3430 rajveer 6784
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
3385 varun.gupt 6785
    public boolean isSetCouponCode() {
6786
      return this.couponCode != null;
6787
    }
6788
 
6789
    public void setCouponCodeIsSet(boolean value) {
6790
      if (!value) {
6791
        this.couponCode = null;
6792
      }
6793
    }
6794
 
6795
    public void setFieldValue(_Fields field, Object value) {
6796
      switch (field) {
6797
      case COUPON_CODE:
6798
        if (value == null) {
6799
          unsetCouponCode();
6800
        } else {
6801
          setCouponCode((String)value);
6802
        }
6803
        break;
6804
 
6805
      }
6806
    }
6807
 
6808
    public Object getFieldValue(_Fields field) {
6809
      switch (field) {
6810
      case COUPON_CODE:
6811
        return getCouponCode();
6812
 
6813
      }
6814
      throw new IllegalStateException();
6815
    }
6816
 
3430 rajveer 6817
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
6818
    public boolean isSet(_Fields field) {
6819
      if (field == null) {
6820
        throw new IllegalArgumentException();
6821
      }
3385 varun.gupt 6822
 
6823
      switch (field) {
6824
      case COUPON_CODE:
6825
        return isSetCouponCode();
6826
      }
6827
      throw new IllegalStateException();
6828
    }
6829
 
6830
    @Override
6831
    public boolean equals(Object that) {
6832
      if (that == null)
6833
        return false;
6834
      if (that instanceof getSuccessfulPaymentCountForCoupon_args)
6835
        return this.equals((getSuccessfulPaymentCountForCoupon_args)that);
6836
      return false;
6837
    }
6838
 
6839
    public boolean equals(getSuccessfulPaymentCountForCoupon_args that) {
6840
      if (that == null)
6841
        return false;
6842
 
6843
      boolean this_present_couponCode = true && this.isSetCouponCode();
6844
      boolean that_present_couponCode = true && that.isSetCouponCode();
6845
      if (this_present_couponCode || that_present_couponCode) {
6846
        if (!(this_present_couponCode && that_present_couponCode))
6847
          return false;
6848
        if (!this.couponCode.equals(that.couponCode))
6849
          return false;
6850
      }
6851
 
6852
      return true;
6853
    }
6854
 
6855
    @Override
6856
    public int hashCode() {
6857
      return 0;
6858
    }
6859
 
6860
    public int compareTo(getSuccessfulPaymentCountForCoupon_args other) {
6861
      if (!getClass().equals(other.getClass())) {
6862
        return getClass().getName().compareTo(other.getClass().getName());
6863
      }
6864
 
6865
      int lastComparison = 0;
6866
      getSuccessfulPaymentCountForCoupon_args typedOther = (getSuccessfulPaymentCountForCoupon_args)other;
6867
 
3430 rajveer 6868
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
3385 varun.gupt 6869
      if (lastComparison != 0) {
6870
        return lastComparison;
6871
      }
3430 rajveer 6872
      if (isSetCouponCode()) {
6873
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
6874
        if (lastComparison != 0) {
6875
          return lastComparison;
6876
        }
3385 varun.gupt 6877
      }
6878
      return 0;
6879
    }
6880
 
3430 rajveer 6881
    public _Fields fieldForId(int fieldId) {
6882
      return _Fields.findByThriftId(fieldId);
6883
    }
6884
 
6885
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
6886
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 6887
      iprot.readStructBegin();
6888
      while (true)
6889
      {
6890
        field = iprot.readFieldBegin();
3430 rajveer 6891
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 6892
          break;
6893
        }
3430 rajveer 6894
        switch (field.id) {
6895
          case 1: // COUPON_CODE
6896
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
6897
              this.couponCode = iprot.readString();
6898
            } else { 
6899
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6900
            }
6901
            break;
6902
          default:
6903
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 6904
        }
3430 rajveer 6905
        iprot.readFieldEnd();
3385 varun.gupt 6906
      }
6907
      iprot.readStructEnd();
6908
      validate();
6909
    }
6910
 
3430 rajveer 6911
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 6912
      validate();
6913
 
6914
      oprot.writeStructBegin(STRUCT_DESC);
6915
      if (this.couponCode != null) {
6916
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
6917
        oprot.writeString(this.couponCode);
6918
        oprot.writeFieldEnd();
6919
      }
6920
      oprot.writeFieldStop();
6921
      oprot.writeStructEnd();
6922
    }
6923
 
6924
    @Override
6925
    public String toString() {
6926
      StringBuilder sb = new StringBuilder("getSuccessfulPaymentCountForCoupon_args(");
6927
      boolean first = true;
6928
 
6929
      sb.append("couponCode:");
6930
      if (this.couponCode == null) {
6931
        sb.append("null");
6932
      } else {
6933
        sb.append(this.couponCode);
6934
      }
6935
      first = false;
6936
      sb.append(")");
6937
      return sb.toString();
6938
    }
6939
 
3430 rajveer 6940
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 6941
      // check for required fields
6942
    }
6943
 
3430 rajveer 6944
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
6945
      try {
6946
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
6947
      } catch (org.apache.thrift.TException te) {
6948
        throw new java.io.IOException(te);
6949
      }
6950
    }
6951
 
6952
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
6953
      try {
6954
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
6955
      } catch (org.apache.thrift.TException te) {
6956
        throw new java.io.IOException(te);
6957
      }
6958
    }
6959
 
3385 varun.gupt 6960
  }
6961
 
3430 rajveer 6962
  public static class getSuccessfulPaymentCountForCoupon_result implements org.apache.thrift.TBase<getSuccessfulPaymentCountForCoupon_result, getSuccessfulPaymentCountForCoupon_result._Fields>, java.io.Serializable, Cloneable   {
6963
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getSuccessfulPaymentCountForCoupon_result");
3385 varun.gupt 6964
 
3430 rajveer 6965
    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);
6966
    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);
3385 varun.gupt 6967
 
3430 rajveer 6968
    private long success; // required
6969
    private PromotionException pex; // required
3385 varun.gupt 6970
 
6971
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 6972
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 6973
      SUCCESS((short)0, "success"),
6974
      PEX((short)1, "pex");
6975
 
6976
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
6977
 
6978
      static {
6979
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
6980
          byName.put(field.getFieldName(), field);
6981
        }
6982
      }
6983
 
6984
      /**
6985
       * Find the _Fields constant that matches fieldId, or null if its not found.
6986
       */
6987
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 6988
        switch(fieldId) {
6989
          case 0: // SUCCESS
6990
            return SUCCESS;
6991
          case 1: // PEX
6992
            return PEX;
6993
          default:
6994
            return null;
6995
        }
3385 varun.gupt 6996
      }
6997
 
6998
      /**
6999
       * Find the _Fields constant that matches fieldId, throwing an exception
7000
       * if it is not found.
7001
       */
7002
      public static _Fields findByThriftIdOrThrow(int fieldId) {
7003
        _Fields fields = findByThriftId(fieldId);
7004
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
7005
        return fields;
7006
      }
7007
 
7008
      /**
7009
       * Find the _Fields constant that matches name, or null if its not found.
7010
       */
7011
      public static _Fields findByName(String name) {
7012
        return byName.get(name);
7013
      }
7014
 
7015
      private final short _thriftId;
7016
      private final String _fieldName;
7017
 
7018
      _Fields(short thriftId, String fieldName) {
7019
        _thriftId = thriftId;
7020
        _fieldName = fieldName;
7021
      }
7022
 
7023
      public short getThriftFieldId() {
7024
        return _thriftId;
7025
      }
7026
 
7027
      public String getFieldName() {
7028
        return _fieldName;
7029
      }
7030
    }
7031
 
7032
    // isset id assignments
7033
    private static final int __SUCCESS_ISSET_ID = 0;
7034
    private BitSet __isset_bit_vector = new BitSet(1);
7035
 
3430 rajveer 7036
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 7037
    static {
3430 rajveer 7038
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
7039
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
7040
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
7041
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
7042
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
7043
      metaDataMap = Collections.unmodifiableMap(tmpMap);
7044
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getSuccessfulPaymentCountForCoupon_result.class, metaDataMap);
3385 varun.gupt 7045
    }
7046
 
7047
    public getSuccessfulPaymentCountForCoupon_result() {
7048
    }
7049
 
7050
    public getSuccessfulPaymentCountForCoupon_result(
7051
      long success,
7052
      PromotionException pex)
7053
    {
7054
      this();
7055
      this.success = success;
7056
      setSuccessIsSet(true);
7057
      this.pex = pex;
7058
    }
7059
 
7060
    /**
7061
     * Performs a deep copy on <i>other</i>.
7062
     */
7063
    public getSuccessfulPaymentCountForCoupon_result(getSuccessfulPaymentCountForCoupon_result other) {
7064
      __isset_bit_vector.clear();
7065
      __isset_bit_vector.or(other.__isset_bit_vector);
7066
      this.success = other.success;
7067
      if (other.isSetPex()) {
7068
        this.pex = new PromotionException(other.pex);
7069
      }
7070
    }
7071
 
7072
    public getSuccessfulPaymentCountForCoupon_result deepCopy() {
7073
      return new getSuccessfulPaymentCountForCoupon_result(this);
7074
    }
7075
 
3430 rajveer 7076
    @Override
7077
    public void clear() {
7078
      setSuccessIsSet(false);
7079
      this.success = 0;
7080
      this.pex = null;
3385 varun.gupt 7081
    }
7082
 
7083
    public long getSuccess() {
7084
      return this.success;
7085
    }
7086
 
3430 rajveer 7087
    public void setSuccess(long success) {
3385 varun.gupt 7088
      this.success = success;
7089
      setSuccessIsSet(true);
7090
    }
7091
 
7092
    public void unsetSuccess() {
7093
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
7094
    }
7095
 
3430 rajveer 7096
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
3385 varun.gupt 7097
    public boolean isSetSuccess() {
7098
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
7099
    }
7100
 
7101
    public void setSuccessIsSet(boolean value) {
7102
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
7103
    }
7104
 
7105
    public PromotionException getPex() {
7106
      return this.pex;
7107
    }
7108
 
3430 rajveer 7109
    public void setPex(PromotionException pex) {
3385 varun.gupt 7110
      this.pex = pex;
7111
    }
7112
 
7113
    public void unsetPex() {
7114
      this.pex = null;
7115
    }
7116
 
3430 rajveer 7117
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
3385 varun.gupt 7118
    public boolean isSetPex() {
7119
      return this.pex != null;
7120
    }
7121
 
7122
    public void setPexIsSet(boolean value) {
7123
      if (!value) {
7124
        this.pex = null;
7125
      }
7126
    }
7127
 
7128
    public void setFieldValue(_Fields field, Object value) {
7129
      switch (field) {
7130
      case SUCCESS:
7131
        if (value == null) {
7132
          unsetSuccess();
7133
        } else {
7134
          setSuccess((Long)value);
7135
        }
7136
        break;
7137
 
7138
      case PEX:
7139
        if (value == null) {
7140
          unsetPex();
7141
        } else {
7142
          setPex((PromotionException)value);
7143
        }
7144
        break;
7145
 
7146
      }
7147
    }
7148
 
7149
    public Object getFieldValue(_Fields field) {
7150
      switch (field) {
7151
      case SUCCESS:
3430 rajveer 7152
        return Long.valueOf(getSuccess());
3385 varun.gupt 7153
 
7154
      case PEX:
7155
        return getPex();
7156
 
7157
      }
7158
      throw new IllegalStateException();
7159
    }
7160
 
3430 rajveer 7161
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
7162
    public boolean isSet(_Fields field) {
7163
      if (field == null) {
7164
        throw new IllegalArgumentException();
7165
      }
3385 varun.gupt 7166
 
7167
      switch (field) {
7168
      case SUCCESS:
7169
        return isSetSuccess();
7170
      case PEX:
7171
        return isSetPex();
7172
      }
7173
      throw new IllegalStateException();
7174
    }
7175
 
7176
    @Override
7177
    public boolean equals(Object that) {
7178
      if (that == null)
7179
        return false;
7180
      if (that instanceof getSuccessfulPaymentCountForCoupon_result)
7181
        return this.equals((getSuccessfulPaymentCountForCoupon_result)that);
7182
      return false;
7183
    }
7184
 
7185
    public boolean equals(getSuccessfulPaymentCountForCoupon_result that) {
7186
      if (that == null)
7187
        return false;
7188
 
7189
      boolean this_present_success = true;
7190
      boolean that_present_success = true;
7191
      if (this_present_success || that_present_success) {
7192
        if (!(this_present_success && that_present_success))
7193
          return false;
7194
        if (this.success != that.success)
7195
          return false;
7196
      }
7197
 
7198
      boolean this_present_pex = true && this.isSetPex();
7199
      boolean that_present_pex = true && that.isSetPex();
7200
      if (this_present_pex || that_present_pex) {
7201
        if (!(this_present_pex && that_present_pex))
7202
          return false;
7203
        if (!this.pex.equals(that.pex))
7204
          return false;
7205
      }
7206
 
7207
      return true;
7208
    }
7209
 
7210
    @Override
7211
    public int hashCode() {
7212
      return 0;
7213
    }
7214
 
7215
    public int compareTo(getSuccessfulPaymentCountForCoupon_result other) {
7216
      if (!getClass().equals(other.getClass())) {
7217
        return getClass().getName().compareTo(other.getClass().getName());
7218
      }
7219
 
7220
      int lastComparison = 0;
7221
      getSuccessfulPaymentCountForCoupon_result typedOther = (getSuccessfulPaymentCountForCoupon_result)other;
7222
 
3430 rajveer 7223
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
3385 varun.gupt 7224
      if (lastComparison != 0) {
7225
        return lastComparison;
7226
      }
3430 rajveer 7227
      if (isSetSuccess()) {
7228
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
7229
        if (lastComparison != 0) {
7230
          return lastComparison;
7231
        }
3385 varun.gupt 7232
      }
3430 rajveer 7233
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
3385 varun.gupt 7234
      if (lastComparison != 0) {
7235
        return lastComparison;
7236
      }
3430 rajveer 7237
      if (isSetPex()) {
7238
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
7239
        if (lastComparison != 0) {
7240
          return lastComparison;
7241
        }
3385 varun.gupt 7242
      }
7243
      return 0;
7244
    }
7245
 
3430 rajveer 7246
    public _Fields fieldForId(int fieldId) {
7247
      return _Fields.findByThriftId(fieldId);
7248
    }
7249
 
7250
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
7251
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 7252
      iprot.readStructBegin();
7253
      while (true)
7254
      {
7255
        field = iprot.readFieldBegin();
3430 rajveer 7256
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 7257
          break;
7258
        }
3430 rajveer 7259
        switch (field.id) {
7260
          case 0: // SUCCESS
7261
            if (field.type == org.apache.thrift.protocol.TType.I64) {
7262
              this.success = iprot.readI64();
7263
              setSuccessIsSet(true);
7264
            } else { 
7265
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
7266
            }
7267
            break;
7268
          case 1: // PEX
7269
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
7270
              this.pex = new PromotionException();
7271
              this.pex.read(iprot);
7272
            } else { 
7273
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
7274
            }
7275
            break;
7276
          default:
7277
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 7278
        }
3430 rajveer 7279
        iprot.readFieldEnd();
3385 varun.gupt 7280
      }
7281
      iprot.readStructEnd();
7282
      validate();
7283
    }
7284
 
3430 rajveer 7285
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 7286
      oprot.writeStructBegin(STRUCT_DESC);
7287
 
7288
      if (this.isSetSuccess()) {
7289
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
7290
        oprot.writeI64(this.success);
7291
        oprot.writeFieldEnd();
7292
      } else if (this.isSetPex()) {
7293
        oprot.writeFieldBegin(PEX_FIELD_DESC);
7294
        this.pex.write(oprot);
7295
        oprot.writeFieldEnd();
7296
      }
7297
      oprot.writeFieldStop();
7298
      oprot.writeStructEnd();
7299
    }
7300
 
7301
    @Override
7302
    public String toString() {
7303
      StringBuilder sb = new StringBuilder("getSuccessfulPaymentCountForCoupon_result(");
7304
      boolean first = true;
7305
 
7306
      sb.append("success:");
7307
      sb.append(this.success);
7308
      first = false;
7309
      if (!first) sb.append(", ");
7310
      sb.append("pex:");
7311
      if (this.pex == null) {
7312
        sb.append("null");
7313
      } else {
7314
        sb.append(this.pex);
7315
      }
7316
      first = false;
7317
      sb.append(")");
7318
      return sb.toString();
7319
    }
7320
 
3430 rajveer 7321
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 7322
      // check for required fields
7323
    }
7324
 
3430 rajveer 7325
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
7326
      try {
7327
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
7328
      } catch (org.apache.thrift.TException te) {
7329
        throw new java.io.IOException(te);
7330
      }
7331
    }
7332
 
7333
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
7334
      try {
7335
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
7336
      } catch (org.apache.thrift.TException te) {
7337
        throw new java.io.IOException(te);
7338
      }
7339
    }
7340
 
3385 varun.gupt 7341
  }
7342
 
3430 rajveer 7343
  public static class getRuleDocString_args implements org.apache.thrift.TBase<getRuleDocString_args, getRuleDocString_args._Fields>, java.io.Serializable, Cloneable   {
7344
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getRuleDocString_args");
3385 varun.gupt 7345
 
3430 rajveer 7346
    private static final org.apache.thrift.protocol.TField RULE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("ruleName", org.apache.thrift.protocol.TType.STRING, (short)1);
3385 varun.gupt 7347
 
3430 rajveer 7348
    private String ruleName; // required
3385 varun.gupt 7349
 
7350
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 7351
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 7352
      RULE_NAME((short)1, "ruleName");
7353
 
7354
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
7355
 
7356
      static {
7357
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
7358
          byName.put(field.getFieldName(), field);
7359
        }
7360
      }
7361
 
7362
      /**
7363
       * Find the _Fields constant that matches fieldId, or null if its not found.
7364
       */
7365
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 7366
        switch(fieldId) {
7367
          case 1: // RULE_NAME
7368
            return RULE_NAME;
7369
          default:
7370
            return null;
7371
        }
3385 varun.gupt 7372
      }
7373
 
7374
      /**
7375
       * Find the _Fields constant that matches fieldId, throwing an exception
7376
       * if it is not found.
7377
       */
7378
      public static _Fields findByThriftIdOrThrow(int fieldId) {
7379
        _Fields fields = findByThriftId(fieldId);
7380
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
7381
        return fields;
7382
      }
7383
 
7384
      /**
7385
       * Find the _Fields constant that matches name, or null if its not found.
7386
       */
7387
      public static _Fields findByName(String name) {
7388
        return byName.get(name);
7389
      }
7390
 
7391
      private final short _thriftId;
7392
      private final String _fieldName;
7393
 
7394
      _Fields(short thriftId, String fieldName) {
7395
        _thriftId = thriftId;
7396
        _fieldName = fieldName;
7397
      }
7398
 
7399
      public short getThriftFieldId() {
7400
        return _thriftId;
7401
      }
7402
 
7403
      public String getFieldName() {
7404
        return _fieldName;
7405
      }
7406
    }
7407
 
7408
    // isset id assignments
7409
 
3430 rajveer 7410
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 7411
    static {
3430 rajveer 7412
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
7413
      tmpMap.put(_Fields.RULE_NAME, new org.apache.thrift.meta_data.FieldMetaData("ruleName", org.apache.thrift.TFieldRequirementType.DEFAULT, 
7414
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
7415
      metaDataMap = Collections.unmodifiableMap(tmpMap);
7416
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getRuleDocString_args.class, metaDataMap);
3385 varun.gupt 7417
    }
7418
 
7419
    public getRuleDocString_args() {
7420
    }
7421
 
7422
    public getRuleDocString_args(
7423
      String ruleName)
7424
    {
7425
      this();
7426
      this.ruleName = ruleName;
7427
    }
7428
 
7429
    /**
7430
     * Performs a deep copy on <i>other</i>.
7431
     */
7432
    public getRuleDocString_args(getRuleDocString_args other) {
7433
      if (other.isSetRuleName()) {
7434
        this.ruleName = other.ruleName;
7435
      }
7436
    }
7437
 
7438
    public getRuleDocString_args deepCopy() {
7439
      return new getRuleDocString_args(this);
7440
    }
7441
 
3430 rajveer 7442
    @Override
7443
    public void clear() {
7444
      this.ruleName = null;
3385 varun.gupt 7445
    }
7446
 
7447
    public String getRuleName() {
7448
      return this.ruleName;
7449
    }
7450
 
3430 rajveer 7451
    public void setRuleName(String ruleName) {
3385 varun.gupt 7452
      this.ruleName = ruleName;
7453
    }
7454
 
7455
    public void unsetRuleName() {
7456
      this.ruleName = null;
7457
    }
7458
 
3430 rajveer 7459
    /** Returns true if field ruleName is set (has been assigned a value) and false otherwise */
3385 varun.gupt 7460
    public boolean isSetRuleName() {
7461
      return this.ruleName != null;
7462
    }
7463
 
7464
    public void setRuleNameIsSet(boolean value) {
7465
      if (!value) {
7466
        this.ruleName = null;
7467
      }
7468
    }
7469
 
7470
    public void setFieldValue(_Fields field, Object value) {
7471
      switch (field) {
7472
      case RULE_NAME:
7473
        if (value == null) {
7474
          unsetRuleName();
7475
        } else {
7476
          setRuleName((String)value);
7477
        }
7478
        break;
7479
 
7480
      }
7481
    }
7482
 
7483
    public Object getFieldValue(_Fields field) {
7484
      switch (field) {
7485
      case RULE_NAME:
7486
        return getRuleName();
7487
 
7488
      }
7489
      throw new IllegalStateException();
7490
    }
7491
 
3430 rajveer 7492
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
7493
    public boolean isSet(_Fields field) {
7494
      if (field == null) {
7495
        throw new IllegalArgumentException();
7496
      }
3385 varun.gupt 7497
 
7498
      switch (field) {
7499
      case RULE_NAME:
7500
        return isSetRuleName();
7501
      }
7502
      throw new IllegalStateException();
7503
    }
7504
 
7505
    @Override
7506
    public boolean equals(Object that) {
7507
      if (that == null)
7508
        return false;
7509
      if (that instanceof getRuleDocString_args)
7510
        return this.equals((getRuleDocString_args)that);
7511
      return false;
7512
    }
7513
 
7514
    public boolean equals(getRuleDocString_args that) {
7515
      if (that == null)
7516
        return false;
7517
 
7518
      boolean this_present_ruleName = true && this.isSetRuleName();
7519
      boolean that_present_ruleName = true && that.isSetRuleName();
7520
      if (this_present_ruleName || that_present_ruleName) {
7521
        if (!(this_present_ruleName && that_present_ruleName))
7522
          return false;
7523
        if (!this.ruleName.equals(that.ruleName))
7524
          return false;
7525
      }
7526
 
7527
      return true;
7528
    }
7529
 
7530
    @Override
7531
    public int hashCode() {
7532
      return 0;
7533
    }
7534
 
7535
    public int compareTo(getRuleDocString_args other) {
7536
      if (!getClass().equals(other.getClass())) {
7537
        return getClass().getName().compareTo(other.getClass().getName());
7538
      }
7539
 
7540
      int lastComparison = 0;
7541
      getRuleDocString_args typedOther = (getRuleDocString_args)other;
7542
 
3430 rajveer 7543
      lastComparison = Boolean.valueOf(isSetRuleName()).compareTo(typedOther.isSetRuleName());
3385 varun.gupt 7544
      if (lastComparison != 0) {
7545
        return lastComparison;
7546
      }
3430 rajveer 7547
      if (isSetRuleName()) {
7548
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ruleName, typedOther.ruleName);
7549
        if (lastComparison != 0) {
7550
          return lastComparison;
7551
        }
3385 varun.gupt 7552
      }
7553
      return 0;
7554
    }
7555
 
3430 rajveer 7556
    public _Fields fieldForId(int fieldId) {
7557
      return _Fields.findByThriftId(fieldId);
7558
    }
7559
 
7560
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
7561
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 7562
      iprot.readStructBegin();
7563
      while (true)
7564
      {
7565
        field = iprot.readFieldBegin();
3430 rajveer 7566
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 7567
          break;
7568
        }
3430 rajveer 7569
        switch (field.id) {
7570
          case 1: // RULE_NAME
7571
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
7572
              this.ruleName = iprot.readString();
7573
            } else { 
7574
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
7575
            }
7576
            break;
7577
          default:
7578
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 7579
        }
3430 rajveer 7580
        iprot.readFieldEnd();
3385 varun.gupt 7581
      }
7582
      iprot.readStructEnd();
7583
      validate();
7584
    }
7585
 
3430 rajveer 7586
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 7587
      validate();
7588
 
7589
      oprot.writeStructBegin(STRUCT_DESC);
7590
      if (this.ruleName != null) {
7591
        oprot.writeFieldBegin(RULE_NAME_FIELD_DESC);
7592
        oprot.writeString(this.ruleName);
7593
        oprot.writeFieldEnd();
7594
      }
7595
      oprot.writeFieldStop();
7596
      oprot.writeStructEnd();
7597
    }
7598
 
7599
    @Override
7600
    public String toString() {
7601
      StringBuilder sb = new StringBuilder("getRuleDocString_args(");
7602
      boolean first = true;
7603
 
7604
      sb.append("ruleName:");
7605
      if (this.ruleName == null) {
7606
        sb.append("null");
7607
      } else {
7608
        sb.append(this.ruleName);
7609
      }
7610
      first = false;
7611
      sb.append(")");
7612
      return sb.toString();
7613
    }
7614
 
3430 rajveer 7615
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 7616
      // check for required fields
7617
    }
7618
 
3430 rajveer 7619
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
7620
      try {
7621
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
7622
      } catch (org.apache.thrift.TException te) {
7623
        throw new java.io.IOException(te);
7624
      }
7625
    }
7626
 
7627
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
7628
      try {
7629
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
7630
      } catch (org.apache.thrift.TException te) {
7631
        throw new java.io.IOException(te);
7632
      }
7633
    }
7634
 
3385 varun.gupt 7635
  }
7636
 
3430 rajveer 7637
  public static class getRuleDocString_result implements org.apache.thrift.TBase<getRuleDocString_result, getRuleDocString_result._Fields>, java.io.Serializable, Cloneable   {
7638
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getRuleDocString_result");
3385 varun.gupt 7639
 
3430 rajveer 7640
    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRING, (short)0);
3385 varun.gupt 7641
 
3430 rajveer 7642
    private String success; // required
3385 varun.gupt 7643
 
7644
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 7645
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 7646
      SUCCESS((short)0, "success");
7647
 
7648
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
7649
 
7650
      static {
7651
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
7652
          byName.put(field.getFieldName(), field);
7653
        }
7654
      }
7655
 
7656
      /**
7657
       * Find the _Fields constant that matches fieldId, or null if its not found.
7658
       */
7659
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 7660
        switch(fieldId) {
7661
          case 0: // SUCCESS
7662
            return SUCCESS;
7663
          default:
7664
            return null;
7665
        }
3385 varun.gupt 7666
      }
7667
 
7668
      /**
7669
       * Find the _Fields constant that matches fieldId, throwing an exception
7670
       * if it is not found.
7671
       */
7672
      public static _Fields findByThriftIdOrThrow(int fieldId) {
7673
        _Fields fields = findByThriftId(fieldId);
7674
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
7675
        return fields;
7676
      }
7677
 
7678
      /**
7679
       * Find the _Fields constant that matches name, or null if its not found.
7680
       */
7681
      public static _Fields findByName(String name) {
7682
        return byName.get(name);
7683
      }
7684
 
7685
      private final short _thriftId;
7686
      private final String _fieldName;
7687
 
7688
      _Fields(short thriftId, String fieldName) {
7689
        _thriftId = thriftId;
7690
        _fieldName = fieldName;
7691
      }
7692
 
7693
      public short getThriftFieldId() {
7694
        return _thriftId;
7695
      }
7696
 
7697
      public String getFieldName() {
7698
        return _fieldName;
7699
      }
7700
    }
7701
 
7702
    // isset id assignments
7703
 
3430 rajveer 7704
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 7705
    static {
3430 rajveer 7706
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
7707
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
7708
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
7709
      metaDataMap = Collections.unmodifiableMap(tmpMap);
7710
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getRuleDocString_result.class, metaDataMap);
3385 varun.gupt 7711
    }
7712
 
7713
    public getRuleDocString_result() {
7714
    }
7715
 
7716
    public getRuleDocString_result(
7717
      String success)
7718
    {
7719
      this();
7720
      this.success = success;
7721
    }
7722
 
7723
    /**
7724
     * Performs a deep copy on <i>other</i>.
7725
     */
7726
    public getRuleDocString_result(getRuleDocString_result other) {
7727
      if (other.isSetSuccess()) {
7728
        this.success = other.success;
7729
      }
7730
    }
7731
 
7732
    public getRuleDocString_result deepCopy() {
7733
      return new getRuleDocString_result(this);
7734
    }
7735
 
3430 rajveer 7736
    @Override
7737
    public void clear() {
7738
      this.success = null;
3385 varun.gupt 7739
    }
7740
 
7741
    public String getSuccess() {
7742
      return this.success;
7743
    }
7744
 
3430 rajveer 7745
    public void setSuccess(String success) {
3385 varun.gupt 7746
      this.success = success;
7747
    }
7748
 
7749
    public void unsetSuccess() {
7750
      this.success = null;
7751
    }
7752
 
3430 rajveer 7753
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
3385 varun.gupt 7754
    public boolean isSetSuccess() {
7755
      return this.success != null;
7756
    }
7757
 
7758
    public void setSuccessIsSet(boolean value) {
7759
      if (!value) {
7760
        this.success = null;
7761
      }
7762
    }
7763
 
7764
    public void setFieldValue(_Fields field, Object value) {
7765
      switch (field) {
7766
      case SUCCESS:
7767
        if (value == null) {
7768
          unsetSuccess();
7769
        } else {
7770
          setSuccess((String)value);
7771
        }
7772
        break;
7773
 
7774
      }
7775
    }
7776
 
7777
    public Object getFieldValue(_Fields field) {
7778
      switch (field) {
7779
      case SUCCESS:
7780
        return getSuccess();
7781
 
7782
      }
7783
      throw new IllegalStateException();
7784
    }
7785
 
3430 rajveer 7786
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
7787
    public boolean isSet(_Fields field) {
7788
      if (field == null) {
7789
        throw new IllegalArgumentException();
7790
      }
3385 varun.gupt 7791
 
7792
      switch (field) {
7793
      case SUCCESS:
7794
        return isSetSuccess();
7795
      }
7796
      throw new IllegalStateException();
7797
    }
7798
 
7799
    @Override
7800
    public boolean equals(Object that) {
7801
      if (that == null)
7802
        return false;
7803
      if (that instanceof getRuleDocString_result)
7804
        return this.equals((getRuleDocString_result)that);
7805
      return false;
7806
    }
7807
 
7808
    public boolean equals(getRuleDocString_result that) {
7809
      if (that == null)
7810
        return false;
7811
 
7812
      boolean this_present_success = true && this.isSetSuccess();
7813
      boolean that_present_success = true && that.isSetSuccess();
7814
      if (this_present_success || that_present_success) {
7815
        if (!(this_present_success && that_present_success))
7816
          return false;
7817
        if (!this.success.equals(that.success))
7818
          return false;
7819
      }
7820
 
7821
      return true;
7822
    }
7823
 
7824
    @Override
7825
    public int hashCode() {
7826
      return 0;
7827
    }
7828
 
7829
    public int compareTo(getRuleDocString_result other) {
7830
      if (!getClass().equals(other.getClass())) {
7831
        return getClass().getName().compareTo(other.getClass().getName());
7832
      }
7833
 
7834
      int lastComparison = 0;
7835
      getRuleDocString_result typedOther = (getRuleDocString_result)other;
7836
 
3430 rajveer 7837
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
3385 varun.gupt 7838
      if (lastComparison != 0) {
7839
        return lastComparison;
7840
      }
3430 rajveer 7841
      if (isSetSuccess()) {
7842
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
7843
        if (lastComparison != 0) {
7844
          return lastComparison;
7845
        }
3385 varun.gupt 7846
      }
7847
      return 0;
7848
    }
7849
 
3430 rajveer 7850
    public _Fields fieldForId(int fieldId) {
7851
      return _Fields.findByThriftId(fieldId);
7852
    }
7853
 
7854
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
7855
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 7856
      iprot.readStructBegin();
7857
      while (true)
7858
      {
7859
        field = iprot.readFieldBegin();
3430 rajveer 7860
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 7861
          break;
7862
        }
3430 rajveer 7863
        switch (field.id) {
7864
          case 0: // SUCCESS
7865
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
7866
              this.success = iprot.readString();
7867
            } else { 
7868
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
7869
            }
7870
            break;
7871
          default:
7872
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 7873
        }
3430 rajveer 7874
        iprot.readFieldEnd();
3385 varun.gupt 7875
      }
7876
      iprot.readStructEnd();
7877
      validate();
7878
    }
7879
 
3430 rajveer 7880
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 7881
      oprot.writeStructBegin(STRUCT_DESC);
7882
 
7883
      if (this.isSetSuccess()) {
7884
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
7885
        oprot.writeString(this.success);
7886
        oprot.writeFieldEnd();
7887
      }
7888
      oprot.writeFieldStop();
7889
      oprot.writeStructEnd();
7890
    }
7891
 
7892
    @Override
7893
    public String toString() {
7894
      StringBuilder sb = new StringBuilder("getRuleDocString_result(");
7895
      boolean first = true;
7896
 
7897
      sb.append("success:");
7898
      if (this.success == null) {
7899
        sb.append("null");
7900
      } else {
7901
        sb.append(this.success);
7902
      }
7903
      first = false;
7904
      sb.append(")");
7905
      return sb.toString();
7906
    }
7907
 
3430 rajveer 7908
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 7909
      // check for required fields
7910
    }
7911
 
3430 rajveer 7912
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
7913
      try {
7914
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
7915
      } catch (org.apache.thrift.TException te) {
7916
        throw new java.io.IOException(te);
7917
      }
7918
    }
7919
 
7920
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
7921
      try {
7922
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
7923
      } catch (org.apache.thrift.TException te) {
7924
        throw new java.io.IOException(te);
7925
      }
7926
    }
7927
 
3385 varun.gupt 7928
  }
7929
 
1982 varun.gupt 7930
}