Subversion Repositories SmartDukaan

Rev

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