Subversion Repositories SmartDukaan

Rev

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