Subversion Repositories SmartDukaan

Rev

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

Rev Author Line No. Line
4496 mandeep.dh 1
/**
2
 * Autogenerated by Thrift Compiler (0.7.0)
3
 *
4
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
 */
6
package in.shop2020.purchase;
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;
18
import java.nio.ByteBuffer;
19
import java.util.Arrays;
20
import org.slf4j.Logger;
21
import org.slf4j.LoggerFactory;
22
 
23
public class PurchaseService {
24
 
25
  public interface Iface extends in.shop2020.generic.GenericService.Iface {
26
 
27
    /**
28
     * Creates a purchase order based on the data in the given purchase order object.
29
     * This method populates a nummber of missing fields
30
     * 
31
     * @param purchaseOrder
32
     */
33
    public long createPurchaseOrder(PurchaseOrder purchaseOrder) throws PurchaseServiceException, org.apache.thrift.TException;
34
 
35
    /**
36
     * Returns the purchase order with the given id. Throws an exception if there is no such purchase order.
37
     * 
38
     * @param id
39
     */
40
    public PurchaseOrder getPurchaseOrder(long id) throws PurchaseServiceException, org.apache.thrift.TException;
41
 
42
    /**
43
     * Returns a list of all the purchase orders in the given state
44
     * 
45
     * @param status
46
     */
47
    public List<PurchaseOrder> getAllPurchaseOrders(POStatus status) throws PurchaseServiceException, org.apache.thrift.TException;
48
 
49
    /**
50
     * Returns the supplier with the given order id. Throws an exception if there is no such supplier.
51
     * 
52
     * @param id
53
     */
54
    public Supplier getSupplier(long id) throws PurchaseServiceException, org.apache.thrift.TException;
55
 
56
    /**
57
     * Creates a purchase for the given purchase order.
58
     * Throws an exception if no more purchases are allowed against the given purchase order.
59
     * 
60
     * @param purchaseOrderId
61
     * @param invoiceNumber
62
     * @param freightCharges
63
     */
64
    public long startPurchase(long purchaseOrderId, String invoiceNumber, double freightCharges) throws PurchaseServiceException, org.apache.thrift.TException;
65
 
66
    /**
67
     * Marks a purchase as complete and updates the receivedOn time.
68
     * Throws an exception if no such purchase exists.
69
     * 
70
     * @param purchaseId
71
     */
72
    public long closePurchase(long purchaseId) throws PurchaseServiceException, org.apache.thrift.TException;
73
 
74
    /**
75
     * Returns all open or closed purchases for the given purchase order. Throws an exception if no such purchase order exists
76
     * 
77
     * @param purchaseOrderId
78
     * @param open
79
     */
80
    public List<Purchase> getAllPurchases(long purchaseOrderId, boolean open) throws PurchaseServiceException, org.apache.thrift.TException;
81
 
82
    /**
4555 mandeep.dh 83
     * Returns the purchase order object for a given purchase
4496 mandeep.dh 84
     * 
85
     * @param purchaseId
86
     */
4555 mandeep.dh 87
    public PurchaseOrder getPurchaseOrderForPurchase(long purchaseId) throws org.apache.thrift.TException;
4496 mandeep.dh 88
 
4754 mandeep.dh 89
    /**
90
     * Creates purchase order objects from pending orders
91
     * 
92
     * @param warehouseId
93
     */
94
    public List<PurchaseOrder> getPendingPurchaseOrders(long warehouseId) throws PurchaseServiceException, org.apache.thrift.TException;
95
 
96
    /**
97
     * Returns all the valid suppliers
98
     */
99
    public List<Supplier> getSuppliers() throws PurchaseServiceException, org.apache.thrift.TException;
100
 
101
    /**
102
     * Fulfills a given purchase order with an item.
103
     * 
104
     * @param purchaseOrderId
105
     * @param itemId
106
     * @param quantity
107
     */
108
    public void fulfillPO(long purchaseOrderId, long itemId, long quantity) throws PurchaseServiceException, org.apache.thrift.TException;
109
 
110
    /**
111
     * Amends a PO as per the new lineitems passed
112
     * 
113
     * @param purchaseOrder
114
     */
115
    public void updatePurchaseOrder(PurchaseOrder purchaseOrder) throws PurchaseServiceException, org.apache.thrift.TException;
116
 
5185 mandeep.dh 117
    /**
118
     * Fulfills a given purchase id with an item and its quantity.
119
     * 
120
     * @param purchaseId
121
     * @param itemId
122
     * @param quantity
123
     */
124
    public void unFulfillPO(long purchaseId, long itemId, long quantity) throws PurchaseServiceException, org.apache.thrift.TException;
125
 
5443 mandeep.dh 126
    /**
5530 mandeep.dh 127
     * Fetches all invoices after a given date
5443 mandeep.dh 128
     * 
129
     * @param date
130
     */
131
    public List<Invoice> getInvoices(long date) throws org.apache.thrift.TException;
132
 
133
    /**
134
     * Creates an invoice object
135
     * 
136
     * @param invoice
137
     */
138
    public void createInvoice(Invoice invoice) throws PurchaseServiceException, org.apache.thrift.TException;
139
 
4496 mandeep.dh 140
  }
141
 
142
  public interface AsyncIface extends in.shop2020.generic.GenericService .AsyncIface {
143
 
144
    public void createPurchaseOrder(PurchaseOrder purchaseOrder, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.createPurchaseOrder_call> resultHandler) throws org.apache.thrift.TException;
145
 
146
    public void getPurchaseOrder(long id, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getPurchaseOrder_call> resultHandler) throws org.apache.thrift.TException;
147
 
148
    public void getAllPurchaseOrders(POStatus status, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getAllPurchaseOrders_call> resultHandler) throws org.apache.thrift.TException;
149
 
150
    public void getSupplier(long id, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getSupplier_call> resultHandler) throws org.apache.thrift.TException;
151
 
152
    public void startPurchase(long purchaseOrderId, String invoiceNumber, double freightCharges, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.startPurchase_call> resultHandler) throws org.apache.thrift.TException;
153
 
154
    public void closePurchase(long purchaseId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.closePurchase_call> resultHandler) throws org.apache.thrift.TException;
155
 
156
    public void getAllPurchases(long purchaseOrderId, boolean open, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getAllPurchases_call> resultHandler) throws org.apache.thrift.TException;
157
 
4555 mandeep.dh 158
    public void getPurchaseOrderForPurchase(long purchaseId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getPurchaseOrderForPurchase_call> resultHandler) throws org.apache.thrift.TException;
4496 mandeep.dh 159
 
4754 mandeep.dh 160
    public void getPendingPurchaseOrders(long warehouseId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getPendingPurchaseOrders_call> resultHandler) throws org.apache.thrift.TException;
161
 
162
    public void getSuppliers(org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getSuppliers_call> resultHandler) throws org.apache.thrift.TException;
163
 
164
    public void fulfillPO(long purchaseOrderId, long itemId, long quantity, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.fulfillPO_call> resultHandler) throws org.apache.thrift.TException;
165
 
166
    public void updatePurchaseOrder(PurchaseOrder purchaseOrder, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.updatePurchaseOrder_call> resultHandler) throws org.apache.thrift.TException;
167
 
5185 mandeep.dh 168
    public void unFulfillPO(long purchaseId, long itemId, long quantity, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.unFulfillPO_call> resultHandler) throws org.apache.thrift.TException;
169
 
5443 mandeep.dh 170
    public void getInvoices(long date, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getInvoices_call> resultHandler) throws org.apache.thrift.TException;
171
 
172
    public void createInvoice(Invoice invoice, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.createInvoice_call> resultHandler) throws org.apache.thrift.TException;
173
 
4496 mandeep.dh 174
  }
175
 
176
  public static class Client extends in.shop2020.generic.GenericService.Client implements Iface {
177
    public static class Factory implements org.apache.thrift.TServiceClientFactory<Client> {
178
      public Factory() {}
179
      public Client getClient(org.apache.thrift.protocol.TProtocol prot) {
180
        return new Client(prot);
181
      }
182
      public Client getClient(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
183
        return new Client(iprot, oprot);
184
      }
185
    }
186
 
187
    public Client(org.apache.thrift.protocol.TProtocol prot)
188
    {
189
      super(prot, prot);
190
    }
191
 
192
    public Client(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
193
      super(iprot, oprot);
194
    }
195
 
196
    public long createPurchaseOrder(PurchaseOrder purchaseOrder) throws PurchaseServiceException, org.apache.thrift.TException
197
    {
198
      send_createPurchaseOrder(purchaseOrder);
199
      return recv_createPurchaseOrder();
200
    }
201
 
202
    public void send_createPurchaseOrder(PurchaseOrder purchaseOrder) throws org.apache.thrift.TException
203
    {
204
      createPurchaseOrder_args args = new createPurchaseOrder_args();
205
      args.setPurchaseOrder(purchaseOrder);
206
      sendBase("createPurchaseOrder", args);
207
    }
208
 
209
    public long recv_createPurchaseOrder() throws PurchaseServiceException, org.apache.thrift.TException
210
    {
211
      createPurchaseOrder_result result = new createPurchaseOrder_result();
212
      receiveBase(result, "createPurchaseOrder");
213
      if (result.isSetSuccess()) {
214
        return result.success;
215
      }
216
      if (result.e != null) {
217
        throw result.e;
218
      }
219
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "createPurchaseOrder failed: unknown result");
220
    }
221
 
222
    public PurchaseOrder getPurchaseOrder(long id) throws PurchaseServiceException, org.apache.thrift.TException
223
    {
224
      send_getPurchaseOrder(id);
225
      return recv_getPurchaseOrder();
226
    }
227
 
228
    public void send_getPurchaseOrder(long id) throws org.apache.thrift.TException
229
    {
230
      getPurchaseOrder_args args = new getPurchaseOrder_args();
231
      args.setId(id);
232
      sendBase("getPurchaseOrder", args);
233
    }
234
 
235
    public PurchaseOrder recv_getPurchaseOrder() throws PurchaseServiceException, org.apache.thrift.TException
236
    {
237
      getPurchaseOrder_result result = new getPurchaseOrder_result();
238
      receiveBase(result, "getPurchaseOrder");
239
      if (result.isSetSuccess()) {
240
        return result.success;
241
      }
242
      if (result.e != null) {
243
        throw result.e;
244
      }
245
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getPurchaseOrder failed: unknown result");
246
    }
247
 
248
    public List<PurchaseOrder> getAllPurchaseOrders(POStatus status) throws PurchaseServiceException, org.apache.thrift.TException
249
    {
250
      send_getAllPurchaseOrders(status);
251
      return recv_getAllPurchaseOrders();
252
    }
253
 
254
    public void send_getAllPurchaseOrders(POStatus status) throws org.apache.thrift.TException
255
    {
256
      getAllPurchaseOrders_args args = new getAllPurchaseOrders_args();
257
      args.setStatus(status);
258
      sendBase("getAllPurchaseOrders", args);
259
    }
260
 
261
    public List<PurchaseOrder> recv_getAllPurchaseOrders() throws PurchaseServiceException, org.apache.thrift.TException
262
    {
263
      getAllPurchaseOrders_result result = new getAllPurchaseOrders_result();
264
      receiveBase(result, "getAllPurchaseOrders");
265
      if (result.isSetSuccess()) {
266
        return result.success;
267
      }
268
      if (result.e != null) {
269
        throw result.e;
270
      }
271
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getAllPurchaseOrders failed: unknown result");
272
    }
273
 
274
    public Supplier getSupplier(long id) throws PurchaseServiceException, org.apache.thrift.TException
275
    {
276
      send_getSupplier(id);
277
      return recv_getSupplier();
278
    }
279
 
280
    public void send_getSupplier(long id) throws org.apache.thrift.TException
281
    {
282
      getSupplier_args args = new getSupplier_args();
283
      args.setId(id);
284
      sendBase("getSupplier", args);
285
    }
286
 
287
    public Supplier recv_getSupplier() throws PurchaseServiceException, org.apache.thrift.TException
288
    {
289
      getSupplier_result result = new getSupplier_result();
290
      receiveBase(result, "getSupplier");
291
      if (result.isSetSuccess()) {
292
        return result.success;
293
      }
294
      if (result.e != null) {
295
        throw result.e;
296
      }
297
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getSupplier failed: unknown result");
298
    }
299
 
300
    public long startPurchase(long purchaseOrderId, String invoiceNumber, double freightCharges) throws PurchaseServiceException, org.apache.thrift.TException
301
    {
302
      send_startPurchase(purchaseOrderId, invoiceNumber, freightCharges);
303
      return recv_startPurchase();
304
    }
305
 
306
    public void send_startPurchase(long purchaseOrderId, String invoiceNumber, double freightCharges) throws org.apache.thrift.TException
307
    {
308
      startPurchase_args args = new startPurchase_args();
309
      args.setPurchaseOrderId(purchaseOrderId);
310
      args.setInvoiceNumber(invoiceNumber);
311
      args.setFreightCharges(freightCharges);
312
      sendBase("startPurchase", args);
313
    }
314
 
315
    public long recv_startPurchase() throws PurchaseServiceException, org.apache.thrift.TException
316
    {
317
      startPurchase_result result = new startPurchase_result();
318
      receiveBase(result, "startPurchase");
319
      if (result.isSetSuccess()) {
320
        return result.success;
321
      }
322
      if (result.e != null) {
323
        throw result.e;
324
      }
325
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "startPurchase failed: unknown result");
326
    }
327
 
328
    public long closePurchase(long purchaseId) throws PurchaseServiceException, org.apache.thrift.TException
329
    {
330
      send_closePurchase(purchaseId);
331
      return recv_closePurchase();
332
    }
333
 
334
    public void send_closePurchase(long purchaseId) throws org.apache.thrift.TException
335
    {
336
      closePurchase_args args = new closePurchase_args();
337
      args.setPurchaseId(purchaseId);
338
      sendBase("closePurchase", args);
339
    }
340
 
341
    public long recv_closePurchase() throws PurchaseServiceException, org.apache.thrift.TException
342
    {
343
      closePurchase_result result = new closePurchase_result();
344
      receiveBase(result, "closePurchase");
345
      if (result.isSetSuccess()) {
346
        return result.success;
347
      }
348
      if (result.e != null) {
349
        throw result.e;
350
      }
351
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "closePurchase failed: unknown result");
352
    }
353
 
354
    public List<Purchase> getAllPurchases(long purchaseOrderId, boolean open) throws PurchaseServiceException, org.apache.thrift.TException
355
    {
356
      send_getAllPurchases(purchaseOrderId, open);
357
      return recv_getAllPurchases();
358
    }
359
 
360
    public void send_getAllPurchases(long purchaseOrderId, boolean open) throws org.apache.thrift.TException
361
    {
362
      getAllPurchases_args args = new getAllPurchases_args();
363
      args.setPurchaseOrderId(purchaseOrderId);
364
      args.setOpen(open);
365
      sendBase("getAllPurchases", args);
366
    }
367
 
368
    public List<Purchase> recv_getAllPurchases() throws PurchaseServiceException, org.apache.thrift.TException
369
    {
370
      getAllPurchases_result result = new getAllPurchases_result();
371
      receiveBase(result, "getAllPurchases");
372
      if (result.isSetSuccess()) {
373
        return result.success;
374
      }
375
      if (result.e != null) {
376
        throw result.e;
377
      }
378
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getAllPurchases failed: unknown result");
379
    }
380
 
4555 mandeep.dh 381
    public PurchaseOrder getPurchaseOrderForPurchase(long purchaseId) throws org.apache.thrift.TException
4496 mandeep.dh 382
    {
4555 mandeep.dh 383
      send_getPurchaseOrderForPurchase(purchaseId);
384
      return recv_getPurchaseOrderForPurchase();
4496 mandeep.dh 385
    }
386
 
4555 mandeep.dh 387
    public void send_getPurchaseOrderForPurchase(long purchaseId) throws org.apache.thrift.TException
4496 mandeep.dh 388
    {
4555 mandeep.dh 389
      getPurchaseOrderForPurchase_args args = new getPurchaseOrderForPurchase_args();
4496 mandeep.dh 390
      args.setPurchaseId(purchaseId);
4555 mandeep.dh 391
      sendBase("getPurchaseOrderForPurchase", args);
4496 mandeep.dh 392
    }
393
 
4555 mandeep.dh 394
    public PurchaseOrder recv_getPurchaseOrderForPurchase() throws org.apache.thrift.TException
4496 mandeep.dh 395
    {
4555 mandeep.dh 396
      getPurchaseOrderForPurchase_result result = new getPurchaseOrderForPurchase_result();
397
      receiveBase(result, "getPurchaseOrderForPurchase");
4496 mandeep.dh 398
      if (result.isSetSuccess()) {
399
        return result.success;
400
      }
4555 mandeep.dh 401
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getPurchaseOrderForPurchase failed: unknown result");
4496 mandeep.dh 402
    }
403
 
4754 mandeep.dh 404
    public List<PurchaseOrder> getPendingPurchaseOrders(long warehouseId) throws PurchaseServiceException, org.apache.thrift.TException
405
    {
406
      send_getPendingPurchaseOrders(warehouseId);
407
      return recv_getPendingPurchaseOrders();
408
    }
409
 
410
    public void send_getPendingPurchaseOrders(long warehouseId) throws org.apache.thrift.TException
411
    {
412
      getPendingPurchaseOrders_args args = new getPendingPurchaseOrders_args();
413
      args.setWarehouseId(warehouseId);
414
      sendBase("getPendingPurchaseOrders", args);
415
    }
416
 
417
    public List<PurchaseOrder> recv_getPendingPurchaseOrders() throws PurchaseServiceException, org.apache.thrift.TException
418
    {
419
      getPendingPurchaseOrders_result result = new getPendingPurchaseOrders_result();
420
      receiveBase(result, "getPendingPurchaseOrders");
421
      if (result.isSetSuccess()) {
422
        return result.success;
423
      }
424
      if (result.e != null) {
425
        throw result.e;
426
      }
427
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getPendingPurchaseOrders failed: unknown result");
428
    }
429
 
430
    public List<Supplier> getSuppliers() throws PurchaseServiceException, org.apache.thrift.TException
431
    {
432
      send_getSuppliers();
433
      return recv_getSuppliers();
434
    }
435
 
436
    public void send_getSuppliers() throws org.apache.thrift.TException
437
    {
438
      getSuppliers_args args = new getSuppliers_args();
439
      sendBase("getSuppliers", args);
440
    }
441
 
442
    public List<Supplier> recv_getSuppliers() throws PurchaseServiceException, org.apache.thrift.TException
443
    {
444
      getSuppliers_result result = new getSuppliers_result();
445
      receiveBase(result, "getSuppliers");
446
      if (result.isSetSuccess()) {
447
        return result.success;
448
      }
449
      if (result.e != null) {
450
        throw result.e;
451
      }
452
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getSuppliers failed: unknown result");
453
    }
454
 
455
    public void fulfillPO(long purchaseOrderId, long itemId, long quantity) throws PurchaseServiceException, org.apache.thrift.TException
456
    {
457
      send_fulfillPO(purchaseOrderId, itemId, quantity);
458
      recv_fulfillPO();
459
    }
460
 
461
    public void send_fulfillPO(long purchaseOrderId, long itemId, long quantity) throws org.apache.thrift.TException
462
    {
463
      fulfillPO_args args = new fulfillPO_args();
464
      args.setPurchaseOrderId(purchaseOrderId);
465
      args.setItemId(itemId);
466
      args.setQuantity(quantity);
467
      sendBase("fulfillPO", args);
468
    }
469
 
470
    public void recv_fulfillPO() throws PurchaseServiceException, org.apache.thrift.TException
471
    {
472
      fulfillPO_result result = new fulfillPO_result();
473
      receiveBase(result, "fulfillPO");
474
      if (result.e != null) {
475
        throw result.e;
476
      }
477
      return;
478
    }
479
 
480
    public void updatePurchaseOrder(PurchaseOrder purchaseOrder) throws PurchaseServiceException, org.apache.thrift.TException
481
    {
482
      send_updatePurchaseOrder(purchaseOrder);
483
      recv_updatePurchaseOrder();
484
    }
485
 
486
    public void send_updatePurchaseOrder(PurchaseOrder purchaseOrder) throws org.apache.thrift.TException
487
    {
488
      updatePurchaseOrder_args args = new updatePurchaseOrder_args();
489
      args.setPurchaseOrder(purchaseOrder);
490
      sendBase("updatePurchaseOrder", args);
491
    }
492
 
493
    public void recv_updatePurchaseOrder() throws PurchaseServiceException, org.apache.thrift.TException
494
    {
495
      updatePurchaseOrder_result result = new updatePurchaseOrder_result();
496
      receiveBase(result, "updatePurchaseOrder");
497
      if (result.e != null) {
498
        throw result.e;
499
      }
500
      return;
501
    }
502
 
5185 mandeep.dh 503
    public void unFulfillPO(long purchaseId, long itemId, long quantity) throws PurchaseServiceException, org.apache.thrift.TException
504
    {
505
      send_unFulfillPO(purchaseId, itemId, quantity);
506
      recv_unFulfillPO();
507
    }
508
 
509
    public void send_unFulfillPO(long purchaseId, long itemId, long quantity) throws org.apache.thrift.TException
510
    {
511
      unFulfillPO_args args = new unFulfillPO_args();
512
      args.setPurchaseId(purchaseId);
513
      args.setItemId(itemId);
514
      args.setQuantity(quantity);
515
      sendBase("unFulfillPO", args);
516
    }
517
 
518
    public void recv_unFulfillPO() throws PurchaseServiceException, org.apache.thrift.TException
519
    {
520
      unFulfillPO_result result = new unFulfillPO_result();
521
      receiveBase(result, "unFulfillPO");
522
      if (result.e != null) {
523
        throw result.e;
524
      }
525
      return;
526
    }
527
 
5443 mandeep.dh 528
    public List<Invoice> getInvoices(long date) throws org.apache.thrift.TException
529
    {
530
      send_getInvoices(date);
531
      return recv_getInvoices();
532
    }
533
 
534
    public void send_getInvoices(long date) throws org.apache.thrift.TException
535
    {
536
      getInvoices_args args = new getInvoices_args();
537
      args.setDate(date);
538
      sendBase("getInvoices", args);
539
    }
540
 
541
    public List<Invoice> recv_getInvoices() throws org.apache.thrift.TException
542
    {
543
      getInvoices_result result = new getInvoices_result();
544
      receiveBase(result, "getInvoices");
545
      if (result.isSetSuccess()) {
546
        return result.success;
547
      }
548
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getInvoices failed: unknown result");
549
    }
550
 
551
    public void createInvoice(Invoice invoice) throws PurchaseServiceException, org.apache.thrift.TException
552
    {
553
      send_createInvoice(invoice);
554
      recv_createInvoice();
555
    }
556
 
557
    public void send_createInvoice(Invoice invoice) throws org.apache.thrift.TException
558
    {
559
      createInvoice_args args = new createInvoice_args();
560
      args.setInvoice(invoice);
561
      sendBase("createInvoice", args);
562
    }
563
 
564
    public void recv_createInvoice() throws PurchaseServiceException, org.apache.thrift.TException
565
    {
566
      createInvoice_result result = new createInvoice_result();
567
      receiveBase(result, "createInvoice");
568
      if (result.e != null) {
569
        throw result.e;
570
      }
571
      return;
572
    }
573
 
4496 mandeep.dh 574
  }
575
  public static class AsyncClient extends in.shop2020.generic.GenericService.AsyncClient implements AsyncIface {
576
    public static class Factory implements org.apache.thrift.async.TAsyncClientFactory<AsyncClient> {
577
      private org.apache.thrift.async.TAsyncClientManager clientManager;
578
      private org.apache.thrift.protocol.TProtocolFactory protocolFactory;
579
      public Factory(org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.protocol.TProtocolFactory protocolFactory) {
580
        this.clientManager = clientManager;
581
        this.protocolFactory = protocolFactory;
582
      }
583
      public AsyncClient getAsyncClient(org.apache.thrift.transport.TNonblockingTransport transport) {
584
        return new AsyncClient(protocolFactory, clientManager, transport);
585
      }
586
    }
587
 
588
    public AsyncClient(org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.transport.TNonblockingTransport transport) {
589
      super(protocolFactory, clientManager, transport);
590
    }
591
 
592
    public void createPurchaseOrder(PurchaseOrder purchaseOrder, org.apache.thrift.async.AsyncMethodCallback<createPurchaseOrder_call> resultHandler) throws org.apache.thrift.TException {
593
      checkReady();
594
      createPurchaseOrder_call method_call = new createPurchaseOrder_call(purchaseOrder, resultHandler, this, ___protocolFactory, ___transport);
595
      this.___currentMethod = method_call;
596
      ___manager.call(method_call);
597
    }
598
 
599
    public static class createPurchaseOrder_call extends org.apache.thrift.async.TAsyncMethodCall {
600
      private PurchaseOrder purchaseOrder;
601
      public createPurchaseOrder_call(PurchaseOrder purchaseOrder, org.apache.thrift.async.AsyncMethodCallback<createPurchaseOrder_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.purchaseOrder = purchaseOrder;
604
      }
605
 
606
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
607
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("createPurchaseOrder", org.apache.thrift.protocol.TMessageType.CALL, 0));
608
        createPurchaseOrder_args args = new createPurchaseOrder_args();
609
        args.setPurchaseOrder(purchaseOrder);
610
        args.write(prot);
611
        prot.writeMessageEnd();
612
      }
613
 
614
      public long getResult() throws PurchaseServiceException, org.apache.thrift.TException {
615
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
616
          throw new IllegalStateException("Method call not finished!");
617
        }
618
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
619
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
620
        return (new Client(prot)).recv_createPurchaseOrder();
621
      }
622
    }
623
 
624
    public void getPurchaseOrder(long id, org.apache.thrift.async.AsyncMethodCallback<getPurchaseOrder_call> resultHandler) throws org.apache.thrift.TException {
625
      checkReady();
626
      getPurchaseOrder_call method_call = new getPurchaseOrder_call(id, resultHandler, this, ___protocolFactory, ___transport);
627
      this.___currentMethod = method_call;
628
      ___manager.call(method_call);
629
    }
630
 
631
    public static class getPurchaseOrder_call extends org.apache.thrift.async.TAsyncMethodCall {
632
      private long id;
633
      public getPurchaseOrder_call(long id, org.apache.thrift.async.AsyncMethodCallback<getPurchaseOrder_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 {
634
        super(client, protocolFactory, transport, resultHandler, false);
635
        this.id = id;
636
      }
637
 
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("getPurchaseOrder", org.apache.thrift.protocol.TMessageType.CALL, 0));
640
        getPurchaseOrder_args args = new getPurchaseOrder_args();
641
        args.setId(id);
642
        args.write(prot);
643
        prot.writeMessageEnd();
644
      }
645
 
646
      public PurchaseOrder getResult() throws PurchaseServiceException, org.apache.thrift.TException {
647
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
648
          throw new IllegalStateException("Method call not finished!");
649
        }
650
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
651
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
652
        return (new Client(prot)).recv_getPurchaseOrder();
653
      }
654
    }
655
 
656
    public void getAllPurchaseOrders(POStatus status, org.apache.thrift.async.AsyncMethodCallback<getAllPurchaseOrders_call> resultHandler) throws org.apache.thrift.TException {
657
      checkReady();
658
      getAllPurchaseOrders_call method_call = new getAllPurchaseOrders_call(status, resultHandler, this, ___protocolFactory, ___transport);
659
      this.___currentMethod = method_call;
660
      ___manager.call(method_call);
661
    }
662
 
663
    public static class getAllPurchaseOrders_call extends org.apache.thrift.async.TAsyncMethodCall {
664
      private POStatus status;
665
      public getAllPurchaseOrders_call(POStatus status, org.apache.thrift.async.AsyncMethodCallback<getAllPurchaseOrders_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 {
666
        super(client, protocolFactory, transport, resultHandler, false);
667
        this.status = status;
668
      }
669
 
670
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
671
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getAllPurchaseOrders", org.apache.thrift.protocol.TMessageType.CALL, 0));
672
        getAllPurchaseOrders_args args = new getAllPurchaseOrders_args();
673
        args.setStatus(status);
674
        args.write(prot);
675
        prot.writeMessageEnd();
676
      }
677
 
678
      public List<PurchaseOrder> getResult() throws PurchaseServiceException, org.apache.thrift.TException {
679
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
680
          throw new IllegalStateException("Method call not finished!");
681
        }
682
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
683
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
684
        return (new Client(prot)).recv_getAllPurchaseOrders();
685
      }
686
    }
687
 
688
    public void getSupplier(long id, org.apache.thrift.async.AsyncMethodCallback<getSupplier_call> resultHandler) throws org.apache.thrift.TException {
689
      checkReady();
690
      getSupplier_call method_call = new getSupplier_call(id, resultHandler, this, ___protocolFactory, ___transport);
691
      this.___currentMethod = method_call;
692
      ___manager.call(method_call);
693
    }
694
 
695
    public static class getSupplier_call extends org.apache.thrift.async.TAsyncMethodCall {
696
      private long id;
697
      public getSupplier_call(long id, org.apache.thrift.async.AsyncMethodCallback<getSupplier_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 {
698
        super(client, protocolFactory, transport, resultHandler, false);
699
        this.id = id;
700
      }
701
 
702
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
703
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getSupplier", org.apache.thrift.protocol.TMessageType.CALL, 0));
704
        getSupplier_args args = new getSupplier_args();
705
        args.setId(id);
706
        args.write(prot);
707
        prot.writeMessageEnd();
708
      }
709
 
710
      public Supplier getResult() throws PurchaseServiceException, org.apache.thrift.TException {
711
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
712
          throw new IllegalStateException("Method call not finished!");
713
        }
714
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
715
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
716
        return (new Client(prot)).recv_getSupplier();
717
      }
718
    }
719
 
720
    public void startPurchase(long purchaseOrderId, String invoiceNumber, double freightCharges, org.apache.thrift.async.AsyncMethodCallback<startPurchase_call> resultHandler) throws org.apache.thrift.TException {
721
      checkReady();
722
      startPurchase_call method_call = new startPurchase_call(purchaseOrderId, invoiceNumber, freightCharges, resultHandler, this, ___protocolFactory, ___transport);
723
      this.___currentMethod = method_call;
724
      ___manager.call(method_call);
725
    }
726
 
727
    public static class startPurchase_call extends org.apache.thrift.async.TAsyncMethodCall {
728
      private long purchaseOrderId;
729
      private String invoiceNumber;
730
      private double freightCharges;
731
      public startPurchase_call(long purchaseOrderId, String invoiceNumber, double freightCharges, org.apache.thrift.async.AsyncMethodCallback<startPurchase_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 {
732
        super(client, protocolFactory, transport, resultHandler, false);
733
        this.purchaseOrderId = purchaseOrderId;
734
        this.invoiceNumber = invoiceNumber;
735
        this.freightCharges = freightCharges;
736
      }
737
 
738
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
739
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("startPurchase", org.apache.thrift.protocol.TMessageType.CALL, 0));
740
        startPurchase_args args = new startPurchase_args();
741
        args.setPurchaseOrderId(purchaseOrderId);
742
        args.setInvoiceNumber(invoiceNumber);
743
        args.setFreightCharges(freightCharges);
744
        args.write(prot);
745
        prot.writeMessageEnd();
746
      }
747
 
748
      public long getResult() throws PurchaseServiceException, org.apache.thrift.TException {
749
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
750
          throw new IllegalStateException("Method call not finished!");
751
        }
752
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
753
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
754
        return (new Client(prot)).recv_startPurchase();
755
      }
756
    }
757
 
758
    public void closePurchase(long purchaseId, org.apache.thrift.async.AsyncMethodCallback<closePurchase_call> resultHandler) throws org.apache.thrift.TException {
759
      checkReady();
760
      closePurchase_call method_call = new closePurchase_call(purchaseId, resultHandler, this, ___protocolFactory, ___transport);
761
      this.___currentMethod = method_call;
762
      ___manager.call(method_call);
763
    }
764
 
765
    public static class closePurchase_call extends org.apache.thrift.async.TAsyncMethodCall {
766
      private long purchaseId;
767
      public closePurchase_call(long purchaseId, org.apache.thrift.async.AsyncMethodCallback<closePurchase_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 {
768
        super(client, protocolFactory, transport, resultHandler, false);
769
        this.purchaseId = purchaseId;
770
      }
771
 
772
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
773
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("closePurchase", org.apache.thrift.protocol.TMessageType.CALL, 0));
774
        closePurchase_args args = new closePurchase_args();
775
        args.setPurchaseId(purchaseId);
776
        args.write(prot);
777
        prot.writeMessageEnd();
778
      }
779
 
780
      public long getResult() throws PurchaseServiceException, org.apache.thrift.TException {
781
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
782
          throw new IllegalStateException("Method call not finished!");
783
        }
784
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
785
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
786
        return (new Client(prot)).recv_closePurchase();
787
      }
788
    }
789
 
790
    public void getAllPurchases(long purchaseOrderId, boolean open, org.apache.thrift.async.AsyncMethodCallback<getAllPurchases_call> resultHandler) throws org.apache.thrift.TException {
791
      checkReady();
792
      getAllPurchases_call method_call = new getAllPurchases_call(purchaseOrderId, open, resultHandler, this, ___protocolFactory, ___transport);
793
      this.___currentMethod = method_call;
794
      ___manager.call(method_call);
795
    }
796
 
797
    public static class getAllPurchases_call extends org.apache.thrift.async.TAsyncMethodCall {
798
      private long purchaseOrderId;
799
      private boolean open;
800
      public getAllPurchases_call(long purchaseOrderId, boolean open, org.apache.thrift.async.AsyncMethodCallback<getAllPurchases_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 {
801
        super(client, protocolFactory, transport, resultHandler, false);
802
        this.purchaseOrderId = purchaseOrderId;
803
        this.open = open;
804
      }
805
 
806
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
807
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getAllPurchases", org.apache.thrift.protocol.TMessageType.CALL, 0));
808
        getAllPurchases_args args = new getAllPurchases_args();
809
        args.setPurchaseOrderId(purchaseOrderId);
810
        args.setOpen(open);
811
        args.write(prot);
812
        prot.writeMessageEnd();
813
      }
814
 
815
      public List<Purchase> getResult() throws PurchaseServiceException, org.apache.thrift.TException {
816
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
817
          throw new IllegalStateException("Method call not finished!");
818
        }
819
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
820
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
821
        return (new Client(prot)).recv_getAllPurchases();
822
      }
823
    }
824
 
4555 mandeep.dh 825
    public void getPurchaseOrderForPurchase(long purchaseId, org.apache.thrift.async.AsyncMethodCallback<getPurchaseOrderForPurchase_call> resultHandler) throws org.apache.thrift.TException {
4496 mandeep.dh 826
      checkReady();
4555 mandeep.dh 827
      getPurchaseOrderForPurchase_call method_call = new getPurchaseOrderForPurchase_call(purchaseId, resultHandler, this, ___protocolFactory, ___transport);
4496 mandeep.dh 828
      this.___currentMethod = method_call;
829
      ___manager.call(method_call);
830
    }
831
 
4555 mandeep.dh 832
    public static class getPurchaseOrderForPurchase_call extends org.apache.thrift.async.TAsyncMethodCall {
4496 mandeep.dh 833
      private long purchaseId;
4555 mandeep.dh 834
      public getPurchaseOrderForPurchase_call(long purchaseId, org.apache.thrift.async.AsyncMethodCallback<getPurchaseOrderForPurchase_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 {
4496 mandeep.dh 835
        super(client, protocolFactory, transport, resultHandler, false);
836
        this.purchaseId = purchaseId;
837
      }
838
 
839
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
4555 mandeep.dh 840
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getPurchaseOrderForPurchase", org.apache.thrift.protocol.TMessageType.CALL, 0));
841
        getPurchaseOrderForPurchase_args args = new getPurchaseOrderForPurchase_args();
4496 mandeep.dh 842
        args.setPurchaseId(purchaseId);
843
        args.write(prot);
844
        prot.writeMessageEnd();
845
      }
846
 
4555 mandeep.dh 847
      public PurchaseOrder getResult() throws org.apache.thrift.TException {
4496 mandeep.dh 848
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
849
          throw new IllegalStateException("Method call not finished!");
850
        }
851
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
852
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
4555 mandeep.dh 853
        return (new Client(prot)).recv_getPurchaseOrderForPurchase();
4496 mandeep.dh 854
      }
855
    }
856
 
4754 mandeep.dh 857
    public void getPendingPurchaseOrders(long warehouseId, org.apache.thrift.async.AsyncMethodCallback<getPendingPurchaseOrders_call> resultHandler) throws org.apache.thrift.TException {
858
      checkReady();
859
      getPendingPurchaseOrders_call method_call = new getPendingPurchaseOrders_call(warehouseId, resultHandler, this, ___protocolFactory, ___transport);
860
      this.___currentMethod = method_call;
861
      ___manager.call(method_call);
862
    }
863
 
864
    public static class getPendingPurchaseOrders_call extends org.apache.thrift.async.TAsyncMethodCall {
865
      private long warehouseId;
866
      public getPendingPurchaseOrders_call(long warehouseId, org.apache.thrift.async.AsyncMethodCallback<getPendingPurchaseOrders_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 {
867
        super(client, protocolFactory, transport, resultHandler, false);
868
        this.warehouseId = warehouseId;
869
      }
870
 
871
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
872
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getPendingPurchaseOrders", org.apache.thrift.protocol.TMessageType.CALL, 0));
873
        getPendingPurchaseOrders_args args = new getPendingPurchaseOrders_args();
874
        args.setWarehouseId(warehouseId);
875
        args.write(prot);
876
        prot.writeMessageEnd();
877
      }
878
 
879
      public List<PurchaseOrder> getResult() throws PurchaseServiceException, org.apache.thrift.TException {
880
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
881
          throw new IllegalStateException("Method call not finished!");
882
        }
883
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
884
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
885
        return (new Client(prot)).recv_getPendingPurchaseOrders();
886
      }
887
    }
888
 
889
    public void getSuppliers(org.apache.thrift.async.AsyncMethodCallback<getSuppliers_call> resultHandler) throws org.apache.thrift.TException {
890
      checkReady();
891
      getSuppliers_call method_call = new getSuppliers_call(resultHandler, this, ___protocolFactory, ___transport);
892
      this.___currentMethod = method_call;
893
      ___manager.call(method_call);
894
    }
895
 
896
    public static class getSuppliers_call extends org.apache.thrift.async.TAsyncMethodCall {
897
      public getSuppliers_call(org.apache.thrift.async.AsyncMethodCallback<getSuppliers_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 {
898
        super(client, protocolFactory, transport, resultHandler, false);
899
      }
900
 
901
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
902
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getSuppliers", org.apache.thrift.protocol.TMessageType.CALL, 0));
903
        getSuppliers_args args = new getSuppliers_args();
904
        args.write(prot);
905
        prot.writeMessageEnd();
906
      }
907
 
908
      public List<Supplier> getResult() throws PurchaseServiceException, org.apache.thrift.TException {
909
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
910
          throw new IllegalStateException("Method call not finished!");
911
        }
912
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
913
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
914
        return (new Client(prot)).recv_getSuppliers();
915
      }
916
    }
917
 
918
    public void fulfillPO(long purchaseOrderId, long itemId, long quantity, org.apache.thrift.async.AsyncMethodCallback<fulfillPO_call> resultHandler) throws org.apache.thrift.TException {
919
      checkReady();
920
      fulfillPO_call method_call = new fulfillPO_call(purchaseOrderId, itemId, quantity, resultHandler, this, ___protocolFactory, ___transport);
921
      this.___currentMethod = method_call;
922
      ___manager.call(method_call);
923
    }
924
 
925
    public static class fulfillPO_call extends org.apache.thrift.async.TAsyncMethodCall {
926
      private long purchaseOrderId;
927
      private long itemId;
928
      private long quantity;
929
      public fulfillPO_call(long purchaseOrderId, long itemId, long quantity, org.apache.thrift.async.AsyncMethodCallback<fulfillPO_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 {
930
        super(client, protocolFactory, transport, resultHandler, false);
931
        this.purchaseOrderId = purchaseOrderId;
932
        this.itemId = itemId;
933
        this.quantity = quantity;
934
      }
935
 
936
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
937
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("fulfillPO", org.apache.thrift.protocol.TMessageType.CALL, 0));
938
        fulfillPO_args args = new fulfillPO_args();
939
        args.setPurchaseOrderId(purchaseOrderId);
940
        args.setItemId(itemId);
941
        args.setQuantity(quantity);
942
        args.write(prot);
943
        prot.writeMessageEnd();
944
      }
945
 
946
      public void getResult() throws PurchaseServiceException, org.apache.thrift.TException {
947
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
948
          throw new IllegalStateException("Method call not finished!");
949
        }
950
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
951
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
952
        (new Client(prot)).recv_fulfillPO();
953
      }
954
    }
955
 
956
    public void updatePurchaseOrder(PurchaseOrder purchaseOrder, org.apache.thrift.async.AsyncMethodCallback<updatePurchaseOrder_call> resultHandler) throws org.apache.thrift.TException {
957
      checkReady();
958
      updatePurchaseOrder_call method_call = new updatePurchaseOrder_call(purchaseOrder, resultHandler, this, ___protocolFactory, ___transport);
959
      this.___currentMethod = method_call;
960
      ___manager.call(method_call);
961
    }
962
 
963
    public static class updatePurchaseOrder_call extends org.apache.thrift.async.TAsyncMethodCall {
964
      private PurchaseOrder purchaseOrder;
965
      public updatePurchaseOrder_call(PurchaseOrder purchaseOrder, org.apache.thrift.async.AsyncMethodCallback<updatePurchaseOrder_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 {
966
        super(client, protocolFactory, transport, resultHandler, false);
967
        this.purchaseOrder = purchaseOrder;
968
      }
969
 
970
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
971
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("updatePurchaseOrder", org.apache.thrift.protocol.TMessageType.CALL, 0));
972
        updatePurchaseOrder_args args = new updatePurchaseOrder_args();
973
        args.setPurchaseOrder(purchaseOrder);
974
        args.write(prot);
975
        prot.writeMessageEnd();
976
      }
977
 
978
      public void getResult() throws PurchaseServiceException, org.apache.thrift.TException {
979
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
980
          throw new IllegalStateException("Method call not finished!");
981
        }
982
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
983
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
984
        (new Client(prot)).recv_updatePurchaseOrder();
985
      }
986
    }
987
 
5185 mandeep.dh 988
    public void unFulfillPO(long purchaseId, long itemId, long quantity, org.apache.thrift.async.AsyncMethodCallback<unFulfillPO_call> resultHandler) throws org.apache.thrift.TException {
989
      checkReady();
990
      unFulfillPO_call method_call = new unFulfillPO_call(purchaseId, itemId, quantity, resultHandler, this, ___protocolFactory, ___transport);
991
      this.___currentMethod = method_call;
992
      ___manager.call(method_call);
993
    }
994
 
995
    public static class unFulfillPO_call extends org.apache.thrift.async.TAsyncMethodCall {
996
      private long purchaseId;
997
      private long itemId;
998
      private long quantity;
999
      public unFulfillPO_call(long purchaseId, long itemId, long quantity, org.apache.thrift.async.AsyncMethodCallback<unFulfillPO_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 {
1000
        super(client, protocolFactory, transport, resultHandler, false);
1001
        this.purchaseId = purchaseId;
1002
        this.itemId = itemId;
1003
        this.quantity = quantity;
1004
      }
1005
 
1006
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1007
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("unFulfillPO", org.apache.thrift.protocol.TMessageType.CALL, 0));
1008
        unFulfillPO_args args = new unFulfillPO_args();
1009
        args.setPurchaseId(purchaseId);
1010
        args.setItemId(itemId);
1011
        args.setQuantity(quantity);
1012
        args.write(prot);
1013
        prot.writeMessageEnd();
1014
      }
1015
 
1016
      public void getResult() throws PurchaseServiceException, org.apache.thrift.TException {
1017
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1018
          throw new IllegalStateException("Method call not finished!");
1019
        }
1020
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1021
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1022
        (new Client(prot)).recv_unFulfillPO();
1023
      }
1024
    }
1025
 
5443 mandeep.dh 1026
    public void getInvoices(long date, org.apache.thrift.async.AsyncMethodCallback<getInvoices_call> resultHandler) throws org.apache.thrift.TException {
1027
      checkReady();
1028
      getInvoices_call method_call = new getInvoices_call(date, resultHandler, this, ___protocolFactory, ___transport);
1029
      this.___currentMethod = method_call;
1030
      ___manager.call(method_call);
1031
    }
1032
 
1033
    public static class getInvoices_call extends org.apache.thrift.async.TAsyncMethodCall {
1034
      private long date;
1035
      public getInvoices_call(long date, org.apache.thrift.async.AsyncMethodCallback<getInvoices_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 {
1036
        super(client, protocolFactory, transport, resultHandler, false);
1037
        this.date = date;
1038
      }
1039
 
1040
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1041
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getInvoices", org.apache.thrift.protocol.TMessageType.CALL, 0));
1042
        getInvoices_args args = new getInvoices_args();
1043
        args.setDate(date);
1044
        args.write(prot);
1045
        prot.writeMessageEnd();
1046
      }
1047
 
1048
      public List<Invoice> getResult() throws org.apache.thrift.TException {
1049
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1050
          throw new IllegalStateException("Method call not finished!");
1051
        }
1052
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1053
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1054
        return (new Client(prot)).recv_getInvoices();
1055
      }
1056
    }
1057
 
1058
    public void createInvoice(Invoice invoice, org.apache.thrift.async.AsyncMethodCallback<createInvoice_call> resultHandler) throws org.apache.thrift.TException {
1059
      checkReady();
1060
      createInvoice_call method_call = new createInvoice_call(invoice, resultHandler, this, ___protocolFactory, ___transport);
1061
      this.___currentMethod = method_call;
1062
      ___manager.call(method_call);
1063
    }
1064
 
1065
    public static class createInvoice_call extends org.apache.thrift.async.TAsyncMethodCall {
1066
      private Invoice invoice;
1067
      public createInvoice_call(Invoice invoice, org.apache.thrift.async.AsyncMethodCallback<createInvoice_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 {
1068
        super(client, protocolFactory, transport, resultHandler, false);
1069
        this.invoice = invoice;
1070
      }
1071
 
1072
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1073
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("createInvoice", org.apache.thrift.protocol.TMessageType.CALL, 0));
1074
        createInvoice_args args = new createInvoice_args();
1075
        args.setInvoice(invoice);
1076
        args.write(prot);
1077
        prot.writeMessageEnd();
1078
      }
1079
 
1080
      public void getResult() throws PurchaseServiceException, org.apache.thrift.TException {
1081
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1082
          throw new IllegalStateException("Method call not finished!");
1083
        }
1084
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1085
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1086
        (new Client(prot)).recv_createInvoice();
1087
      }
1088
    }
1089
 
4496 mandeep.dh 1090
  }
1091
 
1092
  public static class Processor<I extends Iface> extends in.shop2020.generic.GenericService.Processor implements org.apache.thrift.TProcessor {
1093
    private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName());
1094
    public Processor(I iface) {
1095
      super(iface, getProcessMap(new HashMap<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>>()));
1096
    }
1097
 
1098
    protected Processor(I iface, Map<String,  org.apache.thrift.ProcessFunction<I, ? extends  org.apache.thrift.TBase>> processMap) {
1099
      super(iface, getProcessMap(processMap));
1100
    }
1101
 
1102
    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) {
1103
      processMap.put("createPurchaseOrder", new createPurchaseOrder());
1104
      processMap.put("getPurchaseOrder", new getPurchaseOrder());
1105
      processMap.put("getAllPurchaseOrders", new getAllPurchaseOrders());
1106
      processMap.put("getSupplier", new getSupplier());
1107
      processMap.put("startPurchase", new startPurchase());
1108
      processMap.put("closePurchase", new closePurchase());
1109
      processMap.put("getAllPurchases", new getAllPurchases());
4555 mandeep.dh 1110
      processMap.put("getPurchaseOrderForPurchase", new getPurchaseOrderForPurchase());
4754 mandeep.dh 1111
      processMap.put("getPendingPurchaseOrders", new getPendingPurchaseOrders());
1112
      processMap.put("getSuppliers", new getSuppliers());
1113
      processMap.put("fulfillPO", new fulfillPO());
1114
      processMap.put("updatePurchaseOrder", new updatePurchaseOrder());
5185 mandeep.dh 1115
      processMap.put("unFulfillPO", new unFulfillPO());
5443 mandeep.dh 1116
      processMap.put("getInvoices", new getInvoices());
1117
      processMap.put("createInvoice", new createInvoice());
4496 mandeep.dh 1118
      return processMap;
1119
    }
1120
 
1121
    private static class createPurchaseOrder<I extends Iface> extends org.apache.thrift.ProcessFunction<I, createPurchaseOrder_args> {
1122
      public createPurchaseOrder() {
1123
        super("createPurchaseOrder");
1124
      }
1125
 
1126
      protected createPurchaseOrder_args getEmptyArgsInstance() {
1127
        return new createPurchaseOrder_args();
1128
      }
1129
 
1130
      protected createPurchaseOrder_result getResult(I iface, createPurchaseOrder_args args) throws org.apache.thrift.TException {
1131
        createPurchaseOrder_result result = new createPurchaseOrder_result();
1132
        try {
1133
          result.success = iface.createPurchaseOrder(args.purchaseOrder);
1134
          result.setSuccessIsSet(true);
1135
        } catch (PurchaseServiceException e) {
1136
          result.e = e;
1137
        }
1138
        return result;
1139
      }
1140
    }
1141
 
1142
    private static class getPurchaseOrder<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getPurchaseOrder_args> {
1143
      public getPurchaseOrder() {
1144
        super("getPurchaseOrder");
1145
      }
1146
 
1147
      protected getPurchaseOrder_args getEmptyArgsInstance() {
1148
        return new getPurchaseOrder_args();
1149
      }
1150
 
1151
      protected getPurchaseOrder_result getResult(I iface, getPurchaseOrder_args args) throws org.apache.thrift.TException {
1152
        getPurchaseOrder_result result = new getPurchaseOrder_result();
1153
        try {
1154
          result.success = iface.getPurchaseOrder(args.id);
1155
        } catch (PurchaseServiceException e) {
1156
          result.e = e;
1157
        }
1158
        return result;
1159
      }
1160
    }
1161
 
1162
    private static class getAllPurchaseOrders<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getAllPurchaseOrders_args> {
1163
      public getAllPurchaseOrders() {
1164
        super("getAllPurchaseOrders");
1165
      }
1166
 
1167
      protected getAllPurchaseOrders_args getEmptyArgsInstance() {
1168
        return new getAllPurchaseOrders_args();
1169
      }
1170
 
1171
      protected getAllPurchaseOrders_result getResult(I iface, getAllPurchaseOrders_args args) throws org.apache.thrift.TException {
1172
        getAllPurchaseOrders_result result = new getAllPurchaseOrders_result();
1173
        try {
1174
          result.success = iface.getAllPurchaseOrders(args.status);
1175
        } catch (PurchaseServiceException e) {
1176
          result.e = e;
1177
        }
1178
        return result;
1179
      }
1180
    }
1181
 
1182
    private static class getSupplier<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getSupplier_args> {
1183
      public getSupplier() {
1184
        super("getSupplier");
1185
      }
1186
 
1187
      protected getSupplier_args getEmptyArgsInstance() {
1188
        return new getSupplier_args();
1189
      }
1190
 
1191
      protected getSupplier_result getResult(I iface, getSupplier_args args) throws org.apache.thrift.TException {
1192
        getSupplier_result result = new getSupplier_result();
1193
        try {
1194
          result.success = iface.getSupplier(args.id);
1195
        } catch (PurchaseServiceException e) {
1196
          result.e = e;
1197
        }
1198
        return result;
1199
      }
1200
    }
1201
 
1202
    private static class startPurchase<I extends Iface> extends org.apache.thrift.ProcessFunction<I, startPurchase_args> {
1203
      public startPurchase() {
1204
        super("startPurchase");
1205
      }
1206
 
1207
      protected startPurchase_args getEmptyArgsInstance() {
1208
        return new startPurchase_args();
1209
      }
1210
 
1211
      protected startPurchase_result getResult(I iface, startPurchase_args args) throws org.apache.thrift.TException {
1212
        startPurchase_result result = new startPurchase_result();
1213
        try {
1214
          result.success = iface.startPurchase(args.purchaseOrderId, args.invoiceNumber, args.freightCharges);
1215
          result.setSuccessIsSet(true);
1216
        } catch (PurchaseServiceException e) {
1217
          result.e = e;
1218
        }
1219
        return result;
1220
      }
1221
    }
1222
 
1223
    private static class closePurchase<I extends Iface> extends org.apache.thrift.ProcessFunction<I, closePurchase_args> {
1224
      public closePurchase() {
1225
        super("closePurchase");
1226
      }
1227
 
1228
      protected closePurchase_args getEmptyArgsInstance() {
1229
        return new closePurchase_args();
1230
      }
1231
 
1232
      protected closePurchase_result getResult(I iface, closePurchase_args args) throws org.apache.thrift.TException {
1233
        closePurchase_result result = new closePurchase_result();
1234
        try {
1235
          result.success = iface.closePurchase(args.purchaseId);
1236
          result.setSuccessIsSet(true);
1237
        } catch (PurchaseServiceException e) {
1238
          result.e = e;
1239
        }
1240
        return result;
1241
      }
1242
    }
1243
 
1244
    private static class getAllPurchases<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getAllPurchases_args> {
1245
      public getAllPurchases() {
1246
        super("getAllPurchases");
1247
      }
1248
 
1249
      protected getAllPurchases_args getEmptyArgsInstance() {
1250
        return new getAllPurchases_args();
1251
      }
1252
 
1253
      protected getAllPurchases_result getResult(I iface, getAllPurchases_args args) throws org.apache.thrift.TException {
1254
        getAllPurchases_result result = new getAllPurchases_result();
1255
        try {
1256
          result.success = iface.getAllPurchases(args.purchaseOrderId, args.open);
1257
        } catch (PurchaseServiceException e) {
1258
          result.e = e;
1259
        }
1260
        return result;
1261
      }
1262
    }
1263
 
4555 mandeep.dh 1264
    private static class getPurchaseOrderForPurchase<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getPurchaseOrderForPurchase_args> {
1265
      public getPurchaseOrderForPurchase() {
1266
        super("getPurchaseOrderForPurchase");
4496 mandeep.dh 1267
      }
1268
 
4555 mandeep.dh 1269
      protected getPurchaseOrderForPurchase_args getEmptyArgsInstance() {
1270
        return new getPurchaseOrderForPurchase_args();
4496 mandeep.dh 1271
      }
1272
 
4555 mandeep.dh 1273
      protected getPurchaseOrderForPurchase_result getResult(I iface, getPurchaseOrderForPurchase_args args) throws org.apache.thrift.TException {
1274
        getPurchaseOrderForPurchase_result result = new getPurchaseOrderForPurchase_result();
1275
        result.success = iface.getPurchaseOrderForPurchase(args.purchaseId);
4496 mandeep.dh 1276
        return result;
1277
      }
1278
    }
1279
 
4754 mandeep.dh 1280
    private static class getPendingPurchaseOrders<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getPendingPurchaseOrders_args> {
1281
      public getPendingPurchaseOrders() {
1282
        super("getPendingPurchaseOrders");
1283
      }
1284
 
1285
      protected getPendingPurchaseOrders_args getEmptyArgsInstance() {
1286
        return new getPendingPurchaseOrders_args();
1287
      }
1288
 
1289
      protected getPendingPurchaseOrders_result getResult(I iface, getPendingPurchaseOrders_args args) throws org.apache.thrift.TException {
1290
        getPendingPurchaseOrders_result result = new getPendingPurchaseOrders_result();
1291
        try {
1292
          result.success = iface.getPendingPurchaseOrders(args.warehouseId);
1293
        } catch (PurchaseServiceException e) {
1294
          result.e = e;
1295
        }
1296
        return result;
1297
      }
1298
    }
1299
 
1300
    private static class getSuppliers<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getSuppliers_args> {
1301
      public getSuppliers() {
1302
        super("getSuppliers");
1303
      }
1304
 
1305
      protected getSuppliers_args getEmptyArgsInstance() {
1306
        return new getSuppliers_args();
1307
      }
1308
 
1309
      protected getSuppliers_result getResult(I iface, getSuppliers_args args) throws org.apache.thrift.TException {
1310
        getSuppliers_result result = new getSuppliers_result();
1311
        try {
1312
          result.success = iface.getSuppliers();
1313
        } catch (PurchaseServiceException e) {
1314
          result.e = e;
1315
        }
1316
        return result;
1317
      }
1318
    }
1319
 
1320
    private static class fulfillPO<I extends Iface> extends org.apache.thrift.ProcessFunction<I, fulfillPO_args> {
1321
      public fulfillPO() {
1322
        super("fulfillPO");
1323
      }
1324
 
1325
      protected fulfillPO_args getEmptyArgsInstance() {
1326
        return new fulfillPO_args();
1327
      }
1328
 
1329
      protected fulfillPO_result getResult(I iface, fulfillPO_args args) throws org.apache.thrift.TException {
1330
        fulfillPO_result result = new fulfillPO_result();
1331
        try {
1332
          iface.fulfillPO(args.purchaseOrderId, args.itemId, args.quantity);
1333
        } catch (PurchaseServiceException e) {
1334
          result.e = e;
1335
        }
1336
        return result;
1337
      }
1338
    }
1339
 
1340
    private static class updatePurchaseOrder<I extends Iface> extends org.apache.thrift.ProcessFunction<I, updatePurchaseOrder_args> {
1341
      public updatePurchaseOrder() {
1342
        super("updatePurchaseOrder");
1343
      }
1344
 
1345
      protected updatePurchaseOrder_args getEmptyArgsInstance() {
1346
        return new updatePurchaseOrder_args();
1347
      }
1348
 
1349
      protected updatePurchaseOrder_result getResult(I iface, updatePurchaseOrder_args args) throws org.apache.thrift.TException {
1350
        updatePurchaseOrder_result result = new updatePurchaseOrder_result();
1351
        try {
1352
          iface.updatePurchaseOrder(args.purchaseOrder);
1353
        } catch (PurchaseServiceException e) {
1354
          result.e = e;
1355
        }
1356
        return result;
1357
      }
1358
    }
1359
 
5185 mandeep.dh 1360
    private static class unFulfillPO<I extends Iface> extends org.apache.thrift.ProcessFunction<I, unFulfillPO_args> {
1361
      public unFulfillPO() {
1362
        super("unFulfillPO");
1363
      }
1364
 
1365
      protected unFulfillPO_args getEmptyArgsInstance() {
1366
        return new unFulfillPO_args();
1367
      }
1368
 
1369
      protected unFulfillPO_result getResult(I iface, unFulfillPO_args args) throws org.apache.thrift.TException {
1370
        unFulfillPO_result result = new unFulfillPO_result();
1371
        try {
1372
          iface.unFulfillPO(args.purchaseId, args.itemId, args.quantity);
1373
        } catch (PurchaseServiceException e) {
1374
          result.e = e;
1375
        }
1376
        return result;
1377
      }
1378
    }
1379
 
5443 mandeep.dh 1380
    private static class getInvoices<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getInvoices_args> {
1381
      public getInvoices() {
1382
        super("getInvoices");
1383
      }
1384
 
1385
      protected getInvoices_args getEmptyArgsInstance() {
1386
        return new getInvoices_args();
1387
      }
1388
 
1389
      protected getInvoices_result getResult(I iface, getInvoices_args args) throws org.apache.thrift.TException {
1390
        getInvoices_result result = new getInvoices_result();
1391
        result.success = iface.getInvoices(args.date);
1392
        return result;
1393
      }
1394
    }
1395
 
1396
    private static class createInvoice<I extends Iface> extends org.apache.thrift.ProcessFunction<I, createInvoice_args> {
1397
      public createInvoice() {
1398
        super("createInvoice");
1399
      }
1400
 
1401
      protected createInvoice_args getEmptyArgsInstance() {
1402
        return new createInvoice_args();
1403
      }
1404
 
1405
      protected createInvoice_result getResult(I iface, createInvoice_args args) throws org.apache.thrift.TException {
1406
        createInvoice_result result = new createInvoice_result();
1407
        try {
1408
          iface.createInvoice(args.invoice);
1409
        } catch (PurchaseServiceException e) {
1410
          result.e = e;
1411
        }
1412
        return result;
1413
      }
1414
    }
1415
 
4496 mandeep.dh 1416
  }
1417
 
1418
  public static class createPurchaseOrder_args implements org.apache.thrift.TBase<createPurchaseOrder_args, createPurchaseOrder_args._Fields>, java.io.Serializable, Cloneable   {
1419
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createPurchaseOrder_args");
1420
 
1421
    private static final org.apache.thrift.protocol.TField PURCHASE_ORDER_FIELD_DESC = new org.apache.thrift.protocol.TField("purchaseOrder", org.apache.thrift.protocol.TType.STRUCT, (short)1);
1422
 
1423
    private PurchaseOrder purchaseOrder; // required
1424
 
1425
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
1426
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1427
      PURCHASE_ORDER((short)1, "purchaseOrder");
1428
 
1429
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
1430
 
1431
      static {
1432
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
1433
          byName.put(field.getFieldName(), field);
1434
        }
1435
      }
1436
 
1437
      /**
1438
       * Find the _Fields constant that matches fieldId, or null if its not found.
1439
       */
1440
      public static _Fields findByThriftId(int fieldId) {
1441
        switch(fieldId) {
1442
          case 1: // PURCHASE_ORDER
1443
            return PURCHASE_ORDER;
1444
          default:
1445
            return null;
1446
        }
1447
      }
1448
 
1449
      /**
1450
       * Find the _Fields constant that matches fieldId, throwing an exception
1451
       * if it is not found.
1452
       */
1453
      public static _Fields findByThriftIdOrThrow(int fieldId) {
1454
        _Fields fields = findByThriftId(fieldId);
1455
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
1456
        return fields;
1457
      }
1458
 
1459
      /**
1460
       * Find the _Fields constant that matches name, or null if its not found.
1461
       */
1462
      public static _Fields findByName(String name) {
1463
        return byName.get(name);
1464
      }
1465
 
1466
      private final short _thriftId;
1467
      private final String _fieldName;
1468
 
1469
      _Fields(short thriftId, String fieldName) {
1470
        _thriftId = thriftId;
1471
        _fieldName = fieldName;
1472
      }
1473
 
1474
      public short getThriftFieldId() {
1475
        return _thriftId;
1476
      }
1477
 
1478
      public String getFieldName() {
1479
        return _fieldName;
1480
      }
1481
    }
1482
 
1483
    // isset id assignments
1484
 
1485
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1486
    static {
1487
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
1488
      tmpMap.put(_Fields.PURCHASE_ORDER, new org.apache.thrift.meta_data.FieldMetaData("purchaseOrder", org.apache.thrift.TFieldRequirementType.DEFAULT, 
1489
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, PurchaseOrder.class)));
1490
      metaDataMap = Collections.unmodifiableMap(tmpMap);
1491
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createPurchaseOrder_args.class, metaDataMap);
1492
    }
1493
 
1494
    public createPurchaseOrder_args() {
1495
    }
1496
 
1497
    public createPurchaseOrder_args(
1498
      PurchaseOrder purchaseOrder)
1499
    {
1500
      this();
1501
      this.purchaseOrder = purchaseOrder;
1502
    }
1503
 
1504
    /**
1505
     * Performs a deep copy on <i>other</i>.
1506
     */
1507
    public createPurchaseOrder_args(createPurchaseOrder_args other) {
1508
      if (other.isSetPurchaseOrder()) {
1509
        this.purchaseOrder = new PurchaseOrder(other.purchaseOrder);
1510
      }
1511
    }
1512
 
1513
    public createPurchaseOrder_args deepCopy() {
1514
      return new createPurchaseOrder_args(this);
1515
    }
1516
 
1517
    @Override
1518
    public void clear() {
1519
      this.purchaseOrder = null;
1520
    }
1521
 
1522
    public PurchaseOrder getPurchaseOrder() {
1523
      return this.purchaseOrder;
1524
    }
1525
 
1526
    public void setPurchaseOrder(PurchaseOrder purchaseOrder) {
1527
      this.purchaseOrder = purchaseOrder;
1528
    }
1529
 
1530
    public void unsetPurchaseOrder() {
1531
      this.purchaseOrder = null;
1532
    }
1533
 
1534
    /** Returns true if field purchaseOrder is set (has been assigned a value) and false otherwise */
1535
    public boolean isSetPurchaseOrder() {
1536
      return this.purchaseOrder != null;
1537
    }
1538
 
1539
    public void setPurchaseOrderIsSet(boolean value) {
1540
      if (!value) {
1541
        this.purchaseOrder = null;
1542
      }
1543
    }
1544
 
1545
    public void setFieldValue(_Fields field, Object value) {
1546
      switch (field) {
1547
      case PURCHASE_ORDER:
1548
        if (value == null) {
1549
          unsetPurchaseOrder();
1550
        } else {
1551
          setPurchaseOrder((PurchaseOrder)value);
1552
        }
1553
        break;
1554
 
1555
      }
1556
    }
1557
 
1558
    public Object getFieldValue(_Fields field) {
1559
      switch (field) {
1560
      case PURCHASE_ORDER:
1561
        return getPurchaseOrder();
1562
 
1563
      }
1564
      throw new IllegalStateException();
1565
    }
1566
 
1567
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
1568
    public boolean isSet(_Fields field) {
1569
      if (field == null) {
1570
        throw new IllegalArgumentException();
1571
      }
1572
 
1573
      switch (field) {
1574
      case PURCHASE_ORDER:
1575
        return isSetPurchaseOrder();
1576
      }
1577
      throw new IllegalStateException();
1578
    }
1579
 
1580
    @Override
1581
    public boolean equals(Object that) {
1582
      if (that == null)
1583
        return false;
1584
      if (that instanceof createPurchaseOrder_args)
1585
        return this.equals((createPurchaseOrder_args)that);
1586
      return false;
1587
    }
1588
 
1589
    public boolean equals(createPurchaseOrder_args that) {
1590
      if (that == null)
1591
        return false;
1592
 
1593
      boolean this_present_purchaseOrder = true && this.isSetPurchaseOrder();
1594
      boolean that_present_purchaseOrder = true && that.isSetPurchaseOrder();
1595
      if (this_present_purchaseOrder || that_present_purchaseOrder) {
1596
        if (!(this_present_purchaseOrder && that_present_purchaseOrder))
1597
          return false;
1598
        if (!this.purchaseOrder.equals(that.purchaseOrder))
1599
          return false;
1600
      }
1601
 
1602
      return true;
1603
    }
1604
 
1605
    @Override
1606
    public int hashCode() {
1607
      return 0;
1608
    }
1609
 
1610
    public int compareTo(createPurchaseOrder_args other) {
1611
      if (!getClass().equals(other.getClass())) {
1612
        return getClass().getName().compareTo(other.getClass().getName());
1613
      }
1614
 
1615
      int lastComparison = 0;
1616
      createPurchaseOrder_args typedOther = (createPurchaseOrder_args)other;
1617
 
1618
      lastComparison = Boolean.valueOf(isSetPurchaseOrder()).compareTo(typedOther.isSetPurchaseOrder());
1619
      if (lastComparison != 0) {
1620
        return lastComparison;
1621
      }
1622
      if (isSetPurchaseOrder()) {
1623
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.purchaseOrder, typedOther.purchaseOrder);
1624
        if (lastComparison != 0) {
1625
          return lastComparison;
1626
        }
1627
      }
1628
      return 0;
1629
    }
1630
 
1631
    public _Fields fieldForId(int fieldId) {
1632
      return _Fields.findByThriftId(fieldId);
1633
    }
1634
 
1635
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
1636
      org.apache.thrift.protocol.TField field;
1637
      iprot.readStructBegin();
1638
      while (true)
1639
      {
1640
        field = iprot.readFieldBegin();
1641
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1642
          break;
1643
        }
1644
        switch (field.id) {
1645
          case 1: // PURCHASE_ORDER
1646
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
1647
              this.purchaseOrder = new PurchaseOrder();
1648
              this.purchaseOrder.read(iprot);
1649
            } else { 
1650
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1651
            }
1652
            break;
1653
          default:
1654
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1655
        }
1656
        iprot.readFieldEnd();
1657
      }
1658
      iprot.readStructEnd();
1659
      validate();
1660
    }
1661
 
1662
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1663
      validate();
1664
 
1665
      oprot.writeStructBegin(STRUCT_DESC);
1666
      if (this.purchaseOrder != null) {
1667
        oprot.writeFieldBegin(PURCHASE_ORDER_FIELD_DESC);
1668
        this.purchaseOrder.write(oprot);
1669
        oprot.writeFieldEnd();
1670
      }
1671
      oprot.writeFieldStop();
1672
      oprot.writeStructEnd();
1673
    }
1674
 
1675
    @Override
1676
    public String toString() {
1677
      StringBuilder sb = new StringBuilder("createPurchaseOrder_args(");
1678
      boolean first = true;
1679
 
1680
      sb.append("purchaseOrder:");
1681
      if (this.purchaseOrder == null) {
1682
        sb.append("null");
1683
      } else {
1684
        sb.append(this.purchaseOrder);
1685
      }
1686
      first = false;
1687
      sb.append(")");
1688
      return sb.toString();
1689
    }
1690
 
1691
    public void validate() throws org.apache.thrift.TException {
1692
      // check for required fields
1693
    }
1694
 
1695
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
1696
      try {
1697
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
1698
      } catch (org.apache.thrift.TException te) {
1699
        throw new java.io.IOException(te);
1700
      }
1701
    }
1702
 
1703
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
1704
      try {
1705
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
1706
      } catch (org.apache.thrift.TException te) {
1707
        throw new java.io.IOException(te);
1708
      }
1709
    }
1710
 
1711
  }
1712
 
1713
  public static class createPurchaseOrder_result implements org.apache.thrift.TBase<createPurchaseOrder_result, createPurchaseOrder_result._Fields>, java.io.Serializable, Cloneable   {
1714
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createPurchaseOrder_result");
1715
 
1716
    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);
1717
    private static final org.apache.thrift.protocol.TField E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1);
1718
 
1719
    private long success; // required
1720
    private PurchaseServiceException e; // required
1721
 
1722
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
1723
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1724
      SUCCESS((short)0, "success"),
1725
      E((short)1, "e");
1726
 
1727
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
1728
 
1729
      static {
1730
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
1731
          byName.put(field.getFieldName(), field);
1732
        }
1733
      }
1734
 
1735
      /**
1736
       * Find the _Fields constant that matches fieldId, or null if its not found.
1737
       */
1738
      public static _Fields findByThriftId(int fieldId) {
1739
        switch(fieldId) {
1740
          case 0: // SUCCESS
1741
            return SUCCESS;
1742
          case 1: // E
1743
            return E;
1744
          default:
1745
            return null;
1746
        }
1747
      }
1748
 
1749
      /**
1750
       * Find the _Fields constant that matches fieldId, throwing an exception
1751
       * if it is not found.
1752
       */
1753
      public static _Fields findByThriftIdOrThrow(int fieldId) {
1754
        _Fields fields = findByThriftId(fieldId);
1755
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
1756
        return fields;
1757
      }
1758
 
1759
      /**
1760
       * Find the _Fields constant that matches name, or null if its not found.
1761
       */
1762
      public static _Fields findByName(String name) {
1763
        return byName.get(name);
1764
      }
1765
 
1766
      private final short _thriftId;
1767
      private final String _fieldName;
1768
 
1769
      _Fields(short thriftId, String fieldName) {
1770
        _thriftId = thriftId;
1771
        _fieldName = fieldName;
1772
      }
1773
 
1774
      public short getThriftFieldId() {
1775
        return _thriftId;
1776
      }
1777
 
1778
      public String getFieldName() {
1779
        return _fieldName;
1780
      }
1781
    }
1782
 
1783
    // isset id assignments
1784
    private static final int __SUCCESS_ISSET_ID = 0;
1785
    private BitSet __isset_bit_vector = new BitSet(1);
1786
 
1787
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1788
    static {
1789
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
1790
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
1791
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
1792
      tmpMap.put(_Fields.E, new org.apache.thrift.meta_data.FieldMetaData("e", org.apache.thrift.TFieldRequirementType.DEFAULT, 
1793
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
1794
      metaDataMap = Collections.unmodifiableMap(tmpMap);
1795
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createPurchaseOrder_result.class, metaDataMap);
1796
    }
1797
 
1798
    public createPurchaseOrder_result() {
1799
    }
1800
 
1801
    public createPurchaseOrder_result(
1802
      long success,
1803
      PurchaseServiceException e)
1804
    {
1805
      this();
1806
      this.success = success;
1807
      setSuccessIsSet(true);
1808
      this.e = e;
1809
    }
1810
 
1811
    /**
1812
     * Performs a deep copy on <i>other</i>.
1813
     */
1814
    public createPurchaseOrder_result(createPurchaseOrder_result other) {
1815
      __isset_bit_vector.clear();
1816
      __isset_bit_vector.or(other.__isset_bit_vector);
1817
      this.success = other.success;
1818
      if (other.isSetE()) {
1819
        this.e = new PurchaseServiceException(other.e);
1820
      }
1821
    }
1822
 
1823
    public createPurchaseOrder_result deepCopy() {
1824
      return new createPurchaseOrder_result(this);
1825
    }
1826
 
1827
    @Override
1828
    public void clear() {
1829
      setSuccessIsSet(false);
1830
      this.success = 0;
1831
      this.e = null;
1832
    }
1833
 
1834
    public long getSuccess() {
1835
      return this.success;
1836
    }
1837
 
1838
    public void setSuccess(long success) {
1839
      this.success = success;
1840
      setSuccessIsSet(true);
1841
    }
1842
 
1843
    public void unsetSuccess() {
1844
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
1845
    }
1846
 
1847
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
1848
    public boolean isSetSuccess() {
1849
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
1850
    }
1851
 
1852
    public void setSuccessIsSet(boolean value) {
1853
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
1854
    }
1855
 
1856
    public PurchaseServiceException getE() {
1857
      return this.e;
1858
    }
1859
 
1860
    public void setE(PurchaseServiceException e) {
1861
      this.e = e;
1862
    }
1863
 
1864
    public void unsetE() {
1865
      this.e = null;
1866
    }
1867
 
1868
    /** Returns true if field e is set (has been assigned a value) and false otherwise */
1869
    public boolean isSetE() {
1870
      return this.e != null;
1871
    }
1872
 
1873
    public void setEIsSet(boolean value) {
1874
      if (!value) {
1875
        this.e = null;
1876
      }
1877
    }
1878
 
1879
    public void setFieldValue(_Fields field, Object value) {
1880
      switch (field) {
1881
      case SUCCESS:
1882
        if (value == null) {
1883
          unsetSuccess();
1884
        } else {
1885
          setSuccess((Long)value);
1886
        }
1887
        break;
1888
 
1889
      case E:
1890
        if (value == null) {
1891
          unsetE();
1892
        } else {
1893
          setE((PurchaseServiceException)value);
1894
        }
1895
        break;
1896
 
1897
      }
1898
    }
1899
 
1900
    public Object getFieldValue(_Fields field) {
1901
      switch (field) {
1902
      case SUCCESS:
1903
        return Long.valueOf(getSuccess());
1904
 
1905
      case E:
1906
        return getE();
1907
 
1908
      }
1909
      throw new IllegalStateException();
1910
    }
1911
 
1912
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
1913
    public boolean isSet(_Fields field) {
1914
      if (field == null) {
1915
        throw new IllegalArgumentException();
1916
      }
1917
 
1918
      switch (field) {
1919
      case SUCCESS:
1920
        return isSetSuccess();
1921
      case E:
1922
        return isSetE();
1923
      }
1924
      throw new IllegalStateException();
1925
    }
1926
 
1927
    @Override
1928
    public boolean equals(Object that) {
1929
      if (that == null)
1930
        return false;
1931
      if (that instanceof createPurchaseOrder_result)
1932
        return this.equals((createPurchaseOrder_result)that);
1933
      return false;
1934
    }
1935
 
1936
    public boolean equals(createPurchaseOrder_result that) {
1937
      if (that == null)
1938
        return false;
1939
 
1940
      boolean this_present_success = true;
1941
      boolean that_present_success = true;
1942
      if (this_present_success || that_present_success) {
1943
        if (!(this_present_success && that_present_success))
1944
          return false;
1945
        if (this.success != that.success)
1946
          return false;
1947
      }
1948
 
1949
      boolean this_present_e = true && this.isSetE();
1950
      boolean that_present_e = true && that.isSetE();
1951
      if (this_present_e || that_present_e) {
1952
        if (!(this_present_e && that_present_e))
1953
          return false;
1954
        if (!this.e.equals(that.e))
1955
          return false;
1956
      }
1957
 
1958
      return true;
1959
    }
1960
 
1961
    @Override
1962
    public int hashCode() {
1963
      return 0;
1964
    }
1965
 
1966
    public int compareTo(createPurchaseOrder_result other) {
1967
      if (!getClass().equals(other.getClass())) {
1968
        return getClass().getName().compareTo(other.getClass().getName());
1969
      }
1970
 
1971
      int lastComparison = 0;
1972
      createPurchaseOrder_result typedOther = (createPurchaseOrder_result)other;
1973
 
1974
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
1975
      if (lastComparison != 0) {
1976
        return lastComparison;
1977
      }
1978
      if (isSetSuccess()) {
1979
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
1980
        if (lastComparison != 0) {
1981
          return lastComparison;
1982
        }
1983
      }
1984
      lastComparison = Boolean.valueOf(isSetE()).compareTo(typedOther.isSetE());
1985
      if (lastComparison != 0) {
1986
        return lastComparison;
1987
      }
1988
      if (isSetE()) {
1989
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, typedOther.e);
1990
        if (lastComparison != 0) {
1991
          return lastComparison;
1992
        }
1993
      }
1994
      return 0;
1995
    }
1996
 
1997
    public _Fields fieldForId(int fieldId) {
1998
      return _Fields.findByThriftId(fieldId);
1999
    }
2000
 
2001
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
2002
      org.apache.thrift.protocol.TField field;
2003
      iprot.readStructBegin();
2004
      while (true)
2005
      {
2006
        field = iprot.readFieldBegin();
2007
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
2008
          break;
2009
        }
2010
        switch (field.id) {
2011
          case 0: // SUCCESS
2012
            if (field.type == org.apache.thrift.protocol.TType.I64) {
2013
              this.success = iprot.readI64();
2014
              setSuccessIsSet(true);
2015
            } else { 
2016
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2017
            }
2018
            break;
2019
          case 1: // E
2020
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
2021
              this.e = new PurchaseServiceException();
2022
              this.e.read(iprot);
2023
            } else { 
2024
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2025
            }
2026
            break;
2027
          default:
2028
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2029
        }
2030
        iprot.readFieldEnd();
2031
      }
2032
      iprot.readStructEnd();
2033
      validate();
2034
    }
2035
 
2036
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
2037
      oprot.writeStructBegin(STRUCT_DESC);
2038
 
2039
      if (this.isSetSuccess()) {
2040
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
2041
        oprot.writeI64(this.success);
2042
        oprot.writeFieldEnd();
2043
      } else if (this.isSetE()) {
2044
        oprot.writeFieldBegin(E_FIELD_DESC);
2045
        this.e.write(oprot);
2046
        oprot.writeFieldEnd();
2047
      }
2048
      oprot.writeFieldStop();
2049
      oprot.writeStructEnd();
2050
    }
2051
 
2052
    @Override
2053
    public String toString() {
2054
      StringBuilder sb = new StringBuilder("createPurchaseOrder_result(");
2055
      boolean first = true;
2056
 
2057
      sb.append("success:");
2058
      sb.append(this.success);
2059
      first = false;
2060
      if (!first) sb.append(", ");
2061
      sb.append("e:");
2062
      if (this.e == null) {
2063
        sb.append("null");
2064
      } else {
2065
        sb.append(this.e);
2066
      }
2067
      first = false;
2068
      sb.append(")");
2069
      return sb.toString();
2070
    }
2071
 
2072
    public void validate() throws org.apache.thrift.TException {
2073
      // check for required fields
2074
    }
2075
 
2076
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
2077
      try {
2078
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
2079
      } catch (org.apache.thrift.TException te) {
2080
        throw new java.io.IOException(te);
2081
      }
2082
    }
2083
 
2084
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
2085
      try {
2086
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
2087
      } catch (org.apache.thrift.TException te) {
2088
        throw new java.io.IOException(te);
2089
      }
2090
    }
2091
 
2092
  }
2093
 
2094
  public static class getPurchaseOrder_args implements org.apache.thrift.TBase<getPurchaseOrder_args, getPurchaseOrder_args._Fields>, java.io.Serializable, Cloneable   {
2095
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getPurchaseOrder_args");
2096
 
2097
    private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.I64, (short)1);
2098
 
2099
    private long id; // required
2100
 
2101
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
2102
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
2103
      ID((short)1, "id");
2104
 
2105
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
2106
 
2107
      static {
2108
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
2109
          byName.put(field.getFieldName(), field);
2110
        }
2111
      }
2112
 
2113
      /**
2114
       * Find the _Fields constant that matches fieldId, or null if its not found.
2115
       */
2116
      public static _Fields findByThriftId(int fieldId) {
2117
        switch(fieldId) {
2118
          case 1: // ID
2119
            return ID;
2120
          default:
2121
            return null;
2122
        }
2123
      }
2124
 
2125
      /**
2126
       * Find the _Fields constant that matches fieldId, throwing an exception
2127
       * if it is not found.
2128
       */
2129
      public static _Fields findByThriftIdOrThrow(int fieldId) {
2130
        _Fields fields = findByThriftId(fieldId);
2131
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
2132
        return fields;
2133
      }
2134
 
2135
      /**
2136
       * Find the _Fields constant that matches name, or null if its not found.
2137
       */
2138
      public static _Fields findByName(String name) {
2139
        return byName.get(name);
2140
      }
2141
 
2142
      private final short _thriftId;
2143
      private final String _fieldName;
2144
 
2145
      _Fields(short thriftId, String fieldName) {
2146
        _thriftId = thriftId;
2147
        _fieldName = fieldName;
2148
      }
2149
 
2150
      public short getThriftFieldId() {
2151
        return _thriftId;
2152
      }
2153
 
2154
      public String getFieldName() {
2155
        return _fieldName;
2156
      }
2157
    }
2158
 
2159
    // isset id assignments
2160
    private static final int __ID_ISSET_ID = 0;
2161
    private BitSet __isset_bit_vector = new BitSet(1);
2162
 
2163
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
2164
    static {
2165
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
2166
      tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
2167
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
2168
      metaDataMap = Collections.unmodifiableMap(tmpMap);
2169
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPurchaseOrder_args.class, metaDataMap);
2170
    }
2171
 
2172
    public getPurchaseOrder_args() {
2173
    }
2174
 
2175
    public getPurchaseOrder_args(
2176
      long id)
2177
    {
2178
      this();
2179
      this.id = id;
2180
      setIdIsSet(true);
2181
    }
2182
 
2183
    /**
2184
     * Performs a deep copy on <i>other</i>.
2185
     */
2186
    public getPurchaseOrder_args(getPurchaseOrder_args other) {
2187
      __isset_bit_vector.clear();
2188
      __isset_bit_vector.or(other.__isset_bit_vector);
2189
      this.id = other.id;
2190
    }
2191
 
2192
    public getPurchaseOrder_args deepCopy() {
2193
      return new getPurchaseOrder_args(this);
2194
    }
2195
 
2196
    @Override
2197
    public void clear() {
2198
      setIdIsSet(false);
2199
      this.id = 0;
2200
    }
2201
 
2202
    public long getId() {
2203
      return this.id;
2204
    }
2205
 
2206
    public void setId(long id) {
2207
      this.id = id;
2208
      setIdIsSet(true);
2209
    }
2210
 
2211
    public void unsetId() {
2212
      __isset_bit_vector.clear(__ID_ISSET_ID);
2213
    }
2214
 
2215
    /** Returns true if field id is set (has been assigned a value) and false otherwise */
2216
    public boolean isSetId() {
2217
      return __isset_bit_vector.get(__ID_ISSET_ID);
2218
    }
2219
 
2220
    public void setIdIsSet(boolean value) {
2221
      __isset_bit_vector.set(__ID_ISSET_ID, value);
2222
    }
2223
 
2224
    public void setFieldValue(_Fields field, Object value) {
2225
      switch (field) {
2226
      case ID:
2227
        if (value == null) {
2228
          unsetId();
2229
        } else {
2230
          setId((Long)value);
2231
        }
2232
        break;
2233
 
2234
      }
2235
    }
2236
 
2237
    public Object getFieldValue(_Fields field) {
2238
      switch (field) {
2239
      case ID:
2240
        return Long.valueOf(getId());
2241
 
2242
      }
2243
      throw new IllegalStateException();
2244
    }
2245
 
2246
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
2247
    public boolean isSet(_Fields field) {
2248
      if (field == null) {
2249
        throw new IllegalArgumentException();
2250
      }
2251
 
2252
      switch (field) {
2253
      case ID:
2254
        return isSetId();
2255
      }
2256
      throw new IllegalStateException();
2257
    }
2258
 
2259
    @Override
2260
    public boolean equals(Object that) {
2261
      if (that == null)
2262
        return false;
2263
      if (that instanceof getPurchaseOrder_args)
2264
        return this.equals((getPurchaseOrder_args)that);
2265
      return false;
2266
    }
2267
 
2268
    public boolean equals(getPurchaseOrder_args that) {
2269
      if (that == null)
2270
        return false;
2271
 
2272
      boolean this_present_id = true;
2273
      boolean that_present_id = true;
2274
      if (this_present_id || that_present_id) {
2275
        if (!(this_present_id && that_present_id))
2276
          return false;
2277
        if (this.id != that.id)
2278
          return false;
2279
      }
2280
 
2281
      return true;
2282
    }
2283
 
2284
    @Override
2285
    public int hashCode() {
2286
      return 0;
2287
    }
2288
 
2289
    public int compareTo(getPurchaseOrder_args other) {
2290
      if (!getClass().equals(other.getClass())) {
2291
        return getClass().getName().compareTo(other.getClass().getName());
2292
      }
2293
 
2294
      int lastComparison = 0;
2295
      getPurchaseOrder_args typedOther = (getPurchaseOrder_args)other;
2296
 
2297
      lastComparison = Boolean.valueOf(isSetId()).compareTo(typedOther.isSetId());
2298
      if (lastComparison != 0) {
2299
        return lastComparison;
2300
      }
2301
      if (isSetId()) {
2302
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, typedOther.id);
2303
        if (lastComparison != 0) {
2304
          return lastComparison;
2305
        }
2306
      }
2307
      return 0;
2308
    }
2309
 
2310
    public _Fields fieldForId(int fieldId) {
2311
      return _Fields.findByThriftId(fieldId);
2312
    }
2313
 
2314
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
2315
      org.apache.thrift.protocol.TField field;
2316
      iprot.readStructBegin();
2317
      while (true)
2318
      {
2319
        field = iprot.readFieldBegin();
2320
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
2321
          break;
2322
        }
2323
        switch (field.id) {
2324
          case 1: // ID
2325
            if (field.type == org.apache.thrift.protocol.TType.I64) {
2326
              this.id = iprot.readI64();
2327
              setIdIsSet(true);
2328
            } else { 
2329
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2330
            }
2331
            break;
2332
          default:
2333
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2334
        }
2335
        iprot.readFieldEnd();
2336
      }
2337
      iprot.readStructEnd();
2338
      validate();
2339
    }
2340
 
2341
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
2342
      validate();
2343
 
2344
      oprot.writeStructBegin(STRUCT_DESC);
2345
      oprot.writeFieldBegin(ID_FIELD_DESC);
2346
      oprot.writeI64(this.id);
2347
      oprot.writeFieldEnd();
2348
      oprot.writeFieldStop();
2349
      oprot.writeStructEnd();
2350
    }
2351
 
2352
    @Override
2353
    public String toString() {
2354
      StringBuilder sb = new StringBuilder("getPurchaseOrder_args(");
2355
      boolean first = true;
2356
 
2357
      sb.append("id:");
2358
      sb.append(this.id);
2359
      first = false;
2360
      sb.append(")");
2361
      return sb.toString();
2362
    }
2363
 
2364
    public void validate() throws org.apache.thrift.TException {
2365
      // check for required fields
2366
    }
2367
 
2368
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
2369
      try {
2370
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
2371
      } catch (org.apache.thrift.TException te) {
2372
        throw new java.io.IOException(te);
2373
      }
2374
    }
2375
 
2376
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
2377
      try {
2378
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
2379
      } catch (org.apache.thrift.TException te) {
2380
        throw new java.io.IOException(te);
2381
      }
2382
    }
2383
 
2384
  }
2385
 
2386
  public static class getPurchaseOrder_result implements org.apache.thrift.TBase<getPurchaseOrder_result, getPurchaseOrder_result._Fields>, java.io.Serializable, Cloneable   {
2387
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getPurchaseOrder_result");
2388
 
2389
    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);
2390
    private static final org.apache.thrift.protocol.TField E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1);
2391
 
2392
    private PurchaseOrder success; // required
2393
    private PurchaseServiceException e; // required
2394
 
2395
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
2396
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
2397
      SUCCESS((short)0, "success"),
2398
      E((short)1, "e");
2399
 
2400
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
2401
 
2402
      static {
2403
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
2404
          byName.put(field.getFieldName(), field);
2405
        }
2406
      }
2407
 
2408
      /**
2409
       * Find the _Fields constant that matches fieldId, or null if its not found.
2410
       */
2411
      public static _Fields findByThriftId(int fieldId) {
2412
        switch(fieldId) {
2413
          case 0: // SUCCESS
2414
            return SUCCESS;
2415
          case 1: // E
2416
            return E;
2417
          default:
2418
            return null;
2419
        }
2420
      }
2421
 
2422
      /**
2423
       * Find the _Fields constant that matches fieldId, throwing an exception
2424
       * if it is not found.
2425
       */
2426
      public static _Fields findByThriftIdOrThrow(int fieldId) {
2427
        _Fields fields = findByThriftId(fieldId);
2428
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
2429
        return fields;
2430
      }
2431
 
2432
      /**
2433
       * Find the _Fields constant that matches name, or null if its not found.
2434
       */
2435
      public static _Fields findByName(String name) {
2436
        return byName.get(name);
2437
      }
2438
 
2439
      private final short _thriftId;
2440
      private final String _fieldName;
2441
 
2442
      _Fields(short thriftId, String fieldName) {
2443
        _thriftId = thriftId;
2444
        _fieldName = fieldName;
2445
      }
2446
 
2447
      public short getThriftFieldId() {
2448
        return _thriftId;
2449
      }
2450
 
2451
      public String getFieldName() {
2452
        return _fieldName;
2453
      }
2454
    }
2455
 
2456
    // isset id assignments
2457
 
2458
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
2459
    static {
2460
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
2461
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
2462
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, PurchaseOrder.class)));
2463
      tmpMap.put(_Fields.E, new org.apache.thrift.meta_data.FieldMetaData("e", org.apache.thrift.TFieldRequirementType.DEFAULT, 
2464
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
2465
      metaDataMap = Collections.unmodifiableMap(tmpMap);
2466
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPurchaseOrder_result.class, metaDataMap);
2467
    }
2468
 
2469
    public getPurchaseOrder_result() {
2470
    }
2471
 
2472
    public getPurchaseOrder_result(
2473
      PurchaseOrder success,
2474
      PurchaseServiceException e)
2475
    {
2476
      this();
2477
      this.success = success;
2478
      this.e = e;
2479
    }
2480
 
2481
    /**
2482
     * Performs a deep copy on <i>other</i>.
2483
     */
2484
    public getPurchaseOrder_result(getPurchaseOrder_result other) {
2485
      if (other.isSetSuccess()) {
2486
        this.success = new PurchaseOrder(other.success);
2487
      }
2488
      if (other.isSetE()) {
2489
        this.e = new PurchaseServiceException(other.e);
2490
      }
2491
    }
2492
 
2493
    public getPurchaseOrder_result deepCopy() {
2494
      return new getPurchaseOrder_result(this);
2495
    }
2496
 
2497
    @Override
2498
    public void clear() {
2499
      this.success = null;
2500
      this.e = null;
2501
    }
2502
 
2503
    public PurchaseOrder getSuccess() {
2504
      return this.success;
2505
    }
2506
 
2507
    public void setSuccess(PurchaseOrder success) {
2508
      this.success = success;
2509
    }
2510
 
2511
    public void unsetSuccess() {
2512
      this.success = null;
2513
    }
2514
 
2515
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
2516
    public boolean isSetSuccess() {
2517
      return this.success != null;
2518
    }
2519
 
2520
    public void setSuccessIsSet(boolean value) {
2521
      if (!value) {
2522
        this.success = null;
2523
      }
2524
    }
2525
 
2526
    public PurchaseServiceException getE() {
2527
      return this.e;
2528
    }
2529
 
2530
    public void setE(PurchaseServiceException e) {
2531
      this.e = e;
2532
    }
2533
 
2534
    public void unsetE() {
2535
      this.e = null;
2536
    }
2537
 
2538
    /** Returns true if field e is set (has been assigned a value) and false otherwise */
2539
    public boolean isSetE() {
2540
      return this.e != null;
2541
    }
2542
 
2543
    public void setEIsSet(boolean value) {
2544
      if (!value) {
2545
        this.e = null;
2546
      }
2547
    }
2548
 
2549
    public void setFieldValue(_Fields field, Object value) {
2550
      switch (field) {
2551
      case SUCCESS:
2552
        if (value == null) {
2553
          unsetSuccess();
2554
        } else {
2555
          setSuccess((PurchaseOrder)value);
2556
        }
2557
        break;
2558
 
2559
      case E:
2560
        if (value == null) {
2561
          unsetE();
2562
        } else {
2563
          setE((PurchaseServiceException)value);
2564
        }
2565
        break;
2566
 
2567
      }
2568
    }
2569
 
2570
    public Object getFieldValue(_Fields field) {
2571
      switch (field) {
2572
      case SUCCESS:
2573
        return getSuccess();
2574
 
2575
      case E:
2576
        return getE();
2577
 
2578
      }
2579
      throw new IllegalStateException();
2580
    }
2581
 
2582
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
2583
    public boolean isSet(_Fields field) {
2584
      if (field == null) {
2585
        throw new IllegalArgumentException();
2586
      }
2587
 
2588
      switch (field) {
2589
      case SUCCESS:
2590
        return isSetSuccess();
2591
      case E:
2592
        return isSetE();
2593
      }
2594
      throw new IllegalStateException();
2595
    }
2596
 
2597
    @Override
2598
    public boolean equals(Object that) {
2599
      if (that == null)
2600
        return false;
2601
      if (that instanceof getPurchaseOrder_result)
2602
        return this.equals((getPurchaseOrder_result)that);
2603
      return false;
2604
    }
2605
 
2606
    public boolean equals(getPurchaseOrder_result that) {
2607
      if (that == null)
2608
        return false;
2609
 
2610
      boolean this_present_success = true && this.isSetSuccess();
2611
      boolean that_present_success = true && that.isSetSuccess();
2612
      if (this_present_success || that_present_success) {
2613
        if (!(this_present_success && that_present_success))
2614
          return false;
2615
        if (!this.success.equals(that.success))
2616
          return false;
2617
      }
2618
 
2619
      boolean this_present_e = true && this.isSetE();
2620
      boolean that_present_e = true && that.isSetE();
2621
      if (this_present_e || that_present_e) {
2622
        if (!(this_present_e && that_present_e))
2623
          return false;
2624
        if (!this.e.equals(that.e))
2625
          return false;
2626
      }
2627
 
2628
      return true;
2629
    }
2630
 
2631
    @Override
2632
    public int hashCode() {
2633
      return 0;
2634
    }
2635
 
2636
    public int compareTo(getPurchaseOrder_result other) {
2637
      if (!getClass().equals(other.getClass())) {
2638
        return getClass().getName().compareTo(other.getClass().getName());
2639
      }
2640
 
2641
      int lastComparison = 0;
2642
      getPurchaseOrder_result typedOther = (getPurchaseOrder_result)other;
2643
 
2644
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
2645
      if (lastComparison != 0) {
2646
        return lastComparison;
2647
      }
2648
      if (isSetSuccess()) {
2649
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
2650
        if (lastComparison != 0) {
2651
          return lastComparison;
2652
        }
2653
      }
2654
      lastComparison = Boolean.valueOf(isSetE()).compareTo(typedOther.isSetE());
2655
      if (lastComparison != 0) {
2656
        return lastComparison;
2657
      }
2658
      if (isSetE()) {
2659
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, typedOther.e);
2660
        if (lastComparison != 0) {
2661
          return lastComparison;
2662
        }
2663
      }
2664
      return 0;
2665
    }
2666
 
2667
    public _Fields fieldForId(int fieldId) {
2668
      return _Fields.findByThriftId(fieldId);
2669
    }
2670
 
2671
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
2672
      org.apache.thrift.protocol.TField field;
2673
      iprot.readStructBegin();
2674
      while (true)
2675
      {
2676
        field = iprot.readFieldBegin();
2677
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
2678
          break;
2679
        }
2680
        switch (field.id) {
2681
          case 0: // SUCCESS
2682
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
2683
              this.success = new PurchaseOrder();
2684
              this.success.read(iprot);
2685
            } else { 
2686
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2687
            }
2688
            break;
2689
          case 1: // E
2690
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
2691
              this.e = new PurchaseServiceException();
2692
              this.e.read(iprot);
2693
            } else { 
2694
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2695
            }
2696
            break;
2697
          default:
2698
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2699
        }
2700
        iprot.readFieldEnd();
2701
      }
2702
      iprot.readStructEnd();
2703
      validate();
2704
    }
2705
 
2706
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
2707
      oprot.writeStructBegin(STRUCT_DESC);
2708
 
2709
      if (this.isSetSuccess()) {
2710
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
2711
        this.success.write(oprot);
2712
        oprot.writeFieldEnd();
2713
      } else if (this.isSetE()) {
2714
        oprot.writeFieldBegin(E_FIELD_DESC);
2715
        this.e.write(oprot);
2716
        oprot.writeFieldEnd();
2717
      }
2718
      oprot.writeFieldStop();
2719
      oprot.writeStructEnd();
2720
    }
2721
 
2722
    @Override
2723
    public String toString() {
2724
      StringBuilder sb = new StringBuilder("getPurchaseOrder_result(");
2725
      boolean first = true;
2726
 
2727
      sb.append("success:");
2728
      if (this.success == null) {
2729
        sb.append("null");
2730
      } else {
2731
        sb.append(this.success);
2732
      }
2733
      first = false;
2734
      if (!first) sb.append(", ");
2735
      sb.append("e:");
2736
      if (this.e == null) {
2737
        sb.append("null");
2738
      } else {
2739
        sb.append(this.e);
2740
      }
2741
      first = false;
2742
      sb.append(")");
2743
      return sb.toString();
2744
    }
2745
 
2746
    public void validate() throws org.apache.thrift.TException {
2747
      // check for required fields
2748
    }
2749
 
2750
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
2751
      try {
2752
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
2753
      } catch (org.apache.thrift.TException te) {
2754
        throw new java.io.IOException(te);
2755
      }
2756
    }
2757
 
2758
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
2759
      try {
2760
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
2761
      } catch (org.apache.thrift.TException te) {
2762
        throw new java.io.IOException(te);
2763
      }
2764
    }
2765
 
2766
  }
2767
 
2768
  public static class getAllPurchaseOrders_args implements org.apache.thrift.TBase<getAllPurchaseOrders_args, getAllPurchaseOrders_args._Fields>, java.io.Serializable, Cloneable   {
2769
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllPurchaseOrders_args");
2770
 
2771
    private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status", org.apache.thrift.protocol.TType.I32, (short)1);
2772
 
2773
    private POStatus status; // required
2774
 
2775
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
2776
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
2777
      /**
2778
       * 
2779
       * @see POStatus
2780
       */
2781
      STATUS((short)1, "status");
2782
 
2783
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
2784
 
2785
      static {
2786
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
2787
          byName.put(field.getFieldName(), field);
2788
        }
2789
      }
2790
 
2791
      /**
2792
       * Find the _Fields constant that matches fieldId, or null if its not found.
2793
       */
2794
      public static _Fields findByThriftId(int fieldId) {
2795
        switch(fieldId) {
2796
          case 1: // STATUS
2797
            return STATUS;
2798
          default:
2799
            return null;
2800
        }
2801
      }
2802
 
2803
      /**
2804
       * Find the _Fields constant that matches fieldId, throwing an exception
2805
       * if it is not found.
2806
       */
2807
      public static _Fields findByThriftIdOrThrow(int fieldId) {
2808
        _Fields fields = findByThriftId(fieldId);
2809
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
2810
        return fields;
2811
      }
2812
 
2813
      /**
2814
       * Find the _Fields constant that matches name, or null if its not found.
2815
       */
2816
      public static _Fields findByName(String name) {
2817
        return byName.get(name);
2818
      }
2819
 
2820
      private final short _thriftId;
2821
      private final String _fieldName;
2822
 
2823
      _Fields(short thriftId, String fieldName) {
2824
        _thriftId = thriftId;
2825
        _fieldName = fieldName;
2826
      }
2827
 
2828
      public short getThriftFieldId() {
2829
        return _thriftId;
2830
      }
2831
 
2832
      public String getFieldName() {
2833
        return _fieldName;
2834
      }
2835
    }
2836
 
2837
    // isset id assignments
2838
 
2839
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
2840
    static {
2841
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
2842
      tmpMap.put(_Fields.STATUS, new org.apache.thrift.meta_data.FieldMetaData("status", org.apache.thrift.TFieldRequirementType.DEFAULT, 
2843
          new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, POStatus.class)));
2844
      metaDataMap = Collections.unmodifiableMap(tmpMap);
2845
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllPurchaseOrders_args.class, metaDataMap);
2846
    }
2847
 
2848
    public getAllPurchaseOrders_args() {
2849
    }
2850
 
2851
    public getAllPurchaseOrders_args(
2852
      POStatus status)
2853
    {
2854
      this();
2855
      this.status = status;
2856
    }
2857
 
2858
    /**
2859
     * Performs a deep copy on <i>other</i>.
2860
     */
2861
    public getAllPurchaseOrders_args(getAllPurchaseOrders_args other) {
2862
      if (other.isSetStatus()) {
2863
        this.status = other.status;
2864
      }
2865
    }
2866
 
2867
    public getAllPurchaseOrders_args deepCopy() {
2868
      return new getAllPurchaseOrders_args(this);
2869
    }
2870
 
2871
    @Override
2872
    public void clear() {
2873
      this.status = null;
2874
    }
2875
 
2876
    /**
2877
     * 
2878
     * @see POStatus
2879
     */
2880
    public POStatus getStatus() {
2881
      return this.status;
2882
    }
2883
 
2884
    /**
2885
     * 
2886
     * @see POStatus
2887
     */
2888
    public void setStatus(POStatus status) {
2889
      this.status = status;
2890
    }
2891
 
2892
    public void unsetStatus() {
2893
      this.status = null;
2894
    }
2895
 
2896
    /** Returns true if field status is set (has been assigned a value) and false otherwise */
2897
    public boolean isSetStatus() {
2898
      return this.status != null;
2899
    }
2900
 
2901
    public void setStatusIsSet(boolean value) {
2902
      if (!value) {
2903
        this.status = null;
2904
      }
2905
    }
2906
 
2907
    public void setFieldValue(_Fields field, Object value) {
2908
      switch (field) {
2909
      case STATUS:
2910
        if (value == null) {
2911
          unsetStatus();
2912
        } else {
2913
          setStatus((POStatus)value);
2914
        }
2915
        break;
2916
 
2917
      }
2918
    }
2919
 
2920
    public Object getFieldValue(_Fields field) {
2921
      switch (field) {
2922
      case STATUS:
2923
        return getStatus();
2924
 
2925
      }
2926
      throw new IllegalStateException();
2927
    }
2928
 
2929
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
2930
    public boolean isSet(_Fields field) {
2931
      if (field == null) {
2932
        throw new IllegalArgumentException();
2933
      }
2934
 
2935
      switch (field) {
2936
      case STATUS:
2937
        return isSetStatus();
2938
      }
2939
      throw new IllegalStateException();
2940
    }
2941
 
2942
    @Override
2943
    public boolean equals(Object that) {
2944
      if (that == null)
2945
        return false;
2946
      if (that instanceof getAllPurchaseOrders_args)
2947
        return this.equals((getAllPurchaseOrders_args)that);
2948
      return false;
2949
    }
2950
 
2951
    public boolean equals(getAllPurchaseOrders_args that) {
2952
      if (that == null)
2953
        return false;
2954
 
2955
      boolean this_present_status = true && this.isSetStatus();
2956
      boolean that_present_status = true && that.isSetStatus();
2957
      if (this_present_status || that_present_status) {
2958
        if (!(this_present_status && that_present_status))
2959
          return false;
2960
        if (!this.status.equals(that.status))
2961
          return false;
2962
      }
2963
 
2964
      return true;
2965
    }
2966
 
2967
    @Override
2968
    public int hashCode() {
2969
      return 0;
2970
    }
2971
 
2972
    public int compareTo(getAllPurchaseOrders_args other) {
2973
      if (!getClass().equals(other.getClass())) {
2974
        return getClass().getName().compareTo(other.getClass().getName());
2975
      }
2976
 
2977
      int lastComparison = 0;
2978
      getAllPurchaseOrders_args typedOther = (getAllPurchaseOrders_args)other;
2979
 
2980
      lastComparison = Boolean.valueOf(isSetStatus()).compareTo(typedOther.isSetStatus());
2981
      if (lastComparison != 0) {
2982
        return lastComparison;
2983
      }
2984
      if (isSetStatus()) {
2985
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, typedOther.status);
2986
        if (lastComparison != 0) {
2987
          return lastComparison;
2988
        }
2989
      }
2990
      return 0;
2991
    }
2992
 
2993
    public _Fields fieldForId(int fieldId) {
2994
      return _Fields.findByThriftId(fieldId);
2995
    }
2996
 
2997
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
2998
      org.apache.thrift.protocol.TField field;
2999
      iprot.readStructBegin();
3000
      while (true)
3001
      {
3002
        field = iprot.readFieldBegin();
3003
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3004
          break;
3005
        }
3006
        switch (field.id) {
3007
          case 1: // STATUS
3008
            if (field.type == org.apache.thrift.protocol.TType.I32) {
3009
              this.status = POStatus.findByValue(iprot.readI32());
3010
            } else { 
3011
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3012
            }
3013
            break;
3014
          default:
3015
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3016
        }
3017
        iprot.readFieldEnd();
3018
      }
3019
      iprot.readStructEnd();
3020
      validate();
3021
    }
3022
 
3023
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3024
      validate();
3025
 
3026
      oprot.writeStructBegin(STRUCT_DESC);
3027
      if (this.status != null) {
3028
        oprot.writeFieldBegin(STATUS_FIELD_DESC);
3029
        oprot.writeI32(this.status.getValue());
3030
        oprot.writeFieldEnd();
3031
      }
3032
      oprot.writeFieldStop();
3033
      oprot.writeStructEnd();
3034
    }
3035
 
3036
    @Override
3037
    public String toString() {
3038
      StringBuilder sb = new StringBuilder("getAllPurchaseOrders_args(");
3039
      boolean first = true;
3040
 
3041
      sb.append("status:");
3042
      if (this.status == null) {
3043
        sb.append("null");
3044
      } else {
3045
        sb.append(this.status);
3046
      }
3047
      first = false;
3048
      sb.append(")");
3049
      return sb.toString();
3050
    }
3051
 
3052
    public void validate() throws org.apache.thrift.TException {
3053
      // check for required fields
3054
    }
3055
 
3056
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
3057
      try {
3058
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
3059
      } catch (org.apache.thrift.TException te) {
3060
        throw new java.io.IOException(te);
3061
      }
3062
    }
3063
 
3064
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
3065
      try {
3066
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
3067
      } catch (org.apache.thrift.TException te) {
3068
        throw new java.io.IOException(te);
3069
      }
3070
    }
3071
 
3072
  }
3073
 
3074
  public static class getAllPurchaseOrders_result implements org.apache.thrift.TBase<getAllPurchaseOrders_result, getAllPurchaseOrders_result._Fields>, java.io.Serializable, Cloneable   {
3075
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllPurchaseOrders_result");
3076
 
3077
    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);
3078
    private static final org.apache.thrift.protocol.TField E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1);
3079
 
3080
    private List<PurchaseOrder> success; // required
3081
    private PurchaseServiceException e; // required
3082
 
3083
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3084
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3085
      SUCCESS((short)0, "success"),
3086
      E((short)1, "e");
3087
 
3088
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
3089
 
3090
      static {
3091
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
3092
          byName.put(field.getFieldName(), field);
3093
        }
3094
      }
3095
 
3096
      /**
3097
       * Find the _Fields constant that matches fieldId, or null if its not found.
3098
       */
3099
      public static _Fields findByThriftId(int fieldId) {
3100
        switch(fieldId) {
3101
          case 0: // SUCCESS
3102
            return SUCCESS;
3103
          case 1: // E
3104
            return E;
3105
          default:
3106
            return null;
3107
        }
3108
      }
3109
 
3110
      /**
3111
       * Find the _Fields constant that matches fieldId, throwing an exception
3112
       * if it is not found.
3113
       */
3114
      public static _Fields findByThriftIdOrThrow(int fieldId) {
3115
        _Fields fields = findByThriftId(fieldId);
3116
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
3117
        return fields;
3118
      }
3119
 
3120
      /**
3121
       * Find the _Fields constant that matches name, or null if its not found.
3122
       */
3123
      public static _Fields findByName(String name) {
3124
        return byName.get(name);
3125
      }
3126
 
3127
      private final short _thriftId;
3128
      private final String _fieldName;
3129
 
3130
      _Fields(short thriftId, String fieldName) {
3131
        _thriftId = thriftId;
3132
        _fieldName = fieldName;
3133
      }
3134
 
3135
      public short getThriftFieldId() {
3136
        return _thriftId;
3137
      }
3138
 
3139
      public String getFieldName() {
3140
        return _fieldName;
3141
      }
3142
    }
3143
 
3144
    // isset id assignments
3145
 
3146
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3147
    static {
3148
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
3149
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
3150
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
3151
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, PurchaseOrder.class))));
3152
      tmpMap.put(_Fields.E, new org.apache.thrift.meta_data.FieldMetaData("e", org.apache.thrift.TFieldRequirementType.DEFAULT, 
3153
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
3154
      metaDataMap = Collections.unmodifiableMap(tmpMap);
3155
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllPurchaseOrders_result.class, metaDataMap);
3156
    }
3157
 
3158
    public getAllPurchaseOrders_result() {
3159
    }
3160
 
3161
    public getAllPurchaseOrders_result(
3162
      List<PurchaseOrder> success,
3163
      PurchaseServiceException e)
3164
    {
3165
      this();
3166
      this.success = success;
3167
      this.e = e;
3168
    }
3169
 
3170
    /**
3171
     * Performs a deep copy on <i>other</i>.
3172
     */
3173
    public getAllPurchaseOrders_result(getAllPurchaseOrders_result other) {
3174
      if (other.isSetSuccess()) {
3175
        List<PurchaseOrder> __this__success = new ArrayList<PurchaseOrder>();
3176
        for (PurchaseOrder other_element : other.success) {
3177
          __this__success.add(new PurchaseOrder(other_element));
3178
        }
3179
        this.success = __this__success;
3180
      }
3181
      if (other.isSetE()) {
3182
        this.e = new PurchaseServiceException(other.e);
3183
      }
3184
    }
3185
 
3186
    public getAllPurchaseOrders_result deepCopy() {
3187
      return new getAllPurchaseOrders_result(this);
3188
    }
3189
 
3190
    @Override
3191
    public void clear() {
3192
      this.success = null;
3193
      this.e = null;
3194
    }
3195
 
3196
    public int getSuccessSize() {
3197
      return (this.success == null) ? 0 : this.success.size();
3198
    }
3199
 
3200
    public java.util.Iterator<PurchaseOrder> getSuccessIterator() {
3201
      return (this.success == null) ? null : this.success.iterator();
3202
    }
3203
 
3204
    public void addToSuccess(PurchaseOrder elem) {
3205
      if (this.success == null) {
3206
        this.success = new ArrayList<PurchaseOrder>();
3207
      }
3208
      this.success.add(elem);
3209
    }
3210
 
3211
    public List<PurchaseOrder> getSuccess() {
3212
      return this.success;
3213
    }
3214
 
3215
    public void setSuccess(List<PurchaseOrder> success) {
3216
      this.success = success;
3217
    }
3218
 
3219
    public void unsetSuccess() {
3220
      this.success = null;
3221
    }
3222
 
3223
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
3224
    public boolean isSetSuccess() {
3225
      return this.success != null;
3226
    }
3227
 
3228
    public void setSuccessIsSet(boolean value) {
3229
      if (!value) {
3230
        this.success = null;
3231
      }
3232
    }
3233
 
3234
    public PurchaseServiceException getE() {
3235
      return this.e;
3236
    }
3237
 
3238
    public void setE(PurchaseServiceException e) {
3239
      this.e = e;
3240
    }
3241
 
3242
    public void unsetE() {
3243
      this.e = null;
3244
    }
3245
 
3246
    /** Returns true if field e is set (has been assigned a value) and false otherwise */
3247
    public boolean isSetE() {
3248
      return this.e != null;
3249
    }
3250
 
3251
    public void setEIsSet(boolean value) {
3252
      if (!value) {
3253
        this.e = null;
3254
      }
3255
    }
3256
 
3257
    public void setFieldValue(_Fields field, Object value) {
3258
      switch (field) {
3259
      case SUCCESS:
3260
        if (value == null) {
3261
          unsetSuccess();
3262
        } else {
3263
          setSuccess((List<PurchaseOrder>)value);
3264
        }
3265
        break;
3266
 
3267
      case E:
3268
        if (value == null) {
3269
          unsetE();
3270
        } else {
3271
          setE((PurchaseServiceException)value);
3272
        }
3273
        break;
3274
 
3275
      }
3276
    }
3277
 
3278
    public Object getFieldValue(_Fields field) {
3279
      switch (field) {
3280
      case SUCCESS:
3281
        return getSuccess();
3282
 
3283
      case E:
3284
        return getE();
3285
 
3286
      }
3287
      throw new IllegalStateException();
3288
    }
3289
 
3290
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
3291
    public boolean isSet(_Fields field) {
3292
      if (field == null) {
3293
        throw new IllegalArgumentException();
3294
      }
3295
 
3296
      switch (field) {
3297
      case SUCCESS:
3298
        return isSetSuccess();
3299
      case E:
3300
        return isSetE();
3301
      }
3302
      throw new IllegalStateException();
3303
    }
3304
 
3305
    @Override
3306
    public boolean equals(Object that) {
3307
      if (that == null)
3308
        return false;
3309
      if (that instanceof getAllPurchaseOrders_result)
3310
        return this.equals((getAllPurchaseOrders_result)that);
3311
      return false;
3312
    }
3313
 
3314
    public boolean equals(getAllPurchaseOrders_result that) {
3315
      if (that == null)
3316
        return false;
3317
 
3318
      boolean this_present_success = true && this.isSetSuccess();
3319
      boolean that_present_success = true && that.isSetSuccess();
3320
      if (this_present_success || that_present_success) {
3321
        if (!(this_present_success && that_present_success))
3322
          return false;
3323
        if (!this.success.equals(that.success))
3324
          return false;
3325
      }
3326
 
3327
      boolean this_present_e = true && this.isSetE();
3328
      boolean that_present_e = true && that.isSetE();
3329
      if (this_present_e || that_present_e) {
3330
        if (!(this_present_e && that_present_e))
3331
          return false;
3332
        if (!this.e.equals(that.e))
3333
          return false;
3334
      }
3335
 
3336
      return true;
3337
    }
3338
 
3339
    @Override
3340
    public int hashCode() {
3341
      return 0;
3342
    }
3343
 
3344
    public int compareTo(getAllPurchaseOrders_result other) {
3345
      if (!getClass().equals(other.getClass())) {
3346
        return getClass().getName().compareTo(other.getClass().getName());
3347
      }
3348
 
3349
      int lastComparison = 0;
3350
      getAllPurchaseOrders_result typedOther = (getAllPurchaseOrders_result)other;
3351
 
3352
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
3353
      if (lastComparison != 0) {
3354
        return lastComparison;
3355
      }
3356
      if (isSetSuccess()) {
3357
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
3358
        if (lastComparison != 0) {
3359
          return lastComparison;
3360
        }
3361
      }
3362
      lastComparison = Boolean.valueOf(isSetE()).compareTo(typedOther.isSetE());
3363
      if (lastComparison != 0) {
3364
        return lastComparison;
3365
      }
3366
      if (isSetE()) {
3367
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, typedOther.e);
3368
        if (lastComparison != 0) {
3369
          return lastComparison;
3370
        }
3371
      }
3372
      return 0;
3373
    }
3374
 
3375
    public _Fields fieldForId(int fieldId) {
3376
      return _Fields.findByThriftId(fieldId);
3377
    }
3378
 
3379
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
3380
      org.apache.thrift.protocol.TField field;
3381
      iprot.readStructBegin();
3382
      while (true)
3383
      {
3384
        field = iprot.readFieldBegin();
3385
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3386
          break;
3387
        }
3388
        switch (field.id) {
3389
          case 0: // SUCCESS
3390
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
3391
              {
3392
                org.apache.thrift.protocol.TList _list4 = iprot.readListBegin();
3393
                this.success = new ArrayList<PurchaseOrder>(_list4.size);
3394
                for (int _i5 = 0; _i5 < _list4.size; ++_i5)
3395
                {
3396
                  PurchaseOrder _elem6; // required
3397
                  _elem6 = new PurchaseOrder();
3398
                  _elem6.read(iprot);
3399
                  this.success.add(_elem6);
3400
                }
3401
                iprot.readListEnd();
3402
              }
3403
            } else { 
3404
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3405
            }
3406
            break;
3407
          case 1: // E
3408
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
3409
              this.e = new PurchaseServiceException();
3410
              this.e.read(iprot);
3411
            } else { 
3412
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3413
            }
3414
            break;
3415
          default:
3416
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3417
        }
3418
        iprot.readFieldEnd();
3419
      }
3420
      iprot.readStructEnd();
3421
      validate();
3422
    }
3423
 
3424
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3425
      oprot.writeStructBegin(STRUCT_DESC);
3426
 
3427
      if (this.isSetSuccess()) {
3428
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
3429
        {
3430
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
3431
          for (PurchaseOrder _iter7 : this.success)
3432
          {
3433
            _iter7.write(oprot);
3434
          }
3435
          oprot.writeListEnd();
3436
        }
3437
        oprot.writeFieldEnd();
3438
      } else if (this.isSetE()) {
3439
        oprot.writeFieldBegin(E_FIELD_DESC);
3440
        this.e.write(oprot);
3441
        oprot.writeFieldEnd();
3442
      }
3443
      oprot.writeFieldStop();
3444
      oprot.writeStructEnd();
3445
    }
3446
 
3447
    @Override
3448
    public String toString() {
3449
      StringBuilder sb = new StringBuilder("getAllPurchaseOrders_result(");
3450
      boolean first = true;
3451
 
3452
      sb.append("success:");
3453
      if (this.success == null) {
3454
        sb.append("null");
3455
      } else {
3456
        sb.append(this.success);
3457
      }
3458
      first = false;
3459
      if (!first) sb.append(", ");
3460
      sb.append("e:");
3461
      if (this.e == null) {
3462
        sb.append("null");
3463
      } else {
3464
        sb.append(this.e);
3465
      }
3466
      first = false;
3467
      sb.append(")");
3468
      return sb.toString();
3469
    }
3470
 
3471
    public void validate() throws org.apache.thrift.TException {
3472
      // check for required fields
3473
    }
3474
 
3475
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
3476
      try {
3477
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
3478
      } catch (org.apache.thrift.TException te) {
3479
        throw new java.io.IOException(te);
3480
      }
3481
    }
3482
 
3483
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
3484
      try {
3485
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
3486
      } catch (org.apache.thrift.TException te) {
3487
        throw new java.io.IOException(te);
3488
      }
3489
    }
3490
 
3491
  }
3492
 
3493
  public static class getSupplier_args implements org.apache.thrift.TBase<getSupplier_args, getSupplier_args._Fields>, java.io.Serializable, Cloneable   {
3494
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getSupplier_args");
3495
 
3496
    private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.I64, (short)1);
3497
 
3498
    private long id; // required
3499
 
3500
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3501
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3502
      ID((short)1, "id");
3503
 
3504
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
3505
 
3506
      static {
3507
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
3508
          byName.put(field.getFieldName(), field);
3509
        }
3510
      }
3511
 
3512
      /**
3513
       * Find the _Fields constant that matches fieldId, or null if its not found.
3514
       */
3515
      public static _Fields findByThriftId(int fieldId) {
3516
        switch(fieldId) {
3517
          case 1: // ID
3518
            return ID;
3519
          default:
3520
            return null;
3521
        }
3522
      }
3523
 
3524
      /**
3525
       * Find the _Fields constant that matches fieldId, throwing an exception
3526
       * if it is not found.
3527
       */
3528
      public static _Fields findByThriftIdOrThrow(int fieldId) {
3529
        _Fields fields = findByThriftId(fieldId);
3530
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
3531
        return fields;
3532
      }
3533
 
3534
      /**
3535
       * Find the _Fields constant that matches name, or null if its not found.
3536
       */
3537
      public static _Fields findByName(String name) {
3538
        return byName.get(name);
3539
      }
3540
 
3541
      private final short _thriftId;
3542
      private final String _fieldName;
3543
 
3544
      _Fields(short thriftId, String fieldName) {
3545
        _thriftId = thriftId;
3546
        _fieldName = fieldName;
3547
      }
3548
 
3549
      public short getThriftFieldId() {
3550
        return _thriftId;
3551
      }
3552
 
3553
      public String getFieldName() {
3554
        return _fieldName;
3555
      }
3556
    }
3557
 
3558
    // isset id assignments
3559
    private static final int __ID_ISSET_ID = 0;
3560
    private BitSet __isset_bit_vector = new BitSet(1);
3561
 
3562
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3563
    static {
3564
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
3565
      tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
3566
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
3567
      metaDataMap = Collections.unmodifiableMap(tmpMap);
3568
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getSupplier_args.class, metaDataMap);
3569
    }
3570
 
3571
    public getSupplier_args() {
3572
    }
3573
 
3574
    public getSupplier_args(
3575
      long id)
3576
    {
3577
      this();
3578
      this.id = id;
3579
      setIdIsSet(true);
3580
    }
3581
 
3582
    /**
3583
     * Performs a deep copy on <i>other</i>.
3584
     */
3585
    public getSupplier_args(getSupplier_args other) {
3586
      __isset_bit_vector.clear();
3587
      __isset_bit_vector.or(other.__isset_bit_vector);
3588
      this.id = other.id;
3589
    }
3590
 
3591
    public getSupplier_args deepCopy() {
3592
      return new getSupplier_args(this);
3593
    }
3594
 
3595
    @Override
3596
    public void clear() {
3597
      setIdIsSet(false);
3598
      this.id = 0;
3599
    }
3600
 
3601
    public long getId() {
3602
      return this.id;
3603
    }
3604
 
3605
    public void setId(long id) {
3606
      this.id = id;
3607
      setIdIsSet(true);
3608
    }
3609
 
3610
    public void unsetId() {
3611
      __isset_bit_vector.clear(__ID_ISSET_ID);
3612
    }
3613
 
3614
    /** Returns true if field id is set (has been assigned a value) and false otherwise */
3615
    public boolean isSetId() {
3616
      return __isset_bit_vector.get(__ID_ISSET_ID);
3617
    }
3618
 
3619
    public void setIdIsSet(boolean value) {
3620
      __isset_bit_vector.set(__ID_ISSET_ID, value);
3621
    }
3622
 
3623
    public void setFieldValue(_Fields field, Object value) {
3624
      switch (field) {
3625
      case ID:
3626
        if (value == null) {
3627
          unsetId();
3628
        } else {
3629
          setId((Long)value);
3630
        }
3631
        break;
3632
 
3633
      }
3634
    }
3635
 
3636
    public Object getFieldValue(_Fields field) {
3637
      switch (field) {
3638
      case ID:
3639
        return Long.valueOf(getId());
3640
 
3641
      }
3642
      throw new IllegalStateException();
3643
    }
3644
 
3645
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
3646
    public boolean isSet(_Fields field) {
3647
      if (field == null) {
3648
        throw new IllegalArgumentException();
3649
      }
3650
 
3651
      switch (field) {
3652
      case ID:
3653
        return isSetId();
3654
      }
3655
      throw new IllegalStateException();
3656
    }
3657
 
3658
    @Override
3659
    public boolean equals(Object that) {
3660
      if (that == null)
3661
        return false;
3662
      if (that instanceof getSupplier_args)
3663
        return this.equals((getSupplier_args)that);
3664
      return false;
3665
    }
3666
 
3667
    public boolean equals(getSupplier_args that) {
3668
      if (that == null)
3669
        return false;
3670
 
3671
      boolean this_present_id = true;
3672
      boolean that_present_id = true;
3673
      if (this_present_id || that_present_id) {
3674
        if (!(this_present_id && that_present_id))
3675
          return false;
3676
        if (this.id != that.id)
3677
          return false;
3678
      }
3679
 
3680
      return true;
3681
    }
3682
 
3683
    @Override
3684
    public int hashCode() {
3685
      return 0;
3686
    }
3687
 
3688
    public int compareTo(getSupplier_args other) {
3689
      if (!getClass().equals(other.getClass())) {
3690
        return getClass().getName().compareTo(other.getClass().getName());
3691
      }
3692
 
3693
      int lastComparison = 0;
3694
      getSupplier_args typedOther = (getSupplier_args)other;
3695
 
3696
      lastComparison = Boolean.valueOf(isSetId()).compareTo(typedOther.isSetId());
3697
      if (lastComparison != 0) {
3698
        return lastComparison;
3699
      }
3700
      if (isSetId()) {
3701
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, typedOther.id);
3702
        if (lastComparison != 0) {
3703
          return lastComparison;
3704
        }
3705
      }
3706
      return 0;
3707
    }
3708
 
3709
    public _Fields fieldForId(int fieldId) {
3710
      return _Fields.findByThriftId(fieldId);
3711
    }
3712
 
3713
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
3714
      org.apache.thrift.protocol.TField field;
3715
      iprot.readStructBegin();
3716
      while (true)
3717
      {
3718
        field = iprot.readFieldBegin();
3719
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3720
          break;
3721
        }
3722
        switch (field.id) {
3723
          case 1: // ID
3724
            if (field.type == org.apache.thrift.protocol.TType.I64) {
3725
              this.id = iprot.readI64();
3726
              setIdIsSet(true);
3727
            } else { 
3728
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3729
            }
3730
            break;
3731
          default:
3732
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3733
        }
3734
        iprot.readFieldEnd();
3735
      }
3736
      iprot.readStructEnd();
3737
      validate();
3738
    }
3739
 
3740
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3741
      validate();
3742
 
3743
      oprot.writeStructBegin(STRUCT_DESC);
3744
      oprot.writeFieldBegin(ID_FIELD_DESC);
3745
      oprot.writeI64(this.id);
3746
      oprot.writeFieldEnd();
3747
      oprot.writeFieldStop();
3748
      oprot.writeStructEnd();
3749
    }
3750
 
3751
    @Override
3752
    public String toString() {
3753
      StringBuilder sb = new StringBuilder("getSupplier_args(");
3754
      boolean first = true;
3755
 
3756
      sb.append("id:");
3757
      sb.append(this.id);
3758
      first = false;
3759
      sb.append(")");
3760
      return sb.toString();
3761
    }
3762
 
3763
    public void validate() throws org.apache.thrift.TException {
3764
      // check for required fields
3765
    }
3766
 
3767
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
3768
      try {
3769
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
3770
      } catch (org.apache.thrift.TException te) {
3771
        throw new java.io.IOException(te);
3772
      }
3773
    }
3774
 
3775
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
3776
      try {
3777
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
3778
        __isset_bit_vector = new BitSet(1);
3779
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
3780
      } catch (org.apache.thrift.TException te) {
3781
        throw new java.io.IOException(te);
3782
      }
3783
    }
3784
 
3785
  }
3786
 
3787
  public static class getSupplier_result implements org.apache.thrift.TBase<getSupplier_result, getSupplier_result._Fields>, java.io.Serializable, Cloneable   {
3788
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getSupplier_result");
3789
 
3790
    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);
3791
    private static final org.apache.thrift.protocol.TField E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1);
3792
 
3793
    private Supplier success; // required
3794
    private PurchaseServiceException e; // required
3795
 
3796
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3797
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3798
      SUCCESS((short)0, "success"),
3799
      E((short)1, "e");
3800
 
3801
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
3802
 
3803
      static {
3804
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
3805
          byName.put(field.getFieldName(), field);
3806
        }
3807
      }
3808
 
3809
      /**
3810
       * Find the _Fields constant that matches fieldId, or null if its not found.
3811
       */
3812
      public static _Fields findByThriftId(int fieldId) {
3813
        switch(fieldId) {
3814
          case 0: // SUCCESS
3815
            return SUCCESS;
3816
          case 1: // E
3817
            return E;
3818
          default:
3819
            return null;
3820
        }
3821
      }
3822
 
3823
      /**
3824
       * Find the _Fields constant that matches fieldId, throwing an exception
3825
       * if it is not found.
3826
       */
3827
      public static _Fields findByThriftIdOrThrow(int fieldId) {
3828
        _Fields fields = findByThriftId(fieldId);
3829
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
3830
        return fields;
3831
      }
3832
 
3833
      /**
3834
       * Find the _Fields constant that matches name, or null if its not found.
3835
       */
3836
      public static _Fields findByName(String name) {
3837
        return byName.get(name);
3838
      }
3839
 
3840
      private final short _thriftId;
3841
      private final String _fieldName;
3842
 
3843
      _Fields(short thriftId, String fieldName) {
3844
        _thriftId = thriftId;
3845
        _fieldName = fieldName;
3846
      }
3847
 
3848
      public short getThriftFieldId() {
3849
        return _thriftId;
3850
      }
3851
 
3852
      public String getFieldName() {
3853
        return _fieldName;
3854
      }
3855
    }
3856
 
3857
    // isset id assignments
3858
 
3859
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3860
    static {
3861
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
3862
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
3863
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Supplier.class)));
3864
      tmpMap.put(_Fields.E, new org.apache.thrift.meta_data.FieldMetaData("e", org.apache.thrift.TFieldRequirementType.DEFAULT, 
3865
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
3866
      metaDataMap = Collections.unmodifiableMap(tmpMap);
3867
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getSupplier_result.class, metaDataMap);
3868
    }
3869
 
3870
    public getSupplier_result() {
3871
    }
3872
 
3873
    public getSupplier_result(
3874
      Supplier success,
3875
      PurchaseServiceException e)
3876
    {
3877
      this();
3878
      this.success = success;
3879
      this.e = e;
3880
    }
3881
 
3882
    /**
3883
     * Performs a deep copy on <i>other</i>.
3884
     */
3885
    public getSupplier_result(getSupplier_result other) {
3886
      if (other.isSetSuccess()) {
3887
        this.success = new Supplier(other.success);
3888
      }
3889
      if (other.isSetE()) {
3890
        this.e = new PurchaseServiceException(other.e);
3891
      }
3892
    }
3893
 
3894
    public getSupplier_result deepCopy() {
3895
      return new getSupplier_result(this);
3896
    }
3897
 
3898
    @Override
3899
    public void clear() {
3900
      this.success = null;
3901
      this.e = null;
3902
    }
3903
 
3904
    public Supplier getSuccess() {
3905
      return this.success;
3906
    }
3907
 
3908
    public void setSuccess(Supplier success) {
3909
      this.success = success;
3910
    }
3911
 
3912
    public void unsetSuccess() {
3913
      this.success = null;
3914
    }
3915
 
3916
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
3917
    public boolean isSetSuccess() {
3918
      return this.success != null;
3919
    }
3920
 
3921
    public void setSuccessIsSet(boolean value) {
3922
      if (!value) {
3923
        this.success = null;
3924
      }
3925
    }
3926
 
3927
    public PurchaseServiceException getE() {
3928
      return this.e;
3929
    }
3930
 
3931
    public void setE(PurchaseServiceException e) {
3932
      this.e = e;
3933
    }
3934
 
3935
    public void unsetE() {
3936
      this.e = null;
3937
    }
3938
 
3939
    /** Returns true if field e is set (has been assigned a value) and false otherwise */
3940
    public boolean isSetE() {
3941
      return this.e != null;
3942
    }
3943
 
3944
    public void setEIsSet(boolean value) {
3945
      if (!value) {
3946
        this.e = null;
3947
      }
3948
    }
3949
 
3950
    public void setFieldValue(_Fields field, Object value) {
3951
      switch (field) {
3952
      case SUCCESS:
3953
        if (value == null) {
3954
          unsetSuccess();
3955
        } else {
3956
          setSuccess((Supplier)value);
3957
        }
3958
        break;
3959
 
3960
      case E:
3961
        if (value == null) {
3962
          unsetE();
3963
        } else {
3964
          setE((PurchaseServiceException)value);
3965
        }
3966
        break;
3967
 
3968
      }
3969
    }
3970
 
3971
    public Object getFieldValue(_Fields field) {
3972
      switch (field) {
3973
      case SUCCESS:
3974
        return getSuccess();
3975
 
3976
      case E:
3977
        return getE();
3978
 
3979
      }
3980
      throw new IllegalStateException();
3981
    }
3982
 
3983
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
3984
    public boolean isSet(_Fields field) {
3985
      if (field == null) {
3986
        throw new IllegalArgumentException();
3987
      }
3988
 
3989
      switch (field) {
3990
      case SUCCESS:
3991
        return isSetSuccess();
3992
      case E:
3993
        return isSetE();
3994
      }
3995
      throw new IllegalStateException();
3996
    }
3997
 
3998
    @Override
3999
    public boolean equals(Object that) {
4000
      if (that == null)
4001
        return false;
4002
      if (that instanceof getSupplier_result)
4003
        return this.equals((getSupplier_result)that);
4004
      return false;
4005
    }
4006
 
4007
    public boolean equals(getSupplier_result that) {
4008
      if (that == null)
4009
        return false;
4010
 
4011
      boolean this_present_success = true && this.isSetSuccess();
4012
      boolean that_present_success = true && that.isSetSuccess();
4013
      if (this_present_success || that_present_success) {
4014
        if (!(this_present_success && that_present_success))
4015
          return false;
4016
        if (!this.success.equals(that.success))
4017
          return false;
4018
      }
4019
 
4020
      boolean this_present_e = true && this.isSetE();
4021
      boolean that_present_e = true && that.isSetE();
4022
      if (this_present_e || that_present_e) {
4023
        if (!(this_present_e && that_present_e))
4024
          return false;
4025
        if (!this.e.equals(that.e))
4026
          return false;
4027
      }
4028
 
4029
      return true;
4030
    }
4031
 
4032
    @Override
4033
    public int hashCode() {
4034
      return 0;
4035
    }
4036
 
4037
    public int compareTo(getSupplier_result other) {
4038
      if (!getClass().equals(other.getClass())) {
4039
        return getClass().getName().compareTo(other.getClass().getName());
4040
      }
4041
 
4042
      int lastComparison = 0;
4043
      getSupplier_result typedOther = (getSupplier_result)other;
4044
 
4045
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
4046
      if (lastComparison != 0) {
4047
        return lastComparison;
4048
      }
4049
      if (isSetSuccess()) {
4050
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
4051
        if (lastComparison != 0) {
4052
          return lastComparison;
4053
        }
4054
      }
4055
      lastComparison = Boolean.valueOf(isSetE()).compareTo(typedOther.isSetE());
4056
      if (lastComparison != 0) {
4057
        return lastComparison;
4058
      }
4059
      if (isSetE()) {
4060
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, typedOther.e);
4061
        if (lastComparison != 0) {
4062
          return lastComparison;
4063
        }
4064
      }
4065
      return 0;
4066
    }
4067
 
4068
    public _Fields fieldForId(int fieldId) {
4069
      return _Fields.findByThriftId(fieldId);
4070
    }
4071
 
4072
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
4073
      org.apache.thrift.protocol.TField field;
4074
      iprot.readStructBegin();
4075
      while (true)
4076
      {
4077
        field = iprot.readFieldBegin();
4078
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
4079
          break;
4080
        }
4081
        switch (field.id) {
4082
          case 0: // SUCCESS
4083
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
4084
              this.success = new Supplier();
4085
              this.success.read(iprot);
4086
            } else { 
4087
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4088
            }
4089
            break;
4090
          case 1: // E
4091
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
4092
              this.e = new PurchaseServiceException();
4093
              this.e.read(iprot);
4094
            } else { 
4095
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4096
            }
4097
            break;
4098
          default:
4099
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4100
        }
4101
        iprot.readFieldEnd();
4102
      }
4103
      iprot.readStructEnd();
4104
      validate();
4105
    }
4106
 
4107
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
4108
      oprot.writeStructBegin(STRUCT_DESC);
4109
 
4110
      if (this.isSetSuccess()) {
4111
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
4112
        this.success.write(oprot);
4113
        oprot.writeFieldEnd();
4114
      } else if (this.isSetE()) {
4115
        oprot.writeFieldBegin(E_FIELD_DESC);
4116
        this.e.write(oprot);
4117
        oprot.writeFieldEnd();
4118
      }
4119
      oprot.writeFieldStop();
4120
      oprot.writeStructEnd();
4121
    }
4122
 
4123
    @Override
4124
    public String toString() {
4125
      StringBuilder sb = new StringBuilder("getSupplier_result(");
4126
      boolean first = true;
4127
 
4128
      sb.append("success:");
4129
      if (this.success == null) {
4130
        sb.append("null");
4131
      } else {
4132
        sb.append(this.success);
4133
      }
4134
      first = false;
4135
      if (!first) sb.append(", ");
4136
      sb.append("e:");
4137
      if (this.e == null) {
4138
        sb.append("null");
4139
      } else {
4140
        sb.append(this.e);
4141
      }
4142
      first = false;
4143
      sb.append(")");
4144
      return sb.toString();
4145
    }
4146
 
4147
    public void validate() throws org.apache.thrift.TException {
4148
      // check for required fields
4149
    }
4150
 
4151
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
4152
      try {
4153
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
4154
      } catch (org.apache.thrift.TException te) {
4155
        throw new java.io.IOException(te);
4156
      }
4157
    }
4158
 
4159
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
4160
      try {
4161
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
4162
      } catch (org.apache.thrift.TException te) {
4163
        throw new java.io.IOException(te);
4164
      }
4165
    }
4166
 
4167
  }
4168
 
4169
  public static class startPurchase_args implements org.apache.thrift.TBase<startPurchase_args, startPurchase_args._Fields>, java.io.Serializable, Cloneable   {
4170
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("startPurchase_args");
4171
 
4172
    private static final org.apache.thrift.protocol.TField PURCHASE_ORDER_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("purchaseOrderId", org.apache.thrift.protocol.TType.I64, (short)1);
4173
    private static final org.apache.thrift.protocol.TField INVOICE_NUMBER_FIELD_DESC = new org.apache.thrift.protocol.TField("invoiceNumber", org.apache.thrift.protocol.TType.STRING, (short)2);
4174
    private static final org.apache.thrift.protocol.TField FREIGHT_CHARGES_FIELD_DESC = new org.apache.thrift.protocol.TField("freightCharges", org.apache.thrift.protocol.TType.DOUBLE, (short)3);
4175
 
4176
    private long purchaseOrderId; // required
4177
    private String invoiceNumber; // required
4178
    private double freightCharges; // required
4179
 
4180
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
4181
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
4182
      PURCHASE_ORDER_ID((short)1, "purchaseOrderId"),
4183
      INVOICE_NUMBER((short)2, "invoiceNumber"),
4184
      FREIGHT_CHARGES((short)3, "freightCharges");
4185
 
4186
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
4187
 
4188
      static {
4189
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
4190
          byName.put(field.getFieldName(), field);
4191
        }
4192
      }
4193
 
4194
      /**
4195
       * Find the _Fields constant that matches fieldId, or null if its not found.
4196
       */
4197
      public static _Fields findByThriftId(int fieldId) {
4198
        switch(fieldId) {
4199
          case 1: // PURCHASE_ORDER_ID
4200
            return PURCHASE_ORDER_ID;
4201
          case 2: // INVOICE_NUMBER
4202
            return INVOICE_NUMBER;
4203
          case 3: // FREIGHT_CHARGES
4204
            return FREIGHT_CHARGES;
4205
          default:
4206
            return null;
4207
        }
4208
      }
4209
 
4210
      /**
4211
       * Find the _Fields constant that matches fieldId, throwing an exception
4212
       * if it is not found.
4213
       */
4214
      public static _Fields findByThriftIdOrThrow(int fieldId) {
4215
        _Fields fields = findByThriftId(fieldId);
4216
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
4217
        return fields;
4218
      }
4219
 
4220
      /**
4221
       * Find the _Fields constant that matches name, or null if its not found.
4222
       */
4223
      public static _Fields findByName(String name) {
4224
        return byName.get(name);
4225
      }
4226
 
4227
      private final short _thriftId;
4228
      private final String _fieldName;
4229
 
4230
      _Fields(short thriftId, String fieldName) {
4231
        _thriftId = thriftId;
4232
        _fieldName = fieldName;
4233
      }
4234
 
4235
      public short getThriftFieldId() {
4236
        return _thriftId;
4237
      }
4238
 
4239
      public String getFieldName() {
4240
        return _fieldName;
4241
      }
4242
    }
4243
 
4244
    // isset id assignments
4245
    private static final int __PURCHASEORDERID_ISSET_ID = 0;
4246
    private static final int __FREIGHTCHARGES_ISSET_ID = 1;
4247
    private BitSet __isset_bit_vector = new BitSet(2);
4248
 
4249
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
4250
    static {
4251
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
4252
      tmpMap.put(_Fields.PURCHASE_ORDER_ID, new org.apache.thrift.meta_data.FieldMetaData("purchaseOrderId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
4253
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
4254
      tmpMap.put(_Fields.INVOICE_NUMBER, new org.apache.thrift.meta_data.FieldMetaData("invoiceNumber", org.apache.thrift.TFieldRequirementType.DEFAULT, 
4255
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
4256
      tmpMap.put(_Fields.FREIGHT_CHARGES, new org.apache.thrift.meta_data.FieldMetaData("freightCharges", org.apache.thrift.TFieldRequirementType.DEFAULT, 
4257
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
4258
      metaDataMap = Collections.unmodifiableMap(tmpMap);
4259
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(startPurchase_args.class, metaDataMap);
4260
    }
4261
 
4262
    public startPurchase_args() {
4263
    }
4264
 
4265
    public startPurchase_args(
4266
      long purchaseOrderId,
4267
      String invoiceNumber,
4268
      double freightCharges)
4269
    {
4270
      this();
4271
      this.purchaseOrderId = purchaseOrderId;
4272
      setPurchaseOrderIdIsSet(true);
4273
      this.invoiceNumber = invoiceNumber;
4274
      this.freightCharges = freightCharges;
4275
      setFreightChargesIsSet(true);
4276
    }
4277
 
4278
    /**
4279
     * Performs a deep copy on <i>other</i>.
4280
     */
4281
    public startPurchase_args(startPurchase_args other) {
4282
      __isset_bit_vector.clear();
4283
      __isset_bit_vector.or(other.__isset_bit_vector);
4284
      this.purchaseOrderId = other.purchaseOrderId;
4285
      if (other.isSetInvoiceNumber()) {
4286
        this.invoiceNumber = other.invoiceNumber;
4287
      }
4288
      this.freightCharges = other.freightCharges;
4289
    }
4290
 
4291
    public startPurchase_args deepCopy() {
4292
      return new startPurchase_args(this);
4293
    }
4294
 
4295
    @Override
4296
    public void clear() {
4297
      setPurchaseOrderIdIsSet(false);
4298
      this.purchaseOrderId = 0;
4299
      this.invoiceNumber = null;
4300
      setFreightChargesIsSet(false);
4301
      this.freightCharges = 0.0;
4302
    }
4303
 
4304
    public long getPurchaseOrderId() {
4305
      return this.purchaseOrderId;
4306
    }
4307
 
4308
    public void setPurchaseOrderId(long purchaseOrderId) {
4309
      this.purchaseOrderId = purchaseOrderId;
4310
      setPurchaseOrderIdIsSet(true);
4311
    }
4312
 
4313
    public void unsetPurchaseOrderId() {
4314
      __isset_bit_vector.clear(__PURCHASEORDERID_ISSET_ID);
4315
    }
4316
 
4317
    /** Returns true if field purchaseOrderId is set (has been assigned a value) and false otherwise */
4318
    public boolean isSetPurchaseOrderId() {
4319
      return __isset_bit_vector.get(__PURCHASEORDERID_ISSET_ID);
4320
    }
4321
 
4322
    public void setPurchaseOrderIdIsSet(boolean value) {
4323
      __isset_bit_vector.set(__PURCHASEORDERID_ISSET_ID, value);
4324
    }
4325
 
4326
    public String getInvoiceNumber() {
4327
      return this.invoiceNumber;
4328
    }
4329
 
4330
    public void setInvoiceNumber(String invoiceNumber) {
4331
      this.invoiceNumber = invoiceNumber;
4332
    }
4333
 
4334
    public void unsetInvoiceNumber() {
4335
      this.invoiceNumber = null;
4336
    }
4337
 
4338
    /** Returns true if field invoiceNumber is set (has been assigned a value) and false otherwise */
4339
    public boolean isSetInvoiceNumber() {
4340
      return this.invoiceNumber != null;
4341
    }
4342
 
4343
    public void setInvoiceNumberIsSet(boolean value) {
4344
      if (!value) {
4345
        this.invoiceNumber = null;
4346
      }
4347
    }
4348
 
4349
    public double getFreightCharges() {
4350
      return this.freightCharges;
4351
    }
4352
 
4353
    public void setFreightCharges(double freightCharges) {
4354
      this.freightCharges = freightCharges;
4355
      setFreightChargesIsSet(true);
4356
    }
4357
 
4358
    public void unsetFreightCharges() {
4359
      __isset_bit_vector.clear(__FREIGHTCHARGES_ISSET_ID);
4360
    }
4361
 
4362
    /** Returns true if field freightCharges is set (has been assigned a value) and false otherwise */
4363
    public boolean isSetFreightCharges() {
4364
      return __isset_bit_vector.get(__FREIGHTCHARGES_ISSET_ID);
4365
    }
4366
 
4367
    public void setFreightChargesIsSet(boolean value) {
4368
      __isset_bit_vector.set(__FREIGHTCHARGES_ISSET_ID, value);
4369
    }
4370
 
4371
    public void setFieldValue(_Fields field, Object value) {
4372
      switch (field) {
4373
      case PURCHASE_ORDER_ID:
4374
        if (value == null) {
4375
          unsetPurchaseOrderId();
4376
        } else {
4377
          setPurchaseOrderId((Long)value);
4378
        }
4379
        break;
4380
 
4381
      case INVOICE_NUMBER:
4382
        if (value == null) {
4383
          unsetInvoiceNumber();
4384
        } else {
4385
          setInvoiceNumber((String)value);
4386
        }
4387
        break;
4388
 
4389
      case FREIGHT_CHARGES:
4390
        if (value == null) {
4391
          unsetFreightCharges();
4392
        } else {
4393
          setFreightCharges((Double)value);
4394
        }
4395
        break;
4396
 
4397
      }
4398
    }
4399
 
4400
    public Object getFieldValue(_Fields field) {
4401
      switch (field) {
4402
      case PURCHASE_ORDER_ID:
4403
        return Long.valueOf(getPurchaseOrderId());
4404
 
4405
      case INVOICE_NUMBER:
4406
        return getInvoiceNumber();
4407
 
4408
      case FREIGHT_CHARGES:
4409
        return Double.valueOf(getFreightCharges());
4410
 
4411
      }
4412
      throw new IllegalStateException();
4413
    }
4414
 
4415
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
4416
    public boolean isSet(_Fields field) {
4417
      if (field == null) {
4418
        throw new IllegalArgumentException();
4419
      }
4420
 
4421
      switch (field) {
4422
      case PURCHASE_ORDER_ID:
4423
        return isSetPurchaseOrderId();
4424
      case INVOICE_NUMBER:
4425
        return isSetInvoiceNumber();
4426
      case FREIGHT_CHARGES:
4427
        return isSetFreightCharges();
4428
      }
4429
      throw new IllegalStateException();
4430
    }
4431
 
4432
    @Override
4433
    public boolean equals(Object that) {
4434
      if (that == null)
4435
        return false;
4436
      if (that instanceof startPurchase_args)
4437
        return this.equals((startPurchase_args)that);
4438
      return false;
4439
    }
4440
 
4441
    public boolean equals(startPurchase_args that) {
4442
      if (that == null)
4443
        return false;
4444
 
4445
      boolean this_present_purchaseOrderId = true;
4446
      boolean that_present_purchaseOrderId = true;
4447
      if (this_present_purchaseOrderId || that_present_purchaseOrderId) {
4448
        if (!(this_present_purchaseOrderId && that_present_purchaseOrderId))
4449
          return false;
4450
        if (this.purchaseOrderId != that.purchaseOrderId)
4451
          return false;
4452
      }
4453
 
4454
      boolean this_present_invoiceNumber = true && this.isSetInvoiceNumber();
4455
      boolean that_present_invoiceNumber = true && that.isSetInvoiceNumber();
4456
      if (this_present_invoiceNumber || that_present_invoiceNumber) {
4457
        if (!(this_present_invoiceNumber && that_present_invoiceNumber))
4458
          return false;
4459
        if (!this.invoiceNumber.equals(that.invoiceNumber))
4460
          return false;
4461
      }
4462
 
4463
      boolean this_present_freightCharges = true;
4464
      boolean that_present_freightCharges = true;
4465
      if (this_present_freightCharges || that_present_freightCharges) {
4466
        if (!(this_present_freightCharges && that_present_freightCharges))
4467
          return false;
4468
        if (this.freightCharges != that.freightCharges)
4469
          return false;
4470
      }
4471
 
4472
      return true;
4473
    }
4474
 
4475
    @Override
4476
    public int hashCode() {
4477
      return 0;
4478
    }
4479
 
4480
    public int compareTo(startPurchase_args other) {
4481
      if (!getClass().equals(other.getClass())) {
4482
        return getClass().getName().compareTo(other.getClass().getName());
4483
      }
4484
 
4485
      int lastComparison = 0;
4486
      startPurchase_args typedOther = (startPurchase_args)other;
4487
 
4488
      lastComparison = Boolean.valueOf(isSetPurchaseOrderId()).compareTo(typedOther.isSetPurchaseOrderId());
4489
      if (lastComparison != 0) {
4490
        return lastComparison;
4491
      }
4492
      if (isSetPurchaseOrderId()) {
4493
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.purchaseOrderId, typedOther.purchaseOrderId);
4494
        if (lastComparison != 0) {
4495
          return lastComparison;
4496
        }
4497
      }
4498
      lastComparison = Boolean.valueOf(isSetInvoiceNumber()).compareTo(typedOther.isSetInvoiceNumber());
4499
      if (lastComparison != 0) {
4500
        return lastComparison;
4501
      }
4502
      if (isSetInvoiceNumber()) {
4503
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.invoiceNumber, typedOther.invoiceNumber);
4504
        if (lastComparison != 0) {
4505
          return lastComparison;
4506
        }
4507
      }
4508
      lastComparison = Boolean.valueOf(isSetFreightCharges()).compareTo(typedOther.isSetFreightCharges());
4509
      if (lastComparison != 0) {
4510
        return lastComparison;
4511
      }
4512
      if (isSetFreightCharges()) {
4513
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.freightCharges, typedOther.freightCharges);
4514
        if (lastComparison != 0) {
4515
          return lastComparison;
4516
        }
4517
      }
4518
      return 0;
4519
    }
4520
 
4521
    public _Fields fieldForId(int fieldId) {
4522
      return _Fields.findByThriftId(fieldId);
4523
    }
4524
 
4525
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
4526
      org.apache.thrift.protocol.TField field;
4527
      iprot.readStructBegin();
4528
      while (true)
4529
      {
4530
        field = iprot.readFieldBegin();
4531
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
4532
          break;
4533
        }
4534
        switch (field.id) {
4535
          case 1: // PURCHASE_ORDER_ID
4536
            if (field.type == org.apache.thrift.protocol.TType.I64) {
4537
              this.purchaseOrderId = iprot.readI64();
4538
              setPurchaseOrderIdIsSet(true);
4539
            } else { 
4540
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4541
            }
4542
            break;
4543
          case 2: // INVOICE_NUMBER
4544
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
4545
              this.invoiceNumber = iprot.readString();
4546
            } else { 
4547
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4548
            }
4549
            break;
4550
          case 3: // FREIGHT_CHARGES
4551
            if (field.type == org.apache.thrift.protocol.TType.DOUBLE) {
4552
              this.freightCharges = iprot.readDouble();
4553
              setFreightChargesIsSet(true);
4554
            } else { 
4555
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4556
            }
4557
            break;
4558
          default:
4559
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4560
        }
4561
        iprot.readFieldEnd();
4562
      }
4563
      iprot.readStructEnd();
4564
      validate();
4565
    }
4566
 
4567
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
4568
      validate();
4569
 
4570
      oprot.writeStructBegin(STRUCT_DESC);
4571
      oprot.writeFieldBegin(PURCHASE_ORDER_ID_FIELD_DESC);
4572
      oprot.writeI64(this.purchaseOrderId);
4573
      oprot.writeFieldEnd();
4574
      if (this.invoiceNumber != null) {
4575
        oprot.writeFieldBegin(INVOICE_NUMBER_FIELD_DESC);
4576
        oprot.writeString(this.invoiceNumber);
4577
        oprot.writeFieldEnd();
4578
      }
4579
      oprot.writeFieldBegin(FREIGHT_CHARGES_FIELD_DESC);
4580
      oprot.writeDouble(this.freightCharges);
4581
      oprot.writeFieldEnd();
4582
      oprot.writeFieldStop();
4583
      oprot.writeStructEnd();
4584
    }
4585
 
4586
    @Override
4587
    public String toString() {
4588
      StringBuilder sb = new StringBuilder("startPurchase_args(");
4589
      boolean first = true;
4590
 
4591
      sb.append("purchaseOrderId:");
4592
      sb.append(this.purchaseOrderId);
4593
      first = false;
4594
      if (!first) sb.append(", ");
4595
      sb.append("invoiceNumber:");
4596
      if (this.invoiceNumber == null) {
4597
        sb.append("null");
4598
      } else {
4599
        sb.append(this.invoiceNumber);
4600
      }
4601
      first = false;
4602
      if (!first) sb.append(", ");
4603
      sb.append("freightCharges:");
4604
      sb.append(this.freightCharges);
4605
      first = false;
4606
      sb.append(")");
4607
      return sb.toString();
4608
    }
4609
 
4610
    public void validate() throws org.apache.thrift.TException {
4611
      // check for required fields
4612
    }
4613
 
4614
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
4615
      try {
4616
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
4617
      } catch (org.apache.thrift.TException te) {
4618
        throw new java.io.IOException(te);
4619
      }
4620
    }
4621
 
4622
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
4623
      try {
4624
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
4625
      } catch (org.apache.thrift.TException te) {
4626
        throw new java.io.IOException(te);
4627
      }
4628
    }
4629
 
4630
  }
4631
 
4632
  public static class startPurchase_result implements org.apache.thrift.TBase<startPurchase_result, startPurchase_result._Fields>, java.io.Serializable, Cloneable   {
4633
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("startPurchase_result");
4634
 
4635
    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);
4636
    private static final org.apache.thrift.protocol.TField E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1);
4637
 
4638
    private long success; // required
4639
    private PurchaseServiceException e; // required
4640
 
4641
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
4642
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
4643
      SUCCESS((short)0, "success"),
4644
      E((short)1, "e");
4645
 
4646
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
4647
 
4648
      static {
4649
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
4650
          byName.put(field.getFieldName(), field);
4651
        }
4652
      }
4653
 
4654
      /**
4655
       * Find the _Fields constant that matches fieldId, or null if its not found.
4656
       */
4657
      public static _Fields findByThriftId(int fieldId) {
4658
        switch(fieldId) {
4659
          case 0: // SUCCESS
4660
            return SUCCESS;
4661
          case 1: // E
4662
            return E;
4663
          default:
4664
            return null;
4665
        }
4666
      }
4667
 
4668
      /**
4669
       * Find the _Fields constant that matches fieldId, throwing an exception
4670
       * if it is not found.
4671
       */
4672
      public static _Fields findByThriftIdOrThrow(int fieldId) {
4673
        _Fields fields = findByThriftId(fieldId);
4674
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
4675
        return fields;
4676
      }
4677
 
4678
      /**
4679
       * Find the _Fields constant that matches name, or null if its not found.
4680
       */
4681
      public static _Fields findByName(String name) {
4682
        return byName.get(name);
4683
      }
4684
 
4685
      private final short _thriftId;
4686
      private final String _fieldName;
4687
 
4688
      _Fields(short thriftId, String fieldName) {
4689
        _thriftId = thriftId;
4690
        _fieldName = fieldName;
4691
      }
4692
 
4693
      public short getThriftFieldId() {
4694
        return _thriftId;
4695
      }
4696
 
4697
      public String getFieldName() {
4698
        return _fieldName;
4699
      }
4700
    }
4701
 
4702
    // isset id assignments
4703
    private static final int __SUCCESS_ISSET_ID = 0;
4704
    private BitSet __isset_bit_vector = new BitSet(1);
4705
 
4706
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
4707
    static {
4708
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
4709
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
4710
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
4711
      tmpMap.put(_Fields.E, new org.apache.thrift.meta_data.FieldMetaData("e", org.apache.thrift.TFieldRequirementType.DEFAULT, 
4712
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
4713
      metaDataMap = Collections.unmodifiableMap(tmpMap);
4714
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(startPurchase_result.class, metaDataMap);
4715
    }
4716
 
4717
    public startPurchase_result() {
4718
    }
4719
 
4720
    public startPurchase_result(
4721
      long success,
4722
      PurchaseServiceException e)
4723
    {
4724
      this();
4725
      this.success = success;
4726
      setSuccessIsSet(true);
4727
      this.e = e;
4728
    }
4729
 
4730
    /**
4731
     * Performs a deep copy on <i>other</i>.
4732
     */
4733
    public startPurchase_result(startPurchase_result other) {
4734
      __isset_bit_vector.clear();
4735
      __isset_bit_vector.or(other.__isset_bit_vector);
4736
      this.success = other.success;
4737
      if (other.isSetE()) {
4738
        this.e = new PurchaseServiceException(other.e);
4739
      }
4740
    }
4741
 
4742
    public startPurchase_result deepCopy() {
4743
      return new startPurchase_result(this);
4744
    }
4745
 
4746
    @Override
4747
    public void clear() {
4748
      setSuccessIsSet(false);
4749
      this.success = 0;
4750
      this.e = null;
4751
    }
4752
 
4753
    public long getSuccess() {
4754
      return this.success;
4755
    }
4756
 
4757
    public void setSuccess(long success) {
4758
      this.success = success;
4759
      setSuccessIsSet(true);
4760
    }
4761
 
4762
    public void unsetSuccess() {
4763
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
4764
    }
4765
 
4766
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
4767
    public boolean isSetSuccess() {
4768
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
4769
    }
4770
 
4771
    public void setSuccessIsSet(boolean value) {
4772
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
4773
    }
4774
 
4775
    public PurchaseServiceException getE() {
4776
      return this.e;
4777
    }
4778
 
4779
    public void setE(PurchaseServiceException e) {
4780
      this.e = e;
4781
    }
4782
 
4783
    public void unsetE() {
4784
      this.e = null;
4785
    }
4786
 
4787
    /** Returns true if field e is set (has been assigned a value) and false otherwise */
4788
    public boolean isSetE() {
4789
      return this.e != null;
4790
    }
4791
 
4792
    public void setEIsSet(boolean value) {
4793
      if (!value) {
4794
        this.e = null;
4795
      }
4796
    }
4797
 
4798
    public void setFieldValue(_Fields field, Object value) {
4799
      switch (field) {
4800
      case SUCCESS:
4801
        if (value == null) {
4802
          unsetSuccess();
4803
        } else {
4804
          setSuccess((Long)value);
4805
        }
4806
        break;
4807
 
4808
      case E:
4809
        if (value == null) {
4810
          unsetE();
4811
        } else {
4812
          setE((PurchaseServiceException)value);
4813
        }
4814
        break;
4815
 
4816
      }
4817
    }
4818
 
4819
    public Object getFieldValue(_Fields field) {
4820
      switch (field) {
4821
      case SUCCESS:
4822
        return Long.valueOf(getSuccess());
4823
 
4824
      case E:
4825
        return getE();
4826
 
4827
      }
4828
      throw new IllegalStateException();
4829
    }
4830
 
4831
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
4832
    public boolean isSet(_Fields field) {
4833
      if (field == null) {
4834
        throw new IllegalArgumentException();
4835
      }
4836
 
4837
      switch (field) {
4838
      case SUCCESS:
4839
        return isSetSuccess();
4840
      case E:
4841
        return isSetE();
4842
      }
4843
      throw new IllegalStateException();
4844
    }
4845
 
4846
    @Override
4847
    public boolean equals(Object that) {
4848
      if (that == null)
4849
        return false;
4850
      if (that instanceof startPurchase_result)
4851
        return this.equals((startPurchase_result)that);
4852
      return false;
4853
    }
4854
 
4855
    public boolean equals(startPurchase_result that) {
4856
      if (that == null)
4857
        return false;
4858
 
4859
      boolean this_present_success = true;
4860
      boolean that_present_success = true;
4861
      if (this_present_success || that_present_success) {
4862
        if (!(this_present_success && that_present_success))
4863
          return false;
4864
        if (this.success != that.success)
4865
          return false;
4866
      }
4867
 
4868
      boolean this_present_e = true && this.isSetE();
4869
      boolean that_present_e = true && that.isSetE();
4870
      if (this_present_e || that_present_e) {
4871
        if (!(this_present_e && that_present_e))
4872
          return false;
4873
        if (!this.e.equals(that.e))
4874
          return false;
4875
      }
4876
 
4877
      return true;
4878
    }
4879
 
4880
    @Override
4881
    public int hashCode() {
4882
      return 0;
4883
    }
4884
 
4885
    public int compareTo(startPurchase_result other) {
4886
      if (!getClass().equals(other.getClass())) {
4887
        return getClass().getName().compareTo(other.getClass().getName());
4888
      }
4889
 
4890
      int lastComparison = 0;
4891
      startPurchase_result typedOther = (startPurchase_result)other;
4892
 
4893
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
4894
      if (lastComparison != 0) {
4895
        return lastComparison;
4896
      }
4897
      if (isSetSuccess()) {
4898
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
4899
        if (lastComparison != 0) {
4900
          return lastComparison;
4901
        }
4902
      }
4903
      lastComparison = Boolean.valueOf(isSetE()).compareTo(typedOther.isSetE());
4904
      if (lastComparison != 0) {
4905
        return lastComparison;
4906
      }
4907
      if (isSetE()) {
4908
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, typedOther.e);
4909
        if (lastComparison != 0) {
4910
          return lastComparison;
4911
        }
4912
      }
4913
      return 0;
4914
    }
4915
 
4916
    public _Fields fieldForId(int fieldId) {
4917
      return _Fields.findByThriftId(fieldId);
4918
    }
4919
 
4920
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
4921
      org.apache.thrift.protocol.TField field;
4922
      iprot.readStructBegin();
4923
      while (true)
4924
      {
4925
        field = iprot.readFieldBegin();
4926
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
4927
          break;
4928
        }
4929
        switch (field.id) {
4930
          case 0: // SUCCESS
4931
            if (field.type == org.apache.thrift.protocol.TType.I64) {
4932
              this.success = iprot.readI64();
4933
              setSuccessIsSet(true);
4934
            } else { 
4935
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4936
            }
4937
            break;
4938
          case 1: // E
4939
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
4940
              this.e = new PurchaseServiceException();
4941
              this.e.read(iprot);
4942
            } else { 
4943
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4944
            }
4945
            break;
4946
          default:
4947
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4948
        }
4949
        iprot.readFieldEnd();
4950
      }
4951
      iprot.readStructEnd();
4952
      validate();
4953
    }
4954
 
4955
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
4956
      oprot.writeStructBegin(STRUCT_DESC);
4957
 
4958
      if (this.isSetSuccess()) {
4959
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
4960
        oprot.writeI64(this.success);
4961
        oprot.writeFieldEnd();
4962
      } else if (this.isSetE()) {
4963
        oprot.writeFieldBegin(E_FIELD_DESC);
4964
        this.e.write(oprot);
4965
        oprot.writeFieldEnd();
4966
      }
4967
      oprot.writeFieldStop();
4968
      oprot.writeStructEnd();
4969
    }
4970
 
4971
    @Override
4972
    public String toString() {
4973
      StringBuilder sb = new StringBuilder("startPurchase_result(");
4974
      boolean first = true;
4975
 
4976
      sb.append("success:");
4977
      sb.append(this.success);
4978
      first = false;
4979
      if (!first) sb.append(", ");
4980
      sb.append("e:");
4981
      if (this.e == null) {
4982
        sb.append("null");
4983
      } else {
4984
        sb.append(this.e);
4985
      }
4986
      first = false;
4987
      sb.append(")");
4988
      return sb.toString();
4989
    }
4990
 
4991
    public void validate() throws org.apache.thrift.TException {
4992
      // check for required fields
4993
    }
4994
 
4995
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
4996
      try {
4997
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
4998
      } catch (org.apache.thrift.TException te) {
4999
        throw new java.io.IOException(te);
5000
      }
5001
    }
5002
 
5003
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
5004
      try {
5005
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
5006
      } catch (org.apache.thrift.TException te) {
5007
        throw new java.io.IOException(te);
5008
      }
5009
    }
5010
 
5011
  }
5012
 
5013
  public static class closePurchase_args implements org.apache.thrift.TBase<closePurchase_args, closePurchase_args._Fields>, java.io.Serializable, Cloneable   {
5014
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("closePurchase_args");
5015
 
5016
    private static final org.apache.thrift.protocol.TField PURCHASE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("purchaseId", org.apache.thrift.protocol.TType.I64, (short)1);
5017
 
5018
    private long purchaseId; // required
5019
 
5020
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
5021
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
5022
      PURCHASE_ID((short)1, "purchaseId");
5023
 
5024
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
5025
 
5026
      static {
5027
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
5028
          byName.put(field.getFieldName(), field);
5029
        }
5030
      }
5031
 
5032
      /**
5033
       * Find the _Fields constant that matches fieldId, or null if its not found.
5034
       */
5035
      public static _Fields findByThriftId(int fieldId) {
5036
        switch(fieldId) {
5037
          case 1: // PURCHASE_ID
5038
            return PURCHASE_ID;
5039
          default:
5040
            return null;
5041
        }
5042
      }
5043
 
5044
      /**
5045
       * Find the _Fields constant that matches fieldId, throwing an exception
5046
       * if it is not found.
5047
       */
5048
      public static _Fields findByThriftIdOrThrow(int fieldId) {
5049
        _Fields fields = findByThriftId(fieldId);
5050
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
5051
        return fields;
5052
      }
5053
 
5054
      /**
5055
       * Find the _Fields constant that matches name, or null if its not found.
5056
       */
5057
      public static _Fields findByName(String name) {
5058
        return byName.get(name);
5059
      }
5060
 
5061
      private final short _thriftId;
5062
      private final String _fieldName;
5063
 
5064
      _Fields(short thriftId, String fieldName) {
5065
        _thriftId = thriftId;
5066
        _fieldName = fieldName;
5067
      }
5068
 
5069
      public short getThriftFieldId() {
5070
        return _thriftId;
5071
      }
5072
 
5073
      public String getFieldName() {
5074
        return _fieldName;
5075
      }
5076
    }
5077
 
5078
    // isset id assignments
5079
    private static final int __PURCHASEID_ISSET_ID = 0;
5080
    private BitSet __isset_bit_vector = new BitSet(1);
5081
 
5082
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
5083
    static {
5084
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
5085
      tmpMap.put(_Fields.PURCHASE_ID, new org.apache.thrift.meta_data.FieldMetaData("purchaseId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
5086
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
5087
      metaDataMap = Collections.unmodifiableMap(tmpMap);
5088
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(closePurchase_args.class, metaDataMap);
5089
    }
5090
 
5091
    public closePurchase_args() {
5092
    }
5093
 
5094
    public closePurchase_args(
5095
      long purchaseId)
5096
    {
5097
      this();
5098
      this.purchaseId = purchaseId;
5099
      setPurchaseIdIsSet(true);
5100
    }
5101
 
5102
    /**
5103
     * Performs a deep copy on <i>other</i>.
5104
     */
5105
    public closePurchase_args(closePurchase_args other) {
5106
      __isset_bit_vector.clear();
5107
      __isset_bit_vector.or(other.__isset_bit_vector);
5108
      this.purchaseId = other.purchaseId;
5109
    }
5110
 
5111
    public closePurchase_args deepCopy() {
5112
      return new closePurchase_args(this);
5113
    }
5114
 
5115
    @Override
5116
    public void clear() {
5117
      setPurchaseIdIsSet(false);
5118
      this.purchaseId = 0;
5119
    }
5120
 
5121
    public long getPurchaseId() {
5122
      return this.purchaseId;
5123
    }
5124
 
5125
    public void setPurchaseId(long purchaseId) {
5126
      this.purchaseId = purchaseId;
5127
      setPurchaseIdIsSet(true);
5128
    }
5129
 
5130
    public void unsetPurchaseId() {
5131
      __isset_bit_vector.clear(__PURCHASEID_ISSET_ID);
5132
    }
5133
 
5134
    /** Returns true if field purchaseId is set (has been assigned a value) and false otherwise */
5135
    public boolean isSetPurchaseId() {
5136
      return __isset_bit_vector.get(__PURCHASEID_ISSET_ID);
5137
    }
5138
 
5139
    public void setPurchaseIdIsSet(boolean value) {
5140
      __isset_bit_vector.set(__PURCHASEID_ISSET_ID, value);
5141
    }
5142
 
5143
    public void setFieldValue(_Fields field, Object value) {
5144
      switch (field) {
5145
      case PURCHASE_ID:
5146
        if (value == null) {
5147
          unsetPurchaseId();
5148
        } else {
5149
          setPurchaseId((Long)value);
5150
        }
5151
        break;
5152
 
5153
      }
5154
    }
5155
 
5156
    public Object getFieldValue(_Fields field) {
5157
      switch (field) {
5158
      case PURCHASE_ID:
5159
        return Long.valueOf(getPurchaseId());
5160
 
5161
      }
5162
      throw new IllegalStateException();
5163
    }
5164
 
5165
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
5166
    public boolean isSet(_Fields field) {
5167
      if (field == null) {
5168
        throw new IllegalArgumentException();
5169
      }
5170
 
5171
      switch (field) {
5172
      case PURCHASE_ID:
5173
        return isSetPurchaseId();
5174
      }
5175
      throw new IllegalStateException();
5176
    }
5177
 
5178
    @Override
5179
    public boolean equals(Object that) {
5180
      if (that == null)
5181
        return false;
5182
      if (that instanceof closePurchase_args)
5183
        return this.equals((closePurchase_args)that);
5184
      return false;
5185
    }
5186
 
5187
    public boolean equals(closePurchase_args that) {
5188
      if (that == null)
5189
        return false;
5190
 
5191
      boolean this_present_purchaseId = true;
5192
      boolean that_present_purchaseId = true;
5193
      if (this_present_purchaseId || that_present_purchaseId) {
5194
        if (!(this_present_purchaseId && that_present_purchaseId))
5195
          return false;
5196
        if (this.purchaseId != that.purchaseId)
5197
          return false;
5198
      }
5199
 
5200
      return true;
5201
    }
5202
 
5203
    @Override
5204
    public int hashCode() {
5205
      return 0;
5206
    }
5207
 
5208
    public int compareTo(closePurchase_args other) {
5209
      if (!getClass().equals(other.getClass())) {
5210
        return getClass().getName().compareTo(other.getClass().getName());
5211
      }
5212
 
5213
      int lastComparison = 0;
5214
      closePurchase_args typedOther = (closePurchase_args)other;
5215
 
5216
      lastComparison = Boolean.valueOf(isSetPurchaseId()).compareTo(typedOther.isSetPurchaseId());
5217
      if (lastComparison != 0) {
5218
        return lastComparison;
5219
      }
5220
      if (isSetPurchaseId()) {
5221
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.purchaseId, typedOther.purchaseId);
5222
        if (lastComparison != 0) {
5223
          return lastComparison;
5224
        }
5225
      }
5226
      return 0;
5227
    }
5228
 
5229
    public _Fields fieldForId(int fieldId) {
5230
      return _Fields.findByThriftId(fieldId);
5231
    }
5232
 
5233
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
5234
      org.apache.thrift.protocol.TField field;
5235
      iprot.readStructBegin();
5236
      while (true)
5237
      {
5238
        field = iprot.readFieldBegin();
5239
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
5240
          break;
5241
        }
5242
        switch (field.id) {
5243
          case 1: // PURCHASE_ID
5244
            if (field.type == org.apache.thrift.protocol.TType.I64) {
5245
              this.purchaseId = iprot.readI64();
5246
              setPurchaseIdIsSet(true);
5247
            } else { 
5248
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5249
            }
5250
            break;
5251
          default:
5252
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5253
        }
5254
        iprot.readFieldEnd();
5255
      }
5256
      iprot.readStructEnd();
5257
      validate();
5258
    }
5259
 
5260
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
5261
      validate();
5262
 
5263
      oprot.writeStructBegin(STRUCT_DESC);
5264
      oprot.writeFieldBegin(PURCHASE_ID_FIELD_DESC);
5265
      oprot.writeI64(this.purchaseId);
5266
      oprot.writeFieldEnd();
5267
      oprot.writeFieldStop();
5268
      oprot.writeStructEnd();
5269
    }
5270
 
5271
    @Override
5272
    public String toString() {
5273
      StringBuilder sb = new StringBuilder("closePurchase_args(");
5274
      boolean first = true;
5275
 
5276
      sb.append("purchaseId:");
5277
      sb.append(this.purchaseId);
5278
      first = false;
5279
      sb.append(")");
5280
      return sb.toString();
5281
    }
5282
 
5283
    public void validate() throws org.apache.thrift.TException {
5284
      // check for required fields
5285
    }
5286
 
5287
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
5288
      try {
5289
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
5290
      } catch (org.apache.thrift.TException te) {
5291
        throw new java.io.IOException(te);
5292
      }
5293
    }
5294
 
5295
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
5296
      try {
5297
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
5298
      } catch (org.apache.thrift.TException te) {
5299
        throw new java.io.IOException(te);
5300
      }
5301
    }
5302
 
5303
  }
5304
 
5305
  public static class closePurchase_result implements org.apache.thrift.TBase<closePurchase_result, closePurchase_result._Fields>, java.io.Serializable, Cloneable   {
5306
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("closePurchase_result");
5307
 
5308
    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);
5309
    private static final org.apache.thrift.protocol.TField E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1);
5310
 
5311
    private long success; // required
5312
    private PurchaseServiceException e; // required
5313
 
5314
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
5315
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
5316
      SUCCESS((short)0, "success"),
5317
      E((short)1, "e");
5318
 
5319
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
5320
 
5321
      static {
5322
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
5323
          byName.put(field.getFieldName(), field);
5324
        }
5325
      }
5326
 
5327
      /**
5328
       * Find the _Fields constant that matches fieldId, or null if its not found.
5329
       */
5330
      public static _Fields findByThriftId(int fieldId) {
5331
        switch(fieldId) {
5332
          case 0: // SUCCESS
5333
            return SUCCESS;
5334
          case 1: // E
5335
            return E;
5336
          default:
5337
            return null;
5338
        }
5339
      }
5340
 
5341
      /**
5342
       * Find the _Fields constant that matches fieldId, throwing an exception
5343
       * if it is not found.
5344
       */
5345
      public static _Fields findByThriftIdOrThrow(int fieldId) {
5346
        _Fields fields = findByThriftId(fieldId);
5347
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
5348
        return fields;
5349
      }
5350
 
5351
      /**
5352
       * Find the _Fields constant that matches name, or null if its not found.
5353
       */
5354
      public static _Fields findByName(String name) {
5355
        return byName.get(name);
5356
      }
5357
 
5358
      private final short _thriftId;
5359
      private final String _fieldName;
5360
 
5361
      _Fields(short thriftId, String fieldName) {
5362
        _thriftId = thriftId;
5363
        _fieldName = fieldName;
5364
      }
5365
 
5366
      public short getThriftFieldId() {
5367
        return _thriftId;
5368
      }
5369
 
5370
      public String getFieldName() {
5371
        return _fieldName;
5372
      }
5373
    }
5374
 
5375
    // isset id assignments
5376
    private static final int __SUCCESS_ISSET_ID = 0;
5377
    private BitSet __isset_bit_vector = new BitSet(1);
5378
 
5379
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
5380
    static {
5381
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
5382
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
5383
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
5384
      tmpMap.put(_Fields.E, new org.apache.thrift.meta_data.FieldMetaData("e", org.apache.thrift.TFieldRequirementType.DEFAULT, 
5385
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
5386
      metaDataMap = Collections.unmodifiableMap(tmpMap);
5387
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(closePurchase_result.class, metaDataMap);
5388
    }
5389
 
5390
    public closePurchase_result() {
5391
    }
5392
 
5393
    public closePurchase_result(
5394
      long success,
5395
      PurchaseServiceException e)
5396
    {
5397
      this();
5398
      this.success = success;
5399
      setSuccessIsSet(true);
5400
      this.e = e;
5401
    }
5402
 
5403
    /**
5404
     * Performs a deep copy on <i>other</i>.
5405
     */
5406
    public closePurchase_result(closePurchase_result other) {
5407
      __isset_bit_vector.clear();
5408
      __isset_bit_vector.or(other.__isset_bit_vector);
5409
      this.success = other.success;
5410
      if (other.isSetE()) {
5411
        this.e = new PurchaseServiceException(other.e);
5412
      }
5413
    }
5414
 
5415
    public closePurchase_result deepCopy() {
5416
      return new closePurchase_result(this);
5417
    }
5418
 
5419
    @Override
5420
    public void clear() {
5421
      setSuccessIsSet(false);
5422
      this.success = 0;
5423
      this.e = null;
5424
    }
5425
 
5426
    public long getSuccess() {
5427
      return this.success;
5428
    }
5429
 
5430
    public void setSuccess(long success) {
5431
      this.success = success;
5432
      setSuccessIsSet(true);
5433
    }
5434
 
5435
    public void unsetSuccess() {
5436
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
5437
    }
5438
 
5439
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
5440
    public boolean isSetSuccess() {
5441
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
5442
    }
5443
 
5444
    public void setSuccessIsSet(boolean value) {
5445
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
5446
    }
5447
 
5448
    public PurchaseServiceException getE() {
5449
      return this.e;
5450
    }
5451
 
5452
    public void setE(PurchaseServiceException e) {
5453
      this.e = e;
5454
    }
5455
 
5456
    public void unsetE() {
5457
      this.e = null;
5458
    }
5459
 
5460
    /** Returns true if field e is set (has been assigned a value) and false otherwise */
5461
    public boolean isSetE() {
5462
      return this.e != null;
5463
    }
5464
 
5465
    public void setEIsSet(boolean value) {
5466
      if (!value) {
5467
        this.e = null;
5468
      }
5469
    }
5470
 
5471
    public void setFieldValue(_Fields field, Object value) {
5472
      switch (field) {
5473
      case SUCCESS:
5474
        if (value == null) {
5475
          unsetSuccess();
5476
        } else {
5477
          setSuccess((Long)value);
5478
        }
5479
        break;
5480
 
5481
      case E:
5482
        if (value == null) {
5483
          unsetE();
5484
        } else {
5485
          setE((PurchaseServiceException)value);
5486
        }
5487
        break;
5488
 
5489
      }
5490
    }
5491
 
5492
    public Object getFieldValue(_Fields field) {
5493
      switch (field) {
5494
      case SUCCESS:
5495
        return Long.valueOf(getSuccess());
5496
 
5497
      case E:
5498
        return getE();
5499
 
5500
      }
5501
      throw new IllegalStateException();
5502
    }
5503
 
5504
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
5505
    public boolean isSet(_Fields field) {
5506
      if (field == null) {
5507
        throw new IllegalArgumentException();
5508
      }
5509
 
5510
      switch (field) {
5511
      case SUCCESS:
5512
        return isSetSuccess();
5513
      case E:
5514
        return isSetE();
5515
      }
5516
      throw new IllegalStateException();
5517
    }
5518
 
5519
    @Override
5520
    public boolean equals(Object that) {
5521
      if (that == null)
5522
        return false;
5523
      if (that instanceof closePurchase_result)
5524
        return this.equals((closePurchase_result)that);
5525
      return false;
5526
    }
5527
 
5528
    public boolean equals(closePurchase_result that) {
5529
      if (that == null)
5530
        return false;
5531
 
5532
      boolean this_present_success = true;
5533
      boolean that_present_success = true;
5534
      if (this_present_success || that_present_success) {
5535
        if (!(this_present_success && that_present_success))
5536
          return false;
5537
        if (this.success != that.success)
5538
          return false;
5539
      }
5540
 
5541
      boolean this_present_e = true && this.isSetE();
5542
      boolean that_present_e = true && that.isSetE();
5543
      if (this_present_e || that_present_e) {
5544
        if (!(this_present_e && that_present_e))
5545
          return false;
5546
        if (!this.e.equals(that.e))
5547
          return false;
5548
      }
5549
 
5550
      return true;
5551
    }
5552
 
5553
    @Override
5554
    public int hashCode() {
5555
      return 0;
5556
    }
5557
 
5558
    public int compareTo(closePurchase_result other) {
5559
      if (!getClass().equals(other.getClass())) {
5560
        return getClass().getName().compareTo(other.getClass().getName());
5561
      }
5562
 
5563
      int lastComparison = 0;
5564
      closePurchase_result typedOther = (closePurchase_result)other;
5565
 
5566
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
5567
      if (lastComparison != 0) {
5568
        return lastComparison;
5569
      }
5570
      if (isSetSuccess()) {
5571
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
5572
        if (lastComparison != 0) {
5573
          return lastComparison;
5574
        }
5575
      }
5576
      lastComparison = Boolean.valueOf(isSetE()).compareTo(typedOther.isSetE());
5577
      if (lastComparison != 0) {
5578
        return lastComparison;
5579
      }
5580
      if (isSetE()) {
5581
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, typedOther.e);
5582
        if (lastComparison != 0) {
5583
          return lastComparison;
5584
        }
5585
      }
5586
      return 0;
5587
    }
5588
 
5589
    public _Fields fieldForId(int fieldId) {
5590
      return _Fields.findByThriftId(fieldId);
5591
    }
5592
 
5593
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
5594
      org.apache.thrift.protocol.TField field;
5595
      iprot.readStructBegin();
5596
      while (true)
5597
      {
5598
        field = iprot.readFieldBegin();
5599
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
5600
          break;
5601
        }
5602
        switch (field.id) {
5603
          case 0: // SUCCESS
5604
            if (field.type == org.apache.thrift.protocol.TType.I64) {
5605
              this.success = iprot.readI64();
5606
              setSuccessIsSet(true);
5607
            } else { 
5608
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5609
            }
5610
            break;
5611
          case 1: // E
5612
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
5613
              this.e = new PurchaseServiceException();
5614
              this.e.read(iprot);
5615
            } else { 
5616
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5617
            }
5618
            break;
5619
          default:
5620
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5621
        }
5622
        iprot.readFieldEnd();
5623
      }
5624
      iprot.readStructEnd();
5625
      validate();
5626
    }
5627
 
5628
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
5629
      oprot.writeStructBegin(STRUCT_DESC);
5630
 
5631
      if (this.isSetSuccess()) {
5632
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
5633
        oprot.writeI64(this.success);
5634
        oprot.writeFieldEnd();
5635
      } else if (this.isSetE()) {
5636
        oprot.writeFieldBegin(E_FIELD_DESC);
5637
        this.e.write(oprot);
5638
        oprot.writeFieldEnd();
5639
      }
5640
      oprot.writeFieldStop();
5641
      oprot.writeStructEnd();
5642
    }
5643
 
5644
    @Override
5645
    public String toString() {
5646
      StringBuilder sb = new StringBuilder("closePurchase_result(");
5647
      boolean first = true;
5648
 
5649
      sb.append("success:");
5650
      sb.append(this.success);
5651
      first = false;
5652
      if (!first) sb.append(", ");
5653
      sb.append("e:");
5654
      if (this.e == null) {
5655
        sb.append("null");
5656
      } else {
5657
        sb.append(this.e);
5658
      }
5659
      first = false;
5660
      sb.append(")");
5661
      return sb.toString();
5662
    }
5663
 
5664
    public void validate() throws org.apache.thrift.TException {
5665
      // check for required fields
5666
    }
5667
 
5668
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
5669
      try {
5670
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
5671
      } catch (org.apache.thrift.TException te) {
5672
        throw new java.io.IOException(te);
5673
      }
5674
    }
5675
 
5676
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
5677
      try {
5678
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
5679
      } catch (org.apache.thrift.TException te) {
5680
        throw new java.io.IOException(te);
5681
      }
5682
    }
5683
 
5684
  }
5685
 
5686
  public static class getAllPurchases_args implements org.apache.thrift.TBase<getAllPurchases_args, getAllPurchases_args._Fields>, java.io.Serializable, Cloneable   {
5687
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllPurchases_args");
5688
 
5689
    private static final org.apache.thrift.protocol.TField PURCHASE_ORDER_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("purchaseOrderId", org.apache.thrift.protocol.TType.I64, (short)1);
5690
    private static final org.apache.thrift.protocol.TField OPEN_FIELD_DESC = new org.apache.thrift.protocol.TField("open", org.apache.thrift.protocol.TType.BOOL, (short)2);
5691
 
5692
    private long purchaseOrderId; // required
5693
    private boolean open; // required
5694
 
5695
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
5696
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
5697
      PURCHASE_ORDER_ID((short)1, "purchaseOrderId"),
5698
      OPEN((short)2, "open");
5699
 
5700
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
5701
 
5702
      static {
5703
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
5704
          byName.put(field.getFieldName(), field);
5705
        }
5706
      }
5707
 
5708
      /**
5709
       * Find the _Fields constant that matches fieldId, or null if its not found.
5710
       */
5711
      public static _Fields findByThriftId(int fieldId) {
5712
        switch(fieldId) {
5713
          case 1: // PURCHASE_ORDER_ID
5714
            return PURCHASE_ORDER_ID;
5715
          case 2: // OPEN
5716
            return OPEN;
5717
          default:
5718
            return null;
5719
        }
5720
      }
5721
 
5722
      /**
5723
       * Find the _Fields constant that matches fieldId, throwing an exception
5724
       * if it is not found.
5725
       */
5726
      public static _Fields findByThriftIdOrThrow(int fieldId) {
5727
        _Fields fields = findByThriftId(fieldId);
5728
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
5729
        return fields;
5730
      }
5731
 
5732
      /**
5733
       * Find the _Fields constant that matches name, or null if its not found.
5734
       */
5735
      public static _Fields findByName(String name) {
5736
        return byName.get(name);
5737
      }
5738
 
5739
      private final short _thriftId;
5740
      private final String _fieldName;
5741
 
5742
      _Fields(short thriftId, String fieldName) {
5743
        _thriftId = thriftId;
5744
        _fieldName = fieldName;
5745
      }
5746
 
5747
      public short getThriftFieldId() {
5748
        return _thriftId;
5749
      }
5750
 
5751
      public String getFieldName() {
5752
        return _fieldName;
5753
      }
5754
    }
5755
 
5756
    // isset id assignments
5757
    private static final int __PURCHASEORDERID_ISSET_ID = 0;
5758
    private static final int __OPEN_ISSET_ID = 1;
5759
    private BitSet __isset_bit_vector = new BitSet(2);
5760
 
5761
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
5762
    static {
5763
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
5764
      tmpMap.put(_Fields.PURCHASE_ORDER_ID, new org.apache.thrift.meta_data.FieldMetaData("purchaseOrderId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
5765
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
5766
      tmpMap.put(_Fields.OPEN, new org.apache.thrift.meta_data.FieldMetaData("open", org.apache.thrift.TFieldRequirementType.DEFAULT, 
5767
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
5768
      metaDataMap = Collections.unmodifiableMap(tmpMap);
5769
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllPurchases_args.class, metaDataMap);
5770
    }
5771
 
5772
    public getAllPurchases_args() {
5773
    }
5774
 
5775
    public getAllPurchases_args(
5776
      long purchaseOrderId,
5777
      boolean open)
5778
    {
5779
      this();
5780
      this.purchaseOrderId = purchaseOrderId;
5781
      setPurchaseOrderIdIsSet(true);
5782
      this.open = open;
5783
      setOpenIsSet(true);
5784
    }
5785
 
5786
    /**
5787
     * Performs a deep copy on <i>other</i>.
5788
     */
5789
    public getAllPurchases_args(getAllPurchases_args other) {
5790
      __isset_bit_vector.clear();
5791
      __isset_bit_vector.or(other.__isset_bit_vector);
5792
      this.purchaseOrderId = other.purchaseOrderId;
5793
      this.open = other.open;
5794
    }
5795
 
5796
    public getAllPurchases_args deepCopy() {
5797
      return new getAllPurchases_args(this);
5798
    }
5799
 
5800
    @Override
5801
    public void clear() {
5802
      setPurchaseOrderIdIsSet(false);
5803
      this.purchaseOrderId = 0;
5804
      setOpenIsSet(false);
5805
      this.open = false;
5806
    }
5807
 
5808
    public long getPurchaseOrderId() {
5809
      return this.purchaseOrderId;
5810
    }
5811
 
5812
    public void setPurchaseOrderId(long purchaseOrderId) {
5813
      this.purchaseOrderId = purchaseOrderId;
5814
      setPurchaseOrderIdIsSet(true);
5815
    }
5816
 
5817
    public void unsetPurchaseOrderId() {
5818
      __isset_bit_vector.clear(__PURCHASEORDERID_ISSET_ID);
5819
    }
5820
 
5821
    /** Returns true if field purchaseOrderId is set (has been assigned a value) and false otherwise */
5822
    public boolean isSetPurchaseOrderId() {
5823
      return __isset_bit_vector.get(__PURCHASEORDERID_ISSET_ID);
5824
    }
5825
 
5826
    public void setPurchaseOrderIdIsSet(boolean value) {
5827
      __isset_bit_vector.set(__PURCHASEORDERID_ISSET_ID, value);
5828
    }
5829
 
5830
    public boolean isOpen() {
5831
      return this.open;
5832
    }
5833
 
5834
    public void setOpen(boolean open) {
5835
      this.open = open;
5836
      setOpenIsSet(true);
5837
    }
5838
 
5839
    public void unsetOpen() {
5840
      __isset_bit_vector.clear(__OPEN_ISSET_ID);
5841
    }
5842
 
5843
    /** Returns true if field open is set (has been assigned a value) and false otherwise */
5844
    public boolean isSetOpen() {
5845
      return __isset_bit_vector.get(__OPEN_ISSET_ID);
5846
    }
5847
 
5848
    public void setOpenIsSet(boolean value) {
5849
      __isset_bit_vector.set(__OPEN_ISSET_ID, value);
5850
    }
5851
 
5852
    public void setFieldValue(_Fields field, Object value) {
5853
      switch (field) {
5854
      case PURCHASE_ORDER_ID:
5855
        if (value == null) {
5856
          unsetPurchaseOrderId();
5857
        } else {
5858
          setPurchaseOrderId((Long)value);
5859
        }
5860
        break;
5861
 
5862
      case OPEN:
5863
        if (value == null) {
5864
          unsetOpen();
5865
        } else {
5866
          setOpen((Boolean)value);
5867
        }
5868
        break;
5869
 
5870
      }
5871
    }
5872
 
5873
    public Object getFieldValue(_Fields field) {
5874
      switch (field) {
5875
      case PURCHASE_ORDER_ID:
5876
        return Long.valueOf(getPurchaseOrderId());
5877
 
5878
      case OPEN:
5879
        return Boolean.valueOf(isOpen());
5880
 
5881
      }
5882
      throw new IllegalStateException();
5883
    }
5884
 
5885
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
5886
    public boolean isSet(_Fields field) {
5887
      if (field == null) {
5888
        throw new IllegalArgumentException();
5889
      }
5890
 
5891
      switch (field) {
5892
      case PURCHASE_ORDER_ID:
5893
        return isSetPurchaseOrderId();
5894
      case OPEN:
5895
        return isSetOpen();
5896
      }
5897
      throw new IllegalStateException();
5898
    }
5899
 
5900
    @Override
5901
    public boolean equals(Object that) {
5902
      if (that == null)
5903
        return false;
5904
      if (that instanceof getAllPurchases_args)
5905
        return this.equals((getAllPurchases_args)that);
5906
      return false;
5907
    }
5908
 
5909
    public boolean equals(getAllPurchases_args that) {
5910
      if (that == null)
5911
        return false;
5912
 
5913
      boolean this_present_purchaseOrderId = true;
5914
      boolean that_present_purchaseOrderId = true;
5915
      if (this_present_purchaseOrderId || that_present_purchaseOrderId) {
5916
        if (!(this_present_purchaseOrderId && that_present_purchaseOrderId))
5917
          return false;
5918
        if (this.purchaseOrderId != that.purchaseOrderId)
5919
          return false;
5920
      }
5921
 
5922
      boolean this_present_open = true;
5923
      boolean that_present_open = true;
5924
      if (this_present_open || that_present_open) {
5925
        if (!(this_present_open && that_present_open))
5926
          return false;
5927
        if (this.open != that.open)
5928
          return false;
5929
      }
5930
 
5931
      return true;
5932
    }
5933
 
5934
    @Override
5935
    public int hashCode() {
5936
      return 0;
5937
    }
5938
 
5939
    public int compareTo(getAllPurchases_args other) {
5940
      if (!getClass().equals(other.getClass())) {
5941
        return getClass().getName().compareTo(other.getClass().getName());
5942
      }
5943
 
5944
      int lastComparison = 0;
5945
      getAllPurchases_args typedOther = (getAllPurchases_args)other;
5946
 
5947
      lastComparison = Boolean.valueOf(isSetPurchaseOrderId()).compareTo(typedOther.isSetPurchaseOrderId());
5948
      if (lastComparison != 0) {
5949
        return lastComparison;
5950
      }
5951
      if (isSetPurchaseOrderId()) {
5952
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.purchaseOrderId, typedOther.purchaseOrderId);
5953
        if (lastComparison != 0) {
5954
          return lastComparison;
5955
        }
5956
      }
5957
      lastComparison = Boolean.valueOf(isSetOpen()).compareTo(typedOther.isSetOpen());
5958
      if (lastComparison != 0) {
5959
        return lastComparison;
5960
      }
5961
      if (isSetOpen()) {
5962
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.open, typedOther.open);
5963
        if (lastComparison != 0) {
5964
          return lastComparison;
5965
        }
5966
      }
5967
      return 0;
5968
    }
5969
 
5970
    public _Fields fieldForId(int fieldId) {
5971
      return _Fields.findByThriftId(fieldId);
5972
    }
5973
 
5974
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
5975
      org.apache.thrift.protocol.TField field;
5976
      iprot.readStructBegin();
5977
      while (true)
5978
      {
5979
        field = iprot.readFieldBegin();
5980
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
5981
          break;
5982
        }
5983
        switch (field.id) {
5984
          case 1: // PURCHASE_ORDER_ID
5985
            if (field.type == org.apache.thrift.protocol.TType.I64) {
5986
              this.purchaseOrderId = iprot.readI64();
5987
              setPurchaseOrderIdIsSet(true);
5988
            } else { 
5989
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5990
            }
5991
            break;
5992
          case 2: // OPEN
5993
            if (field.type == org.apache.thrift.protocol.TType.BOOL) {
5994
              this.open = iprot.readBool();
5995
              setOpenIsSet(true);
5996
            } else { 
5997
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5998
            }
5999
            break;
6000
          default:
6001
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6002
        }
6003
        iprot.readFieldEnd();
6004
      }
6005
      iprot.readStructEnd();
6006
      validate();
6007
    }
6008
 
6009
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
6010
      validate();
6011
 
6012
      oprot.writeStructBegin(STRUCT_DESC);
6013
      oprot.writeFieldBegin(PURCHASE_ORDER_ID_FIELD_DESC);
6014
      oprot.writeI64(this.purchaseOrderId);
6015
      oprot.writeFieldEnd();
6016
      oprot.writeFieldBegin(OPEN_FIELD_DESC);
6017
      oprot.writeBool(this.open);
6018
      oprot.writeFieldEnd();
6019
      oprot.writeFieldStop();
6020
      oprot.writeStructEnd();
6021
    }
6022
 
6023
    @Override
6024
    public String toString() {
6025
      StringBuilder sb = new StringBuilder("getAllPurchases_args(");
6026
      boolean first = true;
6027
 
6028
      sb.append("purchaseOrderId:");
6029
      sb.append(this.purchaseOrderId);
6030
      first = false;
6031
      if (!first) sb.append(", ");
6032
      sb.append("open:");
6033
      sb.append(this.open);
6034
      first = false;
6035
      sb.append(")");
6036
      return sb.toString();
6037
    }
6038
 
6039
    public void validate() throws org.apache.thrift.TException {
6040
      // check for required fields
6041
    }
6042
 
6043
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
6044
      try {
6045
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
6046
      } catch (org.apache.thrift.TException te) {
6047
        throw new java.io.IOException(te);
6048
      }
6049
    }
6050
 
6051
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
6052
      try {
6053
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
6054
      } catch (org.apache.thrift.TException te) {
6055
        throw new java.io.IOException(te);
6056
      }
6057
    }
6058
 
6059
  }
6060
 
6061
  public static class getAllPurchases_result implements org.apache.thrift.TBase<getAllPurchases_result, getAllPurchases_result._Fields>, java.io.Serializable, Cloneable   {
6062
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllPurchases_result");
6063
 
6064
    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);
6065
    private static final org.apache.thrift.protocol.TField E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1);
6066
 
6067
    private List<Purchase> success; // required
6068
    private PurchaseServiceException e; // required
6069
 
6070
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
6071
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
6072
      SUCCESS((short)0, "success"),
6073
      E((short)1, "e");
6074
 
6075
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
6076
 
6077
      static {
6078
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
6079
          byName.put(field.getFieldName(), field);
6080
        }
6081
      }
6082
 
6083
      /**
6084
       * Find the _Fields constant that matches fieldId, or null if its not found.
6085
       */
6086
      public static _Fields findByThriftId(int fieldId) {
6087
        switch(fieldId) {
6088
          case 0: // SUCCESS
6089
            return SUCCESS;
6090
          case 1: // E
6091
            return E;
6092
          default:
6093
            return null;
6094
        }
6095
      }
6096
 
6097
      /**
6098
       * Find the _Fields constant that matches fieldId, throwing an exception
6099
       * if it is not found.
6100
       */
6101
      public static _Fields findByThriftIdOrThrow(int fieldId) {
6102
        _Fields fields = findByThriftId(fieldId);
6103
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
6104
        return fields;
6105
      }
6106
 
6107
      /**
6108
       * Find the _Fields constant that matches name, or null if its not found.
6109
       */
6110
      public static _Fields findByName(String name) {
6111
        return byName.get(name);
6112
      }
6113
 
6114
      private final short _thriftId;
6115
      private final String _fieldName;
6116
 
6117
      _Fields(short thriftId, String fieldName) {
6118
        _thriftId = thriftId;
6119
        _fieldName = fieldName;
6120
      }
6121
 
6122
      public short getThriftFieldId() {
6123
        return _thriftId;
6124
      }
6125
 
6126
      public String getFieldName() {
6127
        return _fieldName;
6128
      }
6129
    }
6130
 
6131
    // isset id assignments
6132
 
6133
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
6134
    static {
6135
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
6136
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
6137
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
6138
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Purchase.class))));
6139
      tmpMap.put(_Fields.E, new org.apache.thrift.meta_data.FieldMetaData("e", org.apache.thrift.TFieldRequirementType.DEFAULT, 
6140
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
6141
      metaDataMap = Collections.unmodifiableMap(tmpMap);
6142
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllPurchases_result.class, metaDataMap);
6143
    }
6144
 
6145
    public getAllPurchases_result() {
6146
    }
6147
 
6148
    public getAllPurchases_result(
6149
      List<Purchase> success,
6150
      PurchaseServiceException e)
6151
    {
6152
      this();
6153
      this.success = success;
6154
      this.e = e;
6155
    }
6156
 
6157
    /**
6158
     * Performs a deep copy on <i>other</i>.
6159
     */
6160
    public getAllPurchases_result(getAllPurchases_result other) {
6161
      if (other.isSetSuccess()) {
6162
        List<Purchase> __this__success = new ArrayList<Purchase>();
6163
        for (Purchase other_element : other.success) {
6164
          __this__success.add(new Purchase(other_element));
6165
        }
6166
        this.success = __this__success;
6167
      }
6168
      if (other.isSetE()) {
6169
        this.e = new PurchaseServiceException(other.e);
6170
      }
6171
    }
6172
 
6173
    public getAllPurchases_result deepCopy() {
6174
      return new getAllPurchases_result(this);
6175
    }
6176
 
6177
    @Override
6178
    public void clear() {
6179
      this.success = null;
6180
      this.e = null;
6181
    }
6182
 
6183
    public int getSuccessSize() {
6184
      return (this.success == null) ? 0 : this.success.size();
6185
    }
6186
 
6187
    public java.util.Iterator<Purchase> getSuccessIterator() {
6188
      return (this.success == null) ? null : this.success.iterator();
6189
    }
6190
 
6191
    public void addToSuccess(Purchase elem) {
6192
      if (this.success == null) {
6193
        this.success = new ArrayList<Purchase>();
6194
      }
6195
      this.success.add(elem);
6196
    }
6197
 
6198
    public List<Purchase> getSuccess() {
6199
      return this.success;
6200
    }
6201
 
6202
    public void setSuccess(List<Purchase> success) {
6203
      this.success = success;
6204
    }
6205
 
6206
    public void unsetSuccess() {
6207
      this.success = null;
6208
    }
6209
 
6210
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
6211
    public boolean isSetSuccess() {
6212
      return this.success != null;
6213
    }
6214
 
6215
    public void setSuccessIsSet(boolean value) {
6216
      if (!value) {
6217
        this.success = null;
6218
      }
6219
    }
6220
 
6221
    public PurchaseServiceException getE() {
6222
      return this.e;
6223
    }
6224
 
6225
    public void setE(PurchaseServiceException e) {
6226
      this.e = e;
6227
    }
6228
 
6229
    public void unsetE() {
6230
      this.e = null;
6231
    }
6232
 
6233
    /** Returns true if field e is set (has been assigned a value) and false otherwise */
6234
    public boolean isSetE() {
6235
      return this.e != null;
6236
    }
6237
 
6238
    public void setEIsSet(boolean value) {
6239
      if (!value) {
6240
        this.e = null;
6241
      }
6242
    }
6243
 
6244
    public void setFieldValue(_Fields field, Object value) {
6245
      switch (field) {
6246
      case SUCCESS:
6247
        if (value == null) {
6248
          unsetSuccess();
6249
        } else {
6250
          setSuccess((List<Purchase>)value);
6251
        }
6252
        break;
6253
 
6254
      case E:
6255
        if (value == null) {
6256
          unsetE();
6257
        } else {
6258
          setE((PurchaseServiceException)value);
6259
        }
6260
        break;
6261
 
6262
      }
6263
    }
6264
 
6265
    public Object getFieldValue(_Fields field) {
6266
      switch (field) {
6267
      case SUCCESS:
6268
        return getSuccess();
6269
 
6270
      case E:
6271
        return getE();
6272
 
6273
      }
6274
      throw new IllegalStateException();
6275
    }
6276
 
6277
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
6278
    public boolean isSet(_Fields field) {
6279
      if (field == null) {
6280
        throw new IllegalArgumentException();
6281
      }
6282
 
6283
      switch (field) {
6284
      case SUCCESS:
6285
        return isSetSuccess();
6286
      case E:
6287
        return isSetE();
6288
      }
6289
      throw new IllegalStateException();
6290
    }
6291
 
6292
    @Override
6293
    public boolean equals(Object that) {
6294
      if (that == null)
6295
        return false;
6296
      if (that instanceof getAllPurchases_result)
6297
        return this.equals((getAllPurchases_result)that);
6298
      return false;
6299
    }
6300
 
6301
    public boolean equals(getAllPurchases_result that) {
6302
      if (that == null)
6303
        return false;
6304
 
6305
      boolean this_present_success = true && this.isSetSuccess();
6306
      boolean that_present_success = true && that.isSetSuccess();
6307
      if (this_present_success || that_present_success) {
6308
        if (!(this_present_success && that_present_success))
6309
          return false;
6310
        if (!this.success.equals(that.success))
6311
          return false;
6312
      }
6313
 
6314
      boolean this_present_e = true && this.isSetE();
6315
      boolean that_present_e = true && that.isSetE();
6316
      if (this_present_e || that_present_e) {
6317
        if (!(this_present_e && that_present_e))
6318
          return false;
6319
        if (!this.e.equals(that.e))
6320
          return false;
6321
      }
6322
 
6323
      return true;
6324
    }
6325
 
6326
    @Override
6327
    public int hashCode() {
6328
      return 0;
6329
    }
6330
 
6331
    public int compareTo(getAllPurchases_result other) {
6332
      if (!getClass().equals(other.getClass())) {
6333
        return getClass().getName().compareTo(other.getClass().getName());
6334
      }
6335
 
6336
      int lastComparison = 0;
6337
      getAllPurchases_result typedOther = (getAllPurchases_result)other;
6338
 
6339
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
6340
      if (lastComparison != 0) {
6341
        return lastComparison;
6342
      }
6343
      if (isSetSuccess()) {
6344
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
6345
        if (lastComparison != 0) {
6346
          return lastComparison;
6347
        }
6348
      }
6349
      lastComparison = Boolean.valueOf(isSetE()).compareTo(typedOther.isSetE());
6350
      if (lastComparison != 0) {
6351
        return lastComparison;
6352
      }
6353
      if (isSetE()) {
6354
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, typedOther.e);
6355
        if (lastComparison != 0) {
6356
          return lastComparison;
6357
        }
6358
      }
6359
      return 0;
6360
    }
6361
 
6362
    public _Fields fieldForId(int fieldId) {
6363
      return _Fields.findByThriftId(fieldId);
6364
    }
6365
 
6366
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
6367
      org.apache.thrift.protocol.TField field;
6368
      iprot.readStructBegin();
6369
      while (true)
6370
      {
6371
        field = iprot.readFieldBegin();
6372
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
6373
          break;
6374
        }
6375
        switch (field.id) {
6376
          case 0: // SUCCESS
6377
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
6378
              {
6379
                org.apache.thrift.protocol.TList _list8 = iprot.readListBegin();
6380
                this.success = new ArrayList<Purchase>(_list8.size);
6381
                for (int _i9 = 0; _i9 < _list8.size; ++_i9)
6382
                {
6383
                  Purchase _elem10; // required
6384
                  _elem10 = new Purchase();
6385
                  _elem10.read(iprot);
6386
                  this.success.add(_elem10);
6387
                }
6388
                iprot.readListEnd();
6389
              }
6390
            } else { 
6391
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6392
            }
6393
            break;
6394
          case 1: // E
6395
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
6396
              this.e = new PurchaseServiceException();
6397
              this.e.read(iprot);
6398
            } else { 
6399
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6400
            }
6401
            break;
6402
          default:
6403
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6404
        }
6405
        iprot.readFieldEnd();
6406
      }
6407
      iprot.readStructEnd();
6408
      validate();
6409
    }
6410
 
6411
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
6412
      oprot.writeStructBegin(STRUCT_DESC);
6413
 
6414
      if (this.isSetSuccess()) {
6415
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
6416
        {
6417
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
6418
          for (Purchase _iter11 : this.success)
6419
          {
6420
            _iter11.write(oprot);
6421
          }
6422
          oprot.writeListEnd();
6423
        }
6424
        oprot.writeFieldEnd();
6425
      } else if (this.isSetE()) {
6426
        oprot.writeFieldBegin(E_FIELD_DESC);
6427
        this.e.write(oprot);
6428
        oprot.writeFieldEnd();
6429
      }
6430
      oprot.writeFieldStop();
6431
      oprot.writeStructEnd();
6432
    }
6433
 
6434
    @Override
6435
    public String toString() {
6436
      StringBuilder sb = new StringBuilder("getAllPurchases_result(");
6437
      boolean first = true;
6438
 
6439
      sb.append("success:");
6440
      if (this.success == null) {
6441
        sb.append("null");
6442
      } else {
6443
        sb.append(this.success);
6444
      }
6445
      first = false;
6446
      if (!first) sb.append(", ");
6447
      sb.append("e:");
6448
      if (this.e == null) {
6449
        sb.append("null");
6450
      } else {
6451
        sb.append(this.e);
6452
      }
6453
      first = false;
6454
      sb.append(")");
6455
      return sb.toString();
6456
    }
6457
 
6458
    public void validate() throws org.apache.thrift.TException {
6459
      // check for required fields
6460
    }
6461
 
6462
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
6463
      try {
6464
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
6465
      } catch (org.apache.thrift.TException te) {
6466
        throw new java.io.IOException(te);
6467
      }
6468
    }
6469
 
6470
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
6471
      try {
6472
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
6473
      } catch (org.apache.thrift.TException te) {
6474
        throw new java.io.IOException(te);
6475
      }
6476
    }
6477
 
6478
  }
6479
 
4555 mandeep.dh 6480
  public static class getPurchaseOrderForPurchase_args implements org.apache.thrift.TBase<getPurchaseOrderForPurchase_args, getPurchaseOrderForPurchase_args._Fields>, java.io.Serializable, Cloneable   {
6481
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getPurchaseOrderForPurchase_args");
4496 mandeep.dh 6482
 
6483
    private static final org.apache.thrift.protocol.TField PURCHASE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("purchaseId", org.apache.thrift.protocol.TType.I64, (short)1);
6484
 
6485
    private long purchaseId; // required
6486
 
6487
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
6488
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
4555 mandeep.dh 6489
      PURCHASE_ID((short)1, "purchaseId");
4496 mandeep.dh 6490
 
6491
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
6492
 
6493
      static {
6494
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
6495
          byName.put(field.getFieldName(), field);
6496
        }
6497
      }
6498
 
6499
      /**
6500
       * Find the _Fields constant that matches fieldId, or null if its not found.
6501
       */
6502
      public static _Fields findByThriftId(int fieldId) {
6503
        switch(fieldId) {
6504
          case 1: // PURCHASE_ID
6505
            return PURCHASE_ID;
6506
          default:
6507
            return null;
6508
        }
6509
      }
6510
 
6511
      /**
6512
       * Find the _Fields constant that matches fieldId, throwing an exception
6513
       * if it is not found.
6514
       */
6515
      public static _Fields findByThriftIdOrThrow(int fieldId) {
6516
        _Fields fields = findByThriftId(fieldId);
6517
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
6518
        return fields;
6519
      }
6520
 
6521
      /**
6522
       * Find the _Fields constant that matches name, or null if its not found.
6523
       */
6524
      public static _Fields findByName(String name) {
6525
        return byName.get(name);
6526
      }
6527
 
6528
      private final short _thriftId;
6529
      private final String _fieldName;
6530
 
6531
      _Fields(short thriftId, String fieldName) {
6532
        _thriftId = thriftId;
6533
        _fieldName = fieldName;
6534
      }
6535
 
6536
      public short getThriftFieldId() {
6537
        return _thriftId;
6538
      }
6539
 
6540
      public String getFieldName() {
6541
        return _fieldName;
6542
      }
6543
    }
6544
 
6545
    // isset id assignments
6546
    private static final int __PURCHASEID_ISSET_ID = 0;
4555 mandeep.dh 6547
    private BitSet __isset_bit_vector = new BitSet(1);
4496 mandeep.dh 6548
 
6549
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
6550
    static {
6551
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
6552
      tmpMap.put(_Fields.PURCHASE_ID, new org.apache.thrift.meta_data.FieldMetaData("purchaseId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
6553
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
6554
      metaDataMap = Collections.unmodifiableMap(tmpMap);
4555 mandeep.dh 6555
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPurchaseOrderForPurchase_args.class, metaDataMap);
4496 mandeep.dh 6556
    }
6557
 
4555 mandeep.dh 6558
    public getPurchaseOrderForPurchase_args() {
4496 mandeep.dh 6559
    }
6560
 
4555 mandeep.dh 6561
    public getPurchaseOrderForPurchase_args(
6562
      long purchaseId)
4496 mandeep.dh 6563
    {
6564
      this();
6565
      this.purchaseId = purchaseId;
6566
      setPurchaseIdIsSet(true);
6567
    }
6568
 
6569
    /**
6570
     * Performs a deep copy on <i>other</i>.
6571
     */
4555 mandeep.dh 6572
    public getPurchaseOrderForPurchase_args(getPurchaseOrderForPurchase_args other) {
4496 mandeep.dh 6573
      __isset_bit_vector.clear();
6574
      __isset_bit_vector.or(other.__isset_bit_vector);
6575
      this.purchaseId = other.purchaseId;
6576
    }
6577
 
4555 mandeep.dh 6578
    public getPurchaseOrderForPurchase_args deepCopy() {
6579
      return new getPurchaseOrderForPurchase_args(this);
4496 mandeep.dh 6580
    }
6581
 
6582
    @Override
6583
    public void clear() {
6584
      setPurchaseIdIsSet(false);
6585
      this.purchaseId = 0;
6586
    }
6587
 
6588
    public long getPurchaseId() {
6589
      return this.purchaseId;
6590
    }
6591
 
6592
    public void setPurchaseId(long purchaseId) {
6593
      this.purchaseId = purchaseId;
6594
      setPurchaseIdIsSet(true);
6595
    }
6596
 
6597
    public void unsetPurchaseId() {
6598
      __isset_bit_vector.clear(__PURCHASEID_ISSET_ID);
6599
    }
6600
 
6601
    /** Returns true if field purchaseId is set (has been assigned a value) and false otherwise */
6602
    public boolean isSetPurchaseId() {
6603
      return __isset_bit_vector.get(__PURCHASEID_ISSET_ID);
6604
    }
6605
 
6606
    public void setPurchaseIdIsSet(boolean value) {
6607
      __isset_bit_vector.set(__PURCHASEID_ISSET_ID, value);
6608
    }
6609
 
6610
    public void setFieldValue(_Fields field, Object value) {
6611
      switch (field) {
6612
      case PURCHASE_ID:
6613
        if (value == null) {
6614
          unsetPurchaseId();
6615
        } else {
6616
          setPurchaseId((Long)value);
6617
        }
6618
        break;
6619
 
6620
      }
6621
    }
6622
 
6623
    public Object getFieldValue(_Fields field) {
6624
      switch (field) {
6625
      case PURCHASE_ID:
6626
        return Long.valueOf(getPurchaseId());
6627
 
6628
      }
6629
      throw new IllegalStateException();
6630
    }
6631
 
6632
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
6633
    public boolean isSet(_Fields field) {
6634
      if (field == null) {
6635
        throw new IllegalArgumentException();
6636
      }
6637
 
6638
      switch (field) {
6639
      case PURCHASE_ID:
6640
        return isSetPurchaseId();
6641
      }
6642
      throw new IllegalStateException();
6643
    }
6644
 
6645
    @Override
6646
    public boolean equals(Object that) {
6647
      if (that == null)
6648
        return false;
4555 mandeep.dh 6649
      if (that instanceof getPurchaseOrderForPurchase_args)
6650
        return this.equals((getPurchaseOrderForPurchase_args)that);
4496 mandeep.dh 6651
      return false;
6652
    }
6653
 
4555 mandeep.dh 6654
    public boolean equals(getPurchaseOrderForPurchase_args that) {
4496 mandeep.dh 6655
      if (that == null)
6656
        return false;
6657
 
6658
      boolean this_present_purchaseId = true;
6659
      boolean that_present_purchaseId = true;
6660
      if (this_present_purchaseId || that_present_purchaseId) {
6661
        if (!(this_present_purchaseId && that_present_purchaseId))
6662
          return false;
6663
        if (this.purchaseId != that.purchaseId)
6664
          return false;
6665
      }
6666
 
6667
      return true;
6668
    }
6669
 
6670
    @Override
6671
    public int hashCode() {
6672
      return 0;
6673
    }
6674
 
4555 mandeep.dh 6675
    public int compareTo(getPurchaseOrderForPurchase_args other) {
4496 mandeep.dh 6676
      if (!getClass().equals(other.getClass())) {
6677
        return getClass().getName().compareTo(other.getClass().getName());
6678
      }
6679
 
6680
      int lastComparison = 0;
4555 mandeep.dh 6681
      getPurchaseOrderForPurchase_args typedOther = (getPurchaseOrderForPurchase_args)other;
4496 mandeep.dh 6682
 
6683
      lastComparison = Boolean.valueOf(isSetPurchaseId()).compareTo(typedOther.isSetPurchaseId());
6684
      if (lastComparison != 0) {
6685
        return lastComparison;
6686
      }
6687
      if (isSetPurchaseId()) {
6688
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.purchaseId, typedOther.purchaseId);
6689
        if (lastComparison != 0) {
6690
          return lastComparison;
6691
        }
6692
      }
6693
      return 0;
6694
    }
6695
 
6696
    public _Fields fieldForId(int fieldId) {
6697
      return _Fields.findByThriftId(fieldId);
6698
    }
6699
 
6700
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
6701
      org.apache.thrift.protocol.TField field;
6702
      iprot.readStructBegin();
6703
      while (true)
6704
      {
6705
        field = iprot.readFieldBegin();
6706
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
6707
          break;
6708
        }
6709
        switch (field.id) {
6710
          case 1: // PURCHASE_ID
6711
            if (field.type == org.apache.thrift.protocol.TType.I64) {
6712
              this.purchaseId = iprot.readI64();
6713
              setPurchaseIdIsSet(true);
6714
            } else { 
6715
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6716
            }
6717
            break;
6718
          default:
6719
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6720
        }
6721
        iprot.readFieldEnd();
6722
      }
6723
      iprot.readStructEnd();
6724
      validate();
6725
    }
6726
 
6727
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
6728
      validate();
6729
 
6730
      oprot.writeStructBegin(STRUCT_DESC);
6731
      oprot.writeFieldBegin(PURCHASE_ID_FIELD_DESC);
6732
      oprot.writeI64(this.purchaseId);
6733
      oprot.writeFieldEnd();
6734
      oprot.writeFieldStop();
6735
      oprot.writeStructEnd();
6736
    }
6737
 
6738
    @Override
6739
    public String toString() {
4555 mandeep.dh 6740
      StringBuilder sb = new StringBuilder("getPurchaseOrderForPurchase_args(");
4496 mandeep.dh 6741
      boolean first = true;
6742
 
6743
      sb.append("purchaseId:");
6744
      sb.append(this.purchaseId);
6745
      first = false;
6746
      sb.append(")");
6747
      return sb.toString();
6748
    }
6749
 
6750
    public void validate() throws org.apache.thrift.TException {
6751
      // check for required fields
6752
    }
6753
 
6754
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
6755
      try {
6756
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
6757
      } catch (org.apache.thrift.TException te) {
6758
        throw new java.io.IOException(te);
6759
      }
6760
    }
6761
 
6762
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
6763
      try {
4555 mandeep.dh 6764
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
6765
        __isset_bit_vector = new BitSet(1);
4496 mandeep.dh 6766
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
6767
      } catch (org.apache.thrift.TException te) {
6768
        throw new java.io.IOException(te);
6769
      }
6770
    }
6771
 
6772
  }
6773
 
4555 mandeep.dh 6774
  public static class getPurchaseOrderForPurchase_result implements org.apache.thrift.TBase<getPurchaseOrderForPurchase_result, getPurchaseOrderForPurchase_result._Fields>, java.io.Serializable, Cloneable   {
6775
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getPurchaseOrderForPurchase_result");
4496 mandeep.dh 6776
 
4555 mandeep.dh 6777
    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);
4496 mandeep.dh 6778
 
4555 mandeep.dh 6779
    private PurchaseOrder success; // required
4496 mandeep.dh 6780
 
6781
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
6782
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
6783
      SUCCESS((short)0, "success");
6784
 
6785
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
6786
 
6787
      static {
6788
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
6789
          byName.put(field.getFieldName(), field);
6790
        }
6791
      }
6792
 
6793
      /**
6794
       * Find the _Fields constant that matches fieldId, or null if its not found.
6795
       */
6796
      public static _Fields findByThriftId(int fieldId) {
6797
        switch(fieldId) {
6798
          case 0: // SUCCESS
6799
            return SUCCESS;
6800
          default:
6801
            return null;
6802
        }
6803
      }
6804
 
6805
      /**
6806
       * Find the _Fields constant that matches fieldId, throwing an exception
6807
       * if it is not found.
6808
       */
6809
      public static _Fields findByThriftIdOrThrow(int fieldId) {
6810
        _Fields fields = findByThriftId(fieldId);
6811
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
6812
        return fields;
6813
      }
6814
 
6815
      /**
6816
       * Find the _Fields constant that matches name, or null if its not found.
6817
       */
6818
      public static _Fields findByName(String name) {
6819
        return byName.get(name);
6820
      }
6821
 
6822
      private final short _thriftId;
6823
      private final String _fieldName;
6824
 
6825
      _Fields(short thriftId, String fieldName) {
6826
        _thriftId = thriftId;
6827
        _fieldName = fieldName;
6828
      }
6829
 
6830
      public short getThriftFieldId() {
6831
        return _thriftId;
6832
      }
6833
 
6834
      public String getFieldName() {
6835
        return _fieldName;
6836
      }
6837
    }
6838
 
6839
    // isset id assignments
6840
 
6841
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
6842
    static {
6843
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
6844
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
4555 mandeep.dh 6845
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, PurchaseOrder.class)));
4496 mandeep.dh 6846
      metaDataMap = Collections.unmodifiableMap(tmpMap);
4555 mandeep.dh 6847
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPurchaseOrderForPurchase_result.class, metaDataMap);
4496 mandeep.dh 6848
    }
6849
 
4555 mandeep.dh 6850
    public getPurchaseOrderForPurchase_result() {
4496 mandeep.dh 6851
    }
6852
 
4555 mandeep.dh 6853
    public getPurchaseOrderForPurchase_result(
6854
      PurchaseOrder success)
4496 mandeep.dh 6855
    {
6856
      this();
6857
      this.success = success;
6858
    }
6859
 
6860
    /**
6861
     * Performs a deep copy on <i>other</i>.
6862
     */
4555 mandeep.dh 6863
    public getPurchaseOrderForPurchase_result(getPurchaseOrderForPurchase_result other) {
6864
      if (other.isSetSuccess()) {
6865
        this.success = new PurchaseOrder(other.success);
6866
      }
4496 mandeep.dh 6867
    }
6868
 
4555 mandeep.dh 6869
    public getPurchaseOrderForPurchase_result deepCopy() {
6870
      return new getPurchaseOrderForPurchase_result(this);
4496 mandeep.dh 6871
    }
6872
 
6873
    @Override
6874
    public void clear() {
4555 mandeep.dh 6875
      this.success = null;
4496 mandeep.dh 6876
    }
6877
 
4555 mandeep.dh 6878
    public PurchaseOrder getSuccess() {
4496 mandeep.dh 6879
      return this.success;
6880
    }
6881
 
4555 mandeep.dh 6882
    public void setSuccess(PurchaseOrder success) {
4496 mandeep.dh 6883
      this.success = success;
6884
    }
6885
 
6886
    public void unsetSuccess() {
4555 mandeep.dh 6887
      this.success = null;
4496 mandeep.dh 6888
    }
6889
 
6890
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
6891
    public boolean isSetSuccess() {
4555 mandeep.dh 6892
      return this.success != null;
4496 mandeep.dh 6893
    }
6894
 
6895
    public void setSuccessIsSet(boolean value) {
4555 mandeep.dh 6896
      if (!value) {
6897
        this.success = null;
6898
      }
4496 mandeep.dh 6899
    }
6900
 
6901
    public void setFieldValue(_Fields field, Object value) {
6902
      switch (field) {
6903
      case SUCCESS:
6904
        if (value == null) {
6905
          unsetSuccess();
6906
        } else {
4555 mandeep.dh 6907
          setSuccess((PurchaseOrder)value);
4496 mandeep.dh 6908
        }
6909
        break;
6910
 
6911
      }
6912
    }
6913
 
6914
    public Object getFieldValue(_Fields field) {
6915
      switch (field) {
6916
      case SUCCESS:
4555 mandeep.dh 6917
        return getSuccess();
4496 mandeep.dh 6918
 
6919
      }
6920
      throw new IllegalStateException();
6921
    }
6922
 
6923
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
6924
    public boolean isSet(_Fields field) {
6925
      if (field == null) {
6926
        throw new IllegalArgumentException();
6927
      }
6928
 
6929
      switch (field) {
6930
      case SUCCESS:
6931
        return isSetSuccess();
6932
      }
6933
      throw new IllegalStateException();
6934
    }
6935
 
6936
    @Override
6937
    public boolean equals(Object that) {
6938
      if (that == null)
6939
        return false;
4555 mandeep.dh 6940
      if (that instanceof getPurchaseOrderForPurchase_result)
6941
        return this.equals((getPurchaseOrderForPurchase_result)that);
4496 mandeep.dh 6942
      return false;
6943
    }
6944
 
4555 mandeep.dh 6945
    public boolean equals(getPurchaseOrderForPurchase_result that) {
4496 mandeep.dh 6946
      if (that == null)
6947
        return false;
6948
 
4555 mandeep.dh 6949
      boolean this_present_success = true && this.isSetSuccess();
6950
      boolean that_present_success = true && that.isSetSuccess();
4496 mandeep.dh 6951
      if (this_present_success || that_present_success) {
6952
        if (!(this_present_success && that_present_success))
6953
          return false;
4555 mandeep.dh 6954
        if (!this.success.equals(that.success))
4496 mandeep.dh 6955
          return false;
6956
      }
6957
 
6958
      return true;
6959
    }
6960
 
6961
    @Override
6962
    public int hashCode() {
6963
      return 0;
6964
    }
6965
 
4555 mandeep.dh 6966
    public int compareTo(getPurchaseOrderForPurchase_result other) {
4496 mandeep.dh 6967
      if (!getClass().equals(other.getClass())) {
6968
        return getClass().getName().compareTo(other.getClass().getName());
6969
      }
6970
 
6971
      int lastComparison = 0;
4555 mandeep.dh 6972
      getPurchaseOrderForPurchase_result typedOther = (getPurchaseOrderForPurchase_result)other;
4496 mandeep.dh 6973
 
6974
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
6975
      if (lastComparison != 0) {
6976
        return lastComparison;
6977
      }
6978
      if (isSetSuccess()) {
6979
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
6980
        if (lastComparison != 0) {
6981
          return lastComparison;
6982
        }
6983
      }
6984
      return 0;
6985
    }
6986
 
6987
    public _Fields fieldForId(int fieldId) {
6988
      return _Fields.findByThriftId(fieldId);
6989
    }
6990
 
6991
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
6992
      org.apache.thrift.protocol.TField field;
6993
      iprot.readStructBegin();
6994
      while (true)
6995
      {
6996
        field = iprot.readFieldBegin();
6997
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
6998
          break;
6999
        }
7000
        switch (field.id) {
7001
          case 0: // SUCCESS
4555 mandeep.dh 7002
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
7003
              this.success = new PurchaseOrder();
7004
              this.success.read(iprot);
4496 mandeep.dh 7005
            } else { 
7006
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
7007
            }
7008
            break;
7009
          default:
7010
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
7011
        }
7012
        iprot.readFieldEnd();
7013
      }
7014
      iprot.readStructEnd();
7015
      validate();
7016
    }
7017
 
7018
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
7019
      oprot.writeStructBegin(STRUCT_DESC);
7020
 
7021
      if (this.isSetSuccess()) {
7022
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
4555 mandeep.dh 7023
        this.success.write(oprot);
4496 mandeep.dh 7024
        oprot.writeFieldEnd();
7025
      }
7026
      oprot.writeFieldStop();
7027
      oprot.writeStructEnd();
7028
    }
7029
 
7030
    @Override
7031
    public String toString() {
4555 mandeep.dh 7032
      StringBuilder sb = new StringBuilder("getPurchaseOrderForPurchase_result(");
4496 mandeep.dh 7033
      boolean first = true;
7034
 
7035
      sb.append("success:");
4555 mandeep.dh 7036
      if (this.success == null) {
7037
        sb.append("null");
7038
      } else {
7039
        sb.append(this.success);
7040
      }
4496 mandeep.dh 7041
      first = false;
7042
      sb.append(")");
7043
      return sb.toString();
7044
    }
7045
 
7046
    public void validate() throws org.apache.thrift.TException {
7047
      // check for required fields
7048
    }
7049
 
7050
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
7051
      try {
7052
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
7053
      } catch (org.apache.thrift.TException te) {
7054
        throw new java.io.IOException(te);
7055
      }
7056
    }
7057
 
7058
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
7059
      try {
7060
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
7061
      } catch (org.apache.thrift.TException te) {
7062
        throw new java.io.IOException(te);
7063
      }
7064
    }
7065
 
7066
  }
7067
 
4754 mandeep.dh 7068
  public static class getPendingPurchaseOrders_args implements org.apache.thrift.TBase<getPendingPurchaseOrders_args, getPendingPurchaseOrders_args._Fields>, java.io.Serializable, Cloneable   {
7069
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getPendingPurchaseOrders_args");
7070
 
7071
    private static final org.apache.thrift.protocol.TField WAREHOUSE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("warehouseId", org.apache.thrift.protocol.TType.I64, (short)1);
7072
 
7073
    private long warehouseId; // required
7074
 
7075
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
7076
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
7077
      WAREHOUSE_ID((short)1, "warehouseId");
7078
 
7079
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
7080
 
7081
      static {
7082
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
7083
          byName.put(field.getFieldName(), field);
7084
        }
7085
      }
7086
 
7087
      /**
7088
       * Find the _Fields constant that matches fieldId, or null if its not found.
7089
       */
7090
      public static _Fields findByThriftId(int fieldId) {
7091
        switch(fieldId) {
7092
          case 1: // WAREHOUSE_ID
7093
            return WAREHOUSE_ID;
7094
          default:
7095
            return null;
7096
        }
7097
      }
7098
 
7099
      /**
7100
       * Find the _Fields constant that matches fieldId, throwing an exception
7101
       * if it is not found.
7102
       */
7103
      public static _Fields findByThriftIdOrThrow(int fieldId) {
7104
        _Fields fields = findByThriftId(fieldId);
7105
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
7106
        return fields;
7107
      }
7108
 
7109
      /**
7110
       * Find the _Fields constant that matches name, or null if its not found.
7111
       */
7112
      public static _Fields findByName(String name) {
7113
        return byName.get(name);
7114
      }
7115
 
7116
      private final short _thriftId;
7117
      private final String _fieldName;
7118
 
7119
      _Fields(short thriftId, String fieldName) {
7120
        _thriftId = thriftId;
7121
        _fieldName = fieldName;
7122
      }
7123
 
7124
      public short getThriftFieldId() {
7125
        return _thriftId;
7126
      }
7127
 
7128
      public String getFieldName() {
7129
        return _fieldName;
7130
      }
7131
    }
7132
 
7133
    // isset id assignments
7134
    private static final int __WAREHOUSEID_ISSET_ID = 0;
7135
    private BitSet __isset_bit_vector = new BitSet(1);
7136
 
7137
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
7138
    static {
7139
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
7140
      tmpMap.put(_Fields.WAREHOUSE_ID, new org.apache.thrift.meta_data.FieldMetaData("warehouseId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
7141
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
7142
      metaDataMap = Collections.unmodifiableMap(tmpMap);
7143
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPendingPurchaseOrders_args.class, metaDataMap);
7144
    }
7145
 
7146
    public getPendingPurchaseOrders_args() {
7147
    }
7148
 
7149
    public getPendingPurchaseOrders_args(
7150
      long warehouseId)
7151
    {
7152
      this();
7153
      this.warehouseId = warehouseId;
7154
      setWarehouseIdIsSet(true);
7155
    }
7156
 
7157
    /**
7158
     * Performs a deep copy on <i>other</i>.
7159
     */
7160
    public getPendingPurchaseOrders_args(getPendingPurchaseOrders_args other) {
7161
      __isset_bit_vector.clear();
7162
      __isset_bit_vector.or(other.__isset_bit_vector);
7163
      this.warehouseId = other.warehouseId;
7164
    }
7165
 
7166
    public getPendingPurchaseOrders_args deepCopy() {
7167
      return new getPendingPurchaseOrders_args(this);
7168
    }
7169
 
7170
    @Override
7171
    public void clear() {
7172
      setWarehouseIdIsSet(false);
7173
      this.warehouseId = 0;
7174
    }
7175
 
7176
    public long getWarehouseId() {
7177
      return this.warehouseId;
7178
    }
7179
 
7180
    public void setWarehouseId(long warehouseId) {
7181
      this.warehouseId = warehouseId;
7182
      setWarehouseIdIsSet(true);
7183
    }
7184
 
7185
    public void unsetWarehouseId() {
7186
      __isset_bit_vector.clear(__WAREHOUSEID_ISSET_ID);
7187
    }
7188
 
7189
    /** Returns true if field warehouseId is set (has been assigned a value) and false otherwise */
7190
    public boolean isSetWarehouseId() {
7191
      return __isset_bit_vector.get(__WAREHOUSEID_ISSET_ID);
7192
    }
7193
 
7194
    public void setWarehouseIdIsSet(boolean value) {
7195
      __isset_bit_vector.set(__WAREHOUSEID_ISSET_ID, value);
7196
    }
7197
 
7198
    public void setFieldValue(_Fields field, Object value) {
7199
      switch (field) {
7200
      case WAREHOUSE_ID:
7201
        if (value == null) {
7202
          unsetWarehouseId();
7203
        } else {
7204
          setWarehouseId((Long)value);
7205
        }
7206
        break;
7207
 
7208
      }
7209
    }
7210
 
7211
    public Object getFieldValue(_Fields field) {
7212
      switch (field) {
7213
      case WAREHOUSE_ID:
7214
        return Long.valueOf(getWarehouseId());
7215
 
7216
      }
7217
      throw new IllegalStateException();
7218
    }
7219
 
7220
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
7221
    public boolean isSet(_Fields field) {
7222
      if (field == null) {
7223
        throw new IllegalArgumentException();
7224
      }
7225
 
7226
      switch (field) {
7227
      case WAREHOUSE_ID:
7228
        return isSetWarehouseId();
7229
      }
7230
      throw new IllegalStateException();
7231
    }
7232
 
7233
    @Override
7234
    public boolean equals(Object that) {
7235
      if (that == null)
7236
        return false;
7237
      if (that instanceof getPendingPurchaseOrders_args)
7238
        return this.equals((getPendingPurchaseOrders_args)that);
7239
      return false;
7240
    }
7241
 
7242
    public boolean equals(getPendingPurchaseOrders_args that) {
7243
      if (that == null)
7244
        return false;
7245
 
7246
      boolean this_present_warehouseId = true;
7247
      boolean that_present_warehouseId = true;
7248
      if (this_present_warehouseId || that_present_warehouseId) {
7249
        if (!(this_present_warehouseId && that_present_warehouseId))
7250
          return false;
7251
        if (this.warehouseId != that.warehouseId)
7252
          return false;
7253
      }
7254
 
7255
      return true;
7256
    }
7257
 
7258
    @Override
7259
    public int hashCode() {
7260
      return 0;
7261
    }
7262
 
7263
    public int compareTo(getPendingPurchaseOrders_args other) {
7264
      if (!getClass().equals(other.getClass())) {
7265
        return getClass().getName().compareTo(other.getClass().getName());
7266
      }
7267
 
7268
      int lastComparison = 0;
7269
      getPendingPurchaseOrders_args typedOther = (getPendingPurchaseOrders_args)other;
7270
 
7271
      lastComparison = Boolean.valueOf(isSetWarehouseId()).compareTo(typedOther.isSetWarehouseId());
7272
      if (lastComparison != 0) {
7273
        return lastComparison;
7274
      }
7275
      if (isSetWarehouseId()) {
7276
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.warehouseId, typedOther.warehouseId);
7277
        if (lastComparison != 0) {
7278
          return lastComparison;
7279
        }
7280
      }
7281
      return 0;
7282
    }
7283
 
7284
    public _Fields fieldForId(int fieldId) {
7285
      return _Fields.findByThriftId(fieldId);
7286
    }
7287
 
7288
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
7289
      org.apache.thrift.protocol.TField field;
7290
      iprot.readStructBegin();
7291
      while (true)
7292
      {
7293
        field = iprot.readFieldBegin();
7294
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
7295
          break;
7296
        }
7297
        switch (field.id) {
7298
          case 1: // WAREHOUSE_ID
7299
            if (field.type == org.apache.thrift.protocol.TType.I64) {
7300
              this.warehouseId = iprot.readI64();
7301
              setWarehouseIdIsSet(true);
7302
            } else { 
7303
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
7304
            }
7305
            break;
7306
          default:
7307
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
7308
        }
7309
        iprot.readFieldEnd();
7310
      }
7311
      iprot.readStructEnd();
7312
      validate();
7313
    }
7314
 
7315
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
7316
      validate();
7317
 
7318
      oprot.writeStructBegin(STRUCT_DESC);
7319
      oprot.writeFieldBegin(WAREHOUSE_ID_FIELD_DESC);
7320
      oprot.writeI64(this.warehouseId);
7321
      oprot.writeFieldEnd();
7322
      oprot.writeFieldStop();
7323
      oprot.writeStructEnd();
7324
    }
7325
 
7326
    @Override
7327
    public String toString() {
7328
      StringBuilder sb = new StringBuilder("getPendingPurchaseOrders_args(");
7329
      boolean first = true;
7330
 
7331
      sb.append("warehouseId:");
7332
      sb.append(this.warehouseId);
7333
      first = false;
7334
      sb.append(")");
7335
      return sb.toString();
7336
    }
7337
 
7338
    public void validate() throws org.apache.thrift.TException {
7339
      // check for required fields
7340
    }
7341
 
7342
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
7343
      try {
7344
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
7345
      } catch (org.apache.thrift.TException te) {
7346
        throw new java.io.IOException(te);
7347
      }
7348
    }
7349
 
7350
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
7351
      try {
7352
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
7353
        __isset_bit_vector = new BitSet(1);
7354
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
7355
      } catch (org.apache.thrift.TException te) {
7356
        throw new java.io.IOException(te);
7357
      }
7358
    }
7359
 
7360
  }
7361
 
7362
  public static class getPendingPurchaseOrders_result implements org.apache.thrift.TBase<getPendingPurchaseOrders_result, getPendingPurchaseOrders_result._Fields>, java.io.Serializable, Cloneable   {
7363
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getPendingPurchaseOrders_result");
7364
 
7365
    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);
7366
    private static final org.apache.thrift.protocol.TField E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1);
7367
 
7368
    private List<PurchaseOrder> success; // required
7369
    private PurchaseServiceException e; // required
7370
 
7371
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
7372
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
7373
      SUCCESS((short)0, "success"),
7374
      E((short)1, "e");
7375
 
7376
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
7377
 
7378
      static {
7379
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
7380
          byName.put(field.getFieldName(), field);
7381
        }
7382
      }
7383
 
7384
      /**
7385
       * Find the _Fields constant that matches fieldId, or null if its not found.
7386
       */
7387
      public static _Fields findByThriftId(int fieldId) {
7388
        switch(fieldId) {
7389
          case 0: // SUCCESS
7390
            return SUCCESS;
7391
          case 1: // E
7392
            return E;
7393
          default:
7394
            return null;
7395
        }
7396
      }
7397
 
7398
      /**
7399
       * Find the _Fields constant that matches fieldId, throwing an exception
7400
       * if it is not found.
7401
       */
7402
      public static _Fields findByThriftIdOrThrow(int fieldId) {
7403
        _Fields fields = findByThriftId(fieldId);
7404
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
7405
        return fields;
7406
      }
7407
 
7408
      /**
7409
       * Find the _Fields constant that matches name, or null if its not found.
7410
       */
7411
      public static _Fields findByName(String name) {
7412
        return byName.get(name);
7413
      }
7414
 
7415
      private final short _thriftId;
7416
      private final String _fieldName;
7417
 
7418
      _Fields(short thriftId, String fieldName) {
7419
        _thriftId = thriftId;
7420
        _fieldName = fieldName;
7421
      }
7422
 
7423
      public short getThriftFieldId() {
7424
        return _thriftId;
7425
      }
7426
 
7427
      public String getFieldName() {
7428
        return _fieldName;
7429
      }
7430
    }
7431
 
7432
    // isset id assignments
7433
 
7434
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
7435
    static {
7436
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
7437
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
7438
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
7439
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, PurchaseOrder.class))));
7440
      tmpMap.put(_Fields.E, new org.apache.thrift.meta_data.FieldMetaData("e", org.apache.thrift.TFieldRequirementType.DEFAULT, 
7441
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
7442
      metaDataMap = Collections.unmodifiableMap(tmpMap);
7443
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPendingPurchaseOrders_result.class, metaDataMap);
7444
    }
7445
 
7446
    public getPendingPurchaseOrders_result() {
7447
    }
7448
 
7449
    public getPendingPurchaseOrders_result(
7450
      List<PurchaseOrder> success,
7451
      PurchaseServiceException e)
7452
    {
7453
      this();
7454
      this.success = success;
7455
      this.e = e;
7456
    }
7457
 
7458
    /**
7459
     * Performs a deep copy on <i>other</i>.
7460
     */
7461
    public getPendingPurchaseOrders_result(getPendingPurchaseOrders_result other) {
7462
      if (other.isSetSuccess()) {
7463
        List<PurchaseOrder> __this__success = new ArrayList<PurchaseOrder>();
7464
        for (PurchaseOrder other_element : other.success) {
7465
          __this__success.add(new PurchaseOrder(other_element));
7466
        }
7467
        this.success = __this__success;
7468
      }
7469
      if (other.isSetE()) {
7470
        this.e = new PurchaseServiceException(other.e);
7471
      }
7472
    }
7473
 
7474
    public getPendingPurchaseOrders_result deepCopy() {
7475
      return new getPendingPurchaseOrders_result(this);
7476
    }
7477
 
7478
    @Override
7479
    public void clear() {
7480
      this.success = null;
7481
      this.e = null;
7482
    }
7483
 
7484
    public int getSuccessSize() {
7485
      return (this.success == null) ? 0 : this.success.size();
7486
    }
7487
 
7488
    public java.util.Iterator<PurchaseOrder> getSuccessIterator() {
7489
      return (this.success == null) ? null : this.success.iterator();
7490
    }
7491
 
7492
    public void addToSuccess(PurchaseOrder elem) {
7493
      if (this.success == null) {
7494
        this.success = new ArrayList<PurchaseOrder>();
7495
      }
7496
      this.success.add(elem);
7497
    }
7498
 
7499
    public List<PurchaseOrder> getSuccess() {
7500
      return this.success;
7501
    }
7502
 
7503
    public void setSuccess(List<PurchaseOrder> success) {
7504
      this.success = success;
7505
    }
7506
 
7507
    public void unsetSuccess() {
7508
      this.success = null;
7509
    }
7510
 
7511
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
7512
    public boolean isSetSuccess() {
7513
      return this.success != null;
7514
    }
7515
 
7516
    public void setSuccessIsSet(boolean value) {
7517
      if (!value) {
7518
        this.success = null;
7519
      }
7520
    }
7521
 
7522
    public PurchaseServiceException getE() {
7523
      return this.e;
7524
    }
7525
 
7526
    public void setE(PurchaseServiceException e) {
7527
      this.e = e;
7528
    }
7529
 
7530
    public void unsetE() {
7531
      this.e = null;
7532
    }
7533
 
7534
    /** Returns true if field e is set (has been assigned a value) and false otherwise */
7535
    public boolean isSetE() {
7536
      return this.e != null;
7537
    }
7538
 
7539
    public void setEIsSet(boolean value) {
7540
      if (!value) {
7541
        this.e = null;
7542
      }
7543
    }
7544
 
7545
    public void setFieldValue(_Fields field, Object value) {
7546
      switch (field) {
7547
      case SUCCESS:
7548
        if (value == null) {
7549
          unsetSuccess();
7550
        } else {
7551
          setSuccess((List<PurchaseOrder>)value);
7552
        }
7553
        break;
7554
 
7555
      case E:
7556
        if (value == null) {
7557
          unsetE();
7558
        } else {
7559
          setE((PurchaseServiceException)value);
7560
        }
7561
        break;
7562
 
7563
      }
7564
    }
7565
 
7566
    public Object getFieldValue(_Fields field) {
7567
      switch (field) {
7568
      case SUCCESS:
7569
        return getSuccess();
7570
 
7571
      case E:
7572
        return getE();
7573
 
7574
      }
7575
      throw new IllegalStateException();
7576
    }
7577
 
7578
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
7579
    public boolean isSet(_Fields field) {
7580
      if (field == null) {
7581
        throw new IllegalArgumentException();
7582
      }
7583
 
7584
      switch (field) {
7585
      case SUCCESS:
7586
        return isSetSuccess();
7587
      case E:
7588
        return isSetE();
7589
      }
7590
      throw new IllegalStateException();
7591
    }
7592
 
7593
    @Override
7594
    public boolean equals(Object that) {
7595
      if (that == null)
7596
        return false;
7597
      if (that instanceof getPendingPurchaseOrders_result)
7598
        return this.equals((getPendingPurchaseOrders_result)that);
7599
      return false;
7600
    }
7601
 
7602
    public boolean equals(getPendingPurchaseOrders_result that) {
7603
      if (that == null)
7604
        return false;
7605
 
7606
      boolean this_present_success = true && this.isSetSuccess();
7607
      boolean that_present_success = true && that.isSetSuccess();
7608
      if (this_present_success || that_present_success) {
7609
        if (!(this_present_success && that_present_success))
7610
          return false;
7611
        if (!this.success.equals(that.success))
7612
          return false;
7613
      }
7614
 
7615
      boolean this_present_e = true && this.isSetE();
7616
      boolean that_present_e = true && that.isSetE();
7617
      if (this_present_e || that_present_e) {
7618
        if (!(this_present_e && that_present_e))
7619
          return false;
7620
        if (!this.e.equals(that.e))
7621
          return false;
7622
      }
7623
 
7624
      return true;
7625
    }
7626
 
7627
    @Override
7628
    public int hashCode() {
7629
      return 0;
7630
    }
7631
 
7632
    public int compareTo(getPendingPurchaseOrders_result other) {
7633
      if (!getClass().equals(other.getClass())) {
7634
        return getClass().getName().compareTo(other.getClass().getName());
7635
      }
7636
 
7637
      int lastComparison = 0;
7638
      getPendingPurchaseOrders_result typedOther = (getPendingPurchaseOrders_result)other;
7639
 
7640
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
7641
      if (lastComparison != 0) {
7642
        return lastComparison;
7643
      }
7644
      if (isSetSuccess()) {
7645
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
7646
        if (lastComparison != 0) {
7647
          return lastComparison;
7648
        }
7649
      }
7650
      lastComparison = Boolean.valueOf(isSetE()).compareTo(typedOther.isSetE());
7651
      if (lastComparison != 0) {
7652
        return lastComparison;
7653
      }
7654
      if (isSetE()) {
7655
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, typedOther.e);
7656
        if (lastComparison != 0) {
7657
          return lastComparison;
7658
        }
7659
      }
7660
      return 0;
7661
    }
7662
 
7663
    public _Fields fieldForId(int fieldId) {
7664
      return _Fields.findByThriftId(fieldId);
7665
    }
7666
 
7667
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
7668
      org.apache.thrift.protocol.TField field;
7669
      iprot.readStructBegin();
7670
      while (true)
7671
      {
7672
        field = iprot.readFieldBegin();
7673
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
7674
          break;
7675
        }
7676
        switch (field.id) {
7677
          case 0: // SUCCESS
7678
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
7679
              {
7680
                org.apache.thrift.protocol.TList _list12 = iprot.readListBegin();
7681
                this.success = new ArrayList<PurchaseOrder>(_list12.size);
7682
                for (int _i13 = 0; _i13 < _list12.size; ++_i13)
7683
                {
7684
                  PurchaseOrder _elem14; // required
7685
                  _elem14 = new PurchaseOrder();
7686
                  _elem14.read(iprot);
7687
                  this.success.add(_elem14);
7688
                }
7689
                iprot.readListEnd();
7690
              }
7691
            } else { 
7692
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
7693
            }
7694
            break;
7695
          case 1: // E
7696
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
7697
              this.e = new PurchaseServiceException();
7698
              this.e.read(iprot);
7699
            } else { 
7700
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
7701
            }
7702
            break;
7703
          default:
7704
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
7705
        }
7706
        iprot.readFieldEnd();
7707
      }
7708
      iprot.readStructEnd();
7709
      validate();
7710
    }
7711
 
7712
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
7713
      oprot.writeStructBegin(STRUCT_DESC);
7714
 
7715
      if (this.isSetSuccess()) {
7716
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
7717
        {
7718
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
7719
          for (PurchaseOrder _iter15 : this.success)
7720
          {
7721
            _iter15.write(oprot);
7722
          }
7723
          oprot.writeListEnd();
7724
        }
7725
        oprot.writeFieldEnd();
7726
      } else if (this.isSetE()) {
7727
        oprot.writeFieldBegin(E_FIELD_DESC);
7728
        this.e.write(oprot);
7729
        oprot.writeFieldEnd();
7730
      }
7731
      oprot.writeFieldStop();
7732
      oprot.writeStructEnd();
7733
    }
7734
 
7735
    @Override
7736
    public String toString() {
7737
      StringBuilder sb = new StringBuilder("getPendingPurchaseOrders_result(");
7738
      boolean first = true;
7739
 
7740
      sb.append("success:");
7741
      if (this.success == null) {
7742
        sb.append("null");
7743
      } else {
7744
        sb.append(this.success);
7745
      }
7746
      first = false;
7747
      if (!first) sb.append(", ");
7748
      sb.append("e:");
7749
      if (this.e == null) {
7750
        sb.append("null");
7751
      } else {
7752
        sb.append(this.e);
7753
      }
7754
      first = false;
7755
      sb.append(")");
7756
      return sb.toString();
7757
    }
7758
 
7759
    public void validate() throws org.apache.thrift.TException {
7760
      // check for required fields
7761
    }
7762
 
7763
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
7764
      try {
7765
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
7766
      } catch (org.apache.thrift.TException te) {
7767
        throw new java.io.IOException(te);
7768
      }
7769
    }
7770
 
7771
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
7772
      try {
7773
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
7774
      } catch (org.apache.thrift.TException te) {
7775
        throw new java.io.IOException(te);
7776
      }
7777
    }
7778
 
7779
  }
7780
 
7781
  public static class getSuppliers_args implements org.apache.thrift.TBase<getSuppliers_args, getSuppliers_args._Fields>, java.io.Serializable, Cloneable   {
7782
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getSuppliers_args");
7783
 
7784
 
7785
 
7786
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
7787
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
7788
;
7789
 
7790
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
7791
 
7792
      static {
7793
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
7794
          byName.put(field.getFieldName(), field);
7795
        }
7796
      }
7797
 
7798
      /**
7799
       * Find the _Fields constant that matches fieldId, or null if its not found.
7800
       */
7801
      public static _Fields findByThriftId(int fieldId) {
7802
        switch(fieldId) {
7803
          default:
7804
            return null;
7805
        }
7806
      }
7807
 
7808
      /**
7809
       * Find the _Fields constant that matches fieldId, throwing an exception
7810
       * if it is not found.
7811
       */
7812
      public static _Fields findByThriftIdOrThrow(int fieldId) {
7813
        _Fields fields = findByThriftId(fieldId);
7814
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
7815
        return fields;
7816
      }
7817
 
7818
      /**
7819
       * Find the _Fields constant that matches name, or null if its not found.
7820
       */
7821
      public static _Fields findByName(String name) {
7822
        return byName.get(name);
7823
      }
7824
 
7825
      private final short _thriftId;
7826
      private final String _fieldName;
7827
 
7828
      _Fields(short thriftId, String fieldName) {
7829
        _thriftId = thriftId;
7830
        _fieldName = fieldName;
7831
      }
7832
 
7833
      public short getThriftFieldId() {
7834
        return _thriftId;
7835
      }
7836
 
7837
      public String getFieldName() {
7838
        return _fieldName;
7839
      }
7840
    }
7841
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
7842
    static {
7843
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
7844
      metaDataMap = Collections.unmodifiableMap(tmpMap);
7845
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getSuppliers_args.class, metaDataMap);
7846
    }
7847
 
7848
    public getSuppliers_args() {
7849
    }
7850
 
7851
    /**
7852
     * Performs a deep copy on <i>other</i>.
7853
     */
7854
    public getSuppliers_args(getSuppliers_args other) {
7855
    }
7856
 
7857
    public getSuppliers_args deepCopy() {
7858
      return new getSuppliers_args(this);
7859
    }
7860
 
7861
    @Override
7862
    public void clear() {
7863
    }
7864
 
7865
    public void setFieldValue(_Fields field, Object value) {
7866
      switch (field) {
7867
      }
7868
    }
7869
 
7870
    public Object getFieldValue(_Fields field) {
7871
      switch (field) {
7872
      }
7873
      throw new IllegalStateException();
7874
    }
7875
 
7876
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
7877
    public boolean isSet(_Fields field) {
7878
      if (field == null) {
7879
        throw new IllegalArgumentException();
7880
      }
7881
 
7882
      switch (field) {
7883
      }
7884
      throw new IllegalStateException();
7885
    }
7886
 
7887
    @Override
7888
    public boolean equals(Object that) {
7889
      if (that == null)
7890
        return false;
7891
      if (that instanceof getSuppliers_args)
7892
        return this.equals((getSuppliers_args)that);
7893
      return false;
7894
    }
7895
 
7896
    public boolean equals(getSuppliers_args that) {
7897
      if (that == null)
7898
        return false;
7899
 
7900
      return true;
7901
    }
7902
 
7903
    @Override
7904
    public int hashCode() {
7905
      return 0;
7906
    }
7907
 
7908
    public int compareTo(getSuppliers_args other) {
7909
      if (!getClass().equals(other.getClass())) {
7910
        return getClass().getName().compareTo(other.getClass().getName());
7911
      }
7912
 
7913
      int lastComparison = 0;
7914
      getSuppliers_args typedOther = (getSuppliers_args)other;
7915
 
7916
      return 0;
7917
    }
7918
 
7919
    public _Fields fieldForId(int fieldId) {
7920
      return _Fields.findByThriftId(fieldId);
7921
    }
7922
 
7923
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
7924
      org.apache.thrift.protocol.TField field;
7925
      iprot.readStructBegin();
7926
      while (true)
7927
      {
7928
        field = iprot.readFieldBegin();
7929
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
7930
          break;
7931
        }
7932
        switch (field.id) {
7933
          default:
7934
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
7935
        }
7936
        iprot.readFieldEnd();
7937
      }
7938
      iprot.readStructEnd();
7939
      validate();
7940
    }
7941
 
7942
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
7943
      validate();
7944
 
7945
      oprot.writeStructBegin(STRUCT_DESC);
7946
      oprot.writeFieldStop();
7947
      oprot.writeStructEnd();
7948
    }
7949
 
7950
    @Override
7951
    public String toString() {
7952
      StringBuilder sb = new StringBuilder("getSuppliers_args(");
7953
      boolean first = true;
7954
 
7955
      sb.append(")");
7956
      return sb.toString();
7957
    }
7958
 
7959
    public void validate() throws org.apache.thrift.TException {
7960
      // check for required fields
7961
    }
7962
 
7963
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
7964
      try {
7965
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
7966
      } catch (org.apache.thrift.TException te) {
7967
        throw new java.io.IOException(te);
7968
      }
7969
    }
7970
 
7971
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
7972
      try {
7973
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
7974
      } catch (org.apache.thrift.TException te) {
7975
        throw new java.io.IOException(te);
7976
      }
7977
    }
7978
 
7979
  }
7980
 
7981
  public static class getSuppliers_result implements org.apache.thrift.TBase<getSuppliers_result, getSuppliers_result._Fields>, java.io.Serializable, Cloneable   {
7982
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getSuppliers_result");
7983
 
7984
    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);
7985
    private static final org.apache.thrift.protocol.TField E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1);
7986
 
7987
    private List<Supplier> success; // required
7988
    private PurchaseServiceException e; // required
7989
 
7990
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
7991
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
7992
      SUCCESS((short)0, "success"),
7993
      E((short)1, "e");
7994
 
7995
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
7996
 
7997
      static {
7998
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
7999
          byName.put(field.getFieldName(), field);
8000
        }
8001
      }
8002
 
8003
      /**
8004
       * Find the _Fields constant that matches fieldId, or null if its not found.
8005
       */
8006
      public static _Fields findByThriftId(int fieldId) {
8007
        switch(fieldId) {
8008
          case 0: // SUCCESS
8009
            return SUCCESS;
8010
          case 1: // E
8011
            return E;
8012
          default:
8013
            return null;
8014
        }
8015
      }
8016
 
8017
      /**
8018
       * Find the _Fields constant that matches fieldId, throwing an exception
8019
       * if it is not found.
8020
       */
8021
      public static _Fields findByThriftIdOrThrow(int fieldId) {
8022
        _Fields fields = findByThriftId(fieldId);
8023
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
8024
        return fields;
8025
      }
8026
 
8027
      /**
8028
       * Find the _Fields constant that matches name, or null if its not found.
8029
       */
8030
      public static _Fields findByName(String name) {
8031
        return byName.get(name);
8032
      }
8033
 
8034
      private final short _thriftId;
8035
      private final String _fieldName;
8036
 
8037
      _Fields(short thriftId, String fieldName) {
8038
        _thriftId = thriftId;
8039
        _fieldName = fieldName;
8040
      }
8041
 
8042
      public short getThriftFieldId() {
8043
        return _thriftId;
8044
      }
8045
 
8046
      public String getFieldName() {
8047
        return _fieldName;
8048
      }
8049
    }
8050
 
8051
    // isset id assignments
8052
 
8053
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
8054
    static {
8055
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
8056
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
8057
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
8058
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Supplier.class))));
8059
      tmpMap.put(_Fields.E, new org.apache.thrift.meta_data.FieldMetaData("e", org.apache.thrift.TFieldRequirementType.DEFAULT, 
8060
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
8061
      metaDataMap = Collections.unmodifiableMap(tmpMap);
8062
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getSuppliers_result.class, metaDataMap);
8063
    }
8064
 
8065
    public getSuppliers_result() {
8066
    }
8067
 
8068
    public getSuppliers_result(
8069
      List<Supplier> success,
8070
      PurchaseServiceException e)
8071
    {
8072
      this();
8073
      this.success = success;
8074
      this.e = e;
8075
    }
8076
 
8077
    /**
8078
     * Performs a deep copy on <i>other</i>.
8079
     */
8080
    public getSuppliers_result(getSuppliers_result other) {
8081
      if (other.isSetSuccess()) {
8082
        List<Supplier> __this__success = new ArrayList<Supplier>();
8083
        for (Supplier other_element : other.success) {
8084
          __this__success.add(new Supplier(other_element));
8085
        }
8086
        this.success = __this__success;
8087
      }
8088
      if (other.isSetE()) {
8089
        this.e = new PurchaseServiceException(other.e);
8090
      }
8091
    }
8092
 
8093
    public getSuppliers_result deepCopy() {
8094
      return new getSuppliers_result(this);
8095
    }
8096
 
8097
    @Override
8098
    public void clear() {
8099
      this.success = null;
8100
      this.e = null;
8101
    }
8102
 
8103
    public int getSuccessSize() {
8104
      return (this.success == null) ? 0 : this.success.size();
8105
    }
8106
 
8107
    public java.util.Iterator<Supplier> getSuccessIterator() {
8108
      return (this.success == null) ? null : this.success.iterator();
8109
    }
8110
 
8111
    public void addToSuccess(Supplier elem) {
8112
      if (this.success == null) {
8113
        this.success = new ArrayList<Supplier>();
8114
      }
8115
      this.success.add(elem);
8116
    }
8117
 
8118
    public List<Supplier> getSuccess() {
8119
      return this.success;
8120
    }
8121
 
8122
    public void setSuccess(List<Supplier> success) {
8123
      this.success = success;
8124
    }
8125
 
8126
    public void unsetSuccess() {
8127
      this.success = null;
8128
    }
8129
 
8130
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
8131
    public boolean isSetSuccess() {
8132
      return this.success != null;
8133
    }
8134
 
8135
    public void setSuccessIsSet(boolean value) {
8136
      if (!value) {
8137
        this.success = null;
8138
      }
8139
    }
8140
 
8141
    public PurchaseServiceException getE() {
8142
      return this.e;
8143
    }
8144
 
8145
    public void setE(PurchaseServiceException e) {
8146
      this.e = e;
8147
    }
8148
 
8149
    public void unsetE() {
8150
      this.e = null;
8151
    }
8152
 
8153
    /** Returns true if field e is set (has been assigned a value) and false otherwise */
8154
    public boolean isSetE() {
8155
      return this.e != null;
8156
    }
8157
 
8158
    public void setEIsSet(boolean value) {
8159
      if (!value) {
8160
        this.e = null;
8161
      }
8162
    }
8163
 
8164
    public void setFieldValue(_Fields field, Object value) {
8165
      switch (field) {
8166
      case SUCCESS:
8167
        if (value == null) {
8168
          unsetSuccess();
8169
        } else {
8170
          setSuccess((List<Supplier>)value);
8171
        }
8172
        break;
8173
 
8174
      case E:
8175
        if (value == null) {
8176
          unsetE();
8177
        } else {
8178
          setE((PurchaseServiceException)value);
8179
        }
8180
        break;
8181
 
8182
      }
8183
    }
8184
 
8185
    public Object getFieldValue(_Fields field) {
8186
      switch (field) {
8187
      case SUCCESS:
8188
        return getSuccess();
8189
 
8190
      case E:
8191
        return getE();
8192
 
8193
      }
8194
      throw new IllegalStateException();
8195
    }
8196
 
8197
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
8198
    public boolean isSet(_Fields field) {
8199
      if (field == null) {
8200
        throw new IllegalArgumentException();
8201
      }
8202
 
8203
      switch (field) {
8204
      case SUCCESS:
8205
        return isSetSuccess();
8206
      case E:
8207
        return isSetE();
8208
      }
8209
      throw new IllegalStateException();
8210
    }
8211
 
8212
    @Override
8213
    public boolean equals(Object that) {
8214
      if (that == null)
8215
        return false;
8216
      if (that instanceof getSuppliers_result)
8217
        return this.equals((getSuppliers_result)that);
8218
      return false;
8219
    }
8220
 
8221
    public boolean equals(getSuppliers_result that) {
8222
      if (that == null)
8223
        return false;
8224
 
8225
      boolean this_present_success = true && this.isSetSuccess();
8226
      boolean that_present_success = true && that.isSetSuccess();
8227
      if (this_present_success || that_present_success) {
8228
        if (!(this_present_success && that_present_success))
8229
          return false;
8230
        if (!this.success.equals(that.success))
8231
          return false;
8232
      }
8233
 
8234
      boolean this_present_e = true && this.isSetE();
8235
      boolean that_present_e = true && that.isSetE();
8236
      if (this_present_e || that_present_e) {
8237
        if (!(this_present_e && that_present_e))
8238
          return false;
8239
        if (!this.e.equals(that.e))
8240
          return false;
8241
      }
8242
 
8243
      return true;
8244
    }
8245
 
8246
    @Override
8247
    public int hashCode() {
8248
      return 0;
8249
    }
8250
 
8251
    public int compareTo(getSuppliers_result other) {
8252
      if (!getClass().equals(other.getClass())) {
8253
        return getClass().getName().compareTo(other.getClass().getName());
8254
      }
8255
 
8256
      int lastComparison = 0;
8257
      getSuppliers_result typedOther = (getSuppliers_result)other;
8258
 
8259
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
8260
      if (lastComparison != 0) {
8261
        return lastComparison;
8262
      }
8263
      if (isSetSuccess()) {
8264
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
8265
        if (lastComparison != 0) {
8266
          return lastComparison;
8267
        }
8268
      }
8269
      lastComparison = Boolean.valueOf(isSetE()).compareTo(typedOther.isSetE());
8270
      if (lastComparison != 0) {
8271
        return lastComparison;
8272
      }
8273
      if (isSetE()) {
8274
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, typedOther.e);
8275
        if (lastComparison != 0) {
8276
          return lastComparison;
8277
        }
8278
      }
8279
      return 0;
8280
    }
8281
 
8282
    public _Fields fieldForId(int fieldId) {
8283
      return _Fields.findByThriftId(fieldId);
8284
    }
8285
 
8286
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
8287
      org.apache.thrift.protocol.TField field;
8288
      iprot.readStructBegin();
8289
      while (true)
8290
      {
8291
        field = iprot.readFieldBegin();
8292
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
8293
          break;
8294
        }
8295
        switch (field.id) {
8296
          case 0: // SUCCESS
8297
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
8298
              {
8299
                org.apache.thrift.protocol.TList _list16 = iprot.readListBegin();
8300
                this.success = new ArrayList<Supplier>(_list16.size);
8301
                for (int _i17 = 0; _i17 < _list16.size; ++_i17)
8302
                {
8303
                  Supplier _elem18; // required
8304
                  _elem18 = new Supplier();
8305
                  _elem18.read(iprot);
8306
                  this.success.add(_elem18);
8307
                }
8308
                iprot.readListEnd();
8309
              }
8310
            } else { 
8311
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8312
            }
8313
            break;
8314
          case 1: // E
8315
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
8316
              this.e = new PurchaseServiceException();
8317
              this.e.read(iprot);
8318
            } else { 
8319
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8320
            }
8321
            break;
8322
          default:
8323
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8324
        }
8325
        iprot.readFieldEnd();
8326
      }
8327
      iprot.readStructEnd();
8328
      validate();
8329
    }
8330
 
8331
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
8332
      oprot.writeStructBegin(STRUCT_DESC);
8333
 
8334
      if (this.isSetSuccess()) {
8335
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
8336
        {
8337
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
8338
          for (Supplier _iter19 : this.success)
8339
          {
8340
            _iter19.write(oprot);
8341
          }
8342
          oprot.writeListEnd();
8343
        }
8344
        oprot.writeFieldEnd();
8345
      } else if (this.isSetE()) {
8346
        oprot.writeFieldBegin(E_FIELD_DESC);
8347
        this.e.write(oprot);
8348
        oprot.writeFieldEnd();
8349
      }
8350
      oprot.writeFieldStop();
8351
      oprot.writeStructEnd();
8352
    }
8353
 
8354
    @Override
8355
    public String toString() {
8356
      StringBuilder sb = new StringBuilder("getSuppliers_result(");
8357
      boolean first = true;
8358
 
8359
      sb.append("success:");
8360
      if (this.success == null) {
8361
        sb.append("null");
8362
      } else {
8363
        sb.append(this.success);
8364
      }
8365
      first = false;
8366
      if (!first) sb.append(", ");
8367
      sb.append("e:");
8368
      if (this.e == null) {
8369
        sb.append("null");
8370
      } else {
8371
        sb.append(this.e);
8372
      }
8373
      first = false;
8374
      sb.append(")");
8375
      return sb.toString();
8376
    }
8377
 
8378
    public void validate() throws org.apache.thrift.TException {
8379
      // check for required fields
8380
    }
8381
 
8382
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
8383
      try {
8384
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
8385
      } catch (org.apache.thrift.TException te) {
8386
        throw new java.io.IOException(te);
8387
      }
8388
    }
8389
 
8390
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
8391
      try {
8392
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
8393
      } catch (org.apache.thrift.TException te) {
8394
        throw new java.io.IOException(te);
8395
      }
8396
    }
8397
 
8398
  }
8399
 
8400
  public static class fulfillPO_args implements org.apache.thrift.TBase<fulfillPO_args, fulfillPO_args._Fields>, java.io.Serializable, Cloneable   {
8401
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("fulfillPO_args");
8402
 
8403
    private static final org.apache.thrift.protocol.TField PURCHASE_ORDER_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("purchaseOrderId", org.apache.thrift.protocol.TType.I64, (short)1);
8404
    private static final org.apache.thrift.protocol.TField ITEM_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("itemId", org.apache.thrift.protocol.TType.I64, (short)2);
8405
    private static final org.apache.thrift.protocol.TField QUANTITY_FIELD_DESC = new org.apache.thrift.protocol.TField("quantity", org.apache.thrift.protocol.TType.I64, (short)3);
8406
 
8407
    private long purchaseOrderId; // required
8408
    private long itemId; // required
8409
    private long quantity; // required
8410
 
8411
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
8412
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
8413
      PURCHASE_ORDER_ID((short)1, "purchaseOrderId"),
8414
      ITEM_ID((short)2, "itemId"),
8415
      QUANTITY((short)3, "quantity");
8416
 
8417
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
8418
 
8419
      static {
8420
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
8421
          byName.put(field.getFieldName(), field);
8422
        }
8423
      }
8424
 
8425
      /**
8426
       * Find the _Fields constant that matches fieldId, or null if its not found.
8427
       */
8428
      public static _Fields findByThriftId(int fieldId) {
8429
        switch(fieldId) {
8430
          case 1: // PURCHASE_ORDER_ID
8431
            return PURCHASE_ORDER_ID;
8432
          case 2: // ITEM_ID
8433
            return ITEM_ID;
8434
          case 3: // QUANTITY
8435
            return QUANTITY;
8436
          default:
8437
            return null;
8438
        }
8439
      }
8440
 
8441
      /**
8442
       * Find the _Fields constant that matches fieldId, throwing an exception
8443
       * if it is not found.
8444
       */
8445
      public static _Fields findByThriftIdOrThrow(int fieldId) {
8446
        _Fields fields = findByThriftId(fieldId);
8447
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
8448
        return fields;
8449
      }
8450
 
8451
      /**
8452
       * Find the _Fields constant that matches name, or null if its not found.
8453
       */
8454
      public static _Fields findByName(String name) {
8455
        return byName.get(name);
8456
      }
8457
 
8458
      private final short _thriftId;
8459
      private final String _fieldName;
8460
 
8461
      _Fields(short thriftId, String fieldName) {
8462
        _thriftId = thriftId;
8463
        _fieldName = fieldName;
8464
      }
8465
 
8466
      public short getThriftFieldId() {
8467
        return _thriftId;
8468
      }
8469
 
8470
      public String getFieldName() {
8471
        return _fieldName;
8472
      }
8473
    }
8474
 
8475
    // isset id assignments
8476
    private static final int __PURCHASEORDERID_ISSET_ID = 0;
8477
    private static final int __ITEMID_ISSET_ID = 1;
8478
    private static final int __QUANTITY_ISSET_ID = 2;
8479
    private BitSet __isset_bit_vector = new BitSet(3);
8480
 
8481
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
8482
    static {
8483
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
8484
      tmpMap.put(_Fields.PURCHASE_ORDER_ID, new org.apache.thrift.meta_data.FieldMetaData("purchaseOrderId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
8485
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
8486
      tmpMap.put(_Fields.ITEM_ID, new org.apache.thrift.meta_data.FieldMetaData("itemId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
8487
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
8488
      tmpMap.put(_Fields.QUANTITY, new org.apache.thrift.meta_data.FieldMetaData("quantity", org.apache.thrift.TFieldRequirementType.DEFAULT, 
8489
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
8490
      metaDataMap = Collections.unmodifiableMap(tmpMap);
8491
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(fulfillPO_args.class, metaDataMap);
8492
    }
8493
 
8494
    public fulfillPO_args() {
8495
    }
8496
 
8497
    public fulfillPO_args(
8498
      long purchaseOrderId,
8499
      long itemId,
8500
      long quantity)
8501
    {
8502
      this();
8503
      this.purchaseOrderId = purchaseOrderId;
8504
      setPurchaseOrderIdIsSet(true);
8505
      this.itemId = itemId;
8506
      setItemIdIsSet(true);
8507
      this.quantity = quantity;
8508
      setQuantityIsSet(true);
8509
    }
8510
 
8511
    /**
8512
     * Performs a deep copy on <i>other</i>.
8513
     */
8514
    public fulfillPO_args(fulfillPO_args other) {
8515
      __isset_bit_vector.clear();
8516
      __isset_bit_vector.or(other.__isset_bit_vector);
8517
      this.purchaseOrderId = other.purchaseOrderId;
8518
      this.itemId = other.itemId;
8519
      this.quantity = other.quantity;
8520
    }
8521
 
8522
    public fulfillPO_args deepCopy() {
8523
      return new fulfillPO_args(this);
8524
    }
8525
 
8526
    @Override
8527
    public void clear() {
8528
      setPurchaseOrderIdIsSet(false);
8529
      this.purchaseOrderId = 0;
8530
      setItemIdIsSet(false);
8531
      this.itemId = 0;
8532
      setQuantityIsSet(false);
8533
      this.quantity = 0;
8534
    }
8535
 
8536
    public long getPurchaseOrderId() {
8537
      return this.purchaseOrderId;
8538
    }
8539
 
8540
    public void setPurchaseOrderId(long purchaseOrderId) {
8541
      this.purchaseOrderId = purchaseOrderId;
8542
      setPurchaseOrderIdIsSet(true);
8543
    }
8544
 
8545
    public void unsetPurchaseOrderId() {
8546
      __isset_bit_vector.clear(__PURCHASEORDERID_ISSET_ID);
8547
    }
8548
 
8549
    /** Returns true if field purchaseOrderId is set (has been assigned a value) and false otherwise */
8550
    public boolean isSetPurchaseOrderId() {
8551
      return __isset_bit_vector.get(__PURCHASEORDERID_ISSET_ID);
8552
    }
8553
 
8554
    public void setPurchaseOrderIdIsSet(boolean value) {
8555
      __isset_bit_vector.set(__PURCHASEORDERID_ISSET_ID, value);
8556
    }
8557
 
8558
    public long getItemId() {
8559
      return this.itemId;
8560
    }
8561
 
8562
    public void setItemId(long itemId) {
8563
      this.itemId = itemId;
8564
      setItemIdIsSet(true);
8565
    }
8566
 
8567
    public void unsetItemId() {
8568
      __isset_bit_vector.clear(__ITEMID_ISSET_ID);
8569
    }
8570
 
8571
    /** Returns true if field itemId is set (has been assigned a value) and false otherwise */
8572
    public boolean isSetItemId() {
8573
      return __isset_bit_vector.get(__ITEMID_ISSET_ID);
8574
    }
8575
 
8576
    public void setItemIdIsSet(boolean value) {
8577
      __isset_bit_vector.set(__ITEMID_ISSET_ID, value);
8578
    }
8579
 
8580
    public long getQuantity() {
8581
      return this.quantity;
8582
    }
8583
 
8584
    public void setQuantity(long quantity) {
8585
      this.quantity = quantity;
8586
      setQuantityIsSet(true);
8587
    }
8588
 
8589
    public void unsetQuantity() {
8590
      __isset_bit_vector.clear(__QUANTITY_ISSET_ID);
8591
    }
8592
 
8593
    /** Returns true if field quantity is set (has been assigned a value) and false otherwise */
8594
    public boolean isSetQuantity() {
8595
      return __isset_bit_vector.get(__QUANTITY_ISSET_ID);
8596
    }
8597
 
8598
    public void setQuantityIsSet(boolean value) {
8599
      __isset_bit_vector.set(__QUANTITY_ISSET_ID, value);
8600
    }
8601
 
8602
    public void setFieldValue(_Fields field, Object value) {
8603
      switch (field) {
8604
      case PURCHASE_ORDER_ID:
8605
        if (value == null) {
8606
          unsetPurchaseOrderId();
8607
        } else {
8608
          setPurchaseOrderId((Long)value);
8609
        }
8610
        break;
8611
 
8612
      case ITEM_ID:
8613
        if (value == null) {
8614
          unsetItemId();
8615
        } else {
8616
          setItemId((Long)value);
8617
        }
8618
        break;
8619
 
8620
      case QUANTITY:
8621
        if (value == null) {
8622
          unsetQuantity();
8623
        } else {
8624
          setQuantity((Long)value);
8625
        }
8626
        break;
8627
 
8628
      }
8629
    }
8630
 
8631
    public Object getFieldValue(_Fields field) {
8632
      switch (field) {
8633
      case PURCHASE_ORDER_ID:
8634
        return Long.valueOf(getPurchaseOrderId());
8635
 
8636
      case ITEM_ID:
8637
        return Long.valueOf(getItemId());
8638
 
8639
      case QUANTITY:
8640
        return Long.valueOf(getQuantity());
8641
 
8642
      }
8643
      throw new IllegalStateException();
8644
    }
8645
 
8646
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
8647
    public boolean isSet(_Fields field) {
8648
      if (field == null) {
8649
        throw new IllegalArgumentException();
8650
      }
8651
 
8652
      switch (field) {
8653
      case PURCHASE_ORDER_ID:
8654
        return isSetPurchaseOrderId();
8655
      case ITEM_ID:
8656
        return isSetItemId();
8657
      case QUANTITY:
8658
        return isSetQuantity();
8659
      }
8660
      throw new IllegalStateException();
8661
    }
8662
 
8663
    @Override
8664
    public boolean equals(Object that) {
8665
      if (that == null)
8666
        return false;
8667
      if (that instanceof fulfillPO_args)
8668
        return this.equals((fulfillPO_args)that);
8669
      return false;
8670
    }
8671
 
8672
    public boolean equals(fulfillPO_args that) {
8673
      if (that == null)
8674
        return false;
8675
 
8676
      boolean this_present_purchaseOrderId = true;
8677
      boolean that_present_purchaseOrderId = true;
8678
      if (this_present_purchaseOrderId || that_present_purchaseOrderId) {
8679
        if (!(this_present_purchaseOrderId && that_present_purchaseOrderId))
8680
          return false;
8681
        if (this.purchaseOrderId != that.purchaseOrderId)
8682
          return false;
8683
      }
8684
 
8685
      boolean this_present_itemId = true;
8686
      boolean that_present_itemId = true;
8687
      if (this_present_itemId || that_present_itemId) {
8688
        if (!(this_present_itemId && that_present_itemId))
8689
          return false;
8690
        if (this.itemId != that.itemId)
8691
          return false;
8692
      }
8693
 
8694
      boolean this_present_quantity = true;
8695
      boolean that_present_quantity = true;
8696
      if (this_present_quantity || that_present_quantity) {
8697
        if (!(this_present_quantity && that_present_quantity))
8698
          return false;
8699
        if (this.quantity != that.quantity)
8700
          return false;
8701
      }
8702
 
8703
      return true;
8704
    }
8705
 
8706
    @Override
8707
    public int hashCode() {
8708
      return 0;
8709
    }
8710
 
8711
    public int compareTo(fulfillPO_args other) {
8712
      if (!getClass().equals(other.getClass())) {
8713
        return getClass().getName().compareTo(other.getClass().getName());
8714
      }
8715
 
8716
      int lastComparison = 0;
8717
      fulfillPO_args typedOther = (fulfillPO_args)other;
8718
 
8719
      lastComparison = Boolean.valueOf(isSetPurchaseOrderId()).compareTo(typedOther.isSetPurchaseOrderId());
8720
      if (lastComparison != 0) {
8721
        return lastComparison;
8722
      }
8723
      if (isSetPurchaseOrderId()) {
8724
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.purchaseOrderId, typedOther.purchaseOrderId);
8725
        if (lastComparison != 0) {
8726
          return lastComparison;
8727
        }
8728
      }
8729
      lastComparison = Boolean.valueOf(isSetItemId()).compareTo(typedOther.isSetItemId());
8730
      if (lastComparison != 0) {
8731
        return lastComparison;
8732
      }
8733
      if (isSetItemId()) {
8734
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.itemId, typedOther.itemId);
8735
        if (lastComparison != 0) {
8736
          return lastComparison;
8737
        }
8738
      }
8739
      lastComparison = Boolean.valueOf(isSetQuantity()).compareTo(typedOther.isSetQuantity());
8740
      if (lastComparison != 0) {
8741
        return lastComparison;
8742
      }
8743
      if (isSetQuantity()) {
8744
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.quantity, typedOther.quantity);
8745
        if (lastComparison != 0) {
8746
          return lastComparison;
8747
        }
8748
      }
8749
      return 0;
8750
    }
8751
 
8752
    public _Fields fieldForId(int fieldId) {
8753
      return _Fields.findByThriftId(fieldId);
8754
    }
8755
 
8756
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
8757
      org.apache.thrift.protocol.TField field;
8758
      iprot.readStructBegin();
8759
      while (true)
8760
      {
8761
        field = iprot.readFieldBegin();
8762
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
8763
          break;
8764
        }
8765
        switch (field.id) {
8766
          case 1: // PURCHASE_ORDER_ID
8767
            if (field.type == org.apache.thrift.protocol.TType.I64) {
8768
              this.purchaseOrderId = iprot.readI64();
8769
              setPurchaseOrderIdIsSet(true);
8770
            } else { 
8771
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8772
            }
8773
            break;
8774
          case 2: // ITEM_ID
8775
            if (field.type == org.apache.thrift.protocol.TType.I64) {
8776
              this.itemId = iprot.readI64();
8777
              setItemIdIsSet(true);
8778
            } else { 
8779
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8780
            }
8781
            break;
8782
          case 3: // QUANTITY
8783
            if (field.type == org.apache.thrift.protocol.TType.I64) {
8784
              this.quantity = iprot.readI64();
8785
              setQuantityIsSet(true);
8786
            } else { 
8787
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8788
            }
8789
            break;
8790
          default:
8791
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8792
        }
8793
        iprot.readFieldEnd();
8794
      }
8795
      iprot.readStructEnd();
8796
      validate();
8797
    }
8798
 
8799
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
8800
      validate();
8801
 
8802
      oprot.writeStructBegin(STRUCT_DESC);
8803
      oprot.writeFieldBegin(PURCHASE_ORDER_ID_FIELD_DESC);
8804
      oprot.writeI64(this.purchaseOrderId);
8805
      oprot.writeFieldEnd();
8806
      oprot.writeFieldBegin(ITEM_ID_FIELD_DESC);
8807
      oprot.writeI64(this.itemId);
8808
      oprot.writeFieldEnd();
8809
      oprot.writeFieldBegin(QUANTITY_FIELD_DESC);
8810
      oprot.writeI64(this.quantity);
8811
      oprot.writeFieldEnd();
8812
      oprot.writeFieldStop();
8813
      oprot.writeStructEnd();
8814
    }
8815
 
8816
    @Override
8817
    public String toString() {
8818
      StringBuilder sb = new StringBuilder("fulfillPO_args(");
8819
      boolean first = true;
8820
 
8821
      sb.append("purchaseOrderId:");
8822
      sb.append(this.purchaseOrderId);
8823
      first = false;
8824
      if (!first) sb.append(", ");
8825
      sb.append("itemId:");
8826
      sb.append(this.itemId);
8827
      first = false;
8828
      if (!first) sb.append(", ");
8829
      sb.append("quantity:");
8830
      sb.append(this.quantity);
8831
      first = false;
8832
      sb.append(")");
8833
      return sb.toString();
8834
    }
8835
 
8836
    public void validate() throws org.apache.thrift.TException {
8837
      // check for required fields
8838
    }
8839
 
8840
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
8841
      try {
8842
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
8843
      } catch (org.apache.thrift.TException te) {
8844
        throw new java.io.IOException(te);
8845
      }
8846
    }
8847
 
8848
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
8849
      try {
8850
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
8851
        __isset_bit_vector = new BitSet(1);
8852
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
8853
      } catch (org.apache.thrift.TException te) {
8854
        throw new java.io.IOException(te);
8855
      }
8856
    }
8857
 
8858
  }
8859
 
8860
  public static class fulfillPO_result implements org.apache.thrift.TBase<fulfillPO_result, fulfillPO_result._Fields>, java.io.Serializable, Cloneable   {
8861
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("fulfillPO_result");
8862
 
8863
    private static final org.apache.thrift.protocol.TField E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1);
8864
 
8865
    private PurchaseServiceException e; // required
8866
 
8867
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
8868
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
8869
      E((short)1, "e");
8870
 
8871
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
8872
 
8873
      static {
8874
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
8875
          byName.put(field.getFieldName(), field);
8876
        }
8877
      }
8878
 
8879
      /**
8880
       * Find the _Fields constant that matches fieldId, or null if its not found.
8881
       */
8882
      public static _Fields findByThriftId(int fieldId) {
8883
        switch(fieldId) {
8884
          case 1: // E
8885
            return E;
8886
          default:
8887
            return null;
8888
        }
8889
      }
8890
 
8891
      /**
8892
       * Find the _Fields constant that matches fieldId, throwing an exception
8893
       * if it is not found.
8894
       */
8895
      public static _Fields findByThriftIdOrThrow(int fieldId) {
8896
        _Fields fields = findByThriftId(fieldId);
8897
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
8898
        return fields;
8899
      }
8900
 
8901
      /**
8902
       * Find the _Fields constant that matches name, or null if its not found.
8903
       */
8904
      public static _Fields findByName(String name) {
8905
        return byName.get(name);
8906
      }
8907
 
8908
      private final short _thriftId;
8909
      private final String _fieldName;
8910
 
8911
      _Fields(short thriftId, String fieldName) {
8912
        _thriftId = thriftId;
8913
        _fieldName = fieldName;
8914
      }
8915
 
8916
      public short getThriftFieldId() {
8917
        return _thriftId;
8918
      }
8919
 
8920
      public String getFieldName() {
8921
        return _fieldName;
8922
      }
8923
    }
8924
 
8925
    // isset id assignments
8926
 
8927
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
8928
    static {
8929
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
8930
      tmpMap.put(_Fields.E, new org.apache.thrift.meta_data.FieldMetaData("e", org.apache.thrift.TFieldRequirementType.DEFAULT, 
8931
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
8932
      metaDataMap = Collections.unmodifiableMap(tmpMap);
8933
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(fulfillPO_result.class, metaDataMap);
8934
    }
8935
 
8936
    public fulfillPO_result() {
8937
    }
8938
 
8939
    public fulfillPO_result(
8940
      PurchaseServiceException e)
8941
    {
8942
      this();
8943
      this.e = e;
8944
    }
8945
 
8946
    /**
8947
     * Performs a deep copy on <i>other</i>.
8948
     */
8949
    public fulfillPO_result(fulfillPO_result other) {
8950
      if (other.isSetE()) {
8951
        this.e = new PurchaseServiceException(other.e);
8952
      }
8953
    }
8954
 
8955
    public fulfillPO_result deepCopy() {
8956
      return new fulfillPO_result(this);
8957
    }
8958
 
8959
    @Override
8960
    public void clear() {
8961
      this.e = null;
8962
    }
8963
 
8964
    public PurchaseServiceException getE() {
8965
      return this.e;
8966
    }
8967
 
8968
    public void setE(PurchaseServiceException e) {
8969
      this.e = e;
8970
    }
8971
 
8972
    public void unsetE() {
8973
      this.e = null;
8974
    }
8975
 
8976
    /** Returns true if field e is set (has been assigned a value) and false otherwise */
8977
    public boolean isSetE() {
8978
      return this.e != null;
8979
    }
8980
 
8981
    public void setEIsSet(boolean value) {
8982
      if (!value) {
8983
        this.e = null;
8984
      }
8985
    }
8986
 
8987
    public void setFieldValue(_Fields field, Object value) {
8988
      switch (field) {
8989
      case E:
8990
        if (value == null) {
8991
          unsetE();
8992
        } else {
8993
          setE((PurchaseServiceException)value);
8994
        }
8995
        break;
8996
 
8997
      }
8998
    }
8999
 
9000
    public Object getFieldValue(_Fields field) {
9001
      switch (field) {
9002
      case E:
9003
        return getE();
9004
 
9005
      }
9006
      throw new IllegalStateException();
9007
    }
9008
 
9009
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
9010
    public boolean isSet(_Fields field) {
9011
      if (field == null) {
9012
        throw new IllegalArgumentException();
9013
      }
9014
 
9015
      switch (field) {
9016
      case E:
9017
        return isSetE();
9018
      }
9019
      throw new IllegalStateException();
9020
    }
9021
 
9022
    @Override
9023
    public boolean equals(Object that) {
9024
      if (that == null)
9025
        return false;
9026
      if (that instanceof fulfillPO_result)
9027
        return this.equals((fulfillPO_result)that);
9028
      return false;
9029
    }
9030
 
9031
    public boolean equals(fulfillPO_result that) {
9032
      if (that == null)
9033
        return false;
9034
 
9035
      boolean this_present_e = true && this.isSetE();
9036
      boolean that_present_e = true && that.isSetE();
9037
      if (this_present_e || that_present_e) {
9038
        if (!(this_present_e && that_present_e))
9039
          return false;
9040
        if (!this.e.equals(that.e))
9041
          return false;
9042
      }
9043
 
9044
      return true;
9045
    }
9046
 
9047
    @Override
9048
    public int hashCode() {
9049
      return 0;
9050
    }
9051
 
9052
    public int compareTo(fulfillPO_result other) {
9053
      if (!getClass().equals(other.getClass())) {
9054
        return getClass().getName().compareTo(other.getClass().getName());
9055
      }
9056
 
9057
      int lastComparison = 0;
9058
      fulfillPO_result typedOther = (fulfillPO_result)other;
9059
 
9060
      lastComparison = Boolean.valueOf(isSetE()).compareTo(typedOther.isSetE());
9061
      if (lastComparison != 0) {
9062
        return lastComparison;
9063
      }
9064
      if (isSetE()) {
9065
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, typedOther.e);
9066
        if (lastComparison != 0) {
9067
          return lastComparison;
9068
        }
9069
      }
9070
      return 0;
9071
    }
9072
 
9073
    public _Fields fieldForId(int fieldId) {
9074
      return _Fields.findByThriftId(fieldId);
9075
    }
9076
 
9077
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
9078
      org.apache.thrift.protocol.TField field;
9079
      iprot.readStructBegin();
9080
      while (true)
9081
      {
9082
        field = iprot.readFieldBegin();
9083
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
9084
          break;
9085
        }
9086
        switch (field.id) {
9087
          case 1: // E
9088
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
9089
              this.e = new PurchaseServiceException();
9090
              this.e.read(iprot);
9091
            } else { 
9092
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9093
            }
9094
            break;
9095
          default:
9096
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9097
        }
9098
        iprot.readFieldEnd();
9099
      }
9100
      iprot.readStructEnd();
9101
      validate();
9102
    }
9103
 
9104
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
9105
      oprot.writeStructBegin(STRUCT_DESC);
9106
 
9107
      if (this.isSetE()) {
9108
        oprot.writeFieldBegin(E_FIELD_DESC);
9109
        this.e.write(oprot);
9110
        oprot.writeFieldEnd();
9111
      }
9112
      oprot.writeFieldStop();
9113
      oprot.writeStructEnd();
9114
    }
9115
 
9116
    @Override
9117
    public String toString() {
9118
      StringBuilder sb = new StringBuilder("fulfillPO_result(");
9119
      boolean first = true;
9120
 
9121
      sb.append("e:");
9122
      if (this.e == null) {
9123
        sb.append("null");
9124
      } else {
9125
        sb.append(this.e);
9126
      }
9127
      first = false;
9128
      sb.append(")");
9129
      return sb.toString();
9130
    }
9131
 
9132
    public void validate() throws org.apache.thrift.TException {
9133
      // check for required fields
9134
    }
9135
 
9136
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
9137
      try {
9138
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
9139
      } catch (org.apache.thrift.TException te) {
9140
        throw new java.io.IOException(te);
9141
      }
9142
    }
9143
 
9144
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
9145
      try {
9146
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
9147
      } catch (org.apache.thrift.TException te) {
9148
        throw new java.io.IOException(te);
9149
      }
9150
    }
9151
 
9152
  }
9153
 
9154
  public static class updatePurchaseOrder_args implements org.apache.thrift.TBase<updatePurchaseOrder_args, updatePurchaseOrder_args._Fields>, java.io.Serializable, Cloneable   {
9155
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("updatePurchaseOrder_args");
9156
 
9157
    private static final org.apache.thrift.protocol.TField PURCHASE_ORDER_FIELD_DESC = new org.apache.thrift.protocol.TField("purchaseOrder", org.apache.thrift.protocol.TType.STRUCT, (short)1);
9158
 
9159
    private PurchaseOrder purchaseOrder; // required
9160
 
9161
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
9162
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
9163
      PURCHASE_ORDER((short)1, "purchaseOrder");
9164
 
9165
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
9166
 
9167
      static {
9168
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
9169
          byName.put(field.getFieldName(), field);
9170
        }
9171
      }
9172
 
9173
      /**
9174
       * Find the _Fields constant that matches fieldId, or null if its not found.
9175
       */
9176
      public static _Fields findByThriftId(int fieldId) {
9177
        switch(fieldId) {
9178
          case 1: // PURCHASE_ORDER
9179
            return PURCHASE_ORDER;
9180
          default:
9181
            return null;
9182
        }
9183
      }
9184
 
9185
      /**
9186
       * Find the _Fields constant that matches fieldId, throwing an exception
9187
       * if it is not found.
9188
       */
9189
      public static _Fields findByThriftIdOrThrow(int fieldId) {
9190
        _Fields fields = findByThriftId(fieldId);
9191
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
9192
        return fields;
9193
      }
9194
 
9195
      /**
9196
       * Find the _Fields constant that matches name, or null if its not found.
9197
       */
9198
      public static _Fields findByName(String name) {
9199
        return byName.get(name);
9200
      }
9201
 
9202
      private final short _thriftId;
9203
      private final String _fieldName;
9204
 
9205
      _Fields(short thriftId, String fieldName) {
9206
        _thriftId = thriftId;
9207
        _fieldName = fieldName;
9208
      }
9209
 
9210
      public short getThriftFieldId() {
9211
        return _thriftId;
9212
      }
9213
 
9214
      public String getFieldName() {
9215
        return _fieldName;
9216
      }
9217
    }
9218
 
9219
    // isset id assignments
9220
 
9221
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
9222
    static {
9223
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
9224
      tmpMap.put(_Fields.PURCHASE_ORDER, new org.apache.thrift.meta_data.FieldMetaData("purchaseOrder", org.apache.thrift.TFieldRequirementType.DEFAULT, 
9225
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, PurchaseOrder.class)));
9226
      metaDataMap = Collections.unmodifiableMap(tmpMap);
9227
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(updatePurchaseOrder_args.class, metaDataMap);
9228
    }
9229
 
9230
    public updatePurchaseOrder_args() {
9231
    }
9232
 
9233
    public updatePurchaseOrder_args(
9234
      PurchaseOrder purchaseOrder)
9235
    {
9236
      this();
9237
      this.purchaseOrder = purchaseOrder;
9238
    }
9239
 
9240
    /**
9241
     * Performs a deep copy on <i>other</i>.
9242
     */
9243
    public updatePurchaseOrder_args(updatePurchaseOrder_args other) {
9244
      if (other.isSetPurchaseOrder()) {
9245
        this.purchaseOrder = new PurchaseOrder(other.purchaseOrder);
9246
      }
9247
    }
9248
 
9249
    public updatePurchaseOrder_args deepCopy() {
9250
      return new updatePurchaseOrder_args(this);
9251
    }
9252
 
9253
    @Override
9254
    public void clear() {
9255
      this.purchaseOrder = null;
9256
    }
9257
 
9258
    public PurchaseOrder getPurchaseOrder() {
9259
      return this.purchaseOrder;
9260
    }
9261
 
9262
    public void setPurchaseOrder(PurchaseOrder purchaseOrder) {
9263
      this.purchaseOrder = purchaseOrder;
9264
    }
9265
 
9266
    public void unsetPurchaseOrder() {
9267
      this.purchaseOrder = null;
9268
    }
9269
 
9270
    /** Returns true if field purchaseOrder is set (has been assigned a value) and false otherwise */
9271
    public boolean isSetPurchaseOrder() {
9272
      return this.purchaseOrder != null;
9273
    }
9274
 
9275
    public void setPurchaseOrderIsSet(boolean value) {
9276
      if (!value) {
9277
        this.purchaseOrder = null;
9278
      }
9279
    }
9280
 
9281
    public void setFieldValue(_Fields field, Object value) {
9282
      switch (field) {
9283
      case PURCHASE_ORDER:
9284
        if (value == null) {
9285
          unsetPurchaseOrder();
9286
        } else {
9287
          setPurchaseOrder((PurchaseOrder)value);
9288
        }
9289
        break;
9290
 
9291
      }
9292
    }
9293
 
9294
    public Object getFieldValue(_Fields field) {
9295
      switch (field) {
9296
      case PURCHASE_ORDER:
9297
        return getPurchaseOrder();
9298
 
9299
      }
9300
      throw new IllegalStateException();
9301
    }
9302
 
9303
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
9304
    public boolean isSet(_Fields field) {
9305
      if (field == null) {
9306
        throw new IllegalArgumentException();
9307
      }
9308
 
9309
      switch (field) {
9310
      case PURCHASE_ORDER:
9311
        return isSetPurchaseOrder();
9312
      }
9313
      throw new IllegalStateException();
9314
    }
9315
 
9316
    @Override
9317
    public boolean equals(Object that) {
9318
      if (that == null)
9319
        return false;
9320
      if (that instanceof updatePurchaseOrder_args)
9321
        return this.equals((updatePurchaseOrder_args)that);
9322
      return false;
9323
    }
9324
 
9325
    public boolean equals(updatePurchaseOrder_args that) {
9326
      if (that == null)
9327
        return false;
9328
 
9329
      boolean this_present_purchaseOrder = true && this.isSetPurchaseOrder();
9330
      boolean that_present_purchaseOrder = true && that.isSetPurchaseOrder();
9331
      if (this_present_purchaseOrder || that_present_purchaseOrder) {
9332
        if (!(this_present_purchaseOrder && that_present_purchaseOrder))
9333
          return false;
9334
        if (!this.purchaseOrder.equals(that.purchaseOrder))
9335
          return false;
9336
      }
9337
 
9338
      return true;
9339
    }
9340
 
9341
    @Override
9342
    public int hashCode() {
9343
      return 0;
9344
    }
9345
 
9346
    public int compareTo(updatePurchaseOrder_args other) {
9347
      if (!getClass().equals(other.getClass())) {
9348
        return getClass().getName().compareTo(other.getClass().getName());
9349
      }
9350
 
9351
      int lastComparison = 0;
9352
      updatePurchaseOrder_args typedOther = (updatePurchaseOrder_args)other;
9353
 
9354
      lastComparison = Boolean.valueOf(isSetPurchaseOrder()).compareTo(typedOther.isSetPurchaseOrder());
9355
      if (lastComparison != 0) {
9356
        return lastComparison;
9357
      }
9358
      if (isSetPurchaseOrder()) {
9359
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.purchaseOrder, typedOther.purchaseOrder);
9360
        if (lastComparison != 0) {
9361
          return lastComparison;
9362
        }
9363
      }
9364
      return 0;
9365
    }
9366
 
9367
    public _Fields fieldForId(int fieldId) {
9368
      return _Fields.findByThriftId(fieldId);
9369
    }
9370
 
9371
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
9372
      org.apache.thrift.protocol.TField field;
9373
      iprot.readStructBegin();
9374
      while (true)
9375
      {
9376
        field = iprot.readFieldBegin();
9377
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
9378
          break;
9379
        }
9380
        switch (field.id) {
9381
          case 1: // PURCHASE_ORDER
9382
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
9383
              this.purchaseOrder = new PurchaseOrder();
9384
              this.purchaseOrder.read(iprot);
9385
            } else { 
9386
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9387
            }
9388
            break;
9389
          default:
9390
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9391
        }
9392
        iprot.readFieldEnd();
9393
      }
9394
      iprot.readStructEnd();
9395
      validate();
9396
    }
9397
 
9398
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
9399
      validate();
9400
 
9401
      oprot.writeStructBegin(STRUCT_DESC);
9402
      if (this.purchaseOrder != null) {
9403
        oprot.writeFieldBegin(PURCHASE_ORDER_FIELD_DESC);
9404
        this.purchaseOrder.write(oprot);
9405
        oprot.writeFieldEnd();
9406
      }
9407
      oprot.writeFieldStop();
9408
      oprot.writeStructEnd();
9409
    }
9410
 
9411
    @Override
9412
    public String toString() {
9413
      StringBuilder sb = new StringBuilder("updatePurchaseOrder_args(");
9414
      boolean first = true;
9415
 
9416
      sb.append("purchaseOrder:");
9417
      if (this.purchaseOrder == null) {
9418
        sb.append("null");
9419
      } else {
9420
        sb.append(this.purchaseOrder);
9421
      }
9422
      first = false;
9423
      sb.append(")");
9424
      return sb.toString();
9425
    }
9426
 
9427
    public void validate() throws org.apache.thrift.TException {
9428
      // check for required fields
9429
    }
9430
 
9431
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
9432
      try {
9433
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
9434
      } catch (org.apache.thrift.TException te) {
9435
        throw new java.io.IOException(te);
9436
      }
9437
    }
9438
 
9439
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
9440
      try {
9441
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
9442
      } catch (org.apache.thrift.TException te) {
9443
        throw new java.io.IOException(te);
9444
      }
9445
    }
9446
 
9447
  }
9448
 
9449
  public static class updatePurchaseOrder_result implements org.apache.thrift.TBase<updatePurchaseOrder_result, updatePurchaseOrder_result._Fields>, java.io.Serializable, Cloneable   {
9450
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("updatePurchaseOrder_result");
9451
 
9452
    private static final org.apache.thrift.protocol.TField E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1);
9453
 
9454
    private PurchaseServiceException e; // required
9455
 
9456
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
9457
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
9458
      E((short)1, "e");
9459
 
9460
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
9461
 
9462
      static {
9463
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
9464
          byName.put(field.getFieldName(), field);
9465
        }
9466
      }
9467
 
9468
      /**
9469
       * Find the _Fields constant that matches fieldId, or null if its not found.
9470
       */
9471
      public static _Fields findByThriftId(int fieldId) {
9472
        switch(fieldId) {
9473
          case 1: // E
9474
            return E;
9475
          default:
9476
            return null;
9477
        }
9478
      }
9479
 
9480
      /**
9481
       * Find the _Fields constant that matches fieldId, throwing an exception
9482
       * if it is not found.
9483
       */
9484
      public static _Fields findByThriftIdOrThrow(int fieldId) {
9485
        _Fields fields = findByThriftId(fieldId);
9486
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
9487
        return fields;
9488
      }
9489
 
9490
      /**
9491
       * Find the _Fields constant that matches name, or null if its not found.
9492
       */
9493
      public static _Fields findByName(String name) {
9494
        return byName.get(name);
9495
      }
9496
 
9497
      private final short _thriftId;
9498
      private final String _fieldName;
9499
 
9500
      _Fields(short thriftId, String fieldName) {
9501
        _thriftId = thriftId;
9502
        _fieldName = fieldName;
9503
      }
9504
 
9505
      public short getThriftFieldId() {
9506
        return _thriftId;
9507
      }
9508
 
9509
      public String getFieldName() {
9510
        return _fieldName;
9511
      }
9512
    }
9513
 
9514
    // isset id assignments
9515
 
9516
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
9517
    static {
9518
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
9519
      tmpMap.put(_Fields.E, new org.apache.thrift.meta_data.FieldMetaData("e", org.apache.thrift.TFieldRequirementType.DEFAULT, 
9520
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
9521
      metaDataMap = Collections.unmodifiableMap(tmpMap);
9522
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(updatePurchaseOrder_result.class, metaDataMap);
9523
    }
9524
 
9525
    public updatePurchaseOrder_result() {
9526
    }
9527
 
9528
    public updatePurchaseOrder_result(
9529
      PurchaseServiceException e)
9530
    {
9531
      this();
9532
      this.e = e;
9533
    }
9534
 
9535
    /**
9536
     * Performs a deep copy on <i>other</i>.
9537
     */
9538
    public updatePurchaseOrder_result(updatePurchaseOrder_result other) {
9539
      if (other.isSetE()) {
9540
        this.e = new PurchaseServiceException(other.e);
9541
      }
9542
    }
9543
 
9544
    public updatePurchaseOrder_result deepCopy() {
9545
      return new updatePurchaseOrder_result(this);
9546
    }
9547
 
9548
    @Override
9549
    public void clear() {
9550
      this.e = null;
9551
    }
9552
 
9553
    public PurchaseServiceException getE() {
9554
      return this.e;
9555
    }
9556
 
9557
    public void setE(PurchaseServiceException e) {
9558
      this.e = e;
9559
    }
9560
 
9561
    public void unsetE() {
9562
      this.e = null;
9563
    }
9564
 
9565
    /** Returns true if field e is set (has been assigned a value) and false otherwise */
9566
    public boolean isSetE() {
9567
      return this.e != null;
9568
    }
9569
 
9570
    public void setEIsSet(boolean value) {
9571
      if (!value) {
9572
        this.e = null;
9573
      }
9574
    }
9575
 
9576
    public void setFieldValue(_Fields field, Object value) {
9577
      switch (field) {
9578
      case E:
9579
        if (value == null) {
9580
          unsetE();
9581
        } else {
9582
          setE((PurchaseServiceException)value);
9583
        }
9584
        break;
9585
 
9586
      }
9587
    }
9588
 
9589
    public Object getFieldValue(_Fields field) {
9590
      switch (field) {
9591
      case E:
9592
        return getE();
9593
 
9594
      }
9595
      throw new IllegalStateException();
9596
    }
9597
 
9598
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
9599
    public boolean isSet(_Fields field) {
9600
      if (field == null) {
9601
        throw new IllegalArgumentException();
9602
      }
9603
 
9604
      switch (field) {
9605
      case E:
9606
        return isSetE();
9607
      }
9608
      throw new IllegalStateException();
9609
    }
9610
 
9611
    @Override
9612
    public boolean equals(Object that) {
9613
      if (that == null)
9614
        return false;
9615
      if (that instanceof updatePurchaseOrder_result)
9616
        return this.equals((updatePurchaseOrder_result)that);
9617
      return false;
9618
    }
9619
 
9620
    public boolean equals(updatePurchaseOrder_result that) {
9621
      if (that == null)
9622
        return false;
9623
 
9624
      boolean this_present_e = true && this.isSetE();
9625
      boolean that_present_e = true && that.isSetE();
9626
      if (this_present_e || that_present_e) {
9627
        if (!(this_present_e && that_present_e))
9628
          return false;
9629
        if (!this.e.equals(that.e))
9630
          return false;
9631
      }
9632
 
9633
      return true;
9634
    }
9635
 
9636
    @Override
9637
    public int hashCode() {
9638
      return 0;
9639
    }
9640
 
9641
    public int compareTo(updatePurchaseOrder_result other) {
9642
      if (!getClass().equals(other.getClass())) {
9643
        return getClass().getName().compareTo(other.getClass().getName());
9644
      }
9645
 
9646
      int lastComparison = 0;
9647
      updatePurchaseOrder_result typedOther = (updatePurchaseOrder_result)other;
9648
 
9649
      lastComparison = Boolean.valueOf(isSetE()).compareTo(typedOther.isSetE());
9650
      if (lastComparison != 0) {
9651
        return lastComparison;
9652
      }
9653
      if (isSetE()) {
9654
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, typedOther.e);
9655
        if (lastComparison != 0) {
9656
          return lastComparison;
9657
        }
9658
      }
9659
      return 0;
9660
    }
9661
 
9662
    public _Fields fieldForId(int fieldId) {
9663
      return _Fields.findByThriftId(fieldId);
9664
    }
9665
 
9666
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
9667
      org.apache.thrift.protocol.TField field;
9668
      iprot.readStructBegin();
9669
      while (true)
9670
      {
9671
        field = iprot.readFieldBegin();
9672
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
9673
          break;
9674
        }
9675
        switch (field.id) {
9676
          case 1: // E
9677
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
9678
              this.e = new PurchaseServiceException();
9679
              this.e.read(iprot);
9680
            } else { 
9681
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9682
            }
9683
            break;
9684
          default:
9685
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9686
        }
9687
        iprot.readFieldEnd();
9688
      }
9689
      iprot.readStructEnd();
9690
      validate();
9691
    }
9692
 
9693
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
9694
      oprot.writeStructBegin(STRUCT_DESC);
9695
 
9696
      if (this.isSetE()) {
9697
        oprot.writeFieldBegin(E_FIELD_DESC);
9698
        this.e.write(oprot);
9699
        oprot.writeFieldEnd();
9700
      }
9701
      oprot.writeFieldStop();
9702
      oprot.writeStructEnd();
9703
    }
9704
 
9705
    @Override
9706
    public String toString() {
9707
      StringBuilder sb = new StringBuilder("updatePurchaseOrder_result(");
9708
      boolean first = true;
9709
 
9710
      sb.append("e:");
9711
      if (this.e == null) {
9712
        sb.append("null");
9713
      } else {
9714
        sb.append(this.e);
9715
      }
9716
      first = false;
9717
      sb.append(")");
9718
      return sb.toString();
9719
    }
9720
 
9721
    public void validate() throws org.apache.thrift.TException {
9722
      // check for required fields
9723
    }
9724
 
9725
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
9726
      try {
9727
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
9728
      } catch (org.apache.thrift.TException te) {
9729
        throw new java.io.IOException(te);
9730
      }
9731
    }
9732
 
9733
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
9734
      try {
9735
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
9736
      } catch (org.apache.thrift.TException te) {
9737
        throw new java.io.IOException(te);
9738
      }
9739
    }
9740
 
9741
  }
9742
 
5185 mandeep.dh 9743
  public static class unFulfillPO_args implements org.apache.thrift.TBase<unFulfillPO_args, unFulfillPO_args._Fields>, java.io.Serializable, Cloneable   {
9744
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("unFulfillPO_args");
9745
 
9746
    private static final org.apache.thrift.protocol.TField PURCHASE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("purchaseId", org.apache.thrift.protocol.TType.I64, (short)1);
9747
    private static final org.apache.thrift.protocol.TField ITEM_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("itemId", org.apache.thrift.protocol.TType.I64, (short)2);
9748
    private static final org.apache.thrift.protocol.TField QUANTITY_FIELD_DESC = new org.apache.thrift.protocol.TField("quantity", org.apache.thrift.protocol.TType.I64, (short)3);
9749
 
9750
    private long purchaseId; // required
9751
    private long itemId; // required
9752
    private long quantity; // required
9753
 
9754
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
9755
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
9756
      PURCHASE_ID((short)1, "purchaseId"),
9757
      ITEM_ID((short)2, "itemId"),
9758
      QUANTITY((short)3, "quantity");
9759
 
9760
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
9761
 
9762
      static {
9763
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
9764
          byName.put(field.getFieldName(), field);
9765
        }
9766
      }
9767
 
9768
      /**
9769
       * Find the _Fields constant that matches fieldId, or null if its not found.
9770
       */
9771
      public static _Fields findByThriftId(int fieldId) {
9772
        switch(fieldId) {
9773
          case 1: // PURCHASE_ID
9774
            return PURCHASE_ID;
9775
          case 2: // ITEM_ID
9776
            return ITEM_ID;
9777
          case 3: // QUANTITY
9778
            return QUANTITY;
9779
          default:
9780
            return null;
9781
        }
9782
      }
9783
 
9784
      /**
9785
       * Find the _Fields constant that matches fieldId, throwing an exception
9786
       * if it is not found.
9787
       */
9788
      public static _Fields findByThriftIdOrThrow(int fieldId) {
9789
        _Fields fields = findByThriftId(fieldId);
9790
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
9791
        return fields;
9792
      }
9793
 
9794
      /**
9795
       * Find the _Fields constant that matches name, or null if its not found.
9796
       */
9797
      public static _Fields findByName(String name) {
9798
        return byName.get(name);
9799
      }
9800
 
9801
      private final short _thriftId;
9802
      private final String _fieldName;
9803
 
9804
      _Fields(short thriftId, String fieldName) {
9805
        _thriftId = thriftId;
9806
        _fieldName = fieldName;
9807
      }
9808
 
9809
      public short getThriftFieldId() {
9810
        return _thriftId;
9811
      }
9812
 
9813
      public String getFieldName() {
9814
        return _fieldName;
9815
      }
9816
    }
9817
 
9818
    // isset id assignments
9819
    private static final int __PURCHASEID_ISSET_ID = 0;
9820
    private static final int __ITEMID_ISSET_ID = 1;
9821
    private static final int __QUANTITY_ISSET_ID = 2;
9822
    private BitSet __isset_bit_vector = new BitSet(3);
9823
 
9824
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
9825
    static {
9826
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
9827
      tmpMap.put(_Fields.PURCHASE_ID, new org.apache.thrift.meta_data.FieldMetaData("purchaseId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
9828
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
9829
      tmpMap.put(_Fields.ITEM_ID, new org.apache.thrift.meta_data.FieldMetaData("itemId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
9830
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
9831
      tmpMap.put(_Fields.QUANTITY, new org.apache.thrift.meta_data.FieldMetaData("quantity", org.apache.thrift.TFieldRequirementType.DEFAULT, 
9832
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
9833
      metaDataMap = Collections.unmodifiableMap(tmpMap);
9834
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(unFulfillPO_args.class, metaDataMap);
9835
    }
9836
 
9837
    public unFulfillPO_args() {
9838
    }
9839
 
9840
    public unFulfillPO_args(
9841
      long purchaseId,
9842
      long itemId,
9843
      long quantity)
9844
    {
9845
      this();
9846
      this.purchaseId = purchaseId;
9847
      setPurchaseIdIsSet(true);
9848
      this.itemId = itemId;
9849
      setItemIdIsSet(true);
9850
      this.quantity = quantity;
9851
      setQuantityIsSet(true);
9852
    }
9853
 
9854
    /**
9855
     * Performs a deep copy on <i>other</i>.
9856
     */
9857
    public unFulfillPO_args(unFulfillPO_args other) {
9858
      __isset_bit_vector.clear();
9859
      __isset_bit_vector.or(other.__isset_bit_vector);
9860
      this.purchaseId = other.purchaseId;
9861
      this.itemId = other.itemId;
9862
      this.quantity = other.quantity;
9863
    }
9864
 
9865
    public unFulfillPO_args deepCopy() {
9866
      return new unFulfillPO_args(this);
9867
    }
9868
 
9869
    @Override
9870
    public void clear() {
9871
      setPurchaseIdIsSet(false);
9872
      this.purchaseId = 0;
9873
      setItemIdIsSet(false);
9874
      this.itemId = 0;
9875
      setQuantityIsSet(false);
9876
      this.quantity = 0;
9877
    }
9878
 
9879
    public long getPurchaseId() {
9880
      return this.purchaseId;
9881
    }
9882
 
9883
    public void setPurchaseId(long purchaseId) {
9884
      this.purchaseId = purchaseId;
9885
      setPurchaseIdIsSet(true);
9886
    }
9887
 
9888
    public void unsetPurchaseId() {
9889
      __isset_bit_vector.clear(__PURCHASEID_ISSET_ID);
9890
    }
9891
 
9892
    /** Returns true if field purchaseId is set (has been assigned a value) and false otherwise */
9893
    public boolean isSetPurchaseId() {
9894
      return __isset_bit_vector.get(__PURCHASEID_ISSET_ID);
9895
    }
9896
 
9897
    public void setPurchaseIdIsSet(boolean value) {
9898
      __isset_bit_vector.set(__PURCHASEID_ISSET_ID, value);
9899
    }
9900
 
9901
    public long getItemId() {
9902
      return this.itemId;
9903
    }
9904
 
9905
    public void setItemId(long itemId) {
9906
      this.itemId = itemId;
9907
      setItemIdIsSet(true);
9908
    }
9909
 
9910
    public void unsetItemId() {
9911
      __isset_bit_vector.clear(__ITEMID_ISSET_ID);
9912
    }
9913
 
9914
    /** Returns true if field itemId is set (has been assigned a value) and false otherwise */
9915
    public boolean isSetItemId() {
9916
      return __isset_bit_vector.get(__ITEMID_ISSET_ID);
9917
    }
9918
 
9919
    public void setItemIdIsSet(boolean value) {
9920
      __isset_bit_vector.set(__ITEMID_ISSET_ID, value);
9921
    }
9922
 
9923
    public long getQuantity() {
9924
      return this.quantity;
9925
    }
9926
 
9927
    public void setQuantity(long quantity) {
9928
      this.quantity = quantity;
9929
      setQuantityIsSet(true);
9930
    }
9931
 
9932
    public void unsetQuantity() {
9933
      __isset_bit_vector.clear(__QUANTITY_ISSET_ID);
9934
    }
9935
 
9936
    /** Returns true if field quantity is set (has been assigned a value) and false otherwise */
9937
    public boolean isSetQuantity() {
9938
      return __isset_bit_vector.get(__QUANTITY_ISSET_ID);
9939
    }
9940
 
9941
    public void setQuantityIsSet(boolean value) {
9942
      __isset_bit_vector.set(__QUANTITY_ISSET_ID, value);
9943
    }
9944
 
9945
    public void setFieldValue(_Fields field, Object value) {
9946
      switch (field) {
9947
      case PURCHASE_ID:
9948
        if (value == null) {
9949
          unsetPurchaseId();
9950
        } else {
9951
          setPurchaseId((Long)value);
9952
        }
9953
        break;
9954
 
9955
      case ITEM_ID:
9956
        if (value == null) {
9957
          unsetItemId();
9958
        } else {
9959
          setItemId((Long)value);
9960
        }
9961
        break;
9962
 
9963
      case QUANTITY:
9964
        if (value == null) {
9965
          unsetQuantity();
9966
        } else {
9967
          setQuantity((Long)value);
9968
        }
9969
        break;
9970
 
9971
      }
9972
    }
9973
 
9974
    public Object getFieldValue(_Fields field) {
9975
      switch (field) {
9976
      case PURCHASE_ID:
9977
        return Long.valueOf(getPurchaseId());
9978
 
9979
      case ITEM_ID:
9980
        return Long.valueOf(getItemId());
9981
 
9982
      case QUANTITY:
9983
        return Long.valueOf(getQuantity());
9984
 
9985
      }
9986
      throw new IllegalStateException();
9987
    }
9988
 
9989
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
9990
    public boolean isSet(_Fields field) {
9991
      if (field == null) {
9992
        throw new IllegalArgumentException();
9993
      }
9994
 
9995
      switch (field) {
9996
      case PURCHASE_ID:
9997
        return isSetPurchaseId();
9998
      case ITEM_ID:
9999
        return isSetItemId();
10000
      case QUANTITY:
10001
        return isSetQuantity();
10002
      }
10003
      throw new IllegalStateException();
10004
    }
10005
 
10006
    @Override
10007
    public boolean equals(Object that) {
10008
      if (that == null)
10009
        return false;
10010
      if (that instanceof unFulfillPO_args)
10011
        return this.equals((unFulfillPO_args)that);
10012
      return false;
10013
    }
10014
 
10015
    public boolean equals(unFulfillPO_args that) {
10016
      if (that == null)
10017
        return false;
10018
 
10019
      boolean this_present_purchaseId = true;
10020
      boolean that_present_purchaseId = true;
10021
      if (this_present_purchaseId || that_present_purchaseId) {
10022
        if (!(this_present_purchaseId && that_present_purchaseId))
10023
          return false;
10024
        if (this.purchaseId != that.purchaseId)
10025
          return false;
10026
      }
10027
 
10028
      boolean this_present_itemId = true;
10029
      boolean that_present_itemId = true;
10030
      if (this_present_itemId || that_present_itemId) {
10031
        if (!(this_present_itemId && that_present_itemId))
10032
          return false;
10033
        if (this.itemId != that.itemId)
10034
          return false;
10035
      }
10036
 
10037
      boolean this_present_quantity = true;
10038
      boolean that_present_quantity = true;
10039
      if (this_present_quantity || that_present_quantity) {
10040
        if (!(this_present_quantity && that_present_quantity))
10041
          return false;
10042
        if (this.quantity != that.quantity)
10043
          return false;
10044
      }
10045
 
10046
      return true;
10047
    }
10048
 
10049
    @Override
10050
    public int hashCode() {
10051
      return 0;
10052
    }
10053
 
10054
    public int compareTo(unFulfillPO_args other) {
10055
      if (!getClass().equals(other.getClass())) {
10056
        return getClass().getName().compareTo(other.getClass().getName());
10057
      }
10058
 
10059
      int lastComparison = 0;
10060
      unFulfillPO_args typedOther = (unFulfillPO_args)other;
10061
 
10062
      lastComparison = Boolean.valueOf(isSetPurchaseId()).compareTo(typedOther.isSetPurchaseId());
10063
      if (lastComparison != 0) {
10064
        return lastComparison;
10065
      }
10066
      if (isSetPurchaseId()) {
10067
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.purchaseId, typedOther.purchaseId);
10068
        if (lastComparison != 0) {
10069
          return lastComparison;
10070
        }
10071
      }
10072
      lastComparison = Boolean.valueOf(isSetItemId()).compareTo(typedOther.isSetItemId());
10073
      if (lastComparison != 0) {
10074
        return lastComparison;
10075
      }
10076
      if (isSetItemId()) {
10077
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.itemId, typedOther.itemId);
10078
        if (lastComparison != 0) {
10079
          return lastComparison;
10080
        }
10081
      }
10082
      lastComparison = Boolean.valueOf(isSetQuantity()).compareTo(typedOther.isSetQuantity());
10083
      if (lastComparison != 0) {
10084
        return lastComparison;
10085
      }
10086
      if (isSetQuantity()) {
10087
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.quantity, typedOther.quantity);
10088
        if (lastComparison != 0) {
10089
          return lastComparison;
10090
        }
10091
      }
10092
      return 0;
10093
    }
10094
 
10095
    public _Fields fieldForId(int fieldId) {
10096
      return _Fields.findByThriftId(fieldId);
10097
    }
10098
 
10099
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
10100
      org.apache.thrift.protocol.TField field;
10101
      iprot.readStructBegin();
10102
      while (true)
10103
      {
10104
        field = iprot.readFieldBegin();
10105
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
10106
          break;
10107
        }
10108
        switch (field.id) {
10109
          case 1: // PURCHASE_ID
10110
            if (field.type == org.apache.thrift.protocol.TType.I64) {
10111
              this.purchaseId = iprot.readI64();
10112
              setPurchaseIdIsSet(true);
10113
            } else { 
10114
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10115
            }
10116
            break;
10117
          case 2: // ITEM_ID
10118
            if (field.type == org.apache.thrift.protocol.TType.I64) {
10119
              this.itemId = iprot.readI64();
10120
              setItemIdIsSet(true);
10121
            } else { 
10122
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10123
            }
10124
            break;
10125
          case 3: // QUANTITY
10126
            if (field.type == org.apache.thrift.protocol.TType.I64) {
10127
              this.quantity = iprot.readI64();
10128
              setQuantityIsSet(true);
10129
            } else { 
10130
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10131
            }
10132
            break;
10133
          default:
10134
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10135
        }
10136
        iprot.readFieldEnd();
10137
      }
10138
      iprot.readStructEnd();
10139
      validate();
10140
    }
10141
 
10142
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
10143
      validate();
10144
 
10145
      oprot.writeStructBegin(STRUCT_DESC);
10146
      oprot.writeFieldBegin(PURCHASE_ID_FIELD_DESC);
10147
      oprot.writeI64(this.purchaseId);
10148
      oprot.writeFieldEnd();
10149
      oprot.writeFieldBegin(ITEM_ID_FIELD_DESC);
10150
      oprot.writeI64(this.itemId);
10151
      oprot.writeFieldEnd();
10152
      oprot.writeFieldBegin(QUANTITY_FIELD_DESC);
10153
      oprot.writeI64(this.quantity);
10154
      oprot.writeFieldEnd();
10155
      oprot.writeFieldStop();
10156
      oprot.writeStructEnd();
10157
    }
10158
 
10159
    @Override
10160
    public String toString() {
10161
      StringBuilder sb = new StringBuilder("unFulfillPO_args(");
10162
      boolean first = true;
10163
 
10164
      sb.append("purchaseId:");
10165
      sb.append(this.purchaseId);
10166
      first = false;
10167
      if (!first) sb.append(", ");
10168
      sb.append("itemId:");
10169
      sb.append(this.itemId);
10170
      first = false;
10171
      if (!first) sb.append(", ");
10172
      sb.append("quantity:");
10173
      sb.append(this.quantity);
10174
      first = false;
10175
      sb.append(")");
10176
      return sb.toString();
10177
    }
10178
 
10179
    public void validate() throws org.apache.thrift.TException {
10180
      // check for required fields
10181
    }
10182
 
10183
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
10184
      try {
10185
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
10186
      } catch (org.apache.thrift.TException te) {
10187
        throw new java.io.IOException(te);
10188
      }
10189
    }
10190
 
10191
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
10192
      try {
10193
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
10194
        __isset_bit_vector = new BitSet(1);
10195
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
10196
      } catch (org.apache.thrift.TException te) {
10197
        throw new java.io.IOException(te);
10198
      }
10199
    }
10200
 
10201
  }
10202
 
10203
  public static class unFulfillPO_result implements org.apache.thrift.TBase<unFulfillPO_result, unFulfillPO_result._Fields>, java.io.Serializable, Cloneable   {
10204
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("unFulfillPO_result");
10205
 
10206
    private static final org.apache.thrift.protocol.TField E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1);
10207
 
10208
    private PurchaseServiceException e; // required
10209
 
10210
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
10211
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
10212
      E((short)1, "e");
10213
 
10214
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
10215
 
10216
      static {
10217
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
10218
          byName.put(field.getFieldName(), field);
10219
        }
10220
      }
10221
 
10222
      /**
10223
       * Find the _Fields constant that matches fieldId, or null if its not found.
10224
       */
10225
      public static _Fields findByThriftId(int fieldId) {
10226
        switch(fieldId) {
10227
          case 1: // E
10228
            return E;
10229
          default:
10230
            return null;
10231
        }
10232
      }
10233
 
10234
      /**
10235
       * Find the _Fields constant that matches fieldId, throwing an exception
10236
       * if it is not found.
10237
       */
10238
      public static _Fields findByThriftIdOrThrow(int fieldId) {
10239
        _Fields fields = findByThriftId(fieldId);
10240
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
10241
        return fields;
10242
      }
10243
 
10244
      /**
10245
       * Find the _Fields constant that matches name, or null if its not found.
10246
       */
10247
      public static _Fields findByName(String name) {
10248
        return byName.get(name);
10249
      }
10250
 
10251
      private final short _thriftId;
10252
      private final String _fieldName;
10253
 
10254
      _Fields(short thriftId, String fieldName) {
10255
        _thriftId = thriftId;
10256
        _fieldName = fieldName;
10257
      }
10258
 
10259
      public short getThriftFieldId() {
10260
        return _thriftId;
10261
      }
10262
 
10263
      public String getFieldName() {
10264
        return _fieldName;
10265
      }
10266
    }
10267
 
10268
    // isset id assignments
10269
 
10270
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
10271
    static {
10272
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
10273
      tmpMap.put(_Fields.E, new org.apache.thrift.meta_data.FieldMetaData("e", org.apache.thrift.TFieldRequirementType.DEFAULT, 
10274
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
10275
      metaDataMap = Collections.unmodifiableMap(tmpMap);
10276
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(unFulfillPO_result.class, metaDataMap);
10277
    }
10278
 
10279
    public unFulfillPO_result() {
10280
    }
10281
 
10282
    public unFulfillPO_result(
10283
      PurchaseServiceException e)
10284
    {
10285
      this();
10286
      this.e = e;
10287
    }
10288
 
10289
    /**
10290
     * Performs a deep copy on <i>other</i>.
10291
     */
10292
    public unFulfillPO_result(unFulfillPO_result other) {
10293
      if (other.isSetE()) {
10294
        this.e = new PurchaseServiceException(other.e);
10295
      }
10296
    }
10297
 
10298
    public unFulfillPO_result deepCopy() {
10299
      return new unFulfillPO_result(this);
10300
    }
10301
 
10302
    @Override
10303
    public void clear() {
10304
      this.e = null;
10305
    }
10306
 
10307
    public PurchaseServiceException getE() {
10308
      return this.e;
10309
    }
10310
 
10311
    public void setE(PurchaseServiceException e) {
10312
      this.e = e;
10313
    }
10314
 
10315
    public void unsetE() {
10316
      this.e = null;
10317
    }
10318
 
10319
    /** Returns true if field e is set (has been assigned a value) and false otherwise */
10320
    public boolean isSetE() {
10321
      return this.e != null;
10322
    }
10323
 
10324
    public void setEIsSet(boolean value) {
10325
      if (!value) {
10326
        this.e = null;
10327
      }
10328
    }
10329
 
10330
    public void setFieldValue(_Fields field, Object value) {
10331
      switch (field) {
10332
      case E:
10333
        if (value == null) {
10334
          unsetE();
10335
        } else {
10336
          setE((PurchaseServiceException)value);
10337
        }
10338
        break;
10339
 
10340
      }
10341
    }
10342
 
10343
    public Object getFieldValue(_Fields field) {
10344
      switch (field) {
10345
      case E:
10346
        return getE();
10347
 
10348
      }
10349
      throw new IllegalStateException();
10350
    }
10351
 
10352
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
10353
    public boolean isSet(_Fields field) {
10354
      if (field == null) {
10355
        throw new IllegalArgumentException();
10356
      }
10357
 
10358
      switch (field) {
10359
      case E:
10360
        return isSetE();
10361
      }
10362
      throw new IllegalStateException();
10363
    }
10364
 
10365
    @Override
10366
    public boolean equals(Object that) {
10367
      if (that == null)
10368
        return false;
10369
      if (that instanceof unFulfillPO_result)
10370
        return this.equals((unFulfillPO_result)that);
10371
      return false;
10372
    }
10373
 
10374
    public boolean equals(unFulfillPO_result that) {
10375
      if (that == null)
10376
        return false;
10377
 
10378
      boolean this_present_e = true && this.isSetE();
10379
      boolean that_present_e = true && that.isSetE();
10380
      if (this_present_e || that_present_e) {
10381
        if (!(this_present_e && that_present_e))
10382
          return false;
10383
        if (!this.e.equals(that.e))
10384
          return false;
10385
      }
10386
 
10387
      return true;
10388
    }
10389
 
10390
    @Override
10391
    public int hashCode() {
10392
      return 0;
10393
    }
10394
 
10395
    public int compareTo(unFulfillPO_result other) {
10396
      if (!getClass().equals(other.getClass())) {
10397
        return getClass().getName().compareTo(other.getClass().getName());
10398
      }
10399
 
10400
      int lastComparison = 0;
10401
      unFulfillPO_result typedOther = (unFulfillPO_result)other;
10402
 
10403
      lastComparison = Boolean.valueOf(isSetE()).compareTo(typedOther.isSetE());
10404
      if (lastComparison != 0) {
10405
        return lastComparison;
10406
      }
10407
      if (isSetE()) {
10408
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, typedOther.e);
10409
        if (lastComparison != 0) {
10410
          return lastComparison;
10411
        }
10412
      }
10413
      return 0;
10414
    }
10415
 
10416
    public _Fields fieldForId(int fieldId) {
10417
      return _Fields.findByThriftId(fieldId);
10418
    }
10419
 
10420
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
10421
      org.apache.thrift.protocol.TField field;
10422
      iprot.readStructBegin();
10423
      while (true)
10424
      {
10425
        field = iprot.readFieldBegin();
10426
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
10427
          break;
10428
        }
10429
        switch (field.id) {
10430
          case 1: // E
10431
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
10432
              this.e = new PurchaseServiceException();
10433
              this.e.read(iprot);
10434
            } else { 
10435
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10436
            }
10437
            break;
10438
          default:
10439
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10440
        }
10441
        iprot.readFieldEnd();
10442
      }
10443
      iprot.readStructEnd();
10444
      validate();
10445
    }
10446
 
10447
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
10448
      oprot.writeStructBegin(STRUCT_DESC);
10449
 
10450
      if (this.isSetE()) {
10451
        oprot.writeFieldBegin(E_FIELD_DESC);
10452
        this.e.write(oprot);
10453
        oprot.writeFieldEnd();
10454
      }
10455
      oprot.writeFieldStop();
10456
      oprot.writeStructEnd();
10457
    }
10458
 
10459
    @Override
10460
    public String toString() {
10461
      StringBuilder sb = new StringBuilder("unFulfillPO_result(");
10462
      boolean first = true;
10463
 
10464
      sb.append("e:");
10465
      if (this.e == null) {
10466
        sb.append("null");
10467
      } else {
10468
        sb.append(this.e);
10469
      }
10470
      first = false;
10471
      sb.append(")");
10472
      return sb.toString();
10473
    }
10474
 
10475
    public void validate() throws org.apache.thrift.TException {
10476
      // check for required fields
10477
    }
10478
 
10479
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
10480
      try {
10481
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
10482
      } catch (org.apache.thrift.TException te) {
10483
        throw new java.io.IOException(te);
10484
      }
10485
    }
10486
 
10487
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
10488
      try {
10489
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
10490
      } catch (org.apache.thrift.TException te) {
10491
        throw new java.io.IOException(te);
10492
      }
10493
    }
10494
 
10495
  }
10496
 
5443 mandeep.dh 10497
  public static class getInvoices_args implements org.apache.thrift.TBase<getInvoices_args, getInvoices_args._Fields>, java.io.Serializable, Cloneable   {
10498
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getInvoices_args");
10499
 
10500
    private static final org.apache.thrift.protocol.TField DATE_FIELD_DESC = new org.apache.thrift.protocol.TField("date", org.apache.thrift.protocol.TType.I64, (short)1);
10501
 
10502
    private long date; // required
10503
 
10504
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
10505
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
10506
      DATE((short)1, "date");
10507
 
10508
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
10509
 
10510
      static {
10511
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
10512
          byName.put(field.getFieldName(), field);
10513
        }
10514
      }
10515
 
10516
      /**
10517
       * Find the _Fields constant that matches fieldId, or null if its not found.
10518
       */
10519
      public static _Fields findByThriftId(int fieldId) {
10520
        switch(fieldId) {
10521
          case 1: // DATE
10522
            return DATE;
10523
          default:
10524
            return null;
10525
        }
10526
      }
10527
 
10528
      /**
10529
       * Find the _Fields constant that matches fieldId, throwing an exception
10530
       * if it is not found.
10531
       */
10532
      public static _Fields findByThriftIdOrThrow(int fieldId) {
10533
        _Fields fields = findByThriftId(fieldId);
10534
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
10535
        return fields;
10536
      }
10537
 
10538
      /**
10539
       * Find the _Fields constant that matches name, or null if its not found.
10540
       */
10541
      public static _Fields findByName(String name) {
10542
        return byName.get(name);
10543
      }
10544
 
10545
      private final short _thriftId;
10546
      private final String _fieldName;
10547
 
10548
      _Fields(short thriftId, String fieldName) {
10549
        _thriftId = thriftId;
10550
        _fieldName = fieldName;
10551
      }
10552
 
10553
      public short getThriftFieldId() {
10554
        return _thriftId;
10555
      }
10556
 
10557
      public String getFieldName() {
10558
        return _fieldName;
10559
      }
10560
    }
10561
 
10562
    // isset id assignments
10563
    private static final int __DATE_ISSET_ID = 0;
10564
    private BitSet __isset_bit_vector = new BitSet(1);
10565
 
10566
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
10567
    static {
10568
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
10569
      tmpMap.put(_Fields.DATE, new org.apache.thrift.meta_data.FieldMetaData("date", org.apache.thrift.TFieldRequirementType.DEFAULT, 
10570
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
10571
      metaDataMap = Collections.unmodifiableMap(tmpMap);
10572
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getInvoices_args.class, metaDataMap);
10573
    }
10574
 
10575
    public getInvoices_args() {
10576
    }
10577
 
10578
    public getInvoices_args(
10579
      long date)
10580
    {
10581
      this();
10582
      this.date = date;
10583
      setDateIsSet(true);
10584
    }
10585
 
10586
    /**
10587
     * Performs a deep copy on <i>other</i>.
10588
     */
10589
    public getInvoices_args(getInvoices_args other) {
10590
      __isset_bit_vector.clear();
10591
      __isset_bit_vector.or(other.__isset_bit_vector);
10592
      this.date = other.date;
10593
    }
10594
 
10595
    public getInvoices_args deepCopy() {
10596
      return new getInvoices_args(this);
10597
    }
10598
 
10599
    @Override
10600
    public void clear() {
10601
      setDateIsSet(false);
10602
      this.date = 0;
10603
    }
10604
 
10605
    public long getDate() {
10606
      return this.date;
10607
    }
10608
 
10609
    public void setDate(long date) {
10610
      this.date = date;
10611
      setDateIsSet(true);
10612
    }
10613
 
10614
    public void unsetDate() {
10615
      __isset_bit_vector.clear(__DATE_ISSET_ID);
10616
    }
10617
 
10618
    /** Returns true if field date is set (has been assigned a value) and false otherwise */
10619
    public boolean isSetDate() {
10620
      return __isset_bit_vector.get(__DATE_ISSET_ID);
10621
    }
10622
 
10623
    public void setDateIsSet(boolean value) {
10624
      __isset_bit_vector.set(__DATE_ISSET_ID, value);
10625
    }
10626
 
10627
    public void setFieldValue(_Fields field, Object value) {
10628
      switch (field) {
10629
      case DATE:
10630
        if (value == null) {
10631
          unsetDate();
10632
        } else {
10633
          setDate((Long)value);
10634
        }
10635
        break;
10636
 
10637
      }
10638
    }
10639
 
10640
    public Object getFieldValue(_Fields field) {
10641
      switch (field) {
10642
      case DATE:
10643
        return Long.valueOf(getDate());
10644
 
10645
      }
10646
      throw new IllegalStateException();
10647
    }
10648
 
10649
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
10650
    public boolean isSet(_Fields field) {
10651
      if (field == null) {
10652
        throw new IllegalArgumentException();
10653
      }
10654
 
10655
      switch (field) {
10656
      case DATE:
10657
        return isSetDate();
10658
      }
10659
      throw new IllegalStateException();
10660
    }
10661
 
10662
    @Override
10663
    public boolean equals(Object that) {
10664
      if (that == null)
10665
        return false;
10666
      if (that instanceof getInvoices_args)
10667
        return this.equals((getInvoices_args)that);
10668
      return false;
10669
    }
10670
 
10671
    public boolean equals(getInvoices_args that) {
10672
      if (that == null)
10673
        return false;
10674
 
10675
      boolean this_present_date = true;
10676
      boolean that_present_date = true;
10677
      if (this_present_date || that_present_date) {
10678
        if (!(this_present_date && that_present_date))
10679
          return false;
10680
        if (this.date != that.date)
10681
          return false;
10682
      }
10683
 
10684
      return true;
10685
    }
10686
 
10687
    @Override
10688
    public int hashCode() {
10689
      return 0;
10690
    }
10691
 
10692
    public int compareTo(getInvoices_args other) {
10693
      if (!getClass().equals(other.getClass())) {
10694
        return getClass().getName().compareTo(other.getClass().getName());
10695
      }
10696
 
10697
      int lastComparison = 0;
10698
      getInvoices_args typedOther = (getInvoices_args)other;
10699
 
10700
      lastComparison = Boolean.valueOf(isSetDate()).compareTo(typedOther.isSetDate());
10701
      if (lastComparison != 0) {
10702
        return lastComparison;
10703
      }
10704
      if (isSetDate()) {
10705
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.date, typedOther.date);
10706
        if (lastComparison != 0) {
10707
          return lastComparison;
10708
        }
10709
      }
10710
      return 0;
10711
    }
10712
 
10713
    public _Fields fieldForId(int fieldId) {
10714
      return _Fields.findByThriftId(fieldId);
10715
    }
10716
 
10717
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
10718
      org.apache.thrift.protocol.TField field;
10719
      iprot.readStructBegin();
10720
      while (true)
10721
      {
10722
        field = iprot.readFieldBegin();
10723
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
10724
          break;
10725
        }
10726
        switch (field.id) {
10727
          case 1: // DATE
10728
            if (field.type == org.apache.thrift.protocol.TType.I64) {
10729
              this.date = iprot.readI64();
10730
              setDateIsSet(true);
10731
            } else { 
10732
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10733
            }
10734
            break;
10735
          default:
10736
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10737
        }
10738
        iprot.readFieldEnd();
10739
      }
10740
      iprot.readStructEnd();
10741
      validate();
10742
    }
10743
 
10744
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
10745
      validate();
10746
 
10747
      oprot.writeStructBegin(STRUCT_DESC);
10748
      oprot.writeFieldBegin(DATE_FIELD_DESC);
10749
      oprot.writeI64(this.date);
10750
      oprot.writeFieldEnd();
10751
      oprot.writeFieldStop();
10752
      oprot.writeStructEnd();
10753
    }
10754
 
10755
    @Override
10756
    public String toString() {
10757
      StringBuilder sb = new StringBuilder("getInvoices_args(");
10758
      boolean first = true;
10759
 
10760
      sb.append("date:");
10761
      sb.append(this.date);
10762
      first = false;
10763
      sb.append(")");
10764
      return sb.toString();
10765
    }
10766
 
10767
    public void validate() throws org.apache.thrift.TException {
10768
      // check for required fields
10769
    }
10770
 
10771
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
10772
      try {
10773
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
10774
      } catch (org.apache.thrift.TException te) {
10775
        throw new java.io.IOException(te);
10776
      }
10777
    }
10778
 
10779
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
10780
      try {
10781
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
10782
        __isset_bit_vector = new BitSet(1);
10783
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
10784
      } catch (org.apache.thrift.TException te) {
10785
        throw new java.io.IOException(te);
10786
      }
10787
    }
10788
 
10789
  }
10790
 
10791
  public static class getInvoices_result implements org.apache.thrift.TBase<getInvoices_result, getInvoices_result._Fields>, java.io.Serializable, Cloneable   {
10792
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getInvoices_result");
10793
 
10794
    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);
10795
 
10796
    private List<Invoice> success; // required
10797
 
10798
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
10799
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
10800
      SUCCESS((short)0, "success");
10801
 
10802
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
10803
 
10804
      static {
10805
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
10806
          byName.put(field.getFieldName(), field);
10807
        }
10808
      }
10809
 
10810
      /**
10811
       * Find the _Fields constant that matches fieldId, or null if its not found.
10812
       */
10813
      public static _Fields findByThriftId(int fieldId) {
10814
        switch(fieldId) {
10815
          case 0: // SUCCESS
10816
            return SUCCESS;
10817
          default:
10818
            return null;
10819
        }
10820
      }
10821
 
10822
      /**
10823
       * Find the _Fields constant that matches fieldId, throwing an exception
10824
       * if it is not found.
10825
       */
10826
      public static _Fields findByThriftIdOrThrow(int fieldId) {
10827
        _Fields fields = findByThriftId(fieldId);
10828
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
10829
        return fields;
10830
      }
10831
 
10832
      /**
10833
       * Find the _Fields constant that matches name, or null if its not found.
10834
       */
10835
      public static _Fields findByName(String name) {
10836
        return byName.get(name);
10837
      }
10838
 
10839
      private final short _thriftId;
10840
      private final String _fieldName;
10841
 
10842
      _Fields(short thriftId, String fieldName) {
10843
        _thriftId = thriftId;
10844
        _fieldName = fieldName;
10845
      }
10846
 
10847
      public short getThriftFieldId() {
10848
        return _thriftId;
10849
      }
10850
 
10851
      public String getFieldName() {
10852
        return _fieldName;
10853
      }
10854
    }
10855
 
10856
    // isset id assignments
10857
 
10858
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
10859
    static {
10860
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
10861
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
10862
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
10863
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Invoice.class))));
10864
      metaDataMap = Collections.unmodifiableMap(tmpMap);
10865
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getInvoices_result.class, metaDataMap);
10866
    }
10867
 
10868
    public getInvoices_result() {
10869
    }
10870
 
10871
    public getInvoices_result(
10872
      List<Invoice> success)
10873
    {
10874
      this();
10875
      this.success = success;
10876
    }
10877
 
10878
    /**
10879
     * Performs a deep copy on <i>other</i>.
10880
     */
10881
    public getInvoices_result(getInvoices_result other) {
10882
      if (other.isSetSuccess()) {
10883
        List<Invoice> __this__success = new ArrayList<Invoice>();
10884
        for (Invoice other_element : other.success) {
10885
          __this__success.add(new Invoice(other_element));
10886
        }
10887
        this.success = __this__success;
10888
      }
10889
    }
10890
 
10891
    public getInvoices_result deepCopy() {
10892
      return new getInvoices_result(this);
10893
    }
10894
 
10895
    @Override
10896
    public void clear() {
10897
      this.success = null;
10898
    }
10899
 
10900
    public int getSuccessSize() {
10901
      return (this.success == null) ? 0 : this.success.size();
10902
    }
10903
 
10904
    public java.util.Iterator<Invoice> getSuccessIterator() {
10905
      return (this.success == null) ? null : this.success.iterator();
10906
    }
10907
 
10908
    public void addToSuccess(Invoice elem) {
10909
      if (this.success == null) {
10910
        this.success = new ArrayList<Invoice>();
10911
      }
10912
      this.success.add(elem);
10913
    }
10914
 
10915
    public List<Invoice> getSuccess() {
10916
      return this.success;
10917
    }
10918
 
10919
    public void setSuccess(List<Invoice> success) {
10920
      this.success = success;
10921
    }
10922
 
10923
    public void unsetSuccess() {
10924
      this.success = null;
10925
    }
10926
 
10927
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
10928
    public boolean isSetSuccess() {
10929
      return this.success != null;
10930
    }
10931
 
10932
    public void setSuccessIsSet(boolean value) {
10933
      if (!value) {
10934
        this.success = null;
10935
      }
10936
    }
10937
 
10938
    public void setFieldValue(_Fields field, Object value) {
10939
      switch (field) {
10940
      case SUCCESS:
10941
        if (value == null) {
10942
          unsetSuccess();
10943
        } else {
10944
          setSuccess((List<Invoice>)value);
10945
        }
10946
        break;
10947
 
10948
      }
10949
    }
10950
 
10951
    public Object getFieldValue(_Fields field) {
10952
      switch (field) {
10953
      case SUCCESS:
10954
        return getSuccess();
10955
 
10956
      }
10957
      throw new IllegalStateException();
10958
    }
10959
 
10960
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
10961
    public boolean isSet(_Fields field) {
10962
      if (field == null) {
10963
        throw new IllegalArgumentException();
10964
      }
10965
 
10966
      switch (field) {
10967
      case SUCCESS:
10968
        return isSetSuccess();
10969
      }
10970
      throw new IllegalStateException();
10971
    }
10972
 
10973
    @Override
10974
    public boolean equals(Object that) {
10975
      if (that == null)
10976
        return false;
10977
      if (that instanceof getInvoices_result)
10978
        return this.equals((getInvoices_result)that);
10979
      return false;
10980
    }
10981
 
10982
    public boolean equals(getInvoices_result that) {
10983
      if (that == null)
10984
        return false;
10985
 
10986
      boolean this_present_success = true && this.isSetSuccess();
10987
      boolean that_present_success = true && that.isSetSuccess();
10988
      if (this_present_success || that_present_success) {
10989
        if (!(this_present_success && that_present_success))
10990
          return false;
10991
        if (!this.success.equals(that.success))
10992
          return false;
10993
      }
10994
 
10995
      return true;
10996
    }
10997
 
10998
    @Override
10999
    public int hashCode() {
11000
      return 0;
11001
    }
11002
 
11003
    public int compareTo(getInvoices_result other) {
11004
      if (!getClass().equals(other.getClass())) {
11005
        return getClass().getName().compareTo(other.getClass().getName());
11006
      }
11007
 
11008
      int lastComparison = 0;
11009
      getInvoices_result typedOther = (getInvoices_result)other;
11010
 
11011
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
11012
      if (lastComparison != 0) {
11013
        return lastComparison;
11014
      }
11015
      if (isSetSuccess()) {
11016
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
11017
        if (lastComparison != 0) {
11018
          return lastComparison;
11019
        }
11020
      }
11021
      return 0;
11022
    }
11023
 
11024
    public _Fields fieldForId(int fieldId) {
11025
      return _Fields.findByThriftId(fieldId);
11026
    }
11027
 
11028
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
11029
      org.apache.thrift.protocol.TField field;
11030
      iprot.readStructBegin();
11031
      while (true)
11032
      {
11033
        field = iprot.readFieldBegin();
11034
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
11035
          break;
11036
        }
11037
        switch (field.id) {
11038
          case 0: // SUCCESS
11039
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
11040
              {
11041
                org.apache.thrift.protocol.TList _list20 = iprot.readListBegin();
11042
                this.success = new ArrayList<Invoice>(_list20.size);
11043
                for (int _i21 = 0; _i21 < _list20.size; ++_i21)
11044
                {
11045
                  Invoice _elem22; // required
11046
                  _elem22 = new Invoice();
11047
                  _elem22.read(iprot);
11048
                  this.success.add(_elem22);
11049
                }
11050
                iprot.readListEnd();
11051
              }
11052
            } else { 
11053
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
11054
            }
11055
            break;
11056
          default:
11057
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
11058
        }
11059
        iprot.readFieldEnd();
11060
      }
11061
      iprot.readStructEnd();
11062
      validate();
11063
    }
11064
 
11065
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
11066
      oprot.writeStructBegin(STRUCT_DESC);
11067
 
11068
      if (this.isSetSuccess()) {
11069
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
11070
        {
11071
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
11072
          for (Invoice _iter23 : this.success)
11073
          {
11074
            _iter23.write(oprot);
11075
          }
11076
          oprot.writeListEnd();
11077
        }
11078
        oprot.writeFieldEnd();
11079
      }
11080
      oprot.writeFieldStop();
11081
      oprot.writeStructEnd();
11082
    }
11083
 
11084
    @Override
11085
    public String toString() {
11086
      StringBuilder sb = new StringBuilder("getInvoices_result(");
11087
      boolean first = true;
11088
 
11089
      sb.append("success:");
11090
      if (this.success == null) {
11091
        sb.append("null");
11092
      } else {
11093
        sb.append(this.success);
11094
      }
11095
      first = false;
11096
      sb.append(")");
11097
      return sb.toString();
11098
    }
11099
 
11100
    public void validate() throws org.apache.thrift.TException {
11101
      // check for required fields
11102
    }
11103
 
11104
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
11105
      try {
11106
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
11107
      } catch (org.apache.thrift.TException te) {
11108
        throw new java.io.IOException(te);
11109
      }
11110
    }
11111
 
11112
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
11113
      try {
11114
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
11115
      } catch (org.apache.thrift.TException te) {
11116
        throw new java.io.IOException(te);
11117
      }
11118
    }
11119
 
11120
  }
11121
 
11122
  public static class createInvoice_args implements org.apache.thrift.TBase<createInvoice_args, createInvoice_args._Fields>, java.io.Serializable, Cloneable   {
11123
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createInvoice_args");
11124
 
11125
    private static final org.apache.thrift.protocol.TField INVOICE_FIELD_DESC = new org.apache.thrift.protocol.TField("invoice", org.apache.thrift.protocol.TType.STRUCT, (short)1);
11126
 
11127
    private Invoice invoice; // required
11128
 
11129
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
11130
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
11131
      INVOICE((short)1, "invoice");
11132
 
11133
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
11134
 
11135
      static {
11136
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
11137
          byName.put(field.getFieldName(), field);
11138
        }
11139
      }
11140
 
11141
      /**
11142
       * Find the _Fields constant that matches fieldId, or null if its not found.
11143
       */
11144
      public static _Fields findByThriftId(int fieldId) {
11145
        switch(fieldId) {
11146
          case 1: // INVOICE
11147
            return INVOICE;
11148
          default:
11149
            return null;
11150
        }
11151
      }
11152
 
11153
      /**
11154
       * Find the _Fields constant that matches fieldId, throwing an exception
11155
       * if it is not found.
11156
       */
11157
      public static _Fields findByThriftIdOrThrow(int fieldId) {
11158
        _Fields fields = findByThriftId(fieldId);
11159
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
11160
        return fields;
11161
      }
11162
 
11163
      /**
11164
       * Find the _Fields constant that matches name, or null if its not found.
11165
       */
11166
      public static _Fields findByName(String name) {
11167
        return byName.get(name);
11168
      }
11169
 
11170
      private final short _thriftId;
11171
      private final String _fieldName;
11172
 
11173
      _Fields(short thriftId, String fieldName) {
11174
        _thriftId = thriftId;
11175
        _fieldName = fieldName;
11176
      }
11177
 
11178
      public short getThriftFieldId() {
11179
        return _thriftId;
11180
      }
11181
 
11182
      public String getFieldName() {
11183
        return _fieldName;
11184
      }
11185
    }
11186
 
11187
    // isset id assignments
11188
 
11189
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
11190
    static {
11191
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
11192
      tmpMap.put(_Fields.INVOICE, new org.apache.thrift.meta_data.FieldMetaData("invoice", org.apache.thrift.TFieldRequirementType.DEFAULT, 
11193
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Invoice.class)));
11194
      metaDataMap = Collections.unmodifiableMap(tmpMap);
11195
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createInvoice_args.class, metaDataMap);
11196
    }
11197
 
11198
    public createInvoice_args() {
11199
    }
11200
 
11201
    public createInvoice_args(
11202
      Invoice invoice)
11203
    {
11204
      this();
11205
      this.invoice = invoice;
11206
    }
11207
 
11208
    /**
11209
     * Performs a deep copy on <i>other</i>.
11210
     */
11211
    public createInvoice_args(createInvoice_args other) {
11212
      if (other.isSetInvoice()) {
11213
        this.invoice = new Invoice(other.invoice);
11214
      }
11215
    }
11216
 
11217
    public createInvoice_args deepCopy() {
11218
      return new createInvoice_args(this);
11219
    }
11220
 
11221
    @Override
11222
    public void clear() {
11223
      this.invoice = null;
11224
    }
11225
 
11226
    public Invoice getInvoice() {
11227
      return this.invoice;
11228
    }
11229
 
11230
    public void setInvoice(Invoice invoice) {
11231
      this.invoice = invoice;
11232
    }
11233
 
11234
    public void unsetInvoice() {
11235
      this.invoice = null;
11236
    }
11237
 
11238
    /** Returns true if field invoice is set (has been assigned a value) and false otherwise */
11239
    public boolean isSetInvoice() {
11240
      return this.invoice != null;
11241
    }
11242
 
11243
    public void setInvoiceIsSet(boolean value) {
11244
      if (!value) {
11245
        this.invoice = null;
11246
      }
11247
    }
11248
 
11249
    public void setFieldValue(_Fields field, Object value) {
11250
      switch (field) {
11251
      case INVOICE:
11252
        if (value == null) {
11253
          unsetInvoice();
11254
        } else {
11255
          setInvoice((Invoice)value);
11256
        }
11257
        break;
11258
 
11259
      }
11260
    }
11261
 
11262
    public Object getFieldValue(_Fields field) {
11263
      switch (field) {
11264
      case INVOICE:
11265
        return getInvoice();
11266
 
11267
      }
11268
      throw new IllegalStateException();
11269
    }
11270
 
11271
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
11272
    public boolean isSet(_Fields field) {
11273
      if (field == null) {
11274
        throw new IllegalArgumentException();
11275
      }
11276
 
11277
      switch (field) {
11278
      case INVOICE:
11279
        return isSetInvoice();
11280
      }
11281
      throw new IllegalStateException();
11282
    }
11283
 
11284
    @Override
11285
    public boolean equals(Object that) {
11286
      if (that == null)
11287
        return false;
11288
      if (that instanceof createInvoice_args)
11289
        return this.equals((createInvoice_args)that);
11290
      return false;
11291
    }
11292
 
11293
    public boolean equals(createInvoice_args that) {
11294
      if (that == null)
11295
        return false;
11296
 
11297
      boolean this_present_invoice = true && this.isSetInvoice();
11298
      boolean that_present_invoice = true && that.isSetInvoice();
11299
      if (this_present_invoice || that_present_invoice) {
11300
        if (!(this_present_invoice && that_present_invoice))
11301
          return false;
11302
        if (!this.invoice.equals(that.invoice))
11303
          return false;
11304
      }
11305
 
11306
      return true;
11307
    }
11308
 
11309
    @Override
11310
    public int hashCode() {
11311
      return 0;
11312
    }
11313
 
11314
    public int compareTo(createInvoice_args other) {
11315
      if (!getClass().equals(other.getClass())) {
11316
        return getClass().getName().compareTo(other.getClass().getName());
11317
      }
11318
 
11319
      int lastComparison = 0;
11320
      createInvoice_args typedOther = (createInvoice_args)other;
11321
 
11322
      lastComparison = Boolean.valueOf(isSetInvoice()).compareTo(typedOther.isSetInvoice());
11323
      if (lastComparison != 0) {
11324
        return lastComparison;
11325
      }
11326
      if (isSetInvoice()) {
11327
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.invoice, typedOther.invoice);
11328
        if (lastComparison != 0) {
11329
          return lastComparison;
11330
        }
11331
      }
11332
      return 0;
11333
    }
11334
 
11335
    public _Fields fieldForId(int fieldId) {
11336
      return _Fields.findByThriftId(fieldId);
11337
    }
11338
 
11339
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
11340
      org.apache.thrift.protocol.TField field;
11341
      iprot.readStructBegin();
11342
      while (true)
11343
      {
11344
        field = iprot.readFieldBegin();
11345
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
11346
          break;
11347
        }
11348
        switch (field.id) {
11349
          case 1: // INVOICE
11350
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
11351
              this.invoice = new Invoice();
11352
              this.invoice.read(iprot);
11353
            } else { 
11354
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
11355
            }
11356
            break;
11357
          default:
11358
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
11359
        }
11360
        iprot.readFieldEnd();
11361
      }
11362
      iprot.readStructEnd();
11363
      validate();
11364
    }
11365
 
11366
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
11367
      validate();
11368
 
11369
      oprot.writeStructBegin(STRUCT_DESC);
11370
      if (this.invoice != null) {
11371
        oprot.writeFieldBegin(INVOICE_FIELD_DESC);
11372
        this.invoice.write(oprot);
11373
        oprot.writeFieldEnd();
11374
      }
11375
      oprot.writeFieldStop();
11376
      oprot.writeStructEnd();
11377
    }
11378
 
11379
    @Override
11380
    public String toString() {
11381
      StringBuilder sb = new StringBuilder("createInvoice_args(");
11382
      boolean first = true;
11383
 
11384
      sb.append("invoice:");
11385
      if (this.invoice == null) {
11386
        sb.append("null");
11387
      } else {
11388
        sb.append(this.invoice);
11389
      }
11390
      first = false;
11391
      sb.append(")");
11392
      return sb.toString();
11393
    }
11394
 
11395
    public void validate() throws org.apache.thrift.TException {
11396
      // check for required fields
11397
    }
11398
 
11399
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
11400
      try {
11401
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
11402
      } catch (org.apache.thrift.TException te) {
11403
        throw new java.io.IOException(te);
11404
      }
11405
    }
11406
 
11407
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
11408
      try {
11409
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
11410
      } catch (org.apache.thrift.TException te) {
11411
        throw new java.io.IOException(te);
11412
      }
11413
    }
11414
 
11415
  }
11416
 
11417
  public static class createInvoice_result implements org.apache.thrift.TBase<createInvoice_result, createInvoice_result._Fields>, java.io.Serializable, Cloneable   {
11418
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createInvoice_result");
11419
 
11420
    private static final org.apache.thrift.protocol.TField E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1);
11421
 
11422
    private PurchaseServiceException e; // required
11423
 
11424
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
11425
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
11426
      E((short)1, "e");
11427
 
11428
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
11429
 
11430
      static {
11431
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
11432
          byName.put(field.getFieldName(), field);
11433
        }
11434
      }
11435
 
11436
      /**
11437
       * Find the _Fields constant that matches fieldId, or null if its not found.
11438
       */
11439
      public static _Fields findByThriftId(int fieldId) {
11440
        switch(fieldId) {
11441
          case 1: // E
11442
            return E;
11443
          default:
11444
            return null;
11445
        }
11446
      }
11447
 
11448
      /**
11449
       * Find the _Fields constant that matches fieldId, throwing an exception
11450
       * if it is not found.
11451
       */
11452
      public static _Fields findByThriftIdOrThrow(int fieldId) {
11453
        _Fields fields = findByThriftId(fieldId);
11454
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
11455
        return fields;
11456
      }
11457
 
11458
      /**
11459
       * Find the _Fields constant that matches name, or null if its not found.
11460
       */
11461
      public static _Fields findByName(String name) {
11462
        return byName.get(name);
11463
      }
11464
 
11465
      private final short _thriftId;
11466
      private final String _fieldName;
11467
 
11468
      _Fields(short thriftId, String fieldName) {
11469
        _thriftId = thriftId;
11470
        _fieldName = fieldName;
11471
      }
11472
 
11473
      public short getThriftFieldId() {
11474
        return _thriftId;
11475
      }
11476
 
11477
      public String getFieldName() {
11478
        return _fieldName;
11479
      }
11480
    }
11481
 
11482
    // isset id assignments
11483
 
11484
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
11485
    static {
11486
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
11487
      tmpMap.put(_Fields.E, new org.apache.thrift.meta_data.FieldMetaData("e", org.apache.thrift.TFieldRequirementType.DEFAULT, 
11488
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
11489
      metaDataMap = Collections.unmodifiableMap(tmpMap);
11490
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createInvoice_result.class, metaDataMap);
11491
    }
11492
 
11493
    public createInvoice_result() {
11494
    }
11495
 
11496
    public createInvoice_result(
11497
      PurchaseServiceException e)
11498
    {
11499
      this();
11500
      this.e = e;
11501
    }
11502
 
11503
    /**
11504
     * Performs a deep copy on <i>other</i>.
11505
     */
11506
    public createInvoice_result(createInvoice_result other) {
11507
      if (other.isSetE()) {
11508
        this.e = new PurchaseServiceException(other.e);
11509
      }
11510
    }
11511
 
11512
    public createInvoice_result deepCopy() {
11513
      return new createInvoice_result(this);
11514
    }
11515
 
11516
    @Override
11517
    public void clear() {
11518
      this.e = null;
11519
    }
11520
 
11521
    public PurchaseServiceException getE() {
11522
      return this.e;
11523
    }
11524
 
11525
    public void setE(PurchaseServiceException e) {
11526
      this.e = e;
11527
    }
11528
 
11529
    public void unsetE() {
11530
      this.e = null;
11531
    }
11532
 
11533
    /** Returns true if field e is set (has been assigned a value) and false otherwise */
11534
    public boolean isSetE() {
11535
      return this.e != null;
11536
    }
11537
 
11538
    public void setEIsSet(boolean value) {
11539
      if (!value) {
11540
        this.e = null;
11541
      }
11542
    }
11543
 
11544
    public void setFieldValue(_Fields field, Object value) {
11545
      switch (field) {
11546
      case E:
11547
        if (value == null) {
11548
          unsetE();
11549
        } else {
11550
          setE((PurchaseServiceException)value);
11551
        }
11552
        break;
11553
 
11554
      }
11555
    }
11556
 
11557
    public Object getFieldValue(_Fields field) {
11558
      switch (field) {
11559
      case E:
11560
        return getE();
11561
 
11562
      }
11563
      throw new IllegalStateException();
11564
    }
11565
 
11566
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
11567
    public boolean isSet(_Fields field) {
11568
      if (field == null) {
11569
        throw new IllegalArgumentException();
11570
      }
11571
 
11572
      switch (field) {
11573
      case E:
11574
        return isSetE();
11575
      }
11576
      throw new IllegalStateException();
11577
    }
11578
 
11579
    @Override
11580
    public boolean equals(Object that) {
11581
      if (that == null)
11582
        return false;
11583
      if (that instanceof createInvoice_result)
11584
        return this.equals((createInvoice_result)that);
11585
      return false;
11586
    }
11587
 
11588
    public boolean equals(createInvoice_result that) {
11589
      if (that == null)
11590
        return false;
11591
 
11592
      boolean this_present_e = true && this.isSetE();
11593
      boolean that_present_e = true && that.isSetE();
11594
      if (this_present_e || that_present_e) {
11595
        if (!(this_present_e && that_present_e))
11596
          return false;
11597
        if (!this.e.equals(that.e))
11598
          return false;
11599
      }
11600
 
11601
      return true;
11602
    }
11603
 
11604
    @Override
11605
    public int hashCode() {
11606
      return 0;
11607
    }
11608
 
11609
    public int compareTo(createInvoice_result other) {
11610
      if (!getClass().equals(other.getClass())) {
11611
        return getClass().getName().compareTo(other.getClass().getName());
11612
      }
11613
 
11614
      int lastComparison = 0;
11615
      createInvoice_result typedOther = (createInvoice_result)other;
11616
 
11617
      lastComparison = Boolean.valueOf(isSetE()).compareTo(typedOther.isSetE());
11618
      if (lastComparison != 0) {
11619
        return lastComparison;
11620
      }
11621
      if (isSetE()) {
11622
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, typedOther.e);
11623
        if (lastComparison != 0) {
11624
          return lastComparison;
11625
        }
11626
      }
11627
      return 0;
11628
    }
11629
 
11630
    public _Fields fieldForId(int fieldId) {
11631
      return _Fields.findByThriftId(fieldId);
11632
    }
11633
 
11634
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
11635
      org.apache.thrift.protocol.TField field;
11636
      iprot.readStructBegin();
11637
      while (true)
11638
      {
11639
        field = iprot.readFieldBegin();
11640
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
11641
          break;
11642
        }
11643
        switch (field.id) {
11644
          case 1: // E
11645
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
11646
              this.e = new PurchaseServiceException();
11647
              this.e.read(iprot);
11648
            } else { 
11649
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
11650
            }
11651
            break;
11652
          default:
11653
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
11654
        }
11655
        iprot.readFieldEnd();
11656
      }
11657
      iprot.readStructEnd();
11658
      validate();
11659
    }
11660
 
11661
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
11662
      oprot.writeStructBegin(STRUCT_DESC);
11663
 
11664
      if (this.isSetE()) {
11665
        oprot.writeFieldBegin(E_FIELD_DESC);
11666
        this.e.write(oprot);
11667
        oprot.writeFieldEnd();
11668
      }
11669
      oprot.writeFieldStop();
11670
      oprot.writeStructEnd();
11671
    }
11672
 
11673
    @Override
11674
    public String toString() {
11675
      StringBuilder sb = new StringBuilder("createInvoice_result(");
11676
      boolean first = true;
11677
 
11678
      sb.append("e:");
11679
      if (this.e == null) {
11680
        sb.append("null");
11681
      } else {
11682
        sb.append(this.e);
11683
      }
11684
      first = false;
11685
      sb.append(")");
11686
      return sb.toString();
11687
    }
11688
 
11689
    public void validate() throws org.apache.thrift.TException {
11690
      // check for required fields
11691
    }
11692
 
11693
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
11694
      try {
11695
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
11696
      } catch (org.apache.thrift.TException te) {
11697
        throw new java.io.IOException(te);
11698
      }
11699
    }
11700
 
11701
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
11702
      try {
11703
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
11704
      } catch (org.apache.thrift.TException te) {
11705
        throw new java.io.IOException(te);
11706
      }
11707
    }
11708
 
11709
  }
11710
 
4496 mandeep.dh 11711
}