Subversion Repositories SmartDukaan

Rev

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

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