Subversion Repositories SmartDukaan

Rev

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

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