Subversion Repositories SmartDukaan

Rev

Rev 4555 | Go to most recent revision | Details | 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
    /**
83
     * Returns the price at which we bought an item from a supplier
84
     * 
85
     * @param purchaseId
86
     * @param itemId
87
     */
88
    public long getPrice(long purchaseId, long itemId) throws org.apache.thrift.TException;
89
 
90
  }
91
 
92
  public interface AsyncIface extends in.shop2020.generic.GenericService .AsyncIface {
93
 
94
    public void createPurchaseOrder(PurchaseOrder purchaseOrder, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.createPurchaseOrder_call> resultHandler) throws org.apache.thrift.TException;
95
 
96
    public void getPurchaseOrder(long id, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getPurchaseOrder_call> resultHandler) throws org.apache.thrift.TException;
97
 
98
    public void getAllPurchaseOrders(POStatus status, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getAllPurchaseOrders_call> resultHandler) throws org.apache.thrift.TException;
99
 
100
    public void getSupplier(long id, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getSupplier_call> resultHandler) throws org.apache.thrift.TException;
101
 
102
    public void startPurchase(long purchaseOrderId, String invoiceNumber, double freightCharges, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.startPurchase_call> resultHandler) throws org.apache.thrift.TException;
103
 
104
    public void closePurchase(long purchaseId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.closePurchase_call> resultHandler) throws org.apache.thrift.TException;
105
 
106
    public void getAllPurchases(long purchaseOrderId, boolean open, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getAllPurchases_call> resultHandler) throws org.apache.thrift.TException;
107
 
108
    public void getPrice(long purchaseId, long itemId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getPrice_call> resultHandler) throws org.apache.thrift.TException;
109
 
110
  }
111
 
112
  public static class Client extends in.shop2020.generic.GenericService.Client implements Iface {
113
    public static class Factory implements org.apache.thrift.TServiceClientFactory<Client> {
114
      public Factory() {}
115
      public Client getClient(org.apache.thrift.protocol.TProtocol prot) {
116
        return new Client(prot);
117
      }
118
      public Client getClient(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
119
        return new Client(iprot, oprot);
120
      }
121
    }
122
 
123
    public Client(org.apache.thrift.protocol.TProtocol prot)
124
    {
125
      super(prot, prot);
126
    }
127
 
128
    public Client(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
129
      super(iprot, oprot);
130
    }
131
 
132
    public long createPurchaseOrder(PurchaseOrder purchaseOrder) throws PurchaseServiceException, org.apache.thrift.TException
133
    {
134
      send_createPurchaseOrder(purchaseOrder);
135
      return recv_createPurchaseOrder();
136
    }
137
 
138
    public void send_createPurchaseOrder(PurchaseOrder purchaseOrder) throws org.apache.thrift.TException
139
    {
140
      createPurchaseOrder_args args = new createPurchaseOrder_args();
141
      args.setPurchaseOrder(purchaseOrder);
142
      sendBase("createPurchaseOrder", args);
143
    }
144
 
145
    public long recv_createPurchaseOrder() throws PurchaseServiceException, org.apache.thrift.TException
146
    {
147
      createPurchaseOrder_result result = new createPurchaseOrder_result();
148
      receiveBase(result, "createPurchaseOrder");
149
      if (result.isSetSuccess()) {
150
        return result.success;
151
      }
152
      if (result.e != null) {
153
        throw result.e;
154
      }
155
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "createPurchaseOrder failed: unknown result");
156
    }
157
 
158
    public PurchaseOrder getPurchaseOrder(long id) throws PurchaseServiceException, org.apache.thrift.TException
159
    {
160
      send_getPurchaseOrder(id);
161
      return recv_getPurchaseOrder();
162
    }
163
 
164
    public void send_getPurchaseOrder(long id) throws org.apache.thrift.TException
165
    {
166
      getPurchaseOrder_args args = new getPurchaseOrder_args();
167
      args.setId(id);
168
      sendBase("getPurchaseOrder", args);
169
    }
170
 
171
    public PurchaseOrder recv_getPurchaseOrder() throws PurchaseServiceException, org.apache.thrift.TException
172
    {
173
      getPurchaseOrder_result result = new getPurchaseOrder_result();
174
      receiveBase(result, "getPurchaseOrder");
175
      if (result.isSetSuccess()) {
176
        return result.success;
177
      }
178
      if (result.e != null) {
179
        throw result.e;
180
      }
181
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getPurchaseOrder failed: unknown result");
182
    }
183
 
184
    public List<PurchaseOrder> getAllPurchaseOrders(POStatus status) throws PurchaseServiceException, org.apache.thrift.TException
185
    {
186
      send_getAllPurchaseOrders(status);
187
      return recv_getAllPurchaseOrders();
188
    }
189
 
190
    public void send_getAllPurchaseOrders(POStatus status) throws org.apache.thrift.TException
191
    {
192
      getAllPurchaseOrders_args args = new getAllPurchaseOrders_args();
193
      args.setStatus(status);
194
      sendBase("getAllPurchaseOrders", args);
195
    }
196
 
197
    public List<PurchaseOrder> recv_getAllPurchaseOrders() throws PurchaseServiceException, org.apache.thrift.TException
198
    {
199
      getAllPurchaseOrders_result result = new getAllPurchaseOrders_result();
200
      receiveBase(result, "getAllPurchaseOrders");
201
      if (result.isSetSuccess()) {
202
        return result.success;
203
      }
204
      if (result.e != null) {
205
        throw result.e;
206
      }
207
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getAllPurchaseOrders failed: unknown result");
208
    }
209
 
210
    public Supplier getSupplier(long id) throws PurchaseServiceException, org.apache.thrift.TException
211
    {
212
      send_getSupplier(id);
213
      return recv_getSupplier();
214
    }
215
 
216
    public void send_getSupplier(long id) throws org.apache.thrift.TException
217
    {
218
      getSupplier_args args = new getSupplier_args();
219
      args.setId(id);
220
      sendBase("getSupplier", args);
221
    }
222
 
223
    public Supplier recv_getSupplier() throws PurchaseServiceException, org.apache.thrift.TException
224
    {
225
      getSupplier_result result = new getSupplier_result();
226
      receiveBase(result, "getSupplier");
227
      if (result.isSetSuccess()) {
228
        return result.success;
229
      }
230
      if (result.e != null) {
231
        throw result.e;
232
      }
233
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getSupplier failed: unknown result");
234
    }
235
 
236
    public long startPurchase(long purchaseOrderId, String invoiceNumber, double freightCharges) throws PurchaseServiceException, org.apache.thrift.TException
237
    {
238
      send_startPurchase(purchaseOrderId, invoiceNumber, freightCharges);
239
      return recv_startPurchase();
240
    }
241
 
242
    public void send_startPurchase(long purchaseOrderId, String invoiceNumber, double freightCharges) throws org.apache.thrift.TException
243
    {
244
      startPurchase_args args = new startPurchase_args();
245
      args.setPurchaseOrderId(purchaseOrderId);
246
      args.setInvoiceNumber(invoiceNumber);
247
      args.setFreightCharges(freightCharges);
248
      sendBase("startPurchase", args);
249
    }
250
 
251
    public long recv_startPurchase() throws PurchaseServiceException, org.apache.thrift.TException
252
    {
253
      startPurchase_result result = new startPurchase_result();
254
      receiveBase(result, "startPurchase");
255
      if (result.isSetSuccess()) {
256
        return result.success;
257
      }
258
      if (result.e != null) {
259
        throw result.e;
260
      }
261
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "startPurchase failed: unknown result");
262
    }
263
 
264
    public long closePurchase(long purchaseId) throws PurchaseServiceException, org.apache.thrift.TException
265
    {
266
      send_closePurchase(purchaseId);
267
      return recv_closePurchase();
268
    }
269
 
270
    public void send_closePurchase(long purchaseId) throws org.apache.thrift.TException
271
    {
272
      closePurchase_args args = new closePurchase_args();
273
      args.setPurchaseId(purchaseId);
274
      sendBase("closePurchase", args);
275
    }
276
 
277
    public long recv_closePurchase() throws PurchaseServiceException, org.apache.thrift.TException
278
    {
279
      closePurchase_result result = new closePurchase_result();
280
      receiveBase(result, "closePurchase");
281
      if (result.isSetSuccess()) {
282
        return result.success;
283
      }
284
      if (result.e != null) {
285
        throw result.e;
286
      }
287
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "closePurchase failed: unknown result");
288
    }
289
 
290
    public List<Purchase> getAllPurchases(long purchaseOrderId, boolean open) throws PurchaseServiceException, org.apache.thrift.TException
291
    {
292
      send_getAllPurchases(purchaseOrderId, open);
293
      return recv_getAllPurchases();
294
    }
295
 
296
    public void send_getAllPurchases(long purchaseOrderId, boolean open) throws org.apache.thrift.TException
297
    {
298
      getAllPurchases_args args = new getAllPurchases_args();
299
      args.setPurchaseOrderId(purchaseOrderId);
300
      args.setOpen(open);
301
      sendBase("getAllPurchases", args);
302
    }
303
 
304
    public List<Purchase> recv_getAllPurchases() throws PurchaseServiceException, org.apache.thrift.TException
305
    {
306
      getAllPurchases_result result = new getAllPurchases_result();
307
      receiveBase(result, "getAllPurchases");
308
      if (result.isSetSuccess()) {
309
        return result.success;
310
      }
311
      if (result.e != null) {
312
        throw result.e;
313
      }
314
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getAllPurchases failed: unknown result");
315
    }
316
 
317
    public long getPrice(long purchaseId, long itemId) throws org.apache.thrift.TException
318
    {
319
      send_getPrice(purchaseId, itemId);
320
      return recv_getPrice();
321
    }
322
 
323
    public void send_getPrice(long purchaseId, long itemId) throws org.apache.thrift.TException
324
    {
325
      getPrice_args args = new getPrice_args();
326
      args.setPurchaseId(purchaseId);
327
      args.setItemId(itemId);
328
      sendBase("getPrice", args);
329
    }
330
 
331
    public long recv_getPrice() throws org.apache.thrift.TException
332
    {
333
      getPrice_result result = new getPrice_result();
334
      receiveBase(result, "getPrice");
335
      if (result.isSetSuccess()) {
336
        return result.success;
337
      }
338
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getPrice failed: unknown result");
339
    }
340
 
341
  }
342
  public static class AsyncClient extends in.shop2020.generic.GenericService.AsyncClient implements AsyncIface {
343
    public static class Factory implements org.apache.thrift.async.TAsyncClientFactory<AsyncClient> {
344
      private org.apache.thrift.async.TAsyncClientManager clientManager;
345
      private org.apache.thrift.protocol.TProtocolFactory protocolFactory;
346
      public Factory(org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.protocol.TProtocolFactory protocolFactory) {
347
        this.clientManager = clientManager;
348
        this.protocolFactory = protocolFactory;
349
      }
350
      public AsyncClient getAsyncClient(org.apache.thrift.transport.TNonblockingTransport transport) {
351
        return new AsyncClient(protocolFactory, clientManager, transport);
352
      }
353
    }
354
 
355
    public AsyncClient(org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.transport.TNonblockingTransport transport) {
356
      super(protocolFactory, clientManager, transport);
357
    }
358
 
359
    public void createPurchaseOrder(PurchaseOrder purchaseOrder, org.apache.thrift.async.AsyncMethodCallback<createPurchaseOrder_call> resultHandler) throws org.apache.thrift.TException {
360
      checkReady();
361
      createPurchaseOrder_call method_call = new createPurchaseOrder_call(purchaseOrder, resultHandler, this, ___protocolFactory, ___transport);
362
      this.___currentMethod = method_call;
363
      ___manager.call(method_call);
364
    }
365
 
366
    public static class createPurchaseOrder_call extends org.apache.thrift.async.TAsyncMethodCall {
367
      private PurchaseOrder purchaseOrder;
368
      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 {
369
        super(client, protocolFactory, transport, resultHandler, false);
370
        this.purchaseOrder = purchaseOrder;
371
      }
372
 
373
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
374
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("createPurchaseOrder", org.apache.thrift.protocol.TMessageType.CALL, 0));
375
        createPurchaseOrder_args args = new createPurchaseOrder_args();
376
        args.setPurchaseOrder(purchaseOrder);
377
        args.write(prot);
378
        prot.writeMessageEnd();
379
      }
380
 
381
      public long getResult() throws PurchaseServiceException, org.apache.thrift.TException {
382
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
383
          throw new IllegalStateException("Method call not finished!");
384
        }
385
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
386
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
387
        return (new Client(prot)).recv_createPurchaseOrder();
388
      }
389
    }
390
 
391
    public void getPurchaseOrder(long id, org.apache.thrift.async.AsyncMethodCallback<getPurchaseOrder_call> resultHandler) throws org.apache.thrift.TException {
392
      checkReady();
393
      getPurchaseOrder_call method_call = new getPurchaseOrder_call(id, resultHandler, this, ___protocolFactory, ___transport);
394
      this.___currentMethod = method_call;
395
      ___manager.call(method_call);
396
    }
397
 
398
    public static class getPurchaseOrder_call extends org.apache.thrift.async.TAsyncMethodCall {
399
      private long id;
400
      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 {
401
        super(client, protocolFactory, transport, resultHandler, false);
402
        this.id = id;
403
      }
404
 
405
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
406
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getPurchaseOrder", org.apache.thrift.protocol.TMessageType.CALL, 0));
407
        getPurchaseOrder_args args = new getPurchaseOrder_args();
408
        args.setId(id);
409
        args.write(prot);
410
        prot.writeMessageEnd();
411
      }
412
 
413
      public PurchaseOrder getResult() throws PurchaseServiceException, org.apache.thrift.TException {
414
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
415
          throw new IllegalStateException("Method call not finished!");
416
        }
417
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
418
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
419
        return (new Client(prot)).recv_getPurchaseOrder();
420
      }
421
    }
422
 
423
    public void getAllPurchaseOrders(POStatus status, org.apache.thrift.async.AsyncMethodCallback<getAllPurchaseOrders_call> resultHandler) throws org.apache.thrift.TException {
424
      checkReady();
425
      getAllPurchaseOrders_call method_call = new getAllPurchaseOrders_call(status, resultHandler, this, ___protocolFactory, ___transport);
426
      this.___currentMethod = method_call;
427
      ___manager.call(method_call);
428
    }
429
 
430
    public static class getAllPurchaseOrders_call extends org.apache.thrift.async.TAsyncMethodCall {
431
      private POStatus status;
432
      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 {
433
        super(client, protocolFactory, transport, resultHandler, false);
434
        this.status = status;
435
      }
436
 
437
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
438
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getAllPurchaseOrders", org.apache.thrift.protocol.TMessageType.CALL, 0));
439
        getAllPurchaseOrders_args args = new getAllPurchaseOrders_args();
440
        args.setStatus(status);
441
        args.write(prot);
442
        prot.writeMessageEnd();
443
      }
444
 
445
      public List<PurchaseOrder> getResult() throws PurchaseServiceException, org.apache.thrift.TException {
446
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
447
          throw new IllegalStateException("Method call not finished!");
448
        }
449
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
450
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
451
        return (new Client(prot)).recv_getAllPurchaseOrders();
452
      }
453
    }
454
 
455
    public void getSupplier(long id, org.apache.thrift.async.AsyncMethodCallback<getSupplier_call> resultHandler) throws org.apache.thrift.TException {
456
      checkReady();
457
      getSupplier_call method_call = new getSupplier_call(id, resultHandler, this, ___protocolFactory, ___transport);
458
      this.___currentMethod = method_call;
459
      ___manager.call(method_call);
460
    }
461
 
462
    public static class getSupplier_call extends org.apache.thrift.async.TAsyncMethodCall {
463
      private long id;
464
      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 {
465
        super(client, protocolFactory, transport, resultHandler, false);
466
        this.id = id;
467
      }
468
 
469
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
470
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getSupplier", org.apache.thrift.protocol.TMessageType.CALL, 0));
471
        getSupplier_args args = new getSupplier_args();
472
        args.setId(id);
473
        args.write(prot);
474
        prot.writeMessageEnd();
475
      }
476
 
477
      public Supplier getResult() throws PurchaseServiceException, org.apache.thrift.TException {
478
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
479
          throw new IllegalStateException("Method call not finished!");
480
        }
481
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
482
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
483
        return (new Client(prot)).recv_getSupplier();
484
      }
485
    }
486
 
487
    public void startPurchase(long purchaseOrderId, String invoiceNumber, double freightCharges, org.apache.thrift.async.AsyncMethodCallback<startPurchase_call> resultHandler) throws org.apache.thrift.TException {
488
      checkReady();
489
      startPurchase_call method_call = new startPurchase_call(purchaseOrderId, invoiceNumber, freightCharges, resultHandler, this, ___protocolFactory, ___transport);
490
      this.___currentMethod = method_call;
491
      ___manager.call(method_call);
492
    }
493
 
494
    public static class startPurchase_call extends org.apache.thrift.async.TAsyncMethodCall {
495
      private long purchaseOrderId;
496
      private String invoiceNumber;
497
      private double freightCharges;
498
      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 {
499
        super(client, protocolFactory, transport, resultHandler, false);
500
        this.purchaseOrderId = purchaseOrderId;
501
        this.invoiceNumber = invoiceNumber;
502
        this.freightCharges = freightCharges;
503
      }
504
 
505
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
506
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("startPurchase", org.apache.thrift.protocol.TMessageType.CALL, 0));
507
        startPurchase_args args = new startPurchase_args();
508
        args.setPurchaseOrderId(purchaseOrderId);
509
        args.setInvoiceNumber(invoiceNumber);
510
        args.setFreightCharges(freightCharges);
511
        args.write(prot);
512
        prot.writeMessageEnd();
513
      }
514
 
515
      public long getResult() throws PurchaseServiceException, org.apache.thrift.TException {
516
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
517
          throw new IllegalStateException("Method call not finished!");
518
        }
519
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
520
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
521
        return (new Client(prot)).recv_startPurchase();
522
      }
523
    }
524
 
525
    public void closePurchase(long purchaseId, org.apache.thrift.async.AsyncMethodCallback<closePurchase_call> resultHandler) throws org.apache.thrift.TException {
526
      checkReady();
527
      closePurchase_call method_call = new closePurchase_call(purchaseId, resultHandler, this, ___protocolFactory, ___transport);
528
      this.___currentMethod = method_call;
529
      ___manager.call(method_call);
530
    }
531
 
532
    public static class closePurchase_call extends org.apache.thrift.async.TAsyncMethodCall {
533
      private long purchaseId;
534
      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 {
535
        super(client, protocolFactory, transport, resultHandler, false);
536
        this.purchaseId = purchaseId;
537
      }
538
 
539
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
540
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("closePurchase", org.apache.thrift.protocol.TMessageType.CALL, 0));
541
        closePurchase_args args = new closePurchase_args();
542
        args.setPurchaseId(purchaseId);
543
        args.write(prot);
544
        prot.writeMessageEnd();
545
      }
546
 
547
      public long getResult() throws PurchaseServiceException, org.apache.thrift.TException {
548
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
549
          throw new IllegalStateException("Method call not finished!");
550
        }
551
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
552
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
553
        return (new Client(prot)).recv_closePurchase();
554
      }
555
    }
556
 
557
    public void getAllPurchases(long purchaseOrderId, boolean open, org.apache.thrift.async.AsyncMethodCallback<getAllPurchases_call> resultHandler) throws org.apache.thrift.TException {
558
      checkReady();
559
      getAllPurchases_call method_call = new getAllPurchases_call(purchaseOrderId, open, resultHandler, this, ___protocolFactory, ___transport);
560
      this.___currentMethod = method_call;
561
      ___manager.call(method_call);
562
    }
563
 
564
    public static class getAllPurchases_call extends org.apache.thrift.async.TAsyncMethodCall {
565
      private long purchaseOrderId;
566
      private boolean open;
567
      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 {
568
        super(client, protocolFactory, transport, resultHandler, false);
569
        this.purchaseOrderId = purchaseOrderId;
570
        this.open = open;
571
      }
572
 
573
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
574
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getAllPurchases", org.apache.thrift.protocol.TMessageType.CALL, 0));
575
        getAllPurchases_args args = new getAllPurchases_args();
576
        args.setPurchaseOrderId(purchaseOrderId);
577
        args.setOpen(open);
578
        args.write(prot);
579
        prot.writeMessageEnd();
580
      }
581
 
582
      public List<Purchase> getResult() throws PurchaseServiceException, org.apache.thrift.TException {
583
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
584
          throw new IllegalStateException("Method call not finished!");
585
        }
586
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
587
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
588
        return (new Client(prot)).recv_getAllPurchases();
589
      }
590
    }
591
 
592
    public void getPrice(long purchaseId, long itemId, org.apache.thrift.async.AsyncMethodCallback<getPrice_call> resultHandler) throws org.apache.thrift.TException {
593
      checkReady();
594
      getPrice_call method_call = new getPrice_call(purchaseId, itemId, resultHandler, this, ___protocolFactory, ___transport);
595
      this.___currentMethod = method_call;
596
      ___manager.call(method_call);
597
    }
598
 
599
    public static class getPrice_call extends org.apache.thrift.async.TAsyncMethodCall {
600
      private long purchaseId;
601
      private long itemId;
602
      public getPrice_call(long purchaseId, long itemId, org.apache.thrift.async.AsyncMethodCallback<getPrice_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 {
603
        super(client, protocolFactory, transport, resultHandler, false);
604
        this.purchaseId = purchaseId;
605
        this.itemId = itemId;
606
      }
607
 
608
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
609
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getPrice", org.apache.thrift.protocol.TMessageType.CALL, 0));
610
        getPrice_args args = new getPrice_args();
611
        args.setPurchaseId(purchaseId);
612
        args.setItemId(itemId);
613
        args.write(prot);
614
        prot.writeMessageEnd();
615
      }
616
 
617
      public long getResult() throws org.apache.thrift.TException {
618
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
619
          throw new IllegalStateException("Method call not finished!");
620
        }
621
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
622
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
623
        return (new Client(prot)).recv_getPrice();
624
      }
625
    }
626
 
627
  }
628
 
629
  public static class Processor<I extends Iface> extends in.shop2020.generic.GenericService.Processor implements org.apache.thrift.TProcessor {
630
    private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName());
631
    public Processor(I iface) {
632
      super(iface, getProcessMap(new HashMap<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>>()));
633
    }
634
 
635
    protected Processor(I iface, Map<String,  org.apache.thrift.ProcessFunction<I, ? extends  org.apache.thrift.TBase>> processMap) {
636
      super(iface, getProcessMap(processMap));
637
    }
638
 
639
    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) {
640
      processMap.put("createPurchaseOrder", new createPurchaseOrder());
641
      processMap.put("getPurchaseOrder", new getPurchaseOrder());
642
      processMap.put("getAllPurchaseOrders", new getAllPurchaseOrders());
643
      processMap.put("getSupplier", new getSupplier());
644
      processMap.put("startPurchase", new startPurchase());
645
      processMap.put("closePurchase", new closePurchase());
646
      processMap.put("getAllPurchases", new getAllPurchases());
647
      processMap.put("getPrice", new getPrice());
648
      return processMap;
649
    }
650
 
651
    private static class createPurchaseOrder<I extends Iface> extends org.apache.thrift.ProcessFunction<I, createPurchaseOrder_args> {
652
      public createPurchaseOrder() {
653
        super("createPurchaseOrder");
654
      }
655
 
656
      protected createPurchaseOrder_args getEmptyArgsInstance() {
657
        return new createPurchaseOrder_args();
658
      }
659
 
660
      protected createPurchaseOrder_result getResult(I iface, createPurchaseOrder_args args) throws org.apache.thrift.TException {
661
        createPurchaseOrder_result result = new createPurchaseOrder_result();
662
        try {
663
          result.success = iface.createPurchaseOrder(args.purchaseOrder);
664
          result.setSuccessIsSet(true);
665
        } catch (PurchaseServiceException e) {
666
          result.e = e;
667
        }
668
        return result;
669
      }
670
    }
671
 
672
    private static class getPurchaseOrder<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getPurchaseOrder_args> {
673
      public getPurchaseOrder() {
674
        super("getPurchaseOrder");
675
      }
676
 
677
      protected getPurchaseOrder_args getEmptyArgsInstance() {
678
        return new getPurchaseOrder_args();
679
      }
680
 
681
      protected getPurchaseOrder_result getResult(I iface, getPurchaseOrder_args args) throws org.apache.thrift.TException {
682
        getPurchaseOrder_result result = new getPurchaseOrder_result();
683
        try {
684
          result.success = iface.getPurchaseOrder(args.id);
685
        } catch (PurchaseServiceException e) {
686
          result.e = e;
687
        }
688
        return result;
689
      }
690
    }
691
 
692
    private static class getAllPurchaseOrders<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getAllPurchaseOrders_args> {
693
      public getAllPurchaseOrders() {
694
        super("getAllPurchaseOrders");
695
      }
696
 
697
      protected getAllPurchaseOrders_args getEmptyArgsInstance() {
698
        return new getAllPurchaseOrders_args();
699
      }
700
 
701
      protected getAllPurchaseOrders_result getResult(I iface, getAllPurchaseOrders_args args) throws org.apache.thrift.TException {
702
        getAllPurchaseOrders_result result = new getAllPurchaseOrders_result();
703
        try {
704
          result.success = iface.getAllPurchaseOrders(args.status);
705
        } catch (PurchaseServiceException e) {
706
          result.e = e;
707
        }
708
        return result;
709
      }
710
    }
711
 
712
    private static class getSupplier<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getSupplier_args> {
713
      public getSupplier() {
714
        super("getSupplier");
715
      }
716
 
717
      protected getSupplier_args getEmptyArgsInstance() {
718
        return new getSupplier_args();
719
      }
720
 
721
      protected getSupplier_result getResult(I iface, getSupplier_args args) throws org.apache.thrift.TException {
722
        getSupplier_result result = new getSupplier_result();
723
        try {
724
          result.success = iface.getSupplier(args.id);
725
        } catch (PurchaseServiceException e) {
726
          result.e = e;
727
        }
728
        return result;
729
      }
730
    }
731
 
732
    private static class startPurchase<I extends Iface> extends org.apache.thrift.ProcessFunction<I, startPurchase_args> {
733
      public startPurchase() {
734
        super("startPurchase");
735
      }
736
 
737
      protected startPurchase_args getEmptyArgsInstance() {
738
        return new startPurchase_args();
739
      }
740
 
741
      protected startPurchase_result getResult(I iface, startPurchase_args args) throws org.apache.thrift.TException {
742
        startPurchase_result result = new startPurchase_result();
743
        try {
744
          result.success = iface.startPurchase(args.purchaseOrderId, args.invoiceNumber, args.freightCharges);
745
          result.setSuccessIsSet(true);
746
        } catch (PurchaseServiceException e) {
747
          result.e = e;
748
        }
749
        return result;
750
      }
751
    }
752
 
753
    private static class closePurchase<I extends Iface> extends org.apache.thrift.ProcessFunction<I, closePurchase_args> {
754
      public closePurchase() {
755
        super("closePurchase");
756
      }
757
 
758
      protected closePurchase_args getEmptyArgsInstance() {
759
        return new closePurchase_args();
760
      }
761
 
762
      protected closePurchase_result getResult(I iface, closePurchase_args args) throws org.apache.thrift.TException {
763
        closePurchase_result result = new closePurchase_result();
764
        try {
765
          result.success = iface.closePurchase(args.purchaseId);
766
          result.setSuccessIsSet(true);
767
        } catch (PurchaseServiceException e) {
768
          result.e = e;
769
        }
770
        return result;
771
      }
772
    }
773
 
774
    private static class getAllPurchases<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getAllPurchases_args> {
775
      public getAllPurchases() {
776
        super("getAllPurchases");
777
      }
778
 
779
      protected getAllPurchases_args getEmptyArgsInstance() {
780
        return new getAllPurchases_args();
781
      }
782
 
783
      protected getAllPurchases_result getResult(I iface, getAllPurchases_args args) throws org.apache.thrift.TException {
784
        getAllPurchases_result result = new getAllPurchases_result();
785
        try {
786
          result.success = iface.getAllPurchases(args.purchaseOrderId, args.open);
787
        } catch (PurchaseServiceException e) {
788
          result.e = e;
789
        }
790
        return result;
791
      }
792
    }
793
 
794
    private static class getPrice<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getPrice_args> {
795
      public getPrice() {
796
        super("getPrice");
797
      }
798
 
799
      protected getPrice_args getEmptyArgsInstance() {
800
        return new getPrice_args();
801
      }
802
 
803
      protected getPrice_result getResult(I iface, getPrice_args args) throws org.apache.thrift.TException {
804
        getPrice_result result = new getPrice_result();
805
        result.success = iface.getPrice(args.purchaseId, args.itemId);
806
        result.setSuccessIsSet(true);
807
        return result;
808
      }
809
    }
810
 
811
  }
812
 
813
  public static class createPurchaseOrder_args implements org.apache.thrift.TBase<createPurchaseOrder_args, createPurchaseOrder_args._Fields>, java.io.Serializable, Cloneable   {
814
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createPurchaseOrder_args");
815
 
816
    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);
817
 
818
    private PurchaseOrder purchaseOrder; // required
819
 
820
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
821
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
822
      PURCHASE_ORDER((short)1, "purchaseOrder");
823
 
824
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
825
 
826
      static {
827
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
828
          byName.put(field.getFieldName(), field);
829
        }
830
      }
831
 
832
      /**
833
       * Find the _Fields constant that matches fieldId, or null if its not found.
834
       */
835
      public static _Fields findByThriftId(int fieldId) {
836
        switch(fieldId) {
837
          case 1: // PURCHASE_ORDER
838
            return PURCHASE_ORDER;
839
          default:
840
            return null;
841
        }
842
      }
843
 
844
      /**
845
       * Find the _Fields constant that matches fieldId, throwing an exception
846
       * if it is not found.
847
       */
848
      public static _Fields findByThriftIdOrThrow(int fieldId) {
849
        _Fields fields = findByThriftId(fieldId);
850
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
851
        return fields;
852
      }
853
 
854
      /**
855
       * Find the _Fields constant that matches name, or null if its not found.
856
       */
857
      public static _Fields findByName(String name) {
858
        return byName.get(name);
859
      }
860
 
861
      private final short _thriftId;
862
      private final String _fieldName;
863
 
864
      _Fields(short thriftId, String fieldName) {
865
        _thriftId = thriftId;
866
        _fieldName = fieldName;
867
      }
868
 
869
      public short getThriftFieldId() {
870
        return _thriftId;
871
      }
872
 
873
      public String getFieldName() {
874
        return _fieldName;
875
      }
876
    }
877
 
878
    // isset id assignments
879
 
880
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
881
    static {
882
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
883
      tmpMap.put(_Fields.PURCHASE_ORDER, new org.apache.thrift.meta_data.FieldMetaData("purchaseOrder", org.apache.thrift.TFieldRequirementType.DEFAULT, 
884
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, PurchaseOrder.class)));
885
      metaDataMap = Collections.unmodifiableMap(tmpMap);
886
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createPurchaseOrder_args.class, metaDataMap);
887
    }
888
 
889
    public createPurchaseOrder_args() {
890
    }
891
 
892
    public createPurchaseOrder_args(
893
      PurchaseOrder purchaseOrder)
894
    {
895
      this();
896
      this.purchaseOrder = purchaseOrder;
897
    }
898
 
899
    /**
900
     * Performs a deep copy on <i>other</i>.
901
     */
902
    public createPurchaseOrder_args(createPurchaseOrder_args other) {
903
      if (other.isSetPurchaseOrder()) {
904
        this.purchaseOrder = new PurchaseOrder(other.purchaseOrder);
905
      }
906
    }
907
 
908
    public createPurchaseOrder_args deepCopy() {
909
      return new createPurchaseOrder_args(this);
910
    }
911
 
912
    @Override
913
    public void clear() {
914
      this.purchaseOrder = null;
915
    }
916
 
917
    public PurchaseOrder getPurchaseOrder() {
918
      return this.purchaseOrder;
919
    }
920
 
921
    public void setPurchaseOrder(PurchaseOrder purchaseOrder) {
922
      this.purchaseOrder = purchaseOrder;
923
    }
924
 
925
    public void unsetPurchaseOrder() {
926
      this.purchaseOrder = null;
927
    }
928
 
929
    /** Returns true if field purchaseOrder is set (has been assigned a value) and false otherwise */
930
    public boolean isSetPurchaseOrder() {
931
      return this.purchaseOrder != null;
932
    }
933
 
934
    public void setPurchaseOrderIsSet(boolean value) {
935
      if (!value) {
936
        this.purchaseOrder = null;
937
      }
938
    }
939
 
940
    public void setFieldValue(_Fields field, Object value) {
941
      switch (field) {
942
      case PURCHASE_ORDER:
943
        if (value == null) {
944
          unsetPurchaseOrder();
945
        } else {
946
          setPurchaseOrder((PurchaseOrder)value);
947
        }
948
        break;
949
 
950
      }
951
    }
952
 
953
    public Object getFieldValue(_Fields field) {
954
      switch (field) {
955
      case PURCHASE_ORDER:
956
        return getPurchaseOrder();
957
 
958
      }
959
      throw new IllegalStateException();
960
    }
961
 
962
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
963
    public boolean isSet(_Fields field) {
964
      if (field == null) {
965
        throw new IllegalArgumentException();
966
      }
967
 
968
      switch (field) {
969
      case PURCHASE_ORDER:
970
        return isSetPurchaseOrder();
971
      }
972
      throw new IllegalStateException();
973
    }
974
 
975
    @Override
976
    public boolean equals(Object that) {
977
      if (that == null)
978
        return false;
979
      if (that instanceof createPurchaseOrder_args)
980
        return this.equals((createPurchaseOrder_args)that);
981
      return false;
982
    }
983
 
984
    public boolean equals(createPurchaseOrder_args that) {
985
      if (that == null)
986
        return false;
987
 
988
      boolean this_present_purchaseOrder = true && this.isSetPurchaseOrder();
989
      boolean that_present_purchaseOrder = true && that.isSetPurchaseOrder();
990
      if (this_present_purchaseOrder || that_present_purchaseOrder) {
991
        if (!(this_present_purchaseOrder && that_present_purchaseOrder))
992
          return false;
993
        if (!this.purchaseOrder.equals(that.purchaseOrder))
994
          return false;
995
      }
996
 
997
      return true;
998
    }
999
 
1000
    @Override
1001
    public int hashCode() {
1002
      return 0;
1003
    }
1004
 
1005
    public int compareTo(createPurchaseOrder_args other) {
1006
      if (!getClass().equals(other.getClass())) {
1007
        return getClass().getName().compareTo(other.getClass().getName());
1008
      }
1009
 
1010
      int lastComparison = 0;
1011
      createPurchaseOrder_args typedOther = (createPurchaseOrder_args)other;
1012
 
1013
      lastComparison = Boolean.valueOf(isSetPurchaseOrder()).compareTo(typedOther.isSetPurchaseOrder());
1014
      if (lastComparison != 0) {
1015
        return lastComparison;
1016
      }
1017
      if (isSetPurchaseOrder()) {
1018
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.purchaseOrder, typedOther.purchaseOrder);
1019
        if (lastComparison != 0) {
1020
          return lastComparison;
1021
        }
1022
      }
1023
      return 0;
1024
    }
1025
 
1026
    public _Fields fieldForId(int fieldId) {
1027
      return _Fields.findByThriftId(fieldId);
1028
    }
1029
 
1030
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
1031
      org.apache.thrift.protocol.TField field;
1032
      iprot.readStructBegin();
1033
      while (true)
1034
      {
1035
        field = iprot.readFieldBegin();
1036
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1037
          break;
1038
        }
1039
        switch (field.id) {
1040
          case 1: // PURCHASE_ORDER
1041
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
1042
              this.purchaseOrder = new PurchaseOrder();
1043
              this.purchaseOrder.read(iprot);
1044
            } else { 
1045
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1046
            }
1047
            break;
1048
          default:
1049
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1050
        }
1051
        iprot.readFieldEnd();
1052
      }
1053
      iprot.readStructEnd();
1054
      validate();
1055
    }
1056
 
1057
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1058
      validate();
1059
 
1060
      oprot.writeStructBegin(STRUCT_DESC);
1061
      if (this.purchaseOrder != null) {
1062
        oprot.writeFieldBegin(PURCHASE_ORDER_FIELD_DESC);
1063
        this.purchaseOrder.write(oprot);
1064
        oprot.writeFieldEnd();
1065
      }
1066
      oprot.writeFieldStop();
1067
      oprot.writeStructEnd();
1068
    }
1069
 
1070
    @Override
1071
    public String toString() {
1072
      StringBuilder sb = new StringBuilder("createPurchaseOrder_args(");
1073
      boolean first = true;
1074
 
1075
      sb.append("purchaseOrder:");
1076
      if (this.purchaseOrder == null) {
1077
        sb.append("null");
1078
      } else {
1079
        sb.append(this.purchaseOrder);
1080
      }
1081
      first = false;
1082
      sb.append(")");
1083
      return sb.toString();
1084
    }
1085
 
1086
    public void validate() throws org.apache.thrift.TException {
1087
      // check for required fields
1088
    }
1089
 
1090
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
1091
      try {
1092
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
1093
      } catch (org.apache.thrift.TException te) {
1094
        throw new java.io.IOException(te);
1095
      }
1096
    }
1097
 
1098
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
1099
      try {
1100
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
1101
      } catch (org.apache.thrift.TException te) {
1102
        throw new java.io.IOException(te);
1103
      }
1104
    }
1105
 
1106
  }
1107
 
1108
  public static class createPurchaseOrder_result implements org.apache.thrift.TBase<createPurchaseOrder_result, createPurchaseOrder_result._Fields>, java.io.Serializable, Cloneable   {
1109
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createPurchaseOrder_result");
1110
 
1111
    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);
1112
    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);
1113
 
1114
    private long success; // required
1115
    private PurchaseServiceException e; // required
1116
 
1117
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
1118
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1119
      SUCCESS((short)0, "success"),
1120
      E((short)1, "e");
1121
 
1122
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
1123
 
1124
      static {
1125
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
1126
          byName.put(field.getFieldName(), field);
1127
        }
1128
      }
1129
 
1130
      /**
1131
       * Find the _Fields constant that matches fieldId, or null if its not found.
1132
       */
1133
      public static _Fields findByThriftId(int fieldId) {
1134
        switch(fieldId) {
1135
          case 0: // SUCCESS
1136
            return SUCCESS;
1137
          case 1: // E
1138
            return E;
1139
          default:
1140
            return null;
1141
        }
1142
      }
1143
 
1144
      /**
1145
       * Find the _Fields constant that matches fieldId, throwing an exception
1146
       * if it is not found.
1147
       */
1148
      public static _Fields findByThriftIdOrThrow(int fieldId) {
1149
        _Fields fields = findByThriftId(fieldId);
1150
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
1151
        return fields;
1152
      }
1153
 
1154
      /**
1155
       * Find the _Fields constant that matches name, or null if its not found.
1156
       */
1157
      public static _Fields findByName(String name) {
1158
        return byName.get(name);
1159
      }
1160
 
1161
      private final short _thriftId;
1162
      private final String _fieldName;
1163
 
1164
      _Fields(short thriftId, String fieldName) {
1165
        _thriftId = thriftId;
1166
        _fieldName = fieldName;
1167
      }
1168
 
1169
      public short getThriftFieldId() {
1170
        return _thriftId;
1171
      }
1172
 
1173
      public String getFieldName() {
1174
        return _fieldName;
1175
      }
1176
    }
1177
 
1178
    // isset id assignments
1179
    private static final int __SUCCESS_ISSET_ID = 0;
1180
    private BitSet __isset_bit_vector = new BitSet(1);
1181
 
1182
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1183
    static {
1184
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
1185
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
1186
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
1187
      tmpMap.put(_Fields.E, new org.apache.thrift.meta_data.FieldMetaData("e", org.apache.thrift.TFieldRequirementType.DEFAULT, 
1188
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
1189
      metaDataMap = Collections.unmodifiableMap(tmpMap);
1190
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createPurchaseOrder_result.class, metaDataMap);
1191
    }
1192
 
1193
    public createPurchaseOrder_result() {
1194
    }
1195
 
1196
    public createPurchaseOrder_result(
1197
      long success,
1198
      PurchaseServiceException e)
1199
    {
1200
      this();
1201
      this.success = success;
1202
      setSuccessIsSet(true);
1203
      this.e = e;
1204
    }
1205
 
1206
    /**
1207
     * Performs a deep copy on <i>other</i>.
1208
     */
1209
    public createPurchaseOrder_result(createPurchaseOrder_result other) {
1210
      __isset_bit_vector.clear();
1211
      __isset_bit_vector.or(other.__isset_bit_vector);
1212
      this.success = other.success;
1213
      if (other.isSetE()) {
1214
        this.e = new PurchaseServiceException(other.e);
1215
      }
1216
    }
1217
 
1218
    public createPurchaseOrder_result deepCopy() {
1219
      return new createPurchaseOrder_result(this);
1220
    }
1221
 
1222
    @Override
1223
    public void clear() {
1224
      setSuccessIsSet(false);
1225
      this.success = 0;
1226
      this.e = null;
1227
    }
1228
 
1229
    public long getSuccess() {
1230
      return this.success;
1231
    }
1232
 
1233
    public void setSuccess(long success) {
1234
      this.success = success;
1235
      setSuccessIsSet(true);
1236
    }
1237
 
1238
    public void unsetSuccess() {
1239
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
1240
    }
1241
 
1242
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
1243
    public boolean isSetSuccess() {
1244
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
1245
    }
1246
 
1247
    public void setSuccessIsSet(boolean value) {
1248
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
1249
    }
1250
 
1251
    public PurchaseServiceException getE() {
1252
      return this.e;
1253
    }
1254
 
1255
    public void setE(PurchaseServiceException e) {
1256
      this.e = e;
1257
    }
1258
 
1259
    public void unsetE() {
1260
      this.e = null;
1261
    }
1262
 
1263
    /** Returns true if field e is set (has been assigned a value) and false otherwise */
1264
    public boolean isSetE() {
1265
      return this.e != null;
1266
    }
1267
 
1268
    public void setEIsSet(boolean value) {
1269
      if (!value) {
1270
        this.e = null;
1271
      }
1272
    }
1273
 
1274
    public void setFieldValue(_Fields field, Object value) {
1275
      switch (field) {
1276
      case SUCCESS:
1277
        if (value == null) {
1278
          unsetSuccess();
1279
        } else {
1280
          setSuccess((Long)value);
1281
        }
1282
        break;
1283
 
1284
      case E:
1285
        if (value == null) {
1286
          unsetE();
1287
        } else {
1288
          setE((PurchaseServiceException)value);
1289
        }
1290
        break;
1291
 
1292
      }
1293
    }
1294
 
1295
    public Object getFieldValue(_Fields field) {
1296
      switch (field) {
1297
      case SUCCESS:
1298
        return Long.valueOf(getSuccess());
1299
 
1300
      case E:
1301
        return getE();
1302
 
1303
      }
1304
      throw new IllegalStateException();
1305
    }
1306
 
1307
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
1308
    public boolean isSet(_Fields field) {
1309
      if (field == null) {
1310
        throw new IllegalArgumentException();
1311
      }
1312
 
1313
      switch (field) {
1314
      case SUCCESS:
1315
        return isSetSuccess();
1316
      case E:
1317
        return isSetE();
1318
      }
1319
      throw new IllegalStateException();
1320
    }
1321
 
1322
    @Override
1323
    public boolean equals(Object that) {
1324
      if (that == null)
1325
        return false;
1326
      if (that instanceof createPurchaseOrder_result)
1327
        return this.equals((createPurchaseOrder_result)that);
1328
      return false;
1329
    }
1330
 
1331
    public boolean equals(createPurchaseOrder_result that) {
1332
      if (that == null)
1333
        return false;
1334
 
1335
      boolean this_present_success = true;
1336
      boolean that_present_success = true;
1337
      if (this_present_success || that_present_success) {
1338
        if (!(this_present_success && that_present_success))
1339
          return false;
1340
        if (this.success != that.success)
1341
          return false;
1342
      }
1343
 
1344
      boolean this_present_e = true && this.isSetE();
1345
      boolean that_present_e = true && that.isSetE();
1346
      if (this_present_e || that_present_e) {
1347
        if (!(this_present_e && that_present_e))
1348
          return false;
1349
        if (!this.e.equals(that.e))
1350
          return false;
1351
      }
1352
 
1353
      return true;
1354
    }
1355
 
1356
    @Override
1357
    public int hashCode() {
1358
      return 0;
1359
    }
1360
 
1361
    public int compareTo(createPurchaseOrder_result other) {
1362
      if (!getClass().equals(other.getClass())) {
1363
        return getClass().getName().compareTo(other.getClass().getName());
1364
      }
1365
 
1366
      int lastComparison = 0;
1367
      createPurchaseOrder_result typedOther = (createPurchaseOrder_result)other;
1368
 
1369
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
1370
      if (lastComparison != 0) {
1371
        return lastComparison;
1372
      }
1373
      if (isSetSuccess()) {
1374
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
1375
        if (lastComparison != 0) {
1376
          return lastComparison;
1377
        }
1378
      }
1379
      lastComparison = Boolean.valueOf(isSetE()).compareTo(typedOther.isSetE());
1380
      if (lastComparison != 0) {
1381
        return lastComparison;
1382
      }
1383
      if (isSetE()) {
1384
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, typedOther.e);
1385
        if (lastComparison != 0) {
1386
          return lastComparison;
1387
        }
1388
      }
1389
      return 0;
1390
    }
1391
 
1392
    public _Fields fieldForId(int fieldId) {
1393
      return _Fields.findByThriftId(fieldId);
1394
    }
1395
 
1396
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
1397
      org.apache.thrift.protocol.TField field;
1398
      iprot.readStructBegin();
1399
      while (true)
1400
      {
1401
        field = iprot.readFieldBegin();
1402
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1403
          break;
1404
        }
1405
        switch (field.id) {
1406
          case 0: // SUCCESS
1407
            if (field.type == org.apache.thrift.protocol.TType.I64) {
1408
              this.success = iprot.readI64();
1409
              setSuccessIsSet(true);
1410
            } else { 
1411
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1412
            }
1413
            break;
1414
          case 1: // E
1415
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
1416
              this.e = new PurchaseServiceException();
1417
              this.e.read(iprot);
1418
            } else { 
1419
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1420
            }
1421
            break;
1422
          default:
1423
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1424
        }
1425
        iprot.readFieldEnd();
1426
      }
1427
      iprot.readStructEnd();
1428
      validate();
1429
    }
1430
 
1431
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1432
      oprot.writeStructBegin(STRUCT_DESC);
1433
 
1434
      if (this.isSetSuccess()) {
1435
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
1436
        oprot.writeI64(this.success);
1437
        oprot.writeFieldEnd();
1438
      } else if (this.isSetE()) {
1439
        oprot.writeFieldBegin(E_FIELD_DESC);
1440
        this.e.write(oprot);
1441
        oprot.writeFieldEnd();
1442
      }
1443
      oprot.writeFieldStop();
1444
      oprot.writeStructEnd();
1445
    }
1446
 
1447
    @Override
1448
    public String toString() {
1449
      StringBuilder sb = new StringBuilder("createPurchaseOrder_result(");
1450
      boolean first = true;
1451
 
1452
      sb.append("success:");
1453
      sb.append(this.success);
1454
      first = false;
1455
      if (!first) sb.append(", ");
1456
      sb.append("e:");
1457
      if (this.e == null) {
1458
        sb.append("null");
1459
      } else {
1460
        sb.append(this.e);
1461
      }
1462
      first = false;
1463
      sb.append(")");
1464
      return sb.toString();
1465
    }
1466
 
1467
    public void validate() throws org.apache.thrift.TException {
1468
      // check for required fields
1469
    }
1470
 
1471
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
1472
      try {
1473
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
1474
      } catch (org.apache.thrift.TException te) {
1475
        throw new java.io.IOException(te);
1476
      }
1477
    }
1478
 
1479
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
1480
      try {
1481
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
1482
      } catch (org.apache.thrift.TException te) {
1483
        throw new java.io.IOException(te);
1484
      }
1485
    }
1486
 
1487
  }
1488
 
1489
  public static class getPurchaseOrder_args implements org.apache.thrift.TBase<getPurchaseOrder_args, getPurchaseOrder_args._Fields>, java.io.Serializable, Cloneable   {
1490
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getPurchaseOrder_args");
1491
 
1492
    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);
1493
 
1494
    private long id; // required
1495
 
1496
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
1497
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1498
      ID((short)1, "id");
1499
 
1500
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
1501
 
1502
      static {
1503
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
1504
          byName.put(field.getFieldName(), field);
1505
        }
1506
      }
1507
 
1508
      /**
1509
       * Find the _Fields constant that matches fieldId, or null if its not found.
1510
       */
1511
      public static _Fields findByThriftId(int fieldId) {
1512
        switch(fieldId) {
1513
          case 1: // ID
1514
            return ID;
1515
          default:
1516
            return null;
1517
        }
1518
      }
1519
 
1520
      /**
1521
       * Find the _Fields constant that matches fieldId, throwing an exception
1522
       * if it is not found.
1523
       */
1524
      public static _Fields findByThriftIdOrThrow(int fieldId) {
1525
        _Fields fields = findByThriftId(fieldId);
1526
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
1527
        return fields;
1528
      }
1529
 
1530
      /**
1531
       * Find the _Fields constant that matches name, or null if its not found.
1532
       */
1533
      public static _Fields findByName(String name) {
1534
        return byName.get(name);
1535
      }
1536
 
1537
      private final short _thriftId;
1538
      private final String _fieldName;
1539
 
1540
      _Fields(short thriftId, String fieldName) {
1541
        _thriftId = thriftId;
1542
        _fieldName = fieldName;
1543
      }
1544
 
1545
      public short getThriftFieldId() {
1546
        return _thriftId;
1547
      }
1548
 
1549
      public String getFieldName() {
1550
        return _fieldName;
1551
      }
1552
    }
1553
 
1554
    // isset id assignments
1555
    private static final int __ID_ISSET_ID = 0;
1556
    private BitSet __isset_bit_vector = new BitSet(1);
1557
 
1558
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1559
    static {
1560
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
1561
      tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
1562
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
1563
      metaDataMap = Collections.unmodifiableMap(tmpMap);
1564
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPurchaseOrder_args.class, metaDataMap);
1565
    }
1566
 
1567
    public getPurchaseOrder_args() {
1568
    }
1569
 
1570
    public getPurchaseOrder_args(
1571
      long id)
1572
    {
1573
      this();
1574
      this.id = id;
1575
      setIdIsSet(true);
1576
    }
1577
 
1578
    /**
1579
     * Performs a deep copy on <i>other</i>.
1580
     */
1581
    public getPurchaseOrder_args(getPurchaseOrder_args other) {
1582
      __isset_bit_vector.clear();
1583
      __isset_bit_vector.or(other.__isset_bit_vector);
1584
      this.id = other.id;
1585
    }
1586
 
1587
    public getPurchaseOrder_args deepCopy() {
1588
      return new getPurchaseOrder_args(this);
1589
    }
1590
 
1591
    @Override
1592
    public void clear() {
1593
      setIdIsSet(false);
1594
      this.id = 0;
1595
    }
1596
 
1597
    public long getId() {
1598
      return this.id;
1599
    }
1600
 
1601
    public void setId(long id) {
1602
      this.id = id;
1603
      setIdIsSet(true);
1604
    }
1605
 
1606
    public void unsetId() {
1607
      __isset_bit_vector.clear(__ID_ISSET_ID);
1608
    }
1609
 
1610
    /** Returns true if field id is set (has been assigned a value) and false otherwise */
1611
    public boolean isSetId() {
1612
      return __isset_bit_vector.get(__ID_ISSET_ID);
1613
    }
1614
 
1615
    public void setIdIsSet(boolean value) {
1616
      __isset_bit_vector.set(__ID_ISSET_ID, value);
1617
    }
1618
 
1619
    public void setFieldValue(_Fields field, Object value) {
1620
      switch (field) {
1621
      case ID:
1622
        if (value == null) {
1623
          unsetId();
1624
        } else {
1625
          setId((Long)value);
1626
        }
1627
        break;
1628
 
1629
      }
1630
    }
1631
 
1632
    public Object getFieldValue(_Fields field) {
1633
      switch (field) {
1634
      case ID:
1635
        return Long.valueOf(getId());
1636
 
1637
      }
1638
      throw new IllegalStateException();
1639
    }
1640
 
1641
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
1642
    public boolean isSet(_Fields field) {
1643
      if (field == null) {
1644
        throw new IllegalArgumentException();
1645
      }
1646
 
1647
      switch (field) {
1648
      case ID:
1649
        return isSetId();
1650
      }
1651
      throw new IllegalStateException();
1652
    }
1653
 
1654
    @Override
1655
    public boolean equals(Object that) {
1656
      if (that == null)
1657
        return false;
1658
      if (that instanceof getPurchaseOrder_args)
1659
        return this.equals((getPurchaseOrder_args)that);
1660
      return false;
1661
    }
1662
 
1663
    public boolean equals(getPurchaseOrder_args that) {
1664
      if (that == null)
1665
        return false;
1666
 
1667
      boolean this_present_id = true;
1668
      boolean that_present_id = true;
1669
      if (this_present_id || that_present_id) {
1670
        if (!(this_present_id && that_present_id))
1671
          return false;
1672
        if (this.id != that.id)
1673
          return false;
1674
      }
1675
 
1676
      return true;
1677
    }
1678
 
1679
    @Override
1680
    public int hashCode() {
1681
      return 0;
1682
    }
1683
 
1684
    public int compareTo(getPurchaseOrder_args other) {
1685
      if (!getClass().equals(other.getClass())) {
1686
        return getClass().getName().compareTo(other.getClass().getName());
1687
      }
1688
 
1689
      int lastComparison = 0;
1690
      getPurchaseOrder_args typedOther = (getPurchaseOrder_args)other;
1691
 
1692
      lastComparison = Boolean.valueOf(isSetId()).compareTo(typedOther.isSetId());
1693
      if (lastComparison != 0) {
1694
        return lastComparison;
1695
      }
1696
      if (isSetId()) {
1697
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, typedOther.id);
1698
        if (lastComparison != 0) {
1699
          return lastComparison;
1700
        }
1701
      }
1702
      return 0;
1703
    }
1704
 
1705
    public _Fields fieldForId(int fieldId) {
1706
      return _Fields.findByThriftId(fieldId);
1707
    }
1708
 
1709
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
1710
      org.apache.thrift.protocol.TField field;
1711
      iprot.readStructBegin();
1712
      while (true)
1713
      {
1714
        field = iprot.readFieldBegin();
1715
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1716
          break;
1717
        }
1718
        switch (field.id) {
1719
          case 1: // ID
1720
            if (field.type == org.apache.thrift.protocol.TType.I64) {
1721
              this.id = iprot.readI64();
1722
              setIdIsSet(true);
1723
            } else { 
1724
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1725
            }
1726
            break;
1727
          default:
1728
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1729
        }
1730
        iprot.readFieldEnd();
1731
      }
1732
      iprot.readStructEnd();
1733
      validate();
1734
    }
1735
 
1736
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1737
      validate();
1738
 
1739
      oprot.writeStructBegin(STRUCT_DESC);
1740
      oprot.writeFieldBegin(ID_FIELD_DESC);
1741
      oprot.writeI64(this.id);
1742
      oprot.writeFieldEnd();
1743
      oprot.writeFieldStop();
1744
      oprot.writeStructEnd();
1745
    }
1746
 
1747
    @Override
1748
    public String toString() {
1749
      StringBuilder sb = new StringBuilder("getPurchaseOrder_args(");
1750
      boolean first = true;
1751
 
1752
      sb.append("id:");
1753
      sb.append(this.id);
1754
      first = false;
1755
      sb.append(")");
1756
      return sb.toString();
1757
    }
1758
 
1759
    public void validate() throws org.apache.thrift.TException {
1760
      // check for required fields
1761
    }
1762
 
1763
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
1764
      try {
1765
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
1766
      } catch (org.apache.thrift.TException te) {
1767
        throw new java.io.IOException(te);
1768
      }
1769
    }
1770
 
1771
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
1772
      try {
1773
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
1774
      } catch (org.apache.thrift.TException te) {
1775
        throw new java.io.IOException(te);
1776
      }
1777
    }
1778
 
1779
  }
1780
 
1781
  public static class getPurchaseOrder_result implements org.apache.thrift.TBase<getPurchaseOrder_result, getPurchaseOrder_result._Fields>, java.io.Serializable, Cloneable   {
1782
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getPurchaseOrder_result");
1783
 
1784
    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);
1785
    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);
1786
 
1787
    private PurchaseOrder success; // required
1788
    private PurchaseServiceException e; // required
1789
 
1790
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
1791
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1792
      SUCCESS((short)0, "success"),
1793
      E((short)1, "e");
1794
 
1795
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
1796
 
1797
      static {
1798
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
1799
          byName.put(field.getFieldName(), field);
1800
        }
1801
      }
1802
 
1803
      /**
1804
       * Find the _Fields constant that matches fieldId, or null if its not found.
1805
       */
1806
      public static _Fields findByThriftId(int fieldId) {
1807
        switch(fieldId) {
1808
          case 0: // SUCCESS
1809
            return SUCCESS;
1810
          case 1: // E
1811
            return E;
1812
          default:
1813
            return null;
1814
        }
1815
      }
1816
 
1817
      /**
1818
       * Find the _Fields constant that matches fieldId, throwing an exception
1819
       * if it is not found.
1820
       */
1821
      public static _Fields findByThriftIdOrThrow(int fieldId) {
1822
        _Fields fields = findByThriftId(fieldId);
1823
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
1824
        return fields;
1825
      }
1826
 
1827
      /**
1828
       * Find the _Fields constant that matches name, or null if its not found.
1829
       */
1830
      public static _Fields findByName(String name) {
1831
        return byName.get(name);
1832
      }
1833
 
1834
      private final short _thriftId;
1835
      private final String _fieldName;
1836
 
1837
      _Fields(short thriftId, String fieldName) {
1838
        _thriftId = thriftId;
1839
        _fieldName = fieldName;
1840
      }
1841
 
1842
      public short getThriftFieldId() {
1843
        return _thriftId;
1844
      }
1845
 
1846
      public String getFieldName() {
1847
        return _fieldName;
1848
      }
1849
    }
1850
 
1851
    // isset id assignments
1852
 
1853
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1854
    static {
1855
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
1856
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
1857
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, PurchaseOrder.class)));
1858
      tmpMap.put(_Fields.E, new org.apache.thrift.meta_data.FieldMetaData("e", org.apache.thrift.TFieldRequirementType.DEFAULT, 
1859
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
1860
      metaDataMap = Collections.unmodifiableMap(tmpMap);
1861
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPurchaseOrder_result.class, metaDataMap);
1862
    }
1863
 
1864
    public getPurchaseOrder_result() {
1865
    }
1866
 
1867
    public getPurchaseOrder_result(
1868
      PurchaseOrder success,
1869
      PurchaseServiceException e)
1870
    {
1871
      this();
1872
      this.success = success;
1873
      this.e = e;
1874
    }
1875
 
1876
    /**
1877
     * Performs a deep copy on <i>other</i>.
1878
     */
1879
    public getPurchaseOrder_result(getPurchaseOrder_result other) {
1880
      if (other.isSetSuccess()) {
1881
        this.success = new PurchaseOrder(other.success);
1882
      }
1883
      if (other.isSetE()) {
1884
        this.e = new PurchaseServiceException(other.e);
1885
      }
1886
    }
1887
 
1888
    public getPurchaseOrder_result deepCopy() {
1889
      return new getPurchaseOrder_result(this);
1890
    }
1891
 
1892
    @Override
1893
    public void clear() {
1894
      this.success = null;
1895
      this.e = null;
1896
    }
1897
 
1898
    public PurchaseOrder getSuccess() {
1899
      return this.success;
1900
    }
1901
 
1902
    public void setSuccess(PurchaseOrder success) {
1903
      this.success = success;
1904
    }
1905
 
1906
    public void unsetSuccess() {
1907
      this.success = null;
1908
    }
1909
 
1910
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
1911
    public boolean isSetSuccess() {
1912
      return this.success != null;
1913
    }
1914
 
1915
    public void setSuccessIsSet(boolean value) {
1916
      if (!value) {
1917
        this.success = null;
1918
      }
1919
    }
1920
 
1921
    public PurchaseServiceException getE() {
1922
      return this.e;
1923
    }
1924
 
1925
    public void setE(PurchaseServiceException e) {
1926
      this.e = e;
1927
    }
1928
 
1929
    public void unsetE() {
1930
      this.e = null;
1931
    }
1932
 
1933
    /** Returns true if field e is set (has been assigned a value) and false otherwise */
1934
    public boolean isSetE() {
1935
      return this.e != null;
1936
    }
1937
 
1938
    public void setEIsSet(boolean value) {
1939
      if (!value) {
1940
        this.e = null;
1941
      }
1942
    }
1943
 
1944
    public void setFieldValue(_Fields field, Object value) {
1945
      switch (field) {
1946
      case SUCCESS:
1947
        if (value == null) {
1948
          unsetSuccess();
1949
        } else {
1950
          setSuccess((PurchaseOrder)value);
1951
        }
1952
        break;
1953
 
1954
      case E:
1955
        if (value == null) {
1956
          unsetE();
1957
        } else {
1958
          setE((PurchaseServiceException)value);
1959
        }
1960
        break;
1961
 
1962
      }
1963
    }
1964
 
1965
    public Object getFieldValue(_Fields field) {
1966
      switch (field) {
1967
      case SUCCESS:
1968
        return getSuccess();
1969
 
1970
      case E:
1971
        return getE();
1972
 
1973
      }
1974
      throw new IllegalStateException();
1975
    }
1976
 
1977
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
1978
    public boolean isSet(_Fields field) {
1979
      if (field == null) {
1980
        throw new IllegalArgumentException();
1981
      }
1982
 
1983
      switch (field) {
1984
      case SUCCESS:
1985
        return isSetSuccess();
1986
      case E:
1987
        return isSetE();
1988
      }
1989
      throw new IllegalStateException();
1990
    }
1991
 
1992
    @Override
1993
    public boolean equals(Object that) {
1994
      if (that == null)
1995
        return false;
1996
      if (that instanceof getPurchaseOrder_result)
1997
        return this.equals((getPurchaseOrder_result)that);
1998
      return false;
1999
    }
2000
 
2001
    public boolean equals(getPurchaseOrder_result that) {
2002
      if (that == null)
2003
        return false;
2004
 
2005
      boolean this_present_success = true && this.isSetSuccess();
2006
      boolean that_present_success = true && that.isSetSuccess();
2007
      if (this_present_success || that_present_success) {
2008
        if (!(this_present_success && that_present_success))
2009
          return false;
2010
        if (!this.success.equals(that.success))
2011
          return false;
2012
      }
2013
 
2014
      boolean this_present_e = true && this.isSetE();
2015
      boolean that_present_e = true && that.isSetE();
2016
      if (this_present_e || that_present_e) {
2017
        if (!(this_present_e && that_present_e))
2018
          return false;
2019
        if (!this.e.equals(that.e))
2020
          return false;
2021
      }
2022
 
2023
      return true;
2024
    }
2025
 
2026
    @Override
2027
    public int hashCode() {
2028
      return 0;
2029
    }
2030
 
2031
    public int compareTo(getPurchaseOrder_result other) {
2032
      if (!getClass().equals(other.getClass())) {
2033
        return getClass().getName().compareTo(other.getClass().getName());
2034
      }
2035
 
2036
      int lastComparison = 0;
2037
      getPurchaseOrder_result typedOther = (getPurchaseOrder_result)other;
2038
 
2039
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
2040
      if (lastComparison != 0) {
2041
        return lastComparison;
2042
      }
2043
      if (isSetSuccess()) {
2044
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
2045
        if (lastComparison != 0) {
2046
          return lastComparison;
2047
        }
2048
      }
2049
      lastComparison = Boolean.valueOf(isSetE()).compareTo(typedOther.isSetE());
2050
      if (lastComparison != 0) {
2051
        return lastComparison;
2052
      }
2053
      if (isSetE()) {
2054
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, typedOther.e);
2055
        if (lastComparison != 0) {
2056
          return lastComparison;
2057
        }
2058
      }
2059
      return 0;
2060
    }
2061
 
2062
    public _Fields fieldForId(int fieldId) {
2063
      return _Fields.findByThriftId(fieldId);
2064
    }
2065
 
2066
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
2067
      org.apache.thrift.protocol.TField field;
2068
      iprot.readStructBegin();
2069
      while (true)
2070
      {
2071
        field = iprot.readFieldBegin();
2072
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
2073
          break;
2074
        }
2075
        switch (field.id) {
2076
          case 0: // SUCCESS
2077
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
2078
              this.success = new PurchaseOrder();
2079
              this.success.read(iprot);
2080
            } else { 
2081
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2082
            }
2083
            break;
2084
          case 1: // E
2085
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
2086
              this.e = new PurchaseServiceException();
2087
              this.e.read(iprot);
2088
            } else { 
2089
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2090
            }
2091
            break;
2092
          default:
2093
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2094
        }
2095
        iprot.readFieldEnd();
2096
      }
2097
      iprot.readStructEnd();
2098
      validate();
2099
    }
2100
 
2101
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
2102
      oprot.writeStructBegin(STRUCT_DESC);
2103
 
2104
      if (this.isSetSuccess()) {
2105
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
2106
        this.success.write(oprot);
2107
        oprot.writeFieldEnd();
2108
      } else if (this.isSetE()) {
2109
        oprot.writeFieldBegin(E_FIELD_DESC);
2110
        this.e.write(oprot);
2111
        oprot.writeFieldEnd();
2112
      }
2113
      oprot.writeFieldStop();
2114
      oprot.writeStructEnd();
2115
    }
2116
 
2117
    @Override
2118
    public String toString() {
2119
      StringBuilder sb = new StringBuilder("getPurchaseOrder_result(");
2120
      boolean first = true;
2121
 
2122
      sb.append("success:");
2123
      if (this.success == null) {
2124
        sb.append("null");
2125
      } else {
2126
        sb.append(this.success);
2127
      }
2128
      first = false;
2129
      if (!first) sb.append(", ");
2130
      sb.append("e:");
2131
      if (this.e == null) {
2132
        sb.append("null");
2133
      } else {
2134
        sb.append(this.e);
2135
      }
2136
      first = false;
2137
      sb.append(")");
2138
      return sb.toString();
2139
    }
2140
 
2141
    public void validate() throws org.apache.thrift.TException {
2142
      // check for required fields
2143
    }
2144
 
2145
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
2146
      try {
2147
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
2148
      } catch (org.apache.thrift.TException te) {
2149
        throw new java.io.IOException(te);
2150
      }
2151
    }
2152
 
2153
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
2154
      try {
2155
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
2156
      } catch (org.apache.thrift.TException te) {
2157
        throw new java.io.IOException(te);
2158
      }
2159
    }
2160
 
2161
  }
2162
 
2163
  public static class getAllPurchaseOrders_args implements org.apache.thrift.TBase<getAllPurchaseOrders_args, getAllPurchaseOrders_args._Fields>, java.io.Serializable, Cloneable   {
2164
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllPurchaseOrders_args");
2165
 
2166
    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);
2167
 
2168
    private POStatus status; // required
2169
 
2170
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
2171
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
2172
      /**
2173
       * 
2174
       * @see POStatus
2175
       */
2176
      STATUS((short)1, "status");
2177
 
2178
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
2179
 
2180
      static {
2181
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
2182
          byName.put(field.getFieldName(), field);
2183
        }
2184
      }
2185
 
2186
      /**
2187
       * Find the _Fields constant that matches fieldId, or null if its not found.
2188
       */
2189
      public static _Fields findByThriftId(int fieldId) {
2190
        switch(fieldId) {
2191
          case 1: // STATUS
2192
            return STATUS;
2193
          default:
2194
            return null;
2195
        }
2196
      }
2197
 
2198
      /**
2199
       * Find the _Fields constant that matches fieldId, throwing an exception
2200
       * if it is not found.
2201
       */
2202
      public static _Fields findByThriftIdOrThrow(int fieldId) {
2203
        _Fields fields = findByThriftId(fieldId);
2204
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
2205
        return fields;
2206
      }
2207
 
2208
      /**
2209
       * Find the _Fields constant that matches name, or null if its not found.
2210
       */
2211
      public static _Fields findByName(String name) {
2212
        return byName.get(name);
2213
      }
2214
 
2215
      private final short _thriftId;
2216
      private final String _fieldName;
2217
 
2218
      _Fields(short thriftId, String fieldName) {
2219
        _thriftId = thriftId;
2220
        _fieldName = fieldName;
2221
      }
2222
 
2223
      public short getThriftFieldId() {
2224
        return _thriftId;
2225
      }
2226
 
2227
      public String getFieldName() {
2228
        return _fieldName;
2229
      }
2230
    }
2231
 
2232
    // isset id assignments
2233
 
2234
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
2235
    static {
2236
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
2237
      tmpMap.put(_Fields.STATUS, new org.apache.thrift.meta_data.FieldMetaData("status", org.apache.thrift.TFieldRequirementType.DEFAULT, 
2238
          new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, POStatus.class)));
2239
      metaDataMap = Collections.unmodifiableMap(tmpMap);
2240
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllPurchaseOrders_args.class, metaDataMap);
2241
    }
2242
 
2243
    public getAllPurchaseOrders_args() {
2244
    }
2245
 
2246
    public getAllPurchaseOrders_args(
2247
      POStatus status)
2248
    {
2249
      this();
2250
      this.status = status;
2251
    }
2252
 
2253
    /**
2254
     * Performs a deep copy on <i>other</i>.
2255
     */
2256
    public getAllPurchaseOrders_args(getAllPurchaseOrders_args other) {
2257
      if (other.isSetStatus()) {
2258
        this.status = other.status;
2259
      }
2260
    }
2261
 
2262
    public getAllPurchaseOrders_args deepCopy() {
2263
      return new getAllPurchaseOrders_args(this);
2264
    }
2265
 
2266
    @Override
2267
    public void clear() {
2268
      this.status = null;
2269
    }
2270
 
2271
    /**
2272
     * 
2273
     * @see POStatus
2274
     */
2275
    public POStatus getStatus() {
2276
      return this.status;
2277
    }
2278
 
2279
    /**
2280
     * 
2281
     * @see POStatus
2282
     */
2283
    public void setStatus(POStatus status) {
2284
      this.status = status;
2285
    }
2286
 
2287
    public void unsetStatus() {
2288
      this.status = null;
2289
    }
2290
 
2291
    /** Returns true if field status is set (has been assigned a value) and false otherwise */
2292
    public boolean isSetStatus() {
2293
      return this.status != null;
2294
    }
2295
 
2296
    public void setStatusIsSet(boolean value) {
2297
      if (!value) {
2298
        this.status = null;
2299
      }
2300
    }
2301
 
2302
    public void setFieldValue(_Fields field, Object value) {
2303
      switch (field) {
2304
      case STATUS:
2305
        if (value == null) {
2306
          unsetStatus();
2307
        } else {
2308
          setStatus((POStatus)value);
2309
        }
2310
        break;
2311
 
2312
      }
2313
    }
2314
 
2315
    public Object getFieldValue(_Fields field) {
2316
      switch (field) {
2317
      case STATUS:
2318
        return getStatus();
2319
 
2320
      }
2321
      throw new IllegalStateException();
2322
    }
2323
 
2324
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
2325
    public boolean isSet(_Fields field) {
2326
      if (field == null) {
2327
        throw new IllegalArgumentException();
2328
      }
2329
 
2330
      switch (field) {
2331
      case STATUS:
2332
        return isSetStatus();
2333
      }
2334
      throw new IllegalStateException();
2335
    }
2336
 
2337
    @Override
2338
    public boolean equals(Object that) {
2339
      if (that == null)
2340
        return false;
2341
      if (that instanceof getAllPurchaseOrders_args)
2342
        return this.equals((getAllPurchaseOrders_args)that);
2343
      return false;
2344
    }
2345
 
2346
    public boolean equals(getAllPurchaseOrders_args that) {
2347
      if (that == null)
2348
        return false;
2349
 
2350
      boolean this_present_status = true && this.isSetStatus();
2351
      boolean that_present_status = true && that.isSetStatus();
2352
      if (this_present_status || that_present_status) {
2353
        if (!(this_present_status && that_present_status))
2354
          return false;
2355
        if (!this.status.equals(that.status))
2356
          return false;
2357
      }
2358
 
2359
      return true;
2360
    }
2361
 
2362
    @Override
2363
    public int hashCode() {
2364
      return 0;
2365
    }
2366
 
2367
    public int compareTo(getAllPurchaseOrders_args other) {
2368
      if (!getClass().equals(other.getClass())) {
2369
        return getClass().getName().compareTo(other.getClass().getName());
2370
      }
2371
 
2372
      int lastComparison = 0;
2373
      getAllPurchaseOrders_args typedOther = (getAllPurchaseOrders_args)other;
2374
 
2375
      lastComparison = Boolean.valueOf(isSetStatus()).compareTo(typedOther.isSetStatus());
2376
      if (lastComparison != 0) {
2377
        return lastComparison;
2378
      }
2379
      if (isSetStatus()) {
2380
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, typedOther.status);
2381
        if (lastComparison != 0) {
2382
          return lastComparison;
2383
        }
2384
      }
2385
      return 0;
2386
    }
2387
 
2388
    public _Fields fieldForId(int fieldId) {
2389
      return _Fields.findByThriftId(fieldId);
2390
    }
2391
 
2392
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
2393
      org.apache.thrift.protocol.TField field;
2394
      iprot.readStructBegin();
2395
      while (true)
2396
      {
2397
        field = iprot.readFieldBegin();
2398
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
2399
          break;
2400
        }
2401
        switch (field.id) {
2402
          case 1: // STATUS
2403
            if (field.type == org.apache.thrift.protocol.TType.I32) {
2404
              this.status = POStatus.findByValue(iprot.readI32());
2405
            } else { 
2406
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2407
            }
2408
            break;
2409
          default:
2410
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2411
        }
2412
        iprot.readFieldEnd();
2413
      }
2414
      iprot.readStructEnd();
2415
      validate();
2416
    }
2417
 
2418
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
2419
      validate();
2420
 
2421
      oprot.writeStructBegin(STRUCT_DESC);
2422
      if (this.status != null) {
2423
        oprot.writeFieldBegin(STATUS_FIELD_DESC);
2424
        oprot.writeI32(this.status.getValue());
2425
        oprot.writeFieldEnd();
2426
      }
2427
      oprot.writeFieldStop();
2428
      oprot.writeStructEnd();
2429
    }
2430
 
2431
    @Override
2432
    public String toString() {
2433
      StringBuilder sb = new StringBuilder("getAllPurchaseOrders_args(");
2434
      boolean first = true;
2435
 
2436
      sb.append("status:");
2437
      if (this.status == null) {
2438
        sb.append("null");
2439
      } else {
2440
        sb.append(this.status);
2441
      }
2442
      first = false;
2443
      sb.append(")");
2444
      return sb.toString();
2445
    }
2446
 
2447
    public void validate() throws org.apache.thrift.TException {
2448
      // check for required fields
2449
    }
2450
 
2451
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
2452
      try {
2453
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
2454
      } catch (org.apache.thrift.TException te) {
2455
        throw new java.io.IOException(te);
2456
      }
2457
    }
2458
 
2459
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
2460
      try {
2461
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
2462
      } catch (org.apache.thrift.TException te) {
2463
        throw new java.io.IOException(te);
2464
      }
2465
    }
2466
 
2467
  }
2468
 
2469
  public static class getAllPurchaseOrders_result implements org.apache.thrift.TBase<getAllPurchaseOrders_result, getAllPurchaseOrders_result._Fields>, java.io.Serializable, Cloneable   {
2470
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllPurchaseOrders_result");
2471
 
2472
    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);
2473
    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);
2474
 
2475
    private List<PurchaseOrder> success; // required
2476
    private PurchaseServiceException e; // required
2477
 
2478
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
2479
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
2480
      SUCCESS((short)0, "success"),
2481
      E((short)1, "e");
2482
 
2483
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
2484
 
2485
      static {
2486
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
2487
          byName.put(field.getFieldName(), field);
2488
        }
2489
      }
2490
 
2491
      /**
2492
       * Find the _Fields constant that matches fieldId, or null if its not found.
2493
       */
2494
      public static _Fields findByThriftId(int fieldId) {
2495
        switch(fieldId) {
2496
          case 0: // SUCCESS
2497
            return SUCCESS;
2498
          case 1: // E
2499
            return E;
2500
          default:
2501
            return null;
2502
        }
2503
      }
2504
 
2505
      /**
2506
       * Find the _Fields constant that matches fieldId, throwing an exception
2507
       * if it is not found.
2508
       */
2509
      public static _Fields findByThriftIdOrThrow(int fieldId) {
2510
        _Fields fields = findByThriftId(fieldId);
2511
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
2512
        return fields;
2513
      }
2514
 
2515
      /**
2516
       * Find the _Fields constant that matches name, or null if its not found.
2517
       */
2518
      public static _Fields findByName(String name) {
2519
        return byName.get(name);
2520
      }
2521
 
2522
      private final short _thriftId;
2523
      private final String _fieldName;
2524
 
2525
      _Fields(short thriftId, String fieldName) {
2526
        _thriftId = thriftId;
2527
        _fieldName = fieldName;
2528
      }
2529
 
2530
      public short getThriftFieldId() {
2531
        return _thriftId;
2532
      }
2533
 
2534
      public String getFieldName() {
2535
        return _fieldName;
2536
      }
2537
    }
2538
 
2539
    // isset id assignments
2540
 
2541
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
2542
    static {
2543
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
2544
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
2545
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
2546
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, PurchaseOrder.class))));
2547
      tmpMap.put(_Fields.E, new org.apache.thrift.meta_data.FieldMetaData("e", org.apache.thrift.TFieldRequirementType.DEFAULT, 
2548
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
2549
      metaDataMap = Collections.unmodifiableMap(tmpMap);
2550
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllPurchaseOrders_result.class, metaDataMap);
2551
    }
2552
 
2553
    public getAllPurchaseOrders_result() {
2554
    }
2555
 
2556
    public getAllPurchaseOrders_result(
2557
      List<PurchaseOrder> success,
2558
      PurchaseServiceException e)
2559
    {
2560
      this();
2561
      this.success = success;
2562
      this.e = e;
2563
    }
2564
 
2565
    /**
2566
     * Performs a deep copy on <i>other</i>.
2567
     */
2568
    public getAllPurchaseOrders_result(getAllPurchaseOrders_result other) {
2569
      if (other.isSetSuccess()) {
2570
        List<PurchaseOrder> __this__success = new ArrayList<PurchaseOrder>();
2571
        for (PurchaseOrder other_element : other.success) {
2572
          __this__success.add(new PurchaseOrder(other_element));
2573
        }
2574
        this.success = __this__success;
2575
      }
2576
      if (other.isSetE()) {
2577
        this.e = new PurchaseServiceException(other.e);
2578
      }
2579
    }
2580
 
2581
    public getAllPurchaseOrders_result deepCopy() {
2582
      return new getAllPurchaseOrders_result(this);
2583
    }
2584
 
2585
    @Override
2586
    public void clear() {
2587
      this.success = null;
2588
      this.e = null;
2589
    }
2590
 
2591
    public int getSuccessSize() {
2592
      return (this.success == null) ? 0 : this.success.size();
2593
    }
2594
 
2595
    public java.util.Iterator<PurchaseOrder> getSuccessIterator() {
2596
      return (this.success == null) ? null : this.success.iterator();
2597
    }
2598
 
2599
    public void addToSuccess(PurchaseOrder elem) {
2600
      if (this.success == null) {
2601
        this.success = new ArrayList<PurchaseOrder>();
2602
      }
2603
      this.success.add(elem);
2604
    }
2605
 
2606
    public List<PurchaseOrder> getSuccess() {
2607
      return this.success;
2608
    }
2609
 
2610
    public void setSuccess(List<PurchaseOrder> success) {
2611
      this.success = success;
2612
    }
2613
 
2614
    public void unsetSuccess() {
2615
      this.success = null;
2616
    }
2617
 
2618
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
2619
    public boolean isSetSuccess() {
2620
      return this.success != null;
2621
    }
2622
 
2623
    public void setSuccessIsSet(boolean value) {
2624
      if (!value) {
2625
        this.success = null;
2626
      }
2627
    }
2628
 
2629
    public PurchaseServiceException getE() {
2630
      return this.e;
2631
    }
2632
 
2633
    public void setE(PurchaseServiceException e) {
2634
      this.e = e;
2635
    }
2636
 
2637
    public void unsetE() {
2638
      this.e = null;
2639
    }
2640
 
2641
    /** Returns true if field e is set (has been assigned a value) and false otherwise */
2642
    public boolean isSetE() {
2643
      return this.e != null;
2644
    }
2645
 
2646
    public void setEIsSet(boolean value) {
2647
      if (!value) {
2648
        this.e = null;
2649
      }
2650
    }
2651
 
2652
    public void setFieldValue(_Fields field, Object value) {
2653
      switch (field) {
2654
      case SUCCESS:
2655
        if (value == null) {
2656
          unsetSuccess();
2657
        } else {
2658
          setSuccess((List<PurchaseOrder>)value);
2659
        }
2660
        break;
2661
 
2662
      case E:
2663
        if (value == null) {
2664
          unsetE();
2665
        } else {
2666
          setE((PurchaseServiceException)value);
2667
        }
2668
        break;
2669
 
2670
      }
2671
    }
2672
 
2673
    public Object getFieldValue(_Fields field) {
2674
      switch (field) {
2675
      case SUCCESS:
2676
        return getSuccess();
2677
 
2678
      case E:
2679
        return getE();
2680
 
2681
      }
2682
      throw new IllegalStateException();
2683
    }
2684
 
2685
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
2686
    public boolean isSet(_Fields field) {
2687
      if (field == null) {
2688
        throw new IllegalArgumentException();
2689
      }
2690
 
2691
      switch (field) {
2692
      case SUCCESS:
2693
        return isSetSuccess();
2694
      case E:
2695
        return isSetE();
2696
      }
2697
      throw new IllegalStateException();
2698
    }
2699
 
2700
    @Override
2701
    public boolean equals(Object that) {
2702
      if (that == null)
2703
        return false;
2704
      if (that instanceof getAllPurchaseOrders_result)
2705
        return this.equals((getAllPurchaseOrders_result)that);
2706
      return false;
2707
    }
2708
 
2709
    public boolean equals(getAllPurchaseOrders_result that) {
2710
      if (that == null)
2711
        return false;
2712
 
2713
      boolean this_present_success = true && this.isSetSuccess();
2714
      boolean that_present_success = true && that.isSetSuccess();
2715
      if (this_present_success || that_present_success) {
2716
        if (!(this_present_success && that_present_success))
2717
          return false;
2718
        if (!this.success.equals(that.success))
2719
          return false;
2720
      }
2721
 
2722
      boolean this_present_e = true && this.isSetE();
2723
      boolean that_present_e = true && that.isSetE();
2724
      if (this_present_e || that_present_e) {
2725
        if (!(this_present_e && that_present_e))
2726
          return false;
2727
        if (!this.e.equals(that.e))
2728
          return false;
2729
      }
2730
 
2731
      return true;
2732
    }
2733
 
2734
    @Override
2735
    public int hashCode() {
2736
      return 0;
2737
    }
2738
 
2739
    public int compareTo(getAllPurchaseOrders_result other) {
2740
      if (!getClass().equals(other.getClass())) {
2741
        return getClass().getName().compareTo(other.getClass().getName());
2742
      }
2743
 
2744
      int lastComparison = 0;
2745
      getAllPurchaseOrders_result typedOther = (getAllPurchaseOrders_result)other;
2746
 
2747
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
2748
      if (lastComparison != 0) {
2749
        return lastComparison;
2750
      }
2751
      if (isSetSuccess()) {
2752
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
2753
        if (lastComparison != 0) {
2754
          return lastComparison;
2755
        }
2756
      }
2757
      lastComparison = Boolean.valueOf(isSetE()).compareTo(typedOther.isSetE());
2758
      if (lastComparison != 0) {
2759
        return lastComparison;
2760
      }
2761
      if (isSetE()) {
2762
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, typedOther.e);
2763
        if (lastComparison != 0) {
2764
          return lastComparison;
2765
        }
2766
      }
2767
      return 0;
2768
    }
2769
 
2770
    public _Fields fieldForId(int fieldId) {
2771
      return _Fields.findByThriftId(fieldId);
2772
    }
2773
 
2774
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
2775
      org.apache.thrift.protocol.TField field;
2776
      iprot.readStructBegin();
2777
      while (true)
2778
      {
2779
        field = iprot.readFieldBegin();
2780
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
2781
          break;
2782
        }
2783
        switch (field.id) {
2784
          case 0: // SUCCESS
2785
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
2786
              {
2787
                org.apache.thrift.protocol.TList _list4 = iprot.readListBegin();
2788
                this.success = new ArrayList<PurchaseOrder>(_list4.size);
2789
                for (int _i5 = 0; _i5 < _list4.size; ++_i5)
2790
                {
2791
                  PurchaseOrder _elem6; // required
2792
                  _elem6 = new PurchaseOrder();
2793
                  _elem6.read(iprot);
2794
                  this.success.add(_elem6);
2795
                }
2796
                iprot.readListEnd();
2797
              }
2798
            } else { 
2799
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2800
            }
2801
            break;
2802
          case 1: // E
2803
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
2804
              this.e = new PurchaseServiceException();
2805
              this.e.read(iprot);
2806
            } else { 
2807
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2808
            }
2809
            break;
2810
          default:
2811
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2812
        }
2813
        iprot.readFieldEnd();
2814
      }
2815
      iprot.readStructEnd();
2816
      validate();
2817
    }
2818
 
2819
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
2820
      oprot.writeStructBegin(STRUCT_DESC);
2821
 
2822
      if (this.isSetSuccess()) {
2823
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
2824
        {
2825
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
2826
          for (PurchaseOrder _iter7 : this.success)
2827
          {
2828
            _iter7.write(oprot);
2829
          }
2830
          oprot.writeListEnd();
2831
        }
2832
        oprot.writeFieldEnd();
2833
      } else if (this.isSetE()) {
2834
        oprot.writeFieldBegin(E_FIELD_DESC);
2835
        this.e.write(oprot);
2836
        oprot.writeFieldEnd();
2837
      }
2838
      oprot.writeFieldStop();
2839
      oprot.writeStructEnd();
2840
    }
2841
 
2842
    @Override
2843
    public String toString() {
2844
      StringBuilder sb = new StringBuilder("getAllPurchaseOrders_result(");
2845
      boolean first = true;
2846
 
2847
      sb.append("success:");
2848
      if (this.success == null) {
2849
        sb.append("null");
2850
      } else {
2851
        sb.append(this.success);
2852
      }
2853
      first = false;
2854
      if (!first) sb.append(", ");
2855
      sb.append("e:");
2856
      if (this.e == null) {
2857
        sb.append("null");
2858
      } else {
2859
        sb.append(this.e);
2860
      }
2861
      first = false;
2862
      sb.append(")");
2863
      return sb.toString();
2864
    }
2865
 
2866
    public void validate() throws org.apache.thrift.TException {
2867
      // check for required fields
2868
    }
2869
 
2870
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
2871
      try {
2872
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
2873
      } catch (org.apache.thrift.TException te) {
2874
        throw new java.io.IOException(te);
2875
      }
2876
    }
2877
 
2878
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
2879
      try {
2880
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
2881
      } catch (org.apache.thrift.TException te) {
2882
        throw new java.io.IOException(te);
2883
      }
2884
    }
2885
 
2886
  }
2887
 
2888
  public static class getSupplier_args implements org.apache.thrift.TBase<getSupplier_args, getSupplier_args._Fields>, java.io.Serializable, Cloneable   {
2889
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getSupplier_args");
2890
 
2891
    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);
2892
 
2893
    private long id; // required
2894
 
2895
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
2896
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
2897
      ID((short)1, "id");
2898
 
2899
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
2900
 
2901
      static {
2902
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
2903
          byName.put(field.getFieldName(), field);
2904
        }
2905
      }
2906
 
2907
      /**
2908
       * Find the _Fields constant that matches fieldId, or null if its not found.
2909
       */
2910
      public static _Fields findByThriftId(int fieldId) {
2911
        switch(fieldId) {
2912
          case 1: // ID
2913
            return ID;
2914
          default:
2915
            return null;
2916
        }
2917
      }
2918
 
2919
      /**
2920
       * Find the _Fields constant that matches fieldId, throwing an exception
2921
       * if it is not found.
2922
       */
2923
      public static _Fields findByThriftIdOrThrow(int fieldId) {
2924
        _Fields fields = findByThriftId(fieldId);
2925
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
2926
        return fields;
2927
      }
2928
 
2929
      /**
2930
       * Find the _Fields constant that matches name, or null if its not found.
2931
       */
2932
      public static _Fields findByName(String name) {
2933
        return byName.get(name);
2934
      }
2935
 
2936
      private final short _thriftId;
2937
      private final String _fieldName;
2938
 
2939
      _Fields(short thriftId, String fieldName) {
2940
        _thriftId = thriftId;
2941
        _fieldName = fieldName;
2942
      }
2943
 
2944
      public short getThriftFieldId() {
2945
        return _thriftId;
2946
      }
2947
 
2948
      public String getFieldName() {
2949
        return _fieldName;
2950
      }
2951
    }
2952
 
2953
    // isset id assignments
2954
    private static final int __ID_ISSET_ID = 0;
2955
    private BitSet __isset_bit_vector = new BitSet(1);
2956
 
2957
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
2958
    static {
2959
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
2960
      tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
2961
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
2962
      metaDataMap = Collections.unmodifiableMap(tmpMap);
2963
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getSupplier_args.class, metaDataMap);
2964
    }
2965
 
2966
    public getSupplier_args() {
2967
    }
2968
 
2969
    public getSupplier_args(
2970
      long id)
2971
    {
2972
      this();
2973
      this.id = id;
2974
      setIdIsSet(true);
2975
    }
2976
 
2977
    /**
2978
     * Performs a deep copy on <i>other</i>.
2979
     */
2980
    public getSupplier_args(getSupplier_args other) {
2981
      __isset_bit_vector.clear();
2982
      __isset_bit_vector.or(other.__isset_bit_vector);
2983
      this.id = other.id;
2984
    }
2985
 
2986
    public getSupplier_args deepCopy() {
2987
      return new getSupplier_args(this);
2988
    }
2989
 
2990
    @Override
2991
    public void clear() {
2992
      setIdIsSet(false);
2993
      this.id = 0;
2994
    }
2995
 
2996
    public long getId() {
2997
      return this.id;
2998
    }
2999
 
3000
    public void setId(long id) {
3001
      this.id = id;
3002
      setIdIsSet(true);
3003
    }
3004
 
3005
    public void unsetId() {
3006
      __isset_bit_vector.clear(__ID_ISSET_ID);
3007
    }
3008
 
3009
    /** Returns true if field id is set (has been assigned a value) and false otherwise */
3010
    public boolean isSetId() {
3011
      return __isset_bit_vector.get(__ID_ISSET_ID);
3012
    }
3013
 
3014
    public void setIdIsSet(boolean value) {
3015
      __isset_bit_vector.set(__ID_ISSET_ID, value);
3016
    }
3017
 
3018
    public void setFieldValue(_Fields field, Object value) {
3019
      switch (field) {
3020
      case ID:
3021
        if (value == null) {
3022
          unsetId();
3023
        } else {
3024
          setId((Long)value);
3025
        }
3026
        break;
3027
 
3028
      }
3029
    }
3030
 
3031
    public Object getFieldValue(_Fields field) {
3032
      switch (field) {
3033
      case ID:
3034
        return Long.valueOf(getId());
3035
 
3036
      }
3037
      throw new IllegalStateException();
3038
    }
3039
 
3040
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
3041
    public boolean isSet(_Fields field) {
3042
      if (field == null) {
3043
        throw new IllegalArgumentException();
3044
      }
3045
 
3046
      switch (field) {
3047
      case ID:
3048
        return isSetId();
3049
      }
3050
      throw new IllegalStateException();
3051
    }
3052
 
3053
    @Override
3054
    public boolean equals(Object that) {
3055
      if (that == null)
3056
        return false;
3057
      if (that instanceof getSupplier_args)
3058
        return this.equals((getSupplier_args)that);
3059
      return false;
3060
    }
3061
 
3062
    public boolean equals(getSupplier_args that) {
3063
      if (that == null)
3064
        return false;
3065
 
3066
      boolean this_present_id = true;
3067
      boolean that_present_id = true;
3068
      if (this_present_id || that_present_id) {
3069
        if (!(this_present_id && that_present_id))
3070
          return false;
3071
        if (this.id != that.id)
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(getSupplier_args other) {
3084
      if (!getClass().equals(other.getClass())) {
3085
        return getClass().getName().compareTo(other.getClass().getName());
3086
      }
3087
 
3088
      int lastComparison = 0;
3089
      getSupplier_args typedOther = (getSupplier_args)other;
3090
 
3091
      lastComparison = Boolean.valueOf(isSetId()).compareTo(typedOther.isSetId());
3092
      if (lastComparison != 0) {
3093
        return lastComparison;
3094
      }
3095
      if (isSetId()) {
3096
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, typedOther.id);
3097
        if (lastComparison != 0) {
3098
          return lastComparison;
3099
        }
3100
      }
3101
      return 0;
3102
    }
3103
 
3104
    public _Fields fieldForId(int fieldId) {
3105
      return _Fields.findByThriftId(fieldId);
3106
    }
3107
 
3108
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
3109
      org.apache.thrift.protocol.TField field;
3110
      iprot.readStructBegin();
3111
      while (true)
3112
      {
3113
        field = iprot.readFieldBegin();
3114
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3115
          break;
3116
        }
3117
        switch (field.id) {
3118
          case 1: // ID
3119
            if (field.type == org.apache.thrift.protocol.TType.I64) {
3120
              this.id = iprot.readI64();
3121
              setIdIsSet(true);
3122
            } else { 
3123
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3124
            }
3125
            break;
3126
          default:
3127
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3128
        }
3129
        iprot.readFieldEnd();
3130
      }
3131
      iprot.readStructEnd();
3132
      validate();
3133
    }
3134
 
3135
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3136
      validate();
3137
 
3138
      oprot.writeStructBegin(STRUCT_DESC);
3139
      oprot.writeFieldBegin(ID_FIELD_DESC);
3140
      oprot.writeI64(this.id);
3141
      oprot.writeFieldEnd();
3142
      oprot.writeFieldStop();
3143
      oprot.writeStructEnd();
3144
    }
3145
 
3146
    @Override
3147
    public String toString() {
3148
      StringBuilder sb = new StringBuilder("getSupplier_args(");
3149
      boolean first = true;
3150
 
3151
      sb.append("id:");
3152
      sb.append(this.id);
3153
      first = false;
3154
      sb.append(")");
3155
      return sb.toString();
3156
    }
3157
 
3158
    public void validate() throws org.apache.thrift.TException {
3159
      // check for required fields
3160
    }
3161
 
3162
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
3163
      try {
3164
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
3165
      } catch (org.apache.thrift.TException te) {
3166
        throw new java.io.IOException(te);
3167
      }
3168
    }
3169
 
3170
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
3171
      try {
3172
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
3173
        __isset_bit_vector = new BitSet(1);
3174
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
3175
      } catch (org.apache.thrift.TException te) {
3176
        throw new java.io.IOException(te);
3177
      }
3178
    }
3179
 
3180
  }
3181
 
3182
  public static class getSupplier_result implements org.apache.thrift.TBase<getSupplier_result, getSupplier_result._Fields>, java.io.Serializable, Cloneable   {
3183
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getSupplier_result");
3184
 
3185
    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);
3186
    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);
3187
 
3188
    private Supplier success; // required
3189
    private PurchaseServiceException e; // required
3190
 
3191
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3192
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3193
      SUCCESS((short)0, "success"),
3194
      E((short)1, "e");
3195
 
3196
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
3197
 
3198
      static {
3199
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
3200
          byName.put(field.getFieldName(), field);
3201
        }
3202
      }
3203
 
3204
      /**
3205
       * Find the _Fields constant that matches fieldId, or null if its not found.
3206
       */
3207
      public static _Fields findByThriftId(int fieldId) {
3208
        switch(fieldId) {
3209
          case 0: // SUCCESS
3210
            return SUCCESS;
3211
          case 1: // E
3212
            return E;
3213
          default:
3214
            return null;
3215
        }
3216
      }
3217
 
3218
      /**
3219
       * Find the _Fields constant that matches fieldId, throwing an exception
3220
       * if it is not found.
3221
       */
3222
      public static _Fields findByThriftIdOrThrow(int fieldId) {
3223
        _Fields fields = findByThriftId(fieldId);
3224
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
3225
        return fields;
3226
      }
3227
 
3228
      /**
3229
       * Find the _Fields constant that matches name, or null if its not found.
3230
       */
3231
      public static _Fields findByName(String name) {
3232
        return byName.get(name);
3233
      }
3234
 
3235
      private final short _thriftId;
3236
      private final String _fieldName;
3237
 
3238
      _Fields(short thriftId, String fieldName) {
3239
        _thriftId = thriftId;
3240
        _fieldName = fieldName;
3241
      }
3242
 
3243
      public short getThriftFieldId() {
3244
        return _thriftId;
3245
      }
3246
 
3247
      public String getFieldName() {
3248
        return _fieldName;
3249
      }
3250
    }
3251
 
3252
    // isset id assignments
3253
 
3254
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3255
    static {
3256
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
3257
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
3258
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Supplier.class)));
3259
      tmpMap.put(_Fields.E, new org.apache.thrift.meta_data.FieldMetaData("e", org.apache.thrift.TFieldRequirementType.DEFAULT, 
3260
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
3261
      metaDataMap = Collections.unmodifiableMap(tmpMap);
3262
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getSupplier_result.class, metaDataMap);
3263
    }
3264
 
3265
    public getSupplier_result() {
3266
    }
3267
 
3268
    public getSupplier_result(
3269
      Supplier success,
3270
      PurchaseServiceException e)
3271
    {
3272
      this();
3273
      this.success = success;
3274
      this.e = e;
3275
    }
3276
 
3277
    /**
3278
     * Performs a deep copy on <i>other</i>.
3279
     */
3280
    public getSupplier_result(getSupplier_result other) {
3281
      if (other.isSetSuccess()) {
3282
        this.success = new Supplier(other.success);
3283
      }
3284
      if (other.isSetE()) {
3285
        this.e = new PurchaseServiceException(other.e);
3286
      }
3287
    }
3288
 
3289
    public getSupplier_result deepCopy() {
3290
      return new getSupplier_result(this);
3291
    }
3292
 
3293
    @Override
3294
    public void clear() {
3295
      this.success = null;
3296
      this.e = null;
3297
    }
3298
 
3299
    public Supplier getSuccess() {
3300
      return this.success;
3301
    }
3302
 
3303
    public void setSuccess(Supplier success) {
3304
      this.success = success;
3305
    }
3306
 
3307
    public void unsetSuccess() {
3308
      this.success = null;
3309
    }
3310
 
3311
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
3312
    public boolean isSetSuccess() {
3313
      return this.success != null;
3314
    }
3315
 
3316
    public void setSuccessIsSet(boolean value) {
3317
      if (!value) {
3318
        this.success = null;
3319
      }
3320
    }
3321
 
3322
    public PurchaseServiceException getE() {
3323
      return this.e;
3324
    }
3325
 
3326
    public void setE(PurchaseServiceException e) {
3327
      this.e = e;
3328
    }
3329
 
3330
    public void unsetE() {
3331
      this.e = null;
3332
    }
3333
 
3334
    /** Returns true if field e is set (has been assigned a value) and false otherwise */
3335
    public boolean isSetE() {
3336
      return this.e != null;
3337
    }
3338
 
3339
    public void setEIsSet(boolean value) {
3340
      if (!value) {
3341
        this.e = null;
3342
      }
3343
    }
3344
 
3345
    public void setFieldValue(_Fields field, Object value) {
3346
      switch (field) {
3347
      case SUCCESS:
3348
        if (value == null) {
3349
          unsetSuccess();
3350
        } else {
3351
          setSuccess((Supplier)value);
3352
        }
3353
        break;
3354
 
3355
      case E:
3356
        if (value == null) {
3357
          unsetE();
3358
        } else {
3359
          setE((PurchaseServiceException)value);
3360
        }
3361
        break;
3362
 
3363
      }
3364
    }
3365
 
3366
    public Object getFieldValue(_Fields field) {
3367
      switch (field) {
3368
      case SUCCESS:
3369
        return getSuccess();
3370
 
3371
      case E:
3372
        return getE();
3373
 
3374
      }
3375
      throw new IllegalStateException();
3376
    }
3377
 
3378
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
3379
    public boolean isSet(_Fields field) {
3380
      if (field == null) {
3381
        throw new IllegalArgumentException();
3382
      }
3383
 
3384
      switch (field) {
3385
      case SUCCESS:
3386
        return isSetSuccess();
3387
      case E:
3388
        return isSetE();
3389
      }
3390
      throw new IllegalStateException();
3391
    }
3392
 
3393
    @Override
3394
    public boolean equals(Object that) {
3395
      if (that == null)
3396
        return false;
3397
      if (that instanceof getSupplier_result)
3398
        return this.equals((getSupplier_result)that);
3399
      return false;
3400
    }
3401
 
3402
    public boolean equals(getSupplier_result that) {
3403
      if (that == null)
3404
        return false;
3405
 
3406
      boolean this_present_success = true && this.isSetSuccess();
3407
      boolean that_present_success = true && that.isSetSuccess();
3408
      if (this_present_success || that_present_success) {
3409
        if (!(this_present_success && that_present_success))
3410
          return false;
3411
        if (!this.success.equals(that.success))
3412
          return false;
3413
      }
3414
 
3415
      boolean this_present_e = true && this.isSetE();
3416
      boolean that_present_e = true && that.isSetE();
3417
      if (this_present_e || that_present_e) {
3418
        if (!(this_present_e && that_present_e))
3419
          return false;
3420
        if (!this.e.equals(that.e))
3421
          return false;
3422
      }
3423
 
3424
      return true;
3425
    }
3426
 
3427
    @Override
3428
    public int hashCode() {
3429
      return 0;
3430
    }
3431
 
3432
    public int compareTo(getSupplier_result other) {
3433
      if (!getClass().equals(other.getClass())) {
3434
        return getClass().getName().compareTo(other.getClass().getName());
3435
      }
3436
 
3437
      int lastComparison = 0;
3438
      getSupplier_result typedOther = (getSupplier_result)other;
3439
 
3440
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
3441
      if (lastComparison != 0) {
3442
        return lastComparison;
3443
      }
3444
      if (isSetSuccess()) {
3445
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
3446
        if (lastComparison != 0) {
3447
          return lastComparison;
3448
        }
3449
      }
3450
      lastComparison = Boolean.valueOf(isSetE()).compareTo(typedOther.isSetE());
3451
      if (lastComparison != 0) {
3452
        return lastComparison;
3453
      }
3454
      if (isSetE()) {
3455
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, typedOther.e);
3456
        if (lastComparison != 0) {
3457
          return lastComparison;
3458
        }
3459
      }
3460
      return 0;
3461
    }
3462
 
3463
    public _Fields fieldForId(int fieldId) {
3464
      return _Fields.findByThriftId(fieldId);
3465
    }
3466
 
3467
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
3468
      org.apache.thrift.protocol.TField field;
3469
      iprot.readStructBegin();
3470
      while (true)
3471
      {
3472
        field = iprot.readFieldBegin();
3473
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3474
          break;
3475
        }
3476
        switch (field.id) {
3477
          case 0: // SUCCESS
3478
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
3479
              this.success = new Supplier();
3480
              this.success.read(iprot);
3481
            } else { 
3482
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3483
            }
3484
            break;
3485
          case 1: // E
3486
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
3487
              this.e = new PurchaseServiceException();
3488
              this.e.read(iprot);
3489
            } else { 
3490
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3491
            }
3492
            break;
3493
          default:
3494
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3495
        }
3496
        iprot.readFieldEnd();
3497
      }
3498
      iprot.readStructEnd();
3499
      validate();
3500
    }
3501
 
3502
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3503
      oprot.writeStructBegin(STRUCT_DESC);
3504
 
3505
      if (this.isSetSuccess()) {
3506
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
3507
        this.success.write(oprot);
3508
        oprot.writeFieldEnd();
3509
      } else if (this.isSetE()) {
3510
        oprot.writeFieldBegin(E_FIELD_DESC);
3511
        this.e.write(oprot);
3512
        oprot.writeFieldEnd();
3513
      }
3514
      oprot.writeFieldStop();
3515
      oprot.writeStructEnd();
3516
    }
3517
 
3518
    @Override
3519
    public String toString() {
3520
      StringBuilder sb = new StringBuilder("getSupplier_result(");
3521
      boolean first = true;
3522
 
3523
      sb.append("success:");
3524
      if (this.success == null) {
3525
        sb.append("null");
3526
      } else {
3527
        sb.append(this.success);
3528
      }
3529
      first = false;
3530
      if (!first) sb.append(", ");
3531
      sb.append("e:");
3532
      if (this.e == null) {
3533
        sb.append("null");
3534
      } else {
3535
        sb.append(this.e);
3536
      }
3537
      first = false;
3538
      sb.append(")");
3539
      return sb.toString();
3540
    }
3541
 
3542
    public void validate() throws org.apache.thrift.TException {
3543
      // check for required fields
3544
    }
3545
 
3546
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
3547
      try {
3548
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
3549
      } catch (org.apache.thrift.TException te) {
3550
        throw new java.io.IOException(te);
3551
      }
3552
    }
3553
 
3554
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
3555
      try {
3556
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
3557
      } catch (org.apache.thrift.TException te) {
3558
        throw new java.io.IOException(te);
3559
      }
3560
    }
3561
 
3562
  }
3563
 
3564
  public static class startPurchase_args implements org.apache.thrift.TBase<startPurchase_args, startPurchase_args._Fields>, java.io.Serializable, Cloneable   {
3565
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("startPurchase_args");
3566
 
3567
    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);
3568
    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);
3569
    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);
3570
 
3571
    private long purchaseOrderId; // required
3572
    private String invoiceNumber; // required
3573
    private double freightCharges; // required
3574
 
3575
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3576
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3577
      PURCHASE_ORDER_ID((short)1, "purchaseOrderId"),
3578
      INVOICE_NUMBER((short)2, "invoiceNumber"),
3579
      FREIGHT_CHARGES((short)3, "freightCharges");
3580
 
3581
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
3582
 
3583
      static {
3584
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
3585
          byName.put(field.getFieldName(), field);
3586
        }
3587
      }
3588
 
3589
      /**
3590
       * Find the _Fields constant that matches fieldId, or null if its not found.
3591
       */
3592
      public static _Fields findByThriftId(int fieldId) {
3593
        switch(fieldId) {
3594
          case 1: // PURCHASE_ORDER_ID
3595
            return PURCHASE_ORDER_ID;
3596
          case 2: // INVOICE_NUMBER
3597
            return INVOICE_NUMBER;
3598
          case 3: // FREIGHT_CHARGES
3599
            return FREIGHT_CHARGES;
3600
          default:
3601
            return null;
3602
        }
3603
      }
3604
 
3605
      /**
3606
       * Find the _Fields constant that matches fieldId, throwing an exception
3607
       * if it is not found.
3608
       */
3609
      public static _Fields findByThriftIdOrThrow(int fieldId) {
3610
        _Fields fields = findByThriftId(fieldId);
3611
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
3612
        return fields;
3613
      }
3614
 
3615
      /**
3616
       * Find the _Fields constant that matches name, or null if its not found.
3617
       */
3618
      public static _Fields findByName(String name) {
3619
        return byName.get(name);
3620
      }
3621
 
3622
      private final short _thriftId;
3623
      private final String _fieldName;
3624
 
3625
      _Fields(short thriftId, String fieldName) {
3626
        _thriftId = thriftId;
3627
        _fieldName = fieldName;
3628
      }
3629
 
3630
      public short getThriftFieldId() {
3631
        return _thriftId;
3632
      }
3633
 
3634
      public String getFieldName() {
3635
        return _fieldName;
3636
      }
3637
    }
3638
 
3639
    // isset id assignments
3640
    private static final int __PURCHASEORDERID_ISSET_ID = 0;
3641
    private static final int __FREIGHTCHARGES_ISSET_ID = 1;
3642
    private BitSet __isset_bit_vector = new BitSet(2);
3643
 
3644
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3645
    static {
3646
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
3647
      tmpMap.put(_Fields.PURCHASE_ORDER_ID, new org.apache.thrift.meta_data.FieldMetaData("purchaseOrderId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
3648
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
3649
      tmpMap.put(_Fields.INVOICE_NUMBER, new org.apache.thrift.meta_data.FieldMetaData("invoiceNumber", org.apache.thrift.TFieldRequirementType.DEFAULT, 
3650
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
3651
      tmpMap.put(_Fields.FREIGHT_CHARGES, new org.apache.thrift.meta_data.FieldMetaData("freightCharges", org.apache.thrift.TFieldRequirementType.DEFAULT, 
3652
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
3653
      metaDataMap = Collections.unmodifiableMap(tmpMap);
3654
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(startPurchase_args.class, metaDataMap);
3655
    }
3656
 
3657
    public startPurchase_args() {
3658
    }
3659
 
3660
    public startPurchase_args(
3661
      long purchaseOrderId,
3662
      String invoiceNumber,
3663
      double freightCharges)
3664
    {
3665
      this();
3666
      this.purchaseOrderId = purchaseOrderId;
3667
      setPurchaseOrderIdIsSet(true);
3668
      this.invoiceNumber = invoiceNumber;
3669
      this.freightCharges = freightCharges;
3670
      setFreightChargesIsSet(true);
3671
    }
3672
 
3673
    /**
3674
     * Performs a deep copy on <i>other</i>.
3675
     */
3676
    public startPurchase_args(startPurchase_args other) {
3677
      __isset_bit_vector.clear();
3678
      __isset_bit_vector.or(other.__isset_bit_vector);
3679
      this.purchaseOrderId = other.purchaseOrderId;
3680
      if (other.isSetInvoiceNumber()) {
3681
        this.invoiceNumber = other.invoiceNumber;
3682
      }
3683
      this.freightCharges = other.freightCharges;
3684
    }
3685
 
3686
    public startPurchase_args deepCopy() {
3687
      return new startPurchase_args(this);
3688
    }
3689
 
3690
    @Override
3691
    public void clear() {
3692
      setPurchaseOrderIdIsSet(false);
3693
      this.purchaseOrderId = 0;
3694
      this.invoiceNumber = null;
3695
      setFreightChargesIsSet(false);
3696
      this.freightCharges = 0.0;
3697
    }
3698
 
3699
    public long getPurchaseOrderId() {
3700
      return this.purchaseOrderId;
3701
    }
3702
 
3703
    public void setPurchaseOrderId(long purchaseOrderId) {
3704
      this.purchaseOrderId = purchaseOrderId;
3705
      setPurchaseOrderIdIsSet(true);
3706
    }
3707
 
3708
    public void unsetPurchaseOrderId() {
3709
      __isset_bit_vector.clear(__PURCHASEORDERID_ISSET_ID);
3710
    }
3711
 
3712
    /** Returns true if field purchaseOrderId is set (has been assigned a value) and false otherwise */
3713
    public boolean isSetPurchaseOrderId() {
3714
      return __isset_bit_vector.get(__PURCHASEORDERID_ISSET_ID);
3715
    }
3716
 
3717
    public void setPurchaseOrderIdIsSet(boolean value) {
3718
      __isset_bit_vector.set(__PURCHASEORDERID_ISSET_ID, value);
3719
    }
3720
 
3721
    public String getInvoiceNumber() {
3722
      return this.invoiceNumber;
3723
    }
3724
 
3725
    public void setInvoiceNumber(String invoiceNumber) {
3726
      this.invoiceNumber = invoiceNumber;
3727
    }
3728
 
3729
    public void unsetInvoiceNumber() {
3730
      this.invoiceNumber = null;
3731
    }
3732
 
3733
    /** Returns true if field invoiceNumber is set (has been assigned a value) and false otherwise */
3734
    public boolean isSetInvoiceNumber() {
3735
      return this.invoiceNumber != null;
3736
    }
3737
 
3738
    public void setInvoiceNumberIsSet(boolean value) {
3739
      if (!value) {
3740
        this.invoiceNumber = null;
3741
      }
3742
    }
3743
 
3744
    public double getFreightCharges() {
3745
      return this.freightCharges;
3746
    }
3747
 
3748
    public void setFreightCharges(double freightCharges) {
3749
      this.freightCharges = freightCharges;
3750
      setFreightChargesIsSet(true);
3751
    }
3752
 
3753
    public void unsetFreightCharges() {
3754
      __isset_bit_vector.clear(__FREIGHTCHARGES_ISSET_ID);
3755
    }
3756
 
3757
    /** Returns true if field freightCharges is set (has been assigned a value) and false otherwise */
3758
    public boolean isSetFreightCharges() {
3759
      return __isset_bit_vector.get(__FREIGHTCHARGES_ISSET_ID);
3760
    }
3761
 
3762
    public void setFreightChargesIsSet(boolean value) {
3763
      __isset_bit_vector.set(__FREIGHTCHARGES_ISSET_ID, value);
3764
    }
3765
 
3766
    public void setFieldValue(_Fields field, Object value) {
3767
      switch (field) {
3768
      case PURCHASE_ORDER_ID:
3769
        if (value == null) {
3770
          unsetPurchaseOrderId();
3771
        } else {
3772
          setPurchaseOrderId((Long)value);
3773
        }
3774
        break;
3775
 
3776
      case INVOICE_NUMBER:
3777
        if (value == null) {
3778
          unsetInvoiceNumber();
3779
        } else {
3780
          setInvoiceNumber((String)value);
3781
        }
3782
        break;
3783
 
3784
      case FREIGHT_CHARGES:
3785
        if (value == null) {
3786
          unsetFreightCharges();
3787
        } else {
3788
          setFreightCharges((Double)value);
3789
        }
3790
        break;
3791
 
3792
      }
3793
    }
3794
 
3795
    public Object getFieldValue(_Fields field) {
3796
      switch (field) {
3797
      case PURCHASE_ORDER_ID:
3798
        return Long.valueOf(getPurchaseOrderId());
3799
 
3800
      case INVOICE_NUMBER:
3801
        return getInvoiceNumber();
3802
 
3803
      case FREIGHT_CHARGES:
3804
        return Double.valueOf(getFreightCharges());
3805
 
3806
      }
3807
      throw new IllegalStateException();
3808
    }
3809
 
3810
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
3811
    public boolean isSet(_Fields field) {
3812
      if (field == null) {
3813
        throw new IllegalArgumentException();
3814
      }
3815
 
3816
      switch (field) {
3817
      case PURCHASE_ORDER_ID:
3818
        return isSetPurchaseOrderId();
3819
      case INVOICE_NUMBER:
3820
        return isSetInvoiceNumber();
3821
      case FREIGHT_CHARGES:
3822
        return isSetFreightCharges();
3823
      }
3824
      throw new IllegalStateException();
3825
    }
3826
 
3827
    @Override
3828
    public boolean equals(Object that) {
3829
      if (that == null)
3830
        return false;
3831
      if (that instanceof startPurchase_args)
3832
        return this.equals((startPurchase_args)that);
3833
      return false;
3834
    }
3835
 
3836
    public boolean equals(startPurchase_args that) {
3837
      if (that == null)
3838
        return false;
3839
 
3840
      boolean this_present_purchaseOrderId = true;
3841
      boolean that_present_purchaseOrderId = true;
3842
      if (this_present_purchaseOrderId || that_present_purchaseOrderId) {
3843
        if (!(this_present_purchaseOrderId && that_present_purchaseOrderId))
3844
          return false;
3845
        if (this.purchaseOrderId != that.purchaseOrderId)
3846
          return false;
3847
      }
3848
 
3849
      boolean this_present_invoiceNumber = true && this.isSetInvoiceNumber();
3850
      boolean that_present_invoiceNumber = true && that.isSetInvoiceNumber();
3851
      if (this_present_invoiceNumber || that_present_invoiceNumber) {
3852
        if (!(this_present_invoiceNumber && that_present_invoiceNumber))
3853
          return false;
3854
        if (!this.invoiceNumber.equals(that.invoiceNumber))
3855
          return false;
3856
      }
3857
 
3858
      boolean this_present_freightCharges = true;
3859
      boolean that_present_freightCharges = true;
3860
      if (this_present_freightCharges || that_present_freightCharges) {
3861
        if (!(this_present_freightCharges && that_present_freightCharges))
3862
          return false;
3863
        if (this.freightCharges != that.freightCharges)
3864
          return false;
3865
      }
3866
 
3867
      return true;
3868
    }
3869
 
3870
    @Override
3871
    public int hashCode() {
3872
      return 0;
3873
    }
3874
 
3875
    public int compareTo(startPurchase_args other) {
3876
      if (!getClass().equals(other.getClass())) {
3877
        return getClass().getName().compareTo(other.getClass().getName());
3878
      }
3879
 
3880
      int lastComparison = 0;
3881
      startPurchase_args typedOther = (startPurchase_args)other;
3882
 
3883
      lastComparison = Boolean.valueOf(isSetPurchaseOrderId()).compareTo(typedOther.isSetPurchaseOrderId());
3884
      if (lastComparison != 0) {
3885
        return lastComparison;
3886
      }
3887
      if (isSetPurchaseOrderId()) {
3888
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.purchaseOrderId, typedOther.purchaseOrderId);
3889
        if (lastComparison != 0) {
3890
          return lastComparison;
3891
        }
3892
      }
3893
      lastComparison = Boolean.valueOf(isSetInvoiceNumber()).compareTo(typedOther.isSetInvoiceNumber());
3894
      if (lastComparison != 0) {
3895
        return lastComparison;
3896
      }
3897
      if (isSetInvoiceNumber()) {
3898
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.invoiceNumber, typedOther.invoiceNumber);
3899
        if (lastComparison != 0) {
3900
          return lastComparison;
3901
        }
3902
      }
3903
      lastComparison = Boolean.valueOf(isSetFreightCharges()).compareTo(typedOther.isSetFreightCharges());
3904
      if (lastComparison != 0) {
3905
        return lastComparison;
3906
      }
3907
      if (isSetFreightCharges()) {
3908
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.freightCharges, typedOther.freightCharges);
3909
        if (lastComparison != 0) {
3910
          return lastComparison;
3911
        }
3912
      }
3913
      return 0;
3914
    }
3915
 
3916
    public _Fields fieldForId(int fieldId) {
3917
      return _Fields.findByThriftId(fieldId);
3918
    }
3919
 
3920
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
3921
      org.apache.thrift.protocol.TField field;
3922
      iprot.readStructBegin();
3923
      while (true)
3924
      {
3925
        field = iprot.readFieldBegin();
3926
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3927
          break;
3928
        }
3929
        switch (field.id) {
3930
          case 1: // PURCHASE_ORDER_ID
3931
            if (field.type == org.apache.thrift.protocol.TType.I64) {
3932
              this.purchaseOrderId = iprot.readI64();
3933
              setPurchaseOrderIdIsSet(true);
3934
            } else { 
3935
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3936
            }
3937
            break;
3938
          case 2: // INVOICE_NUMBER
3939
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
3940
              this.invoiceNumber = iprot.readString();
3941
            } else { 
3942
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3943
            }
3944
            break;
3945
          case 3: // FREIGHT_CHARGES
3946
            if (field.type == org.apache.thrift.protocol.TType.DOUBLE) {
3947
              this.freightCharges = iprot.readDouble();
3948
              setFreightChargesIsSet(true);
3949
            } else { 
3950
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3951
            }
3952
            break;
3953
          default:
3954
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3955
        }
3956
        iprot.readFieldEnd();
3957
      }
3958
      iprot.readStructEnd();
3959
      validate();
3960
    }
3961
 
3962
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3963
      validate();
3964
 
3965
      oprot.writeStructBegin(STRUCT_DESC);
3966
      oprot.writeFieldBegin(PURCHASE_ORDER_ID_FIELD_DESC);
3967
      oprot.writeI64(this.purchaseOrderId);
3968
      oprot.writeFieldEnd();
3969
      if (this.invoiceNumber != null) {
3970
        oprot.writeFieldBegin(INVOICE_NUMBER_FIELD_DESC);
3971
        oprot.writeString(this.invoiceNumber);
3972
        oprot.writeFieldEnd();
3973
      }
3974
      oprot.writeFieldBegin(FREIGHT_CHARGES_FIELD_DESC);
3975
      oprot.writeDouble(this.freightCharges);
3976
      oprot.writeFieldEnd();
3977
      oprot.writeFieldStop();
3978
      oprot.writeStructEnd();
3979
    }
3980
 
3981
    @Override
3982
    public String toString() {
3983
      StringBuilder sb = new StringBuilder("startPurchase_args(");
3984
      boolean first = true;
3985
 
3986
      sb.append("purchaseOrderId:");
3987
      sb.append(this.purchaseOrderId);
3988
      first = false;
3989
      if (!first) sb.append(", ");
3990
      sb.append("invoiceNumber:");
3991
      if (this.invoiceNumber == null) {
3992
        sb.append("null");
3993
      } else {
3994
        sb.append(this.invoiceNumber);
3995
      }
3996
      first = false;
3997
      if (!first) sb.append(", ");
3998
      sb.append("freightCharges:");
3999
      sb.append(this.freightCharges);
4000
      first = false;
4001
      sb.append(")");
4002
      return sb.toString();
4003
    }
4004
 
4005
    public void validate() throws org.apache.thrift.TException {
4006
      // check for required fields
4007
    }
4008
 
4009
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
4010
      try {
4011
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
4012
      } catch (org.apache.thrift.TException te) {
4013
        throw new java.io.IOException(te);
4014
      }
4015
    }
4016
 
4017
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
4018
      try {
4019
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
4020
      } catch (org.apache.thrift.TException te) {
4021
        throw new java.io.IOException(te);
4022
      }
4023
    }
4024
 
4025
  }
4026
 
4027
  public static class startPurchase_result implements org.apache.thrift.TBase<startPurchase_result, startPurchase_result._Fields>, java.io.Serializable, Cloneable   {
4028
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("startPurchase_result");
4029
 
4030
    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);
4031
    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);
4032
 
4033
    private long success; // required
4034
    private PurchaseServiceException e; // required
4035
 
4036
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
4037
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
4038
      SUCCESS((short)0, "success"),
4039
      E((short)1, "e");
4040
 
4041
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
4042
 
4043
      static {
4044
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
4045
          byName.put(field.getFieldName(), field);
4046
        }
4047
      }
4048
 
4049
      /**
4050
       * Find the _Fields constant that matches fieldId, or null if its not found.
4051
       */
4052
      public static _Fields findByThriftId(int fieldId) {
4053
        switch(fieldId) {
4054
          case 0: // SUCCESS
4055
            return SUCCESS;
4056
          case 1: // E
4057
            return E;
4058
          default:
4059
            return null;
4060
        }
4061
      }
4062
 
4063
      /**
4064
       * Find the _Fields constant that matches fieldId, throwing an exception
4065
       * if it is not found.
4066
       */
4067
      public static _Fields findByThriftIdOrThrow(int fieldId) {
4068
        _Fields fields = findByThriftId(fieldId);
4069
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
4070
        return fields;
4071
      }
4072
 
4073
      /**
4074
       * Find the _Fields constant that matches name, or null if its not found.
4075
       */
4076
      public static _Fields findByName(String name) {
4077
        return byName.get(name);
4078
      }
4079
 
4080
      private final short _thriftId;
4081
      private final String _fieldName;
4082
 
4083
      _Fields(short thriftId, String fieldName) {
4084
        _thriftId = thriftId;
4085
        _fieldName = fieldName;
4086
      }
4087
 
4088
      public short getThriftFieldId() {
4089
        return _thriftId;
4090
      }
4091
 
4092
      public String getFieldName() {
4093
        return _fieldName;
4094
      }
4095
    }
4096
 
4097
    // isset id assignments
4098
    private static final int __SUCCESS_ISSET_ID = 0;
4099
    private BitSet __isset_bit_vector = new BitSet(1);
4100
 
4101
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
4102
    static {
4103
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
4104
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
4105
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
4106
      tmpMap.put(_Fields.E, new org.apache.thrift.meta_data.FieldMetaData("e", org.apache.thrift.TFieldRequirementType.DEFAULT, 
4107
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
4108
      metaDataMap = Collections.unmodifiableMap(tmpMap);
4109
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(startPurchase_result.class, metaDataMap);
4110
    }
4111
 
4112
    public startPurchase_result() {
4113
    }
4114
 
4115
    public startPurchase_result(
4116
      long success,
4117
      PurchaseServiceException e)
4118
    {
4119
      this();
4120
      this.success = success;
4121
      setSuccessIsSet(true);
4122
      this.e = e;
4123
    }
4124
 
4125
    /**
4126
     * Performs a deep copy on <i>other</i>.
4127
     */
4128
    public startPurchase_result(startPurchase_result other) {
4129
      __isset_bit_vector.clear();
4130
      __isset_bit_vector.or(other.__isset_bit_vector);
4131
      this.success = other.success;
4132
      if (other.isSetE()) {
4133
        this.e = new PurchaseServiceException(other.e);
4134
      }
4135
    }
4136
 
4137
    public startPurchase_result deepCopy() {
4138
      return new startPurchase_result(this);
4139
    }
4140
 
4141
    @Override
4142
    public void clear() {
4143
      setSuccessIsSet(false);
4144
      this.success = 0;
4145
      this.e = null;
4146
    }
4147
 
4148
    public long getSuccess() {
4149
      return this.success;
4150
    }
4151
 
4152
    public void setSuccess(long success) {
4153
      this.success = success;
4154
      setSuccessIsSet(true);
4155
    }
4156
 
4157
    public void unsetSuccess() {
4158
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
4159
    }
4160
 
4161
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
4162
    public boolean isSetSuccess() {
4163
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
4164
    }
4165
 
4166
    public void setSuccessIsSet(boolean value) {
4167
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
4168
    }
4169
 
4170
    public PurchaseServiceException getE() {
4171
      return this.e;
4172
    }
4173
 
4174
    public void setE(PurchaseServiceException e) {
4175
      this.e = e;
4176
    }
4177
 
4178
    public void unsetE() {
4179
      this.e = null;
4180
    }
4181
 
4182
    /** Returns true if field e is set (has been assigned a value) and false otherwise */
4183
    public boolean isSetE() {
4184
      return this.e != null;
4185
    }
4186
 
4187
    public void setEIsSet(boolean value) {
4188
      if (!value) {
4189
        this.e = null;
4190
      }
4191
    }
4192
 
4193
    public void setFieldValue(_Fields field, Object value) {
4194
      switch (field) {
4195
      case SUCCESS:
4196
        if (value == null) {
4197
          unsetSuccess();
4198
        } else {
4199
          setSuccess((Long)value);
4200
        }
4201
        break;
4202
 
4203
      case E:
4204
        if (value == null) {
4205
          unsetE();
4206
        } else {
4207
          setE((PurchaseServiceException)value);
4208
        }
4209
        break;
4210
 
4211
      }
4212
    }
4213
 
4214
    public Object getFieldValue(_Fields field) {
4215
      switch (field) {
4216
      case SUCCESS:
4217
        return Long.valueOf(getSuccess());
4218
 
4219
      case E:
4220
        return getE();
4221
 
4222
      }
4223
      throw new IllegalStateException();
4224
    }
4225
 
4226
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
4227
    public boolean isSet(_Fields field) {
4228
      if (field == null) {
4229
        throw new IllegalArgumentException();
4230
      }
4231
 
4232
      switch (field) {
4233
      case SUCCESS:
4234
        return isSetSuccess();
4235
      case E:
4236
        return isSetE();
4237
      }
4238
      throw new IllegalStateException();
4239
    }
4240
 
4241
    @Override
4242
    public boolean equals(Object that) {
4243
      if (that == null)
4244
        return false;
4245
      if (that instanceof startPurchase_result)
4246
        return this.equals((startPurchase_result)that);
4247
      return false;
4248
    }
4249
 
4250
    public boolean equals(startPurchase_result that) {
4251
      if (that == null)
4252
        return false;
4253
 
4254
      boolean this_present_success = true;
4255
      boolean that_present_success = true;
4256
      if (this_present_success || that_present_success) {
4257
        if (!(this_present_success && that_present_success))
4258
          return false;
4259
        if (this.success != that.success)
4260
          return false;
4261
      }
4262
 
4263
      boolean this_present_e = true && this.isSetE();
4264
      boolean that_present_e = true && that.isSetE();
4265
      if (this_present_e || that_present_e) {
4266
        if (!(this_present_e && that_present_e))
4267
          return false;
4268
        if (!this.e.equals(that.e))
4269
          return false;
4270
      }
4271
 
4272
      return true;
4273
    }
4274
 
4275
    @Override
4276
    public int hashCode() {
4277
      return 0;
4278
    }
4279
 
4280
    public int compareTo(startPurchase_result other) {
4281
      if (!getClass().equals(other.getClass())) {
4282
        return getClass().getName().compareTo(other.getClass().getName());
4283
      }
4284
 
4285
      int lastComparison = 0;
4286
      startPurchase_result typedOther = (startPurchase_result)other;
4287
 
4288
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
4289
      if (lastComparison != 0) {
4290
        return lastComparison;
4291
      }
4292
      if (isSetSuccess()) {
4293
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
4294
        if (lastComparison != 0) {
4295
          return lastComparison;
4296
        }
4297
      }
4298
      lastComparison = Boolean.valueOf(isSetE()).compareTo(typedOther.isSetE());
4299
      if (lastComparison != 0) {
4300
        return lastComparison;
4301
      }
4302
      if (isSetE()) {
4303
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, typedOther.e);
4304
        if (lastComparison != 0) {
4305
          return lastComparison;
4306
        }
4307
      }
4308
      return 0;
4309
    }
4310
 
4311
    public _Fields fieldForId(int fieldId) {
4312
      return _Fields.findByThriftId(fieldId);
4313
    }
4314
 
4315
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
4316
      org.apache.thrift.protocol.TField field;
4317
      iprot.readStructBegin();
4318
      while (true)
4319
      {
4320
        field = iprot.readFieldBegin();
4321
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
4322
          break;
4323
        }
4324
        switch (field.id) {
4325
          case 0: // SUCCESS
4326
            if (field.type == org.apache.thrift.protocol.TType.I64) {
4327
              this.success = iprot.readI64();
4328
              setSuccessIsSet(true);
4329
            } else { 
4330
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4331
            }
4332
            break;
4333
          case 1: // E
4334
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
4335
              this.e = new PurchaseServiceException();
4336
              this.e.read(iprot);
4337
            } else { 
4338
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4339
            }
4340
            break;
4341
          default:
4342
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4343
        }
4344
        iprot.readFieldEnd();
4345
      }
4346
      iprot.readStructEnd();
4347
      validate();
4348
    }
4349
 
4350
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
4351
      oprot.writeStructBegin(STRUCT_DESC);
4352
 
4353
      if (this.isSetSuccess()) {
4354
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
4355
        oprot.writeI64(this.success);
4356
        oprot.writeFieldEnd();
4357
      } else if (this.isSetE()) {
4358
        oprot.writeFieldBegin(E_FIELD_DESC);
4359
        this.e.write(oprot);
4360
        oprot.writeFieldEnd();
4361
      }
4362
      oprot.writeFieldStop();
4363
      oprot.writeStructEnd();
4364
    }
4365
 
4366
    @Override
4367
    public String toString() {
4368
      StringBuilder sb = new StringBuilder("startPurchase_result(");
4369
      boolean first = true;
4370
 
4371
      sb.append("success:");
4372
      sb.append(this.success);
4373
      first = false;
4374
      if (!first) sb.append(", ");
4375
      sb.append("e:");
4376
      if (this.e == null) {
4377
        sb.append("null");
4378
      } else {
4379
        sb.append(this.e);
4380
      }
4381
      first = false;
4382
      sb.append(")");
4383
      return sb.toString();
4384
    }
4385
 
4386
    public void validate() throws org.apache.thrift.TException {
4387
      // check for required fields
4388
    }
4389
 
4390
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
4391
      try {
4392
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
4393
      } catch (org.apache.thrift.TException te) {
4394
        throw new java.io.IOException(te);
4395
      }
4396
    }
4397
 
4398
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
4399
      try {
4400
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
4401
      } catch (org.apache.thrift.TException te) {
4402
        throw new java.io.IOException(te);
4403
      }
4404
    }
4405
 
4406
  }
4407
 
4408
  public static class closePurchase_args implements org.apache.thrift.TBase<closePurchase_args, closePurchase_args._Fields>, java.io.Serializable, Cloneable   {
4409
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("closePurchase_args");
4410
 
4411
    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);
4412
 
4413
    private long purchaseId; // required
4414
 
4415
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
4416
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
4417
      PURCHASE_ID((short)1, "purchaseId");
4418
 
4419
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
4420
 
4421
      static {
4422
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
4423
          byName.put(field.getFieldName(), field);
4424
        }
4425
      }
4426
 
4427
      /**
4428
       * Find the _Fields constant that matches fieldId, or null if its not found.
4429
       */
4430
      public static _Fields findByThriftId(int fieldId) {
4431
        switch(fieldId) {
4432
          case 1: // PURCHASE_ID
4433
            return PURCHASE_ID;
4434
          default:
4435
            return null;
4436
        }
4437
      }
4438
 
4439
      /**
4440
       * Find the _Fields constant that matches fieldId, throwing an exception
4441
       * if it is not found.
4442
       */
4443
      public static _Fields findByThriftIdOrThrow(int fieldId) {
4444
        _Fields fields = findByThriftId(fieldId);
4445
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
4446
        return fields;
4447
      }
4448
 
4449
      /**
4450
       * Find the _Fields constant that matches name, or null if its not found.
4451
       */
4452
      public static _Fields findByName(String name) {
4453
        return byName.get(name);
4454
      }
4455
 
4456
      private final short _thriftId;
4457
      private final String _fieldName;
4458
 
4459
      _Fields(short thriftId, String fieldName) {
4460
        _thriftId = thriftId;
4461
        _fieldName = fieldName;
4462
      }
4463
 
4464
      public short getThriftFieldId() {
4465
        return _thriftId;
4466
      }
4467
 
4468
      public String getFieldName() {
4469
        return _fieldName;
4470
      }
4471
    }
4472
 
4473
    // isset id assignments
4474
    private static final int __PURCHASEID_ISSET_ID = 0;
4475
    private BitSet __isset_bit_vector = new BitSet(1);
4476
 
4477
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
4478
    static {
4479
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
4480
      tmpMap.put(_Fields.PURCHASE_ID, new org.apache.thrift.meta_data.FieldMetaData("purchaseId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
4481
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
4482
      metaDataMap = Collections.unmodifiableMap(tmpMap);
4483
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(closePurchase_args.class, metaDataMap);
4484
    }
4485
 
4486
    public closePurchase_args() {
4487
    }
4488
 
4489
    public closePurchase_args(
4490
      long purchaseId)
4491
    {
4492
      this();
4493
      this.purchaseId = purchaseId;
4494
      setPurchaseIdIsSet(true);
4495
    }
4496
 
4497
    /**
4498
     * Performs a deep copy on <i>other</i>.
4499
     */
4500
    public closePurchase_args(closePurchase_args other) {
4501
      __isset_bit_vector.clear();
4502
      __isset_bit_vector.or(other.__isset_bit_vector);
4503
      this.purchaseId = other.purchaseId;
4504
    }
4505
 
4506
    public closePurchase_args deepCopy() {
4507
      return new closePurchase_args(this);
4508
    }
4509
 
4510
    @Override
4511
    public void clear() {
4512
      setPurchaseIdIsSet(false);
4513
      this.purchaseId = 0;
4514
    }
4515
 
4516
    public long getPurchaseId() {
4517
      return this.purchaseId;
4518
    }
4519
 
4520
    public void setPurchaseId(long purchaseId) {
4521
      this.purchaseId = purchaseId;
4522
      setPurchaseIdIsSet(true);
4523
    }
4524
 
4525
    public void unsetPurchaseId() {
4526
      __isset_bit_vector.clear(__PURCHASEID_ISSET_ID);
4527
    }
4528
 
4529
    /** Returns true if field purchaseId is set (has been assigned a value) and false otherwise */
4530
    public boolean isSetPurchaseId() {
4531
      return __isset_bit_vector.get(__PURCHASEID_ISSET_ID);
4532
    }
4533
 
4534
    public void setPurchaseIdIsSet(boolean value) {
4535
      __isset_bit_vector.set(__PURCHASEID_ISSET_ID, value);
4536
    }
4537
 
4538
    public void setFieldValue(_Fields field, Object value) {
4539
      switch (field) {
4540
      case PURCHASE_ID:
4541
        if (value == null) {
4542
          unsetPurchaseId();
4543
        } else {
4544
          setPurchaseId((Long)value);
4545
        }
4546
        break;
4547
 
4548
      }
4549
    }
4550
 
4551
    public Object getFieldValue(_Fields field) {
4552
      switch (field) {
4553
      case PURCHASE_ID:
4554
        return Long.valueOf(getPurchaseId());
4555
 
4556
      }
4557
      throw new IllegalStateException();
4558
    }
4559
 
4560
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
4561
    public boolean isSet(_Fields field) {
4562
      if (field == null) {
4563
        throw new IllegalArgumentException();
4564
      }
4565
 
4566
      switch (field) {
4567
      case PURCHASE_ID:
4568
        return isSetPurchaseId();
4569
      }
4570
      throw new IllegalStateException();
4571
    }
4572
 
4573
    @Override
4574
    public boolean equals(Object that) {
4575
      if (that == null)
4576
        return false;
4577
      if (that instanceof closePurchase_args)
4578
        return this.equals((closePurchase_args)that);
4579
      return false;
4580
    }
4581
 
4582
    public boolean equals(closePurchase_args that) {
4583
      if (that == null)
4584
        return false;
4585
 
4586
      boolean this_present_purchaseId = true;
4587
      boolean that_present_purchaseId = true;
4588
      if (this_present_purchaseId || that_present_purchaseId) {
4589
        if (!(this_present_purchaseId && that_present_purchaseId))
4590
          return false;
4591
        if (this.purchaseId != that.purchaseId)
4592
          return false;
4593
      }
4594
 
4595
      return true;
4596
    }
4597
 
4598
    @Override
4599
    public int hashCode() {
4600
      return 0;
4601
    }
4602
 
4603
    public int compareTo(closePurchase_args other) {
4604
      if (!getClass().equals(other.getClass())) {
4605
        return getClass().getName().compareTo(other.getClass().getName());
4606
      }
4607
 
4608
      int lastComparison = 0;
4609
      closePurchase_args typedOther = (closePurchase_args)other;
4610
 
4611
      lastComparison = Boolean.valueOf(isSetPurchaseId()).compareTo(typedOther.isSetPurchaseId());
4612
      if (lastComparison != 0) {
4613
        return lastComparison;
4614
      }
4615
      if (isSetPurchaseId()) {
4616
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.purchaseId, typedOther.purchaseId);
4617
        if (lastComparison != 0) {
4618
          return lastComparison;
4619
        }
4620
      }
4621
      return 0;
4622
    }
4623
 
4624
    public _Fields fieldForId(int fieldId) {
4625
      return _Fields.findByThriftId(fieldId);
4626
    }
4627
 
4628
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
4629
      org.apache.thrift.protocol.TField field;
4630
      iprot.readStructBegin();
4631
      while (true)
4632
      {
4633
        field = iprot.readFieldBegin();
4634
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
4635
          break;
4636
        }
4637
        switch (field.id) {
4638
          case 1: // PURCHASE_ID
4639
            if (field.type == org.apache.thrift.protocol.TType.I64) {
4640
              this.purchaseId = iprot.readI64();
4641
              setPurchaseIdIsSet(true);
4642
            } else { 
4643
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4644
            }
4645
            break;
4646
          default:
4647
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4648
        }
4649
        iprot.readFieldEnd();
4650
      }
4651
      iprot.readStructEnd();
4652
      validate();
4653
    }
4654
 
4655
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
4656
      validate();
4657
 
4658
      oprot.writeStructBegin(STRUCT_DESC);
4659
      oprot.writeFieldBegin(PURCHASE_ID_FIELD_DESC);
4660
      oprot.writeI64(this.purchaseId);
4661
      oprot.writeFieldEnd();
4662
      oprot.writeFieldStop();
4663
      oprot.writeStructEnd();
4664
    }
4665
 
4666
    @Override
4667
    public String toString() {
4668
      StringBuilder sb = new StringBuilder("closePurchase_args(");
4669
      boolean first = true;
4670
 
4671
      sb.append("purchaseId:");
4672
      sb.append(this.purchaseId);
4673
      first = false;
4674
      sb.append(")");
4675
      return sb.toString();
4676
    }
4677
 
4678
    public void validate() throws org.apache.thrift.TException {
4679
      // check for required fields
4680
    }
4681
 
4682
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
4683
      try {
4684
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
4685
      } catch (org.apache.thrift.TException te) {
4686
        throw new java.io.IOException(te);
4687
      }
4688
    }
4689
 
4690
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
4691
      try {
4692
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
4693
      } catch (org.apache.thrift.TException te) {
4694
        throw new java.io.IOException(te);
4695
      }
4696
    }
4697
 
4698
  }
4699
 
4700
  public static class closePurchase_result implements org.apache.thrift.TBase<closePurchase_result, closePurchase_result._Fields>, java.io.Serializable, Cloneable   {
4701
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("closePurchase_result");
4702
 
4703
    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);
4704
    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);
4705
 
4706
    private long success; // required
4707
    private PurchaseServiceException e; // required
4708
 
4709
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
4710
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
4711
      SUCCESS((short)0, "success"),
4712
      E((short)1, "e");
4713
 
4714
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
4715
 
4716
      static {
4717
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
4718
          byName.put(field.getFieldName(), field);
4719
        }
4720
      }
4721
 
4722
      /**
4723
       * Find the _Fields constant that matches fieldId, or null if its not found.
4724
       */
4725
      public static _Fields findByThriftId(int fieldId) {
4726
        switch(fieldId) {
4727
          case 0: // SUCCESS
4728
            return SUCCESS;
4729
          case 1: // E
4730
            return E;
4731
          default:
4732
            return null;
4733
        }
4734
      }
4735
 
4736
      /**
4737
       * Find the _Fields constant that matches fieldId, throwing an exception
4738
       * if it is not found.
4739
       */
4740
      public static _Fields findByThriftIdOrThrow(int fieldId) {
4741
        _Fields fields = findByThriftId(fieldId);
4742
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
4743
        return fields;
4744
      }
4745
 
4746
      /**
4747
       * Find the _Fields constant that matches name, or null if its not found.
4748
       */
4749
      public static _Fields findByName(String name) {
4750
        return byName.get(name);
4751
      }
4752
 
4753
      private final short _thriftId;
4754
      private final String _fieldName;
4755
 
4756
      _Fields(short thriftId, String fieldName) {
4757
        _thriftId = thriftId;
4758
        _fieldName = fieldName;
4759
      }
4760
 
4761
      public short getThriftFieldId() {
4762
        return _thriftId;
4763
      }
4764
 
4765
      public String getFieldName() {
4766
        return _fieldName;
4767
      }
4768
    }
4769
 
4770
    // isset id assignments
4771
    private static final int __SUCCESS_ISSET_ID = 0;
4772
    private BitSet __isset_bit_vector = new BitSet(1);
4773
 
4774
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
4775
    static {
4776
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
4777
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
4778
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
4779
      tmpMap.put(_Fields.E, new org.apache.thrift.meta_data.FieldMetaData("e", org.apache.thrift.TFieldRequirementType.DEFAULT, 
4780
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
4781
      metaDataMap = Collections.unmodifiableMap(tmpMap);
4782
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(closePurchase_result.class, metaDataMap);
4783
    }
4784
 
4785
    public closePurchase_result() {
4786
    }
4787
 
4788
    public closePurchase_result(
4789
      long success,
4790
      PurchaseServiceException e)
4791
    {
4792
      this();
4793
      this.success = success;
4794
      setSuccessIsSet(true);
4795
      this.e = e;
4796
    }
4797
 
4798
    /**
4799
     * Performs a deep copy on <i>other</i>.
4800
     */
4801
    public closePurchase_result(closePurchase_result other) {
4802
      __isset_bit_vector.clear();
4803
      __isset_bit_vector.or(other.__isset_bit_vector);
4804
      this.success = other.success;
4805
      if (other.isSetE()) {
4806
        this.e = new PurchaseServiceException(other.e);
4807
      }
4808
    }
4809
 
4810
    public closePurchase_result deepCopy() {
4811
      return new closePurchase_result(this);
4812
    }
4813
 
4814
    @Override
4815
    public void clear() {
4816
      setSuccessIsSet(false);
4817
      this.success = 0;
4818
      this.e = null;
4819
    }
4820
 
4821
    public long getSuccess() {
4822
      return this.success;
4823
    }
4824
 
4825
    public void setSuccess(long success) {
4826
      this.success = success;
4827
      setSuccessIsSet(true);
4828
    }
4829
 
4830
    public void unsetSuccess() {
4831
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
4832
    }
4833
 
4834
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
4835
    public boolean isSetSuccess() {
4836
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
4837
    }
4838
 
4839
    public void setSuccessIsSet(boolean value) {
4840
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
4841
    }
4842
 
4843
    public PurchaseServiceException getE() {
4844
      return this.e;
4845
    }
4846
 
4847
    public void setE(PurchaseServiceException e) {
4848
      this.e = e;
4849
    }
4850
 
4851
    public void unsetE() {
4852
      this.e = null;
4853
    }
4854
 
4855
    /** Returns true if field e is set (has been assigned a value) and false otherwise */
4856
    public boolean isSetE() {
4857
      return this.e != null;
4858
    }
4859
 
4860
    public void setEIsSet(boolean value) {
4861
      if (!value) {
4862
        this.e = null;
4863
      }
4864
    }
4865
 
4866
    public void setFieldValue(_Fields field, Object value) {
4867
      switch (field) {
4868
      case SUCCESS:
4869
        if (value == null) {
4870
          unsetSuccess();
4871
        } else {
4872
          setSuccess((Long)value);
4873
        }
4874
        break;
4875
 
4876
      case E:
4877
        if (value == null) {
4878
          unsetE();
4879
        } else {
4880
          setE((PurchaseServiceException)value);
4881
        }
4882
        break;
4883
 
4884
      }
4885
    }
4886
 
4887
    public Object getFieldValue(_Fields field) {
4888
      switch (field) {
4889
      case SUCCESS:
4890
        return Long.valueOf(getSuccess());
4891
 
4892
      case E:
4893
        return getE();
4894
 
4895
      }
4896
      throw new IllegalStateException();
4897
    }
4898
 
4899
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
4900
    public boolean isSet(_Fields field) {
4901
      if (field == null) {
4902
        throw new IllegalArgumentException();
4903
      }
4904
 
4905
      switch (field) {
4906
      case SUCCESS:
4907
        return isSetSuccess();
4908
      case E:
4909
        return isSetE();
4910
      }
4911
      throw new IllegalStateException();
4912
    }
4913
 
4914
    @Override
4915
    public boolean equals(Object that) {
4916
      if (that == null)
4917
        return false;
4918
      if (that instanceof closePurchase_result)
4919
        return this.equals((closePurchase_result)that);
4920
      return false;
4921
    }
4922
 
4923
    public boolean equals(closePurchase_result that) {
4924
      if (that == null)
4925
        return false;
4926
 
4927
      boolean this_present_success = true;
4928
      boolean that_present_success = true;
4929
      if (this_present_success || that_present_success) {
4930
        if (!(this_present_success && that_present_success))
4931
          return false;
4932
        if (this.success != that.success)
4933
          return false;
4934
      }
4935
 
4936
      boolean this_present_e = true && this.isSetE();
4937
      boolean that_present_e = true && that.isSetE();
4938
      if (this_present_e || that_present_e) {
4939
        if (!(this_present_e && that_present_e))
4940
          return false;
4941
        if (!this.e.equals(that.e))
4942
          return false;
4943
      }
4944
 
4945
      return true;
4946
    }
4947
 
4948
    @Override
4949
    public int hashCode() {
4950
      return 0;
4951
    }
4952
 
4953
    public int compareTo(closePurchase_result other) {
4954
      if (!getClass().equals(other.getClass())) {
4955
        return getClass().getName().compareTo(other.getClass().getName());
4956
      }
4957
 
4958
      int lastComparison = 0;
4959
      closePurchase_result typedOther = (closePurchase_result)other;
4960
 
4961
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
4962
      if (lastComparison != 0) {
4963
        return lastComparison;
4964
      }
4965
      if (isSetSuccess()) {
4966
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
4967
        if (lastComparison != 0) {
4968
          return lastComparison;
4969
        }
4970
      }
4971
      lastComparison = Boolean.valueOf(isSetE()).compareTo(typedOther.isSetE());
4972
      if (lastComparison != 0) {
4973
        return lastComparison;
4974
      }
4975
      if (isSetE()) {
4976
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, typedOther.e);
4977
        if (lastComparison != 0) {
4978
          return lastComparison;
4979
        }
4980
      }
4981
      return 0;
4982
    }
4983
 
4984
    public _Fields fieldForId(int fieldId) {
4985
      return _Fields.findByThriftId(fieldId);
4986
    }
4987
 
4988
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
4989
      org.apache.thrift.protocol.TField field;
4990
      iprot.readStructBegin();
4991
      while (true)
4992
      {
4993
        field = iprot.readFieldBegin();
4994
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
4995
          break;
4996
        }
4997
        switch (field.id) {
4998
          case 0: // SUCCESS
4999
            if (field.type == org.apache.thrift.protocol.TType.I64) {
5000
              this.success = iprot.readI64();
5001
              setSuccessIsSet(true);
5002
            } else { 
5003
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5004
            }
5005
            break;
5006
          case 1: // E
5007
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
5008
              this.e = new PurchaseServiceException();
5009
              this.e.read(iprot);
5010
            } else { 
5011
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5012
            }
5013
            break;
5014
          default:
5015
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5016
        }
5017
        iprot.readFieldEnd();
5018
      }
5019
      iprot.readStructEnd();
5020
      validate();
5021
    }
5022
 
5023
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
5024
      oprot.writeStructBegin(STRUCT_DESC);
5025
 
5026
      if (this.isSetSuccess()) {
5027
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
5028
        oprot.writeI64(this.success);
5029
        oprot.writeFieldEnd();
5030
      } else if (this.isSetE()) {
5031
        oprot.writeFieldBegin(E_FIELD_DESC);
5032
        this.e.write(oprot);
5033
        oprot.writeFieldEnd();
5034
      }
5035
      oprot.writeFieldStop();
5036
      oprot.writeStructEnd();
5037
    }
5038
 
5039
    @Override
5040
    public String toString() {
5041
      StringBuilder sb = new StringBuilder("closePurchase_result(");
5042
      boolean first = true;
5043
 
5044
      sb.append("success:");
5045
      sb.append(this.success);
5046
      first = false;
5047
      if (!first) sb.append(", ");
5048
      sb.append("e:");
5049
      if (this.e == null) {
5050
        sb.append("null");
5051
      } else {
5052
        sb.append(this.e);
5053
      }
5054
      first = false;
5055
      sb.append(")");
5056
      return sb.toString();
5057
    }
5058
 
5059
    public void validate() throws org.apache.thrift.TException {
5060
      // check for required fields
5061
    }
5062
 
5063
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
5064
      try {
5065
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
5066
      } catch (org.apache.thrift.TException te) {
5067
        throw new java.io.IOException(te);
5068
      }
5069
    }
5070
 
5071
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
5072
      try {
5073
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
5074
      } catch (org.apache.thrift.TException te) {
5075
        throw new java.io.IOException(te);
5076
      }
5077
    }
5078
 
5079
  }
5080
 
5081
  public static class getAllPurchases_args implements org.apache.thrift.TBase<getAllPurchases_args, getAllPurchases_args._Fields>, java.io.Serializable, Cloneable   {
5082
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllPurchases_args");
5083
 
5084
    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);
5085
    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);
5086
 
5087
    private long purchaseOrderId; // required
5088
    private boolean open; // required
5089
 
5090
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
5091
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
5092
      PURCHASE_ORDER_ID((short)1, "purchaseOrderId"),
5093
      OPEN((short)2, "open");
5094
 
5095
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
5096
 
5097
      static {
5098
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
5099
          byName.put(field.getFieldName(), field);
5100
        }
5101
      }
5102
 
5103
      /**
5104
       * Find the _Fields constant that matches fieldId, or null if its not found.
5105
       */
5106
      public static _Fields findByThriftId(int fieldId) {
5107
        switch(fieldId) {
5108
          case 1: // PURCHASE_ORDER_ID
5109
            return PURCHASE_ORDER_ID;
5110
          case 2: // OPEN
5111
            return OPEN;
5112
          default:
5113
            return null;
5114
        }
5115
      }
5116
 
5117
      /**
5118
       * Find the _Fields constant that matches fieldId, throwing an exception
5119
       * if it is not found.
5120
       */
5121
      public static _Fields findByThriftIdOrThrow(int fieldId) {
5122
        _Fields fields = findByThriftId(fieldId);
5123
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
5124
        return fields;
5125
      }
5126
 
5127
      /**
5128
       * Find the _Fields constant that matches name, or null if its not found.
5129
       */
5130
      public static _Fields findByName(String name) {
5131
        return byName.get(name);
5132
      }
5133
 
5134
      private final short _thriftId;
5135
      private final String _fieldName;
5136
 
5137
      _Fields(short thriftId, String fieldName) {
5138
        _thriftId = thriftId;
5139
        _fieldName = fieldName;
5140
      }
5141
 
5142
      public short getThriftFieldId() {
5143
        return _thriftId;
5144
      }
5145
 
5146
      public String getFieldName() {
5147
        return _fieldName;
5148
      }
5149
    }
5150
 
5151
    // isset id assignments
5152
    private static final int __PURCHASEORDERID_ISSET_ID = 0;
5153
    private static final int __OPEN_ISSET_ID = 1;
5154
    private BitSet __isset_bit_vector = new BitSet(2);
5155
 
5156
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
5157
    static {
5158
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
5159
      tmpMap.put(_Fields.PURCHASE_ORDER_ID, new org.apache.thrift.meta_data.FieldMetaData("purchaseOrderId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
5160
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
5161
      tmpMap.put(_Fields.OPEN, new org.apache.thrift.meta_data.FieldMetaData("open", org.apache.thrift.TFieldRequirementType.DEFAULT, 
5162
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
5163
      metaDataMap = Collections.unmodifiableMap(tmpMap);
5164
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllPurchases_args.class, metaDataMap);
5165
    }
5166
 
5167
    public getAllPurchases_args() {
5168
    }
5169
 
5170
    public getAllPurchases_args(
5171
      long purchaseOrderId,
5172
      boolean open)
5173
    {
5174
      this();
5175
      this.purchaseOrderId = purchaseOrderId;
5176
      setPurchaseOrderIdIsSet(true);
5177
      this.open = open;
5178
      setOpenIsSet(true);
5179
    }
5180
 
5181
    /**
5182
     * Performs a deep copy on <i>other</i>.
5183
     */
5184
    public getAllPurchases_args(getAllPurchases_args other) {
5185
      __isset_bit_vector.clear();
5186
      __isset_bit_vector.or(other.__isset_bit_vector);
5187
      this.purchaseOrderId = other.purchaseOrderId;
5188
      this.open = other.open;
5189
    }
5190
 
5191
    public getAllPurchases_args deepCopy() {
5192
      return new getAllPurchases_args(this);
5193
    }
5194
 
5195
    @Override
5196
    public void clear() {
5197
      setPurchaseOrderIdIsSet(false);
5198
      this.purchaseOrderId = 0;
5199
      setOpenIsSet(false);
5200
      this.open = false;
5201
    }
5202
 
5203
    public long getPurchaseOrderId() {
5204
      return this.purchaseOrderId;
5205
    }
5206
 
5207
    public void setPurchaseOrderId(long purchaseOrderId) {
5208
      this.purchaseOrderId = purchaseOrderId;
5209
      setPurchaseOrderIdIsSet(true);
5210
    }
5211
 
5212
    public void unsetPurchaseOrderId() {
5213
      __isset_bit_vector.clear(__PURCHASEORDERID_ISSET_ID);
5214
    }
5215
 
5216
    /** Returns true if field purchaseOrderId is set (has been assigned a value) and false otherwise */
5217
    public boolean isSetPurchaseOrderId() {
5218
      return __isset_bit_vector.get(__PURCHASEORDERID_ISSET_ID);
5219
    }
5220
 
5221
    public void setPurchaseOrderIdIsSet(boolean value) {
5222
      __isset_bit_vector.set(__PURCHASEORDERID_ISSET_ID, value);
5223
    }
5224
 
5225
    public boolean isOpen() {
5226
      return this.open;
5227
    }
5228
 
5229
    public void setOpen(boolean open) {
5230
      this.open = open;
5231
      setOpenIsSet(true);
5232
    }
5233
 
5234
    public void unsetOpen() {
5235
      __isset_bit_vector.clear(__OPEN_ISSET_ID);
5236
    }
5237
 
5238
    /** Returns true if field open is set (has been assigned a value) and false otherwise */
5239
    public boolean isSetOpen() {
5240
      return __isset_bit_vector.get(__OPEN_ISSET_ID);
5241
    }
5242
 
5243
    public void setOpenIsSet(boolean value) {
5244
      __isset_bit_vector.set(__OPEN_ISSET_ID, value);
5245
    }
5246
 
5247
    public void setFieldValue(_Fields field, Object value) {
5248
      switch (field) {
5249
      case PURCHASE_ORDER_ID:
5250
        if (value == null) {
5251
          unsetPurchaseOrderId();
5252
        } else {
5253
          setPurchaseOrderId((Long)value);
5254
        }
5255
        break;
5256
 
5257
      case OPEN:
5258
        if (value == null) {
5259
          unsetOpen();
5260
        } else {
5261
          setOpen((Boolean)value);
5262
        }
5263
        break;
5264
 
5265
      }
5266
    }
5267
 
5268
    public Object getFieldValue(_Fields field) {
5269
      switch (field) {
5270
      case PURCHASE_ORDER_ID:
5271
        return Long.valueOf(getPurchaseOrderId());
5272
 
5273
      case OPEN:
5274
        return Boolean.valueOf(isOpen());
5275
 
5276
      }
5277
      throw new IllegalStateException();
5278
    }
5279
 
5280
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
5281
    public boolean isSet(_Fields field) {
5282
      if (field == null) {
5283
        throw new IllegalArgumentException();
5284
      }
5285
 
5286
      switch (field) {
5287
      case PURCHASE_ORDER_ID:
5288
        return isSetPurchaseOrderId();
5289
      case OPEN:
5290
        return isSetOpen();
5291
      }
5292
      throw new IllegalStateException();
5293
    }
5294
 
5295
    @Override
5296
    public boolean equals(Object that) {
5297
      if (that == null)
5298
        return false;
5299
      if (that instanceof getAllPurchases_args)
5300
        return this.equals((getAllPurchases_args)that);
5301
      return false;
5302
    }
5303
 
5304
    public boolean equals(getAllPurchases_args that) {
5305
      if (that == null)
5306
        return false;
5307
 
5308
      boolean this_present_purchaseOrderId = true;
5309
      boolean that_present_purchaseOrderId = true;
5310
      if (this_present_purchaseOrderId || that_present_purchaseOrderId) {
5311
        if (!(this_present_purchaseOrderId && that_present_purchaseOrderId))
5312
          return false;
5313
        if (this.purchaseOrderId != that.purchaseOrderId)
5314
          return false;
5315
      }
5316
 
5317
      boolean this_present_open = true;
5318
      boolean that_present_open = true;
5319
      if (this_present_open || that_present_open) {
5320
        if (!(this_present_open && that_present_open))
5321
          return false;
5322
        if (this.open != that.open)
5323
          return false;
5324
      }
5325
 
5326
      return true;
5327
    }
5328
 
5329
    @Override
5330
    public int hashCode() {
5331
      return 0;
5332
    }
5333
 
5334
    public int compareTo(getAllPurchases_args other) {
5335
      if (!getClass().equals(other.getClass())) {
5336
        return getClass().getName().compareTo(other.getClass().getName());
5337
      }
5338
 
5339
      int lastComparison = 0;
5340
      getAllPurchases_args typedOther = (getAllPurchases_args)other;
5341
 
5342
      lastComparison = Boolean.valueOf(isSetPurchaseOrderId()).compareTo(typedOther.isSetPurchaseOrderId());
5343
      if (lastComparison != 0) {
5344
        return lastComparison;
5345
      }
5346
      if (isSetPurchaseOrderId()) {
5347
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.purchaseOrderId, typedOther.purchaseOrderId);
5348
        if (lastComparison != 0) {
5349
          return lastComparison;
5350
        }
5351
      }
5352
      lastComparison = Boolean.valueOf(isSetOpen()).compareTo(typedOther.isSetOpen());
5353
      if (lastComparison != 0) {
5354
        return lastComparison;
5355
      }
5356
      if (isSetOpen()) {
5357
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.open, typedOther.open);
5358
        if (lastComparison != 0) {
5359
          return lastComparison;
5360
        }
5361
      }
5362
      return 0;
5363
    }
5364
 
5365
    public _Fields fieldForId(int fieldId) {
5366
      return _Fields.findByThriftId(fieldId);
5367
    }
5368
 
5369
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
5370
      org.apache.thrift.protocol.TField field;
5371
      iprot.readStructBegin();
5372
      while (true)
5373
      {
5374
        field = iprot.readFieldBegin();
5375
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
5376
          break;
5377
        }
5378
        switch (field.id) {
5379
          case 1: // PURCHASE_ORDER_ID
5380
            if (field.type == org.apache.thrift.protocol.TType.I64) {
5381
              this.purchaseOrderId = iprot.readI64();
5382
              setPurchaseOrderIdIsSet(true);
5383
            } else { 
5384
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5385
            }
5386
            break;
5387
          case 2: // OPEN
5388
            if (field.type == org.apache.thrift.protocol.TType.BOOL) {
5389
              this.open = iprot.readBool();
5390
              setOpenIsSet(true);
5391
            } else { 
5392
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5393
            }
5394
            break;
5395
          default:
5396
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5397
        }
5398
        iprot.readFieldEnd();
5399
      }
5400
      iprot.readStructEnd();
5401
      validate();
5402
    }
5403
 
5404
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
5405
      validate();
5406
 
5407
      oprot.writeStructBegin(STRUCT_DESC);
5408
      oprot.writeFieldBegin(PURCHASE_ORDER_ID_FIELD_DESC);
5409
      oprot.writeI64(this.purchaseOrderId);
5410
      oprot.writeFieldEnd();
5411
      oprot.writeFieldBegin(OPEN_FIELD_DESC);
5412
      oprot.writeBool(this.open);
5413
      oprot.writeFieldEnd();
5414
      oprot.writeFieldStop();
5415
      oprot.writeStructEnd();
5416
    }
5417
 
5418
    @Override
5419
    public String toString() {
5420
      StringBuilder sb = new StringBuilder("getAllPurchases_args(");
5421
      boolean first = true;
5422
 
5423
      sb.append("purchaseOrderId:");
5424
      sb.append(this.purchaseOrderId);
5425
      first = false;
5426
      if (!first) sb.append(", ");
5427
      sb.append("open:");
5428
      sb.append(this.open);
5429
      first = false;
5430
      sb.append(")");
5431
      return sb.toString();
5432
    }
5433
 
5434
    public void validate() throws org.apache.thrift.TException {
5435
      // check for required fields
5436
    }
5437
 
5438
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
5439
      try {
5440
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
5441
      } catch (org.apache.thrift.TException te) {
5442
        throw new java.io.IOException(te);
5443
      }
5444
    }
5445
 
5446
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
5447
      try {
5448
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
5449
      } catch (org.apache.thrift.TException te) {
5450
        throw new java.io.IOException(te);
5451
      }
5452
    }
5453
 
5454
  }
5455
 
5456
  public static class getAllPurchases_result implements org.apache.thrift.TBase<getAllPurchases_result, getAllPurchases_result._Fields>, java.io.Serializable, Cloneable   {
5457
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllPurchases_result");
5458
 
5459
    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);
5460
    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);
5461
 
5462
    private List<Purchase> success; // required
5463
    private PurchaseServiceException e; // required
5464
 
5465
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
5466
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
5467
      SUCCESS((short)0, "success"),
5468
      E((short)1, "e");
5469
 
5470
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
5471
 
5472
      static {
5473
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
5474
          byName.put(field.getFieldName(), field);
5475
        }
5476
      }
5477
 
5478
      /**
5479
       * Find the _Fields constant that matches fieldId, or null if its not found.
5480
       */
5481
      public static _Fields findByThriftId(int fieldId) {
5482
        switch(fieldId) {
5483
          case 0: // SUCCESS
5484
            return SUCCESS;
5485
          case 1: // E
5486
            return E;
5487
          default:
5488
            return null;
5489
        }
5490
      }
5491
 
5492
      /**
5493
       * Find the _Fields constant that matches fieldId, throwing an exception
5494
       * if it is not found.
5495
       */
5496
      public static _Fields findByThriftIdOrThrow(int fieldId) {
5497
        _Fields fields = findByThriftId(fieldId);
5498
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
5499
        return fields;
5500
      }
5501
 
5502
      /**
5503
       * Find the _Fields constant that matches name, or null if its not found.
5504
       */
5505
      public static _Fields findByName(String name) {
5506
        return byName.get(name);
5507
      }
5508
 
5509
      private final short _thriftId;
5510
      private final String _fieldName;
5511
 
5512
      _Fields(short thriftId, String fieldName) {
5513
        _thriftId = thriftId;
5514
        _fieldName = fieldName;
5515
      }
5516
 
5517
      public short getThriftFieldId() {
5518
        return _thriftId;
5519
      }
5520
 
5521
      public String getFieldName() {
5522
        return _fieldName;
5523
      }
5524
    }
5525
 
5526
    // isset id assignments
5527
 
5528
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
5529
    static {
5530
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
5531
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
5532
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
5533
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Purchase.class))));
5534
      tmpMap.put(_Fields.E, new org.apache.thrift.meta_data.FieldMetaData("e", org.apache.thrift.TFieldRequirementType.DEFAULT, 
5535
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
5536
      metaDataMap = Collections.unmodifiableMap(tmpMap);
5537
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllPurchases_result.class, metaDataMap);
5538
    }
5539
 
5540
    public getAllPurchases_result() {
5541
    }
5542
 
5543
    public getAllPurchases_result(
5544
      List<Purchase> success,
5545
      PurchaseServiceException e)
5546
    {
5547
      this();
5548
      this.success = success;
5549
      this.e = e;
5550
    }
5551
 
5552
    /**
5553
     * Performs a deep copy on <i>other</i>.
5554
     */
5555
    public getAllPurchases_result(getAllPurchases_result other) {
5556
      if (other.isSetSuccess()) {
5557
        List<Purchase> __this__success = new ArrayList<Purchase>();
5558
        for (Purchase other_element : other.success) {
5559
          __this__success.add(new Purchase(other_element));
5560
        }
5561
        this.success = __this__success;
5562
      }
5563
      if (other.isSetE()) {
5564
        this.e = new PurchaseServiceException(other.e);
5565
      }
5566
    }
5567
 
5568
    public getAllPurchases_result deepCopy() {
5569
      return new getAllPurchases_result(this);
5570
    }
5571
 
5572
    @Override
5573
    public void clear() {
5574
      this.success = null;
5575
      this.e = null;
5576
    }
5577
 
5578
    public int getSuccessSize() {
5579
      return (this.success == null) ? 0 : this.success.size();
5580
    }
5581
 
5582
    public java.util.Iterator<Purchase> getSuccessIterator() {
5583
      return (this.success == null) ? null : this.success.iterator();
5584
    }
5585
 
5586
    public void addToSuccess(Purchase elem) {
5587
      if (this.success == null) {
5588
        this.success = new ArrayList<Purchase>();
5589
      }
5590
      this.success.add(elem);
5591
    }
5592
 
5593
    public List<Purchase> getSuccess() {
5594
      return this.success;
5595
    }
5596
 
5597
    public void setSuccess(List<Purchase> success) {
5598
      this.success = success;
5599
    }
5600
 
5601
    public void unsetSuccess() {
5602
      this.success = null;
5603
    }
5604
 
5605
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
5606
    public boolean isSetSuccess() {
5607
      return this.success != null;
5608
    }
5609
 
5610
    public void setSuccessIsSet(boolean value) {
5611
      if (!value) {
5612
        this.success = null;
5613
      }
5614
    }
5615
 
5616
    public PurchaseServiceException getE() {
5617
      return this.e;
5618
    }
5619
 
5620
    public void setE(PurchaseServiceException e) {
5621
      this.e = e;
5622
    }
5623
 
5624
    public void unsetE() {
5625
      this.e = null;
5626
    }
5627
 
5628
    /** Returns true if field e is set (has been assigned a value) and false otherwise */
5629
    public boolean isSetE() {
5630
      return this.e != null;
5631
    }
5632
 
5633
    public void setEIsSet(boolean value) {
5634
      if (!value) {
5635
        this.e = null;
5636
      }
5637
    }
5638
 
5639
    public void setFieldValue(_Fields field, Object value) {
5640
      switch (field) {
5641
      case SUCCESS:
5642
        if (value == null) {
5643
          unsetSuccess();
5644
        } else {
5645
          setSuccess((List<Purchase>)value);
5646
        }
5647
        break;
5648
 
5649
      case E:
5650
        if (value == null) {
5651
          unsetE();
5652
        } else {
5653
          setE((PurchaseServiceException)value);
5654
        }
5655
        break;
5656
 
5657
      }
5658
    }
5659
 
5660
    public Object getFieldValue(_Fields field) {
5661
      switch (field) {
5662
      case SUCCESS:
5663
        return getSuccess();
5664
 
5665
      case E:
5666
        return getE();
5667
 
5668
      }
5669
      throw new IllegalStateException();
5670
    }
5671
 
5672
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
5673
    public boolean isSet(_Fields field) {
5674
      if (field == null) {
5675
        throw new IllegalArgumentException();
5676
      }
5677
 
5678
      switch (field) {
5679
      case SUCCESS:
5680
        return isSetSuccess();
5681
      case E:
5682
        return isSetE();
5683
      }
5684
      throw new IllegalStateException();
5685
    }
5686
 
5687
    @Override
5688
    public boolean equals(Object that) {
5689
      if (that == null)
5690
        return false;
5691
      if (that instanceof getAllPurchases_result)
5692
        return this.equals((getAllPurchases_result)that);
5693
      return false;
5694
    }
5695
 
5696
    public boolean equals(getAllPurchases_result that) {
5697
      if (that == null)
5698
        return false;
5699
 
5700
      boolean this_present_success = true && this.isSetSuccess();
5701
      boolean that_present_success = true && that.isSetSuccess();
5702
      if (this_present_success || that_present_success) {
5703
        if (!(this_present_success && that_present_success))
5704
          return false;
5705
        if (!this.success.equals(that.success))
5706
          return false;
5707
      }
5708
 
5709
      boolean this_present_e = true && this.isSetE();
5710
      boolean that_present_e = true && that.isSetE();
5711
      if (this_present_e || that_present_e) {
5712
        if (!(this_present_e && that_present_e))
5713
          return false;
5714
        if (!this.e.equals(that.e))
5715
          return false;
5716
      }
5717
 
5718
      return true;
5719
    }
5720
 
5721
    @Override
5722
    public int hashCode() {
5723
      return 0;
5724
    }
5725
 
5726
    public int compareTo(getAllPurchases_result other) {
5727
      if (!getClass().equals(other.getClass())) {
5728
        return getClass().getName().compareTo(other.getClass().getName());
5729
      }
5730
 
5731
      int lastComparison = 0;
5732
      getAllPurchases_result typedOther = (getAllPurchases_result)other;
5733
 
5734
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
5735
      if (lastComparison != 0) {
5736
        return lastComparison;
5737
      }
5738
      if (isSetSuccess()) {
5739
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
5740
        if (lastComparison != 0) {
5741
          return lastComparison;
5742
        }
5743
      }
5744
      lastComparison = Boolean.valueOf(isSetE()).compareTo(typedOther.isSetE());
5745
      if (lastComparison != 0) {
5746
        return lastComparison;
5747
      }
5748
      if (isSetE()) {
5749
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, typedOther.e);
5750
        if (lastComparison != 0) {
5751
          return lastComparison;
5752
        }
5753
      }
5754
      return 0;
5755
    }
5756
 
5757
    public _Fields fieldForId(int fieldId) {
5758
      return _Fields.findByThriftId(fieldId);
5759
    }
5760
 
5761
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
5762
      org.apache.thrift.protocol.TField field;
5763
      iprot.readStructBegin();
5764
      while (true)
5765
      {
5766
        field = iprot.readFieldBegin();
5767
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
5768
          break;
5769
        }
5770
        switch (field.id) {
5771
          case 0: // SUCCESS
5772
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
5773
              {
5774
                org.apache.thrift.protocol.TList _list8 = iprot.readListBegin();
5775
                this.success = new ArrayList<Purchase>(_list8.size);
5776
                for (int _i9 = 0; _i9 < _list8.size; ++_i9)
5777
                {
5778
                  Purchase _elem10; // required
5779
                  _elem10 = new Purchase();
5780
                  _elem10.read(iprot);
5781
                  this.success.add(_elem10);
5782
                }
5783
                iprot.readListEnd();
5784
              }
5785
            } else { 
5786
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5787
            }
5788
            break;
5789
          case 1: // E
5790
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
5791
              this.e = new PurchaseServiceException();
5792
              this.e.read(iprot);
5793
            } else { 
5794
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5795
            }
5796
            break;
5797
          default:
5798
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5799
        }
5800
        iprot.readFieldEnd();
5801
      }
5802
      iprot.readStructEnd();
5803
      validate();
5804
    }
5805
 
5806
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
5807
      oprot.writeStructBegin(STRUCT_DESC);
5808
 
5809
      if (this.isSetSuccess()) {
5810
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
5811
        {
5812
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
5813
          for (Purchase _iter11 : this.success)
5814
          {
5815
            _iter11.write(oprot);
5816
          }
5817
          oprot.writeListEnd();
5818
        }
5819
        oprot.writeFieldEnd();
5820
      } else if (this.isSetE()) {
5821
        oprot.writeFieldBegin(E_FIELD_DESC);
5822
        this.e.write(oprot);
5823
        oprot.writeFieldEnd();
5824
      }
5825
      oprot.writeFieldStop();
5826
      oprot.writeStructEnd();
5827
    }
5828
 
5829
    @Override
5830
    public String toString() {
5831
      StringBuilder sb = new StringBuilder("getAllPurchases_result(");
5832
      boolean first = true;
5833
 
5834
      sb.append("success:");
5835
      if (this.success == null) {
5836
        sb.append("null");
5837
      } else {
5838
        sb.append(this.success);
5839
      }
5840
      first = false;
5841
      if (!first) sb.append(", ");
5842
      sb.append("e:");
5843
      if (this.e == null) {
5844
        sb.append("null");
5845
      } else {
5846
        sb.append(this.e);
5847
      }
5848
      first = false;
5849
      sb.append(")");
5850
      return sb.toString();
5851
    }
5852
 
5853
    public void validate() throws org.apache.thrift.TException {
5854
      // check for required fields
5855
    }
5856
 
5857
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
5858
      try {
5859
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
5860
      } catch (org.apache.thrift.TException te) {
5861
        throw new java.io.IOException(te);
5862
      }
5863
    }
5864
 
5865
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
5866
      try {
5867
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
5868
      } catch (org.apache.thrift.TException te) {
5869
        throw new java.io.IOException(te);
5870
      }
5871
    }
5872
 
5873
  }
5874
 
5875
  public static class getPrice_args implements org.apache.thrift.TBase<getPrice_args, getPrice_args._Fields>, java.io.Serializable, Cloneable   {
5876
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getPrice_args");
5877
 
5878
    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);
5879
    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);
5880
 
5881
    private long purchaseId; // required
5882
    private long itemId; // required
5883
 
5884
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
5885
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
5886
      PURCHASE_ID((short)1, "purchaseId"),
5887
      ITEM_ID((short)2, "itemId");
5888
 
5889
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
5890
 
5891
      static {
5892
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
5893
          byName.put(field.getFieldName(), field);
5894
        }
5895
      }
5896
 
5897
      /**
5898
       * Find the _Fields constant that matches fieldId, or null if its not found.
5899
       */
5900
      public static _Fields findByThriftId(int fieldId) {
5901
        switch(fieldId) {
5902
          case 1: // PURCHASE_ID
5903
            return PURCHASE_ID;
5904
          case 2: // ITEM_ID
5905
            return ITEM_ID;
5906
          default:
5907
            return null;
5908
        }
5909
      }
5910
 
5911
      /**
5912
       * Find the _Fields constant that matches fieldId, throwing an exception
5913
       * if it is not found.
5914
       */
5915
      public static _Fields findByThriftIdOrThrow(int fieldId) {
5916
        _Fields fields = findByThriftId(fieldId);
5917
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
5918
        return fields;
5919
      }
5920
 
5921
      /**
5922
       * Find the _Fields constant that matches name, or null if its not found.
5923
       */
5924
      public static _Fields findByName(String name) {
5925
        return byName.get(name);
5926
      }
5927
 
5928
      private final short _thriftId;
5929
      private final String _fieldName;
5930
 
5931
      _Fields(short thriftId, String fieldName) {
5932
        _thriftId = thriftId;
5933
        _fieldName = fieldName;
5934
      }
5935
 
5936
      public short getThriftFieldId() {
5937
        return _thriftId;
5938
      }
5939
 
5940
      public String getFieldName() {
5941
        return _fieldName;
5942
      }
5943
    }
5944
 
5945
    // isset id assignments
5946
    private static final int __PURCHASEID_ISSET_ID = 0;
5947
    private static final int __ITEMID_ISSET_ID = 1;
5948
    private BitSet __isset_bit_vector = new BitSet(2);
5949
 
5950
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
5951
    static {
5952
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
5953
      tmpMap.put(_Fields.PURCHASE_ID, new org.apache.thrift.meta_data.FieldMetaData("purchaseId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
5954
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
5955
      tmpMap.put(_Fields.ITEM_ID, new org.apache.thrift.meta_data.FieldMetaData("itemId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
5956
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
5957
      metaDataMap = Collections.unmodifiableMap(tmpMap);
5958
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPrice_args.class, metaDataMap);
5959
    }
5960
 
5961
    public getPrice_args() {
5962
    }
5963
 
5964
    public getPrice_args(
5965
      long purchaseId,
5966
      long itemId)
5967
    {
5968
      this();
5969
      this.purchaseId = purchaseId;
5970
      setPurchaseIdIsSet(true);
5971
      this.itemId = itemId;
5972
      setItemIdIsSet(true);
5973
    }
5974
 
5975
    /**
5976
     * Performs a deep copy on <i>other</i>.
5977
     */
5978
    public getPrice_args(getPrice_args other) {
5979
      __isset_bit_vector.clear();
5980
      __isset_bit_vector.or(other.__isset_bit_vector);
5981
      this.purchaseId = other.purchaseId;
5982
      this.itemId = other.itemId;
5983
    }
5984
 
5985
    public getPrice_args deepCopy() {
5986
      return new getPrice_args(this);
5987
    }
5988
 
5989
    @Override
5990
    public void clear() {
5991
      setPurchaseIdIsSet(false);
5992
      this.purchaseId = 0;
5993
      setItemIdIsSet(false);
5994
      this.itemId = 0;
5995
    }
5996
 
5997
    public long getPurchaseId() {
5998
      return this.purchaseId;
5999
    }
6000
 
6001
    public void setPurchaseId(long purchaseId) {
6002
      this.purchaseId = purchaseId;
6003
      setPurchaseIdIsSet(true);
6004
    }
6005
 
6006
    public void unsetPurchaseId() {
6007
      __isset_bit_vector.clear(__PURCHASEID_ISSET_ID);
6008
    }
6009
 
6010
    /** Returns true if field purchaseId is set (has been assigned a value) and false otherwise */
6011
    public boolean isSetPurchaseId() {
6012
      return __isset_bit_vector.get(__PURCHASEID_ISSET_ID);
6013
    }
6014
 
6015
    public void setPurchaseIdIsSet(boolean value) {
6016
      __isset_bit_vector.set(__PURCHASEID_ISSET_ID, value);
6017
    }
6018
 
6019
    public long getItemId() {
6020
      return this.itemId;
6021
    }
6022
 
6023
    public void setItemId(long itemId) {
6024
      this.itemId = itemId;
6025
      setItemIdIsSet(true);
6026
    }
6027
 
6028
    public void unsetItemId() {
6029
      __isset_bit_vector.clear(__ITEMID_ISSET_ID);
6030
    }
6031
 
6032
    /** Returns true if field itemId is set (has been assigned a value) and false otherwise */
6033
    public boolean isSetItemId() {
6034
      return __isset_bit_vector.get(__ITEMID_ISSET_ID);
6035
    }
6036
 
6037
    public void setItemIdIsSet(boolean value) {
6038
      __isset_bit_vector.set(__ITEMID_ISSET_ID, value);
6039
    }
6040
 
6041
    public void setFieldValue(_Fields field, Object value) {
6042
      switch (field) {
6043
      case PURCHASE_ID:
6044
        if (value == null) {
6045
          unsetPurchaseId();
6046
        } else {
6047
          setPurchaseId((Long)value);
6048
        }
6049
        break;
6050
 
6051
      case ITEM_ID:
6052
        if (value == null) {
6053
          unsetItemId();
6054
        } else {
6055
          setItemId((Long)value);
6056
        }
6057
        break;
6058
 
6059
      }
6060
    }
6061
 
6062
    public Object getFieldValue(_Fields field) {
6063
      switch (field) {
6064
      case PURCHASE_ID:
6065
        return Long.valueOf(getPurchaseId());
6066
 
6067
      case ITEM_ID:
6068
        return Long.valueOf(getItemId());
6069
 
6070
      }
6071
      throw new IllegalStateException();
6072
    }
6073
 
6074
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
6075
    public boolean isSet(_Fields field) {
6076
      if (field == null) {
6077
        throw new IllegalArgumentException();
6078
      }
6079
 
6080
      switch (field) {
6081
      case PURCHASE_ID:
6082
        return isSetPurchaseId();
6083
      case ITEM_ID:
6084
        return isSetItemId();
6085
      }
6086
      throw new IllegalStateException();
6087
    }
6088
 
6089
    @Override
6090
    public boolean equals(Object that) {
6091
      if (that == null)
6092
        return false;
6093
      if (that instanceof getPrice_args)
6094
        return this.equals((getPrice_args)that);
6095
      return false;
6096
    }
6097
 
6098
    public boolean equals(getPrice_args that) {
6099
      if (that == null)
6100
        return false;
6101
 
6102
      boolean this_present_purchaseId = true;
6103
      boolean that_present_purchaseId = true;
6104
      if (this_present_purchaseId || that_present_purchaseId) {
6105
        if (!(this_present_purchaseId && that_present_purchaseId))
6106
          return false;
6107
        if (this.purchaseId != that.purchaseId)
6108
          return false;
6109
      }
6110
 
6111
      boolean this_present_itemId = true;
6112
      boolean that_present_itemId = true;
6113
      if (this_present_itemId || that_present_itemId) {
6114
        if (!(this_present_itemId && that_present_itemId))
6115
          return false;
6116
        if (this.itemId != that.itemId)
6117
          return false;
6118
      }
6119
 
6120
      return true;
6121
    }
6122
 
6123
    @Override
6124
    public int hashCode() {
6125
      return 0;
6126
    }
6127
 
6128
    public int compareTo(getPrice_args other) {
6129
      if (!getClass().equals(other.getClass())) {
6130
        return getClass().getName().compareTo(other.getClass().getName());
6131
      }
6132
 
6133
      int lastComparison = 0;
6134
      getPrice_args typedOther = (getPrice_args)other;
6135
 
6136
      lastComparison = Boolean.valueOf(isSetPurchaseId()).compareTo(typedOther.isSetPurchaseId());
6137
      if (lastComparison != 0) {
6138
        return lastComparison;
6139
      }
6140
      if (isSetPurchaseId()) {
6141
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.purchaseId, typedOther.purchaseId);
6142
        if (lastComparison != 0) {
6143
          return lastComparison;
6144
        }
6145
      }
6146
      lastComparison = Boolean.valueOf(isSetItemId()).compareTo(typedOther.isSetItemId());
6147
      if (lastComparison != 0) {
6148
        return lastComparison;
6149
      }
6150
      if (isSetItemId()) {
6151
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.itemId, typedOther.itemId);
6152
        if (lastComparison != 0) {
6153
          return lastComparison;
6154
        }
6155
      }
6156
      return 0;
6157
    }
6158
 
6159
    public _Fields fieldForId(int fieldId) {
6160
      return _Fields.findByThriftId(fieldId);
6161
    }
6162
 
6163
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
6164
      org.apache.thrift.protocol.TField field;
6165
      iprot.readStructBegin();
6166
      while (true)
6167
      {
6168
        field = iprot.readFieldBegin();
6169
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
6170
          break;
6171
        }
6172
        switch (field.id) {
6173
          case 1: // PURCHASE_ID
6174
            if (field.type == org.apache.thrift.protocol.TType.I64) {
6175
              this.purchaseId = iprot.readI64();
6176
              setPurchaseIdIsSet(true);
6177
            } else { 
6178
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6179
            }
6180
            break;
6181
          case 2: // ITEM_ID
6182
            if (field.type == org.apache.thrift.protocol.TType.I64) {
6183
              this.itemId = iprot.readI64();
6184
              setItemIdIsSet(true);
6185
            } else { 
6186
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6187
            }
6188
            break;
6189
          default:
6190
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6191
        }
6192
        iprot.readFieldEnd();
6193
      }
6194
      iprot.readStructEnd();
6195
      validate();
6196
    }
6197
 
6198
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
6199
      validate();
6200
 
6201
      oprot.writeStructBegin(STRUCT_DESC);
6202
      oprot.writeFieldBegin(PURCHASE_ID_FIELD_DESC);
6203
      oprot.writeI64(this.purchaseId);
6204
      oprot.writeFieldEnd();
6205
      oprot.writeFieldBegin(ITEM_ID_FIELD_DESC);
6206
      oprot.writeI64(this.itemId);
6207
      oprot.writeFieldEnd();
6208
      oprot.writeFieldStop();
6209
      oprot.writeStructEnd();
6210
    }
6211
 
6212
    @Override
6213
    public String toString() {
6214
      StringBuilder sb = new StringBuilder("getPrice_args(");
6215
      boolean first = true;
6216
 
6217
      sb.append("purchaseId:");
6218
      sb.append(this.purchaseId);
6219
      first = false;
6220
      if (!first) sb.append(", ");
6221
      sb.append("itemId:");
6222
      sb.append(this.itemId);
6223
      first = false;
6224
      sb.append(")");
6225
      return sb.toString();
6226
    }
6227
 
6228
    public void validate() throws org.apache.thrift.TException {
6229
      // check for required fields
6230
    }
6231
 
6232
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
6233
      try {
6234
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
6235
      } catch (org.apache.thrift.TException te) {
6236
        throw new java.io.IOException(te);
6237
      }
6238
    }
6239
 
6240
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
6241
      try {
6242
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
6243
      } catch (org.apache.thrift.TException te) {
6244
        throw new java.io.IOException(te);
6245
      }
6246
    }
6247
 
6248
  }
6249
 
6250
  public static class getPrice_result implements org.apache.thrift.TBase<getPrice_result, getPrice_result._Fields>, java.io.Serializable, Cloneable   {
6251
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getPrice_result");
6252
 
6253
    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);
6254
 
6255
    private long success; // required
6256
 
6257
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
6258
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
6259
      SUCCESS((short)0, "success");
6260
 
6261
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
6262
 
6263
      static {
6264
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
6265
          byName.put(field.getFieldName(), field);
6266
        }
6267
      }
6268
 
6269
      /**
6270
       * Find the _Fields constant that matches fieldId, or null if its not found.
6271
       */
6272
      public static _Fields findByThriftId(int fieldId) {
6273
        switch(fieldId) {
6274
          case 0: // SUCCESS
6275
            return SUCCESS;
6276
          default:
6277
            return null;
6278
        }
6279
      }
6280
 
6281
      /**
6282
       * Find the _Fields constant that matches fieldId, throwing an exception
6283
       * if it is not found.
6284
       */
6285
      public static _Fields findByThriftIdOrThrow(int fieldId) {
6286
        _Fields fields = findByThriftId(fieldId);
6287
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
6288
        return fields;
6289
      }
6290
 
6291
      /**
6292
       * Find the _Fields constant that matches name, or null if its not found.
6293
       */
6294
      public static _Fields findByName(String name) {
6295
        return byName.get(name);
6296
      }
6297
 
6298
      private final short _thriftId;
6299
      private final String _fieldName;
6300
 
6301
      _Fields(short thriftId, String fieldName) {
6302
        _thriftId = thriftId;
6303
        _fieldName = fieldName;
6304
      }
6305
 
6306
      public short getThriftFieldId() {
6307
        return _thriftId;
6308
      }
6309
 
6310
      public String getFieldName() {
6311
        return _fieldName;
6312
      }
6313
    }
6314
 
6315
    // isset id assignments
6316
    private static final int __SUCCESS_ISSET_ID = 0;
6317
    private BitSet __isset_bit_vector = new BitSet(1);
6318
 
6319
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
6320
    static {
6321
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
6322
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
6323
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
6324
      metaDataMap = Collections.unmodifiableMap(tmpMap);
6325
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPrice_result.class, metaDataMap);
6326
    }
6327
 
6328
    public getPrice_result() {
6329
    }
6330
 
6331
    public getPrice_result(
6332
      long success)
6333
    {
6334
      this();
6335
      this.success = success;
6336
      setSuccessIsSet(true);
6337
    }
6338
 
6339
    /**
6340
     * Performs a deep copy on <i>other</i>.
6341
     */
6342
    public getPrice_result(getPrice_result other) {
6343
      __isset_bit_vector.clear();
6344
      __isset_bit_vector.or(other.__isset_bit_vector);
6345
      this.success = other.success;
6346
    }
6347
 
6348
    public getPrice_result deepCopy() {
6349
      return new getPrice_result(this);
6350
    }
6351
 
6352
    @Override
6353
    public void clear() {
6354
      setSuccessIsSet(false);
6355
      this.success = 0;
6356
    }
6357
 
6358
    public long getSuccess() {
6359
      return this.success;
6360
    }
6361
 
6362
    public void setSuccess(long success) {
6363
      this.success = success;
6364
      setSuccessIsSet(true);
6365
    }
6366
 
6367
    public void unsetSuccess() {
6368
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
6369
    }
6370
 
6371
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
6372
    public boolean isSetSuccess() {
6373
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
6374
    }
6375
 
6376
    public void setSuccessIsSet(boolean value) {
6377
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
6378
    }
6379
 
6380
    public void setFieldValue(_Fields field, Object value) {
6381
      switch (field) {
6382
      case SUCCESS:
6383
        if (value == null) {
6384
          unsetSuccess();
6385
        } else {
6386
          setSuccess((Long)value);
6387
        }
6388
        break;
6389
 
6390
      }
6391
    }
6392
 
6393
    public Object getFieldValue(_Fields field) {
6394
      switch (field) {
6395
      case SUCCESS:
6396
        return Long.valueOf(getSuccess());
6397
 
6398
      }
6399
      throw new IllegalStateException();
6400
    }
6401
 
6402
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
6403
    public boolean isSet(_Fields field) {
6404
      if (field == null) {
6405
        throw new IllegalArgumentException();
6406
      }
6407
 
6408
      switch (field) {
6409
      case SUCCESS:
6410
        return isSetSuccess();
6411
      }
6412
      throw new IllegalStateException();
6413
    }
6414
 
6415
    @Override
6416
    public boolean equals(Object that) {
6417
      if (that == null)
6418
        return false;
6419
      if (that instanceof getPrice_result)
6420
        return this.equals((getPrice_result)that);
6421
      return false;
6422
    }
6423
 
6424
    public boolean equals(getPrice_result that) {
6425
      if (that == null)
6426
        return false;
6427
 
6428
      boolean this_present_success = true;
6429
      boolean that_present_success = true;
6430
      if (this_present_success || that_present_success) {
6431
        if (!(this_present_success && that_present_success))
6432
          return false;
6433
        if (this.success != that.success)
6434
          return false;
6435
      }
6436
 
6437
      return true;
6438
    }
6439
 
6440
    @Override
6441
    public int hashCode() {
6442
      return 0;
6443
    }
6444
 
6445
    public int compareTo(getPrice_result other) {
6446
      if (!getClass().equals(other.getClass())) {
6447
        return getClass().getName().compareTo(other.getClass().getName());
6448
      }
6449
 
6450
      int lastComparison = 0;
6451
      getPrice_result typedOther = (getPrice_result)other;
6452
 
6453
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
6454
      if (lastComparison != 0) {
6455
        return lastComparison;
6456
      }
6457
      if (isSetSuccess()) {
6458
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
6459
        if (lastComparison != 0) {
6460
          return lastComparison;
6461
        }
6462
      }
6463
      return 0;
6464
    }
6465
 
6466
    public _Fields fieldForId(int fieldId) {
6467
      return _Fields.findByThriftId(fieldId);
6468
    }
6469
 
6470
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
6471
      org.apache.thrift.protocol.TField field;
6472
      iprot.readStructBegin();
6473
      while (true)
6474
      {
6475
        field = iprot.readFieldBegin();
6476
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
6477
          break;
6478
        }
6479
        switch (field.id) {
6480
          case 0: // SUCCESS
6481
            if (field.type == org.apache.thrift.protocol.TType.I64) {
6482
              this.success = iprot.readI64();
6483
              setSuccessIsSet(true);
6484
            } else { 
6485
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6486
            }
6487
            break;
6488
          default:
6489
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6490
        }
6491
        iprot.readFieldEnd();
6492
      }
6493
      iprot.readStructEnd();
6494
      validate();
6495
    }
6496
 
6497
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
6498
      oprot.writeStructBegin(STRUCT_DESC);
6499
 
6500
      if (this.isSetSuccess()) {
6501
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
6502
        oprot.writeI64(this.success);
6503
        oprot.writeFieldEnd();
6504
      }
6505
      oprot.writeFieldStop();
6506
      oprot.writeStructEnd();
6507
    }
6508
 
6509
    @Override
6510
    public String toString() {
6511
      StringBuilder sb = new StringBuilder("getPrice_result(");
6512
      boolean first = true;
6513
 
6514
      sb.append("success:");
6515
      sb.append(this.success);
6516
      first = false;
6517
      sb.append(")");
6518
      return sb.toString();
6519
    }
6520
 
6521
    public void validate() throws org.apache.thrift.TException {
6522
      // check for required fields
6523
    }
6524
 
6525
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
6526
      try {
6527
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
6528
      } catch (org.apache.thrift.TException te) {
6529
        throw new java.io.IOException(te);
6530
      }
6531
    }
6532
 
6533
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
6534
      try {
6535
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
6536
      } catch (org.apache.thrift.TException te) {
6537
        throw new java.io.IOException(te);
6538
      }
6539
    }
6540
 
6541
  }
6542
 
6543
}