Subversion Repositories SmartDukaan

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

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