Subversion Repositories SmartDukaan

Rev

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