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
     */
58
    public LogisticsInfo getLogisticsInfo(String destination_pincode, String 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
 
648 chandransh 212
    public LogisticsInfo getLogisticsInfo(String destination_pincode, String 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
 
648 chandransh 218
    public void send_getLogisticsInfo(String destination_pincode, String 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);
2498
    private static final TField ITEM_ID_FIELD_DESC = new TField("item_id", TType.STRING, (short)2);
471 rajveer 2499
 
648 chandransh 2500
    private String destination_pincode;
2501
    private String 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
2560
 
2561
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
648 chandransh 2562
      put(_Fields.DESTINATION_PINCODE, new FieldMetaData("destination_pincode", TFieldRequirementType.DEFAULT, 
471 rajveer 2563
          new FieldValueMetaData(TType.STRING)));
648 chandransh 2564
      put(_Fields.ITEM_ID, new FieldMetaData("item_id", TFieldRequirementType.DEFAULT, 
477 rajveer 2565
          new FieldValueMetaData(TType.STRING)));
2566
    }});
2567
 
2568
    static {
648 chandransh 2569
      FieldMetaData.addStructMetaDataMap(getLogisticsInfo_args.class, metaDataMap);
477 rajveer 2570
    }
2571
 
648 chandransh 2572
    public getLogisticsInfo_args() {
477 rajveer 2573
    }
2574
 
648 chandransh 2575
    public getLogisticsInfo_args(
2576
      String destination_pincode,
2577
      String item_id)
477 rajveer 2578
    {
2579
      this();
648 chandransh 2580
      this.destination_pincode = destination_pincode;
2581
      this.item_id = item_id;
477 rajveer 2582
    }
2583
 
2584
    /**
2585
     * Performs a deep copy on <i>other</i>.
2586
     */
648 chandransh 2587
    public getLogisticsInfo_args(getLogisticsInfo_args other) {
2588
      if (other.isSetDestination_pincode()) {
2589
        this.destination_pincode = other.destination_pincode;
477 rajveer 2590
      }
648 chandransh 2591
      if (other.isSetItem_id()) {
2592
        this.item_id = other.item_id;
477 rajveer 2593
      }
2594
    }
2595
 
648 chandransh 2596
    public getLogisticsInfo_args deepCopy() {
2597
      return new getLogisticsInfo_args(this);
477 rajveer 2598
    }
2599
 
2600
    @Deprecated
648 chandransh 2601
    public getLogisticsInfo_args clone() {
2602
      return new getLogisticsInfo_args(this);
477 rajveer 2603
    }
2604
 
648 chandransh 2605
    public String getDestination_pincode() {
2606
      return this.destination_pincode;
477 rajveer 2607
    }
2608
 
648 chandransh 2609
    public getLogisticsInfo_args setDestination_pincode(String destination_pincode) {
2610
      this.destination_pincode = destination_pincode;
477 rajveer 2611
      return this;
2612
    }
2613
 
648 chandransh 2614
    public void unsetDestination_pincode() {
2615
      this.destination_pincode = null;
477 rajveer 2616
    }
2617
 
648 chandransh 2618
    /** Returns true if field destination_pincode is set (has been asigned a value) and false otherwise */
2619
    public boolean isSetDestination_pincode() {
2620
      return this.destination_pincode != null;
477 rajveer 2621
    }
2622
 
648 chandransh 2623
    public void setDestination_pincodeIsSet(boolean value) {
477 rajveer 2624
      if (!value) {
648 chandransh 2625
        this.destination_pincode = null;
477 rajveer 2626
      }
2627
    }
2628
 
648 chandransh 2629
    public String getItem_id() {
2630
      return this.item_id;
477 rajveer 2631
    }
2632
 
648 chandransh 2633
    public getLogisticsInfo_args setItem_id(String item_id) {
2634
      this.item_id = item_id;
477 rajveer 2635
      return this;
2636
    }
2637
 
648 chandransh 2638
    public void unsetItem_id() {
2639
      this.item_id = null;
477 rajveer 2640
    }
2641
 
648 chandransh 2642
    /** Returns true if field item_id is set (has been asigned a value) and false otherwise */
2643
    public boolean isSetItem_id() {
2644
      return this.item_id != null;
477 rajveer 2645
    }
2646
 
648 chandransh 2647
    public void setItem_idIsSet(boolean value) {
477 rajveer 2648
      if (!value) {
648 chandransh 2649
        this.item_id = null;
477 rajveer 2650
      }
2651
    }
2652
 
2653
    public void setFieldValue(_Fields field, Object value) {
2654
      switch (field) {
648 chandransh 2655
      case DESTINATION_PINCODE:
477 rajveer 2656
        if (value == null) {
648 chandransh 2657
          unsetDestination_pincode();
477 rajveer 2658
        } else {
648 chandransh 2659
          setDestination_pincode((String)value);
477 rajveer 2660
        }
2661
        break;
2662
 
648 chandransh 2663
      case ITEM_ID:
477 rajveer 2664
        if (value == null) {
648 chandransh 2665
          unsetItem_id();
477 rajveer 2666
        } else {
648 chandransh 2667
          setItem_id((String)value);
477 rajveer 2668
        }
2669
        break;
2670
 
2671
      }
2672
    }
2673
 
2674
    public void setFieldValue(int fieldID, Object value) {
2675
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
2676
    }
2677
 
2678
    public Object getFieldValue(_Fields field) {
2679
      switch (field) {
648 chandransh 2680
      case DESTINATION_PINCODE:
2681
        return getDestination_pincode();
477 rajveer 2682
 
648 chandransh 2683
      case ITEM_ID:
2684
        return getItem_id();
477 rajveer 2685
 
2686
      }
2687
      throw new IllegalStateException();
2688
    }
2689
 
2690
    public Object getFieldValue(int fieldId) {
2691
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
2692
    }
2693
 
2694
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
2695
    public boolean isSet(_Fields field) {
2696
      switch (field) {
648 chandransh 2697
      case DESTINATION_PINCODE:
2698
        return isSetDestination_pincode();
2699
      case ITEM_ID:
2700
        return isSetItem_id();
477 rajveer 2701
      }
2702
      throw new IllegalStateException();
2703
    }
2704
 
2705
    public boolean isSet(int fieldID) {
2706
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
2707
    }
2708
 
2709
    @Override
2710
    public boolean equals(Object that) {
2711
      if (that == null)
2712
        return false;
648 chandransh 2713
      if (that instanceof getLogisticsInfo_args)
2714
        return this.equals((getLogisticsInfo_args)that);
477 rajveer 2715
      return false;
2716
    }
2717
 
648 chandransh 2718
    public boolean equals(getLogisticsInfo_args that) {
477 rajveer 2719
      if (that == null)
2720
        return false;
2721
 
648 chandransh 2722
      boolean this_present_destination_pincode = true && this.isSetDestination_pincode();
2723
      boolean that_present_destination_pincode = true && that.isSetDestination_pincode();
2724
      if (this_present_destination_pincode || that_present_destination_pincode) {
2725
        if (!(this_present_destination_pincode && that_present_destination_pincode))
477 rajveer 2726
          return false;
648 chandransh 2727
        if (!this.destination_pincode.equals(that.destination_pincode))
477 rajveer 2728
          return false;
2729
      }
2730
 
648 chandransh 2731
      boolean this_present_item_id = true && this.isSetItem_id();
2732
      boolean that_present_item_id = true && that.isSetItem_id();
2733
      if (this_present_item_id || that_present_item_id) {
2734
        if (!(this_present_item_id && that_present_item_id))
477 rajveer 2735
          return false;
648 chandransh 2736
        if (!this.item_id.equals(that.item_id))
477 rajveer 2737
          return false;
2738
      }
2739
 
2740
      return true;
2741
    }
2742
 
2743
    @Override
2744
    public int hashCode() {
2745
      return 0;
2746
    }
2747
 
648 chandransh 2748
    public int compareTo(getLogisticsInfo_args other) {
477 rajveer 2749
      if (!getClass().equals(other.getClass())) {
2750
        return getClass().getName().compareTo(other.getClass().getName());
2751
      }
2752
 
2753
      int lastComparison = 0;
648 chandransh 2754
      getLogisticsInfo_args typedOther = (getLogisticsInfo_args)other;
477 rajveer 2755
 
648 chandransh 2756
      lastComparison = Boolean.valueOf(isSetDestination_pincode()).compareTo(isSetDestination_pincode());
477 rajveer 2757
      if (lastComparison != 0) {
2758
        return lastComparison;
2759
      }
648 chandransh 2760
      lastComparison = TBaseHelper.compareTo(destination_pincode, typedOther.destination_pincode);
477 rajveer 2761
      if (lastComparison != 0) {
2762
        return lastComparison;
2763
      }
648 chandransh 2764
      lastComparison = Boolean.valueOf(isSetItem_id()).compareTo(isSetItem_id());
477 rajveer 2765
      if (lastComparison != 0) {
2766
        return lastComparison;
2767
      }
648 chandransh 2768
      lastComparison = TBaseHelper.compareTo(item_id, typedOther.item_id);
477 rajveer 2769
      if (lastComparison != 0) {
2770
        return lastComparison;
2771
      }
2772
      return 0;
2773
    }
2774
 
2775
    public void read(TProtocol iprot) throws TException {
2776
      TField field;
2777
      iprot.readStructBegin();
2778
      while (true)
2779
      {
2780
        field = iprot.readFieldBegin();
2781
        if (field.type == TType.STOP) { 
2782
          break;
2783
        }
2784
        _Fields fieldId = _Fields.findByThriftId(field.id);
2785
        if (fieldId == null) {
2786
          TProtocolUtil.skip(iprot, field.type);
2787
        } else {
2788
          switch (fieldId) {
648 chandransh 2789
            case DESTINATION_PINCODE:
477 rajveer 2790
              if (field.type == TType.STRING) {
648 chandransh 2791
                this.destination_pincode = iprot.readString();
477 rajveer 2792
              } else { 
2793
                TProtocolUtil.skip(iprot, field.type);
2794
              }
2795
              break;
648 chandransh 2796
            case ITEM_ID:
477 rajveer 2797
              if (field.type == TType.STRING) {
648 chandransh 2798
                this.item_id = iprot.readString();
477 rajveer 2799
              } else { 
2800
                TProtocolUtil.skip(iprot, field.type);
2801
              }
2802
              break;
2803
          }
2804
          iprot.readFieldEnd();
2805
        }
2806
      }
2807
      iprot.readStructEnd();
2808
      validate();
2809
    }
2810
 
2811
    public void write(TProtocol oprot) throws TException {
2812
      validate();
2813
 
2814
      oprot.writeStructBegin(STRUCT_DESC);
648 chandransh 2815
      if (this.destination_pincode != null) {
2816
        oprot.writeFieldBegin(DESTINATION_PINCODE_FIELD_DESC);
2817
        oprot.writeString(this.destination_pincode);
477 rajveer 2818
        oprot.writeFieldEnd();
2819
      }
648 chandransh 2820
      if (this.item_id != null) {
2821
        oprot.writeFieldBegin(ITEM_ID_FIELD_DESC);
2822
        oprot.writeString(this.item_id);
477 rajveer 2823
        oprot.writeFieldEnd();
2824
      }
2825
      oprot.writeFieldStop();
2826
      oprot.writeStructEnd();
2827
    }
2828
 
2829
    @Override
2830
    public String toString() {
648 chandransh 2831
      StringBuilder sb = new StringBuilder("getLogisticsInfo_args(");
477 rajveer 2832
      boolean first = true;
2833
 
648 chandransh 2834
      sb.append("destination_pincode:");
2835
      if (this.destination_pincode == null) {
477 rajveer 2836
        sb.append("null");
2837
      } else {
648 chandransh 2838
        sb.append(this.destination_pincode);
477 rajveer 2839
      }
2840
      first = false;
2841
      if (!first) sb.append(", ");
648 chandransh 2842
      sb.append("item_id:");
2843
      if (this.item_id == null) {
477 rajveer 2844
        sb.append("null");
2845
      } else {
648 chandransh 2846
        sb.append(this.item_id);
477 rajveer 2847
      }
2848
      first = false;
2849
      sb.append(")");
2850
      return sb.toString();
2851
    }
2852
 
2853
    public void validate() throws TException {
2854
      // check for required fields
2855
    }
2856
 
2857
  }
2858
 
648 chandransh 2859
  public static class getLogisticsInfo_result implements TBase<getLogisticsInfo_result._Fields>, java.io.Serializable, Cloneable, Comparable<getLogisticsInfo_result>   {
2860
    private static final TStruct STRUCT_DESC = new TStruct("getLogisticsInfo_result");
477 rajveer 2861
 
648 chandransh 2862
    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRUCT, (short)0);
2863
    private static final TField SE_FIELD_DESC = new TField("se", TType.STRUCT, (short)1);
477 rajveer 2864
 
648 chandransh 2865
    private LogisticsInfo success;
2866
    private LogisticsServiceException se;
477 rajveer 2867
 
2868
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
2869
    public enum _Fields implements TFieldIdEnum {
648 chandransh 2870
      SUCCESS((short)0, "success"),
2871
      SE((short)1, "se");
477 rajveer 2872
 
2873
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
2874
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
2875
 
2876
      static {
2877
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
2878
          byId.put((int)field._thriftId, field);
2879
          byName.put(field.getFieldName(), field);
2880
        }
2881
      }
2882
 
2883
      /**
2884
       * Find the _Fields constant that matches fieldId, or null if its not found.
2885
       */
2886
      public static _Fields findByThriftId(int fieldId) {
2887
        return byId.get(fieldId);
2888
      }
2889
 
2890
      /**
2891
       * Find the _Fields constant that matches fieldId, throwing an exception
2892
       * if it is not found.
2893
       */
2894
      public static _Fields findByThriftIdOrThrow(int fieldId) {
2895
        _Fields fields = findByThriftId(fieldId);
2896
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
2897
        return fields;
2898
      }
2899
 
2900
      /**
2901
       * Find the _Fields constant that matches name, or null if its not found.
2902
       */
2903
      public static _Fields findByName(String name) {
2904
        return byName.get(name);
2905
      }
2906
 
2907
      private final short _thriftId;
2908
      private final String _fieldName;
2909
 
2910
      _Fields(short thriftId, String fieldName) {
2911
        _thriftId = thriftId;
2912
        _fieldName = fieldName;
2913
      }
2914
 
2915
      public short getThriftFieldId() {
2916
        return _thriftId;
2917
      }
2918
 
2919
      public String getFieldName() {
2920
        return _fieldName;
2921
      }
2922
    }
2923
 
412 ashish 2924
    // isset id assignments
2925
 
2926
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
648 chandransh 2927
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
2928
          new StructMetaData(TType.STRUCT, LogisticsInfo.class)));
2929
      put(_Fields.SE, new FieldMetaData("se", TFieldRequirementType.DEFAULT, 
2930
          new FieldValueMetaData(TType.STRUCT)));
412 ashish 2931
    }});
2932
 
2933
    static {
648 chandransh 2934
      FieldMetaData.addStructMetaDataMap(getLogisticsInfo_result.class, metaDataMap);
412 ashish 2935
    }
2936
 
648 chandransh 2937
    public getLogisticsInfo_result() {
412 ashish 2938
    }
2939
 
648 chandransh 2940
    public getLogisticsInfo_result(
2941
      LogisticsInfo success,
2942
      LogisticsServiceException se)
412 ashish 2943
    {
2944
      this();
648 chandransh 2945
      this.success = success;
2946
      this.se = se;
412 ashish 2947
    }
2948
 
2949
    /**
2950
     * Performs a deep copy on <i>other</i>.
2951
     */
648 chandransh 2952
    public getLogisticsInfo_result(getLogisticsInfo_result other) {
2953
      if (other.isSetSuccess()) {
2954
        this.success = new LogisticsInfo(other.success);
412 ashish 2955
      }
648 chandransh 2956
      if (other.isSetSe()) {
2957
        this.se = new LogisticsServiceException(other.se);
2958
      }
412 ashish 2959
    }
2960
 
648 chandransh 2961
    public getLogisticsInfo_result deepCopy() {
2962
      return new getLogisticsInfo_result(this);
412 ashish 2963
    }
2964
 
2965
    @Deprecated
648 chandransh 2966
    public getLogisticsInfo_result clone() {
2967
      return new getLogisticsInfo_result(this);
412 ashish 2968
    }
2969
 
648 chandransh 2970
    public LogisticsInfo getSuccess() {
2971
      return this.success;
412 ashish 2972
    }
2973
 
648 chandransh 2974
    public getLogisticsInfo_result setSuccess(LogisticsInfo success) {
2975
      this.success = success;
412 ashish 2976
      return this;
2977
    }
2978
 
648 chandransh 2979
    public void unsetSuccess() {
2980
      this.success = null;
412 ashish 2981
    }
2982
 
648 chandransh 2983
    /** Returns true if field success is set (has been asigned a value) and false otherwise */
2984
    public boolean isSetSuccess() {
2985
      return this.success != null;
412 ashish 2986
    }
2987
 
648 chandransh 2988
    public void setSuccessIsSet(boolean value) {
412 ashish 2989
      if (!value) {
648 chandransh 2990
        this.success = null;
412 ashish 2991
      }
2992
    }
2993
 
648 chandransh 2994
    public LogisticsServiceException getSe() {
2995
      return this.se;
412 ashish 2996
    }
2997
 
648 chandransh 2998
    public getLogisticsInfo_result setSe(LogisticsServiceException se) {
2999
      this.se = se;
412 ashish 3000
      return this;
3001
    }
3002
 
648 chandransh 3003
    public void unsetSe() {
3004
      this.se = null;
412 ashish 3005
    }
3006
 
648 chandransh 3007
    /** Returns true if field se is set (has been asigned a value) and false otherwise */
3008
    public boolean isSetSe() {
3009
      return this.se != null;
412 ashish 3010
    }
3011
 
648 chandransh 3012
    public void setSeIsSet(boolean value) {
3013
      if (!value) {
3014
        this.se = null;
3015
      }
412 ashish 3016
    }
3017
 
3018
    public void setFieldValue(_Fields field, Object value) {
3019
      switch (field) {
648 chandransh 3020
      case SUCCESS:
412 ashish 3021
        if (value == null) {
648 chandransh 3022
          unsetSuccess();
412 ashish 3023
        } else {
648 chandransh 3024
          setSuccess((LogisticsInfo)value);
412 ashish 3025
        }
3026
        break;
3027
 
648 chandransh 3028
      case SE:
412 ashish 3029
        if (value == null) {
648 chandransh 3030
          unsetSe();
412 ashish 3031
        } else {
648 chandransh 3032
          setSe((LogisticsServiceException)value);
412 ashish 3033
        }
3034
        break;
3035
 
3036
      }
3037
    }
3038
 
3039
    public void setFieldValue(int fieldID, Object value) {
3040
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
3041
    }
3042
 
3043
    public Object getFieldValue(_Fields field) {
3044
      switch (field) {
648 chandransh 3045
      case SUCCESS:
3046
        return getSuccess();
412 ashish 3047
 
648 chandransh 3048
      case SE:
3049
        return getSe();
412 ashish 3050
 
3051
      }
3052
      throw new IllegalStateException();
3053
    }
3054
 
3055
    public Object getFieldValue(int fieldId) {
3056
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
3057
    }
3058
 
3059
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
3060
    public boolean isSet(_Fields field) {
3061
      switch (field) {
648 chandransh 3062
      case SUCCESS:
3063
        return isSetSuccess();
3064
      case SE:
3065
        return isSetSe();
412 ashish 3066
      }
3067
      throw new IllegalStateException();
3068
    }
3069
 
3070
    public boolean isSet(int fieldID) {
3071
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
3072
    }
3073
 
3074
    @Override
3075
    public boolean equals(Object that) {
3076
      if (that == null)
3077
        return false;
648 chandransh 3078
      if (that instanceof getLogisticsInfo_result)
3079
        return this.equals((getLogisticsInfo_result)that);
412 ashish 3080
      return false;
3081
    }
3082
 
648 chandransh 3083
    public boolean equals(getLogisticsInfo_result that) {
412 ashish 3084
      if (that == null)
3085
        return false;
3086
 
648 chandransh 3087
      boolean this_present_success = true && this.isSetSuccess();
3088
      boolean that_present_success = true && that.isSetSuccess();
3089
      if (this_present_success || that_present_success) {
3090
        if (!(this_present_success && that_present_success))
412 ashish 3091
          return false;
648 chandransh 3092
        if (!this.success.equals(that.success))
412 ashish 3093
          return false;
3094
      }
3095
 
648 chandransh 3096
      boolean this_present_se = true && this.isSetSe();
3097
      boolean that_present_se = true && that.isSetSe();
3098
      if (this_present_se || that_present_se) {
3099
        if (!(this_present_se && that_present_se))
412 ashish 3100
          return false;
648 chandransh 3101
        if (!this.se.equals(that.se))
412 ashish 3102
          return false;
3103
      }
3104
 
3105
      return true;
3106
    }
3107
 
3108
    @Override
3109
    public int hashCode() {
3110
      return 0;
3111
    }
3112
 
648 chandransh 3113
    public int compareTo(getLogisticsInfo_result other) {
412 ashish 3114
      if (!getClass().equals(other.getClass())) {
3115
        return getClass().getName().compareTo(other.getClass().getName());
3116
      }
3117
 
3118
      int lastComparison = 0;
648 chandransh 3119
      getLogisticsInfo_result typedOther = (getLogisticsInfo_result)other;
412 ashish 3120
 
648 chandransh 3121
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
412 ashish 3122
      if (lastComparison != 0) {
3123
        return lastComparison;
3124
      }
648 chandransh 3125
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
412 ashish 3126
      if (lastComparison != 0) {
3127
        return lastComparison;
3128
      }
648 chandransh 3129
      lastComparison = Boolean.valueOf(isSetSe()).compareTo(isSetSe());
412 ashish 3130
      if (lastComparison != 0) {
3131
        return lastComparison;
3132
      }
648 chandransh 3133
      lastComparison = TBaseHelper.compareTo(se, typedOther.se);
412 ashish 3134
      if (lastComparison != 0) {
3135
        return lastComparison;
3136
      }
3137
      return 0;
3138
    }
3139
 
3140
    public void read(TProtocol iprot) throws TException {
3141
      TField field;
3142
      iprot.readStructBegin();
3143
      while (true)
3144
      {
3145
        field = iprot.readFieldBegin();
3146
        if (field.type == TType.STOP) { 
3147
          break;
3148
        }
3149
        _Fields fieldId = _Fields.findByThriftId(field.id);
3150
        if (fieldId == null) {
3151
          TProtocolUtil.skip(iprot, field.type);
3152
        } else {
3153
          switch (fieldId) {
648 chandransh 3154
            case SUCCESS:
3155
              if (field.type == TType.STRUCT) {
3156
                this.success = new LogisticsInfo();
3157
                this.success.read(iprot);
412 ashish 3158
              } else { 
3159
                TProtocolUtil.skip(iprot, field.type);
3160
              }
3161
              break;
648 chandransh 3162
            case SE:
3163
              if (field.type == TType.STRUCT) {
3164
                this.se = new LogisticsServiceException();
3165
                this.se.read(iprot);
412 ashish 3166
              } else { 
3167
                TProtocolUtil.skip(iprot, field.type);
3168
              }
3169
              break;
3170
          }
3171
          iprot.readFieldEnd();
3172
        }
3173
      }
3174
      iprot.readStructEnd();
3175
      validate();
3176
    }
3177
 
3178
    public void write(TProtocol oprot) throws TException {
648 chandransh 3179
      oprot.writeStructBegin(STRUCT_DESC);
412 ashish 3180
 
648 chandransh 3181
      if (this.isSetSuccess()) {
3182
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
3183
        this.success.write(oprot);
412 ashish 3184
        oprot.writeFieldEnd();
648 chandransh 3185
      } else if (this.isSetSe()) {
3186
        oprot.writeFieldBegin(SE_FIELD_DESC);
3187
        this.se.write(oprot);
3188
        oprot.writeFieldEnd();
412 ashish 3189
      }
3190
      oprot.writeFieldStop();
3191
      oprot.writeStructEnd();
3192
    }
3193
 
3194
    @Override
3195
    public String toString() {
648 chandransh 3196
      StringBuilder sb = new StringBuilder("getLogisticsInfo_result(");
412 ashish 3197
      boolean first = true;
3198
 
648 chandransh 3199
      sb.append("success:");
3200
      if (this.success == null) {
412 ashish 3201
        sb.append("null");
3202
      } else {
648 chandransh 3203
        sb.append(this.success);
412 ashish 3204
      }
3205
      first = false;
3206
      if (!first) sb.append(", ");
648 chandransh 3207
      sb.append("se:");
3208
      if (this.se == null) {
3209
        sb.append("null");
3210
      } else {
3211
        sb.append(this.se);
3212
      }
412 ashish 3213
      first = false;
3214
      sb.append(")");
3215
      return sb.toString();
3216
    }
3217
 
3218
    public void validate() throws TException {
3219
      // check for required fields
3220
    }
3221
 
3222
  }
3223
 
3224
  public static class getEmptyAWB_args implements TBase<getEmptyAWB_args._Fields>, java.io.Serializable, Cloneable, Comparable<getEmptyAWB_args>   {
3225
    private static final TStruct STRUCT_DESC = new TStruct("getEmptyAWB_args");
3226
 
648 chandransh 3227
    private static final TField PROVIDER_ID_FIELD_DESC = new TField("providerId", TType.I64, (short)1);
412 ashish 3228
 
648 chandransh 3229
    private long providerId;
412 ashish 3230
 
3231
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3232
    public enum _Fields implements TFieldIdEnum {
648 chandransh 3233
      PROVIDER_ID((short)1, "providerId");
412 ashish 3234
 
3235
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
3236
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
3237
 
3238
      static {
3239
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
3240
          byId.put((int)field._thriftId, field);
3241
          byName.put(field.getFieldName(), field);
3242
        }
3243
      }
3244
 
3245
      /**
3246
       * Find the _Fields constant that matches fieldId, or null if its not found.
3247
       */
3248
      public static _Fields findByThriftId(int fieldId) {
3249
        return byId.get(fieldId);
3250
      }
3251
 
3252
      /**
3253
       * Find the _Fields constant that matches fieldId, throwing an exception
3254
       * if it is not found.
3255
       */
3256
      public static _Fields findByThriftIdOrThrow(int fieldId) {
3257
        _Fields fields = findByThriftId(fieldId);
3258
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
3259
        return fields;
3260
      }
3261
 
3262
      /**
3263
       * Find the _Fields constant that matches name, or null if its not found.
3264
       */
3265
      public static _Fields findByName(String name) {
3266
        return byName.get(name);
3267
      }
3268
 
3269
      private final short _thriftId;
3270
      private final String _fieldName;
3271
 
3272
      _Fields(short thriftId, String fieldName) {
3273
        _thriftId = thriftId;
3274
        _fieldName = fieldName;
3275
      }
3276
 
3277
      public short getThriftFieldId() {
3278
        return _thriftId;
3279
      }
3280
 
3281
      public String getFieldName() {
3282
        return _fieldName;
3283
      }
3284
    }
3285
 
3286
    // isset id assignments
648 chandransh 3287
    private static final int __PROVIDERID_ISSET_ID = 0;
412 ashish 3288
    private BitSet __isset_bit_vector = new BitSet(1);
3289
 
3290
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
648 chandransh 3291
      put(_Fields.PROVIDER_ID, new FieldMetaData("providerId", TFieldRequirementType.DEFAULT, 
412 ashish 3292
          new FieldValueMetaData(TType.I64)));
3293
    }});
3294
 
3295
    static {
3296
      FieldMetaData.addStructMetaDataMap(getEmptyAWB_args.class, metaDataMap);
3297
    }
3298
 
3299
    public getEmptyAWB_args() {
3300
    }
3301
 
3302
    public getEmptyAWB_args(
648 chandransh 3303
      long providerId)
412 ashish 3304
    {
3305
      this();
648 chandransh 3306
      this.providerId = providerId;
3307
      setProviderIdIsSet(true);
412 ashish 3308
    }
3309
 
3310
    /**
3311
     * Performs a deep copy on <i>other</i>.
3312
     */
3313
    public getEmptyAWB_args(getEmptyAWB_args other) {
3314
      __isset_bit_vector.clear();
3315
      __isset_bit_vector.or(other.__isset_bit_vector);
648 chandransh 3316
      this.providerId = other.providerId;
412 ashish 3317
    }
3318
 
3319
    public getEmptyAWB_args deepCopy() {
3320
      return new getEmptyAWB_args(this);
3321
    }
3322
 
3323
    @Deprecated
3324
    public getEmptyAWB_args clone() {
3325
      return new getEmptyAWB_args(this);
3326
    }
3327
 
648 chandransh 3328
    public long getProviderId() {
3329
      return this.providerId;
412 ashish 3330
    }
3331
 
648 chandransh 3332
    public getEmptyAWB_args setProviderId(long providerId) {
3333
      this.providerId = providerId;
3334
      setProviderIdIsSet(true);
412 ashish 3335
      return this;
3336
    }
3337
 
648 chandransh 3338
    public void unsetProviderId() {
3339
      __isset_bit_vector.clear(__PROVIDERID_ISSET_ID);
412 ashish 3340
    }
3341
 
648 chandransh 3342
    /** Returns true if field providerId is set (has been asigned a value) and false otherwise */
3343
    public boolean isSetProviderId() {
3344
      return __isset_bit_vector.get(__PROVIDERID_ISSET_ID);
412 ashish 3345
    }
3346
 
648 chandransh 3347
    public void setProviderIdIsSet(boolean value) {
3348
      __isset_bit_vector.set(__PROVIDERID_ISSET_ID, value);
412 ashish 3349
    }
3350
 
3351
    public void setFieldValue(_Fields field, Object value) {
3352
      switch (field) {
3353
      case PROVIDER_ID:
3354
        if (value == null) {
648 chandransh 3355
          unsetProviderId();
412 ashish 3356
        } else {
648 chandransh 3357
          setProviderId((Long)value);
412 ashish 3358
        }
3359
        break;
3360
 
3361
      }
3362
    }
3363
 
3364
    public void setFieldValue(int fieldID, Object value) {
3365
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
3366
    }
3367
 
3368
    public Object getFieldValue(_Fields field) {
3369
      switch (field) {
3370
      case PROVIDER_ID:
648 chandransh 3371
        return new Long(getProviderId());
412 ashish 3372
 
3373
      }
3374
      throw new IllegalStateException();
3375
    }
3376
 
3377
    public Object getFieldValue(int fieldId) {
3378
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
3379
    }
3380
 
3381
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
3382
    public boolean isSet(_Fields field) {
3383
      switch (field) {
3384
      case PROVIDER_ID:
648 chandransh 3385
        return isSetProviderId();
412 ashish 3386
      }
3387
      throw new IllegalStateException();
3388
    }
3389
 
3390
    public boolean isSet(int fieldID) {
3391
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
3392
    }
3393
 
3394
    @Override
3395
    public boolean equals(Object that) {
3396
      if (that == null)
3397
        return false;
3398
      if (that instanceof getEmptyAWB_args)
3399
        return this.equals((getEmptyAWB_args)that);
3400
      return false;
3401
    }
3402
 
3403
    public boolean equals(getEmptyAWB_args that) {
3404
      if (that == null)
3405
        return false;
3406
 
648 chandransh 3407
      boolean this_present_providerId = true;
3408
      boolean that_present_providerId = true;
3409
      if (this_present_providerId || that_present_providerId) {
3410
        if (!(this_present_providerId && that_present_providerId))
412 ashish 3411
          return false;
648 chandransh 3412
        if (this.providerId != that.providerId)
412 ashish 3413
          return false;
3414
      }
3415
 
3416
      return true;
3417
    }
3418
 
3419
    @Override
3420
    public int hashCode() {
3421
      return 0;
3422
    }
3423
 
3424
    public int compareTo(getEmptyAWB_args other) {
3425
      if (!getClass().equals(other.getClass())) {
3426
        return getClass().getName().compareTo(other.getClass().getName());
3427
      }
3428
 
3429
      int lastComparison = 0;
3430
      getEmptyAWB_args typedOther = (getEmptyAWB_args)other;
3431
 
648 chandransh 3432
      lastComparison = Boolean.valueOf(isSetProviderId()).compareTo(isSetProviderId());
412 ashish 3433
      if (lastComparison != 0) {
3434
        return lastComparison;
3435
      }
648 chandransh 3436
      lastComparison = TBaseHelper.compareTo(providerId, typedOther.providerId);
412 ashish 3437
      if (lastComparison != 0) {
3438
        return lastComparison;
3439
      }
3440
      return 0;
3441
    }
3442
 
3443
    public void read(TProtocol iprot) throws TException {
3444
      TField field;
3445
      iprot.readStructBegin();
3446
      while (true)
3447
      {
3448
        field = iprot.readFieldBegin();
3449
        if (field.type == TType.STOP) { 
3450
          break;
3451
        }
3452
        _Fields fieldId = _Fields.findByThriftId(field.id);
3453
        if (fieldId == null) {
3454
          TProtocolUtil.skip(iprot, field.type);
3455
        } else {
3456
          switch (fieldId) {
3457
            case PROVIDER_ID:
3458
              if (field.type == TType.I64) {
648 chandransh 3459
                this.providerId = iprot.readI64();
3460
                setProviderIdIsSet(true);
412 ashish 3461
              } else { 
3462
                TProtocolUtil.skip(iprot, field.type);
3463
              }
3464
              break;
3465
          }
3466
          iprot.readFieldEnd();
3467
        }
3468
      }
3469
      iprot.readStructEnd();
3470
      validate();
3471
    }
3472
 
3473
    public void write(TProtocol oprot) throws TException {
3474
      validate();
3475
 
3476
      oprot.writeStructBegin(STRUCT_DESC);
3477
      oprot.writeFieldBegin(PROVIDER_ID_FIELD_DESC);
648 chandransh 3478
      oprot.writeI64(this.providerId);
412 ashish 3479
      oprot.writeFieldEnd();
3480
      oprot.writeFieldStop();
3481
      oprot.writeStructEnd();
3482
    }
3483
 
3484
    @Override
3485
    public String toString() {
3486
      StringBuilder sb = new StringBuilder("getEmptyAWB_args(");
3487
      boolean first = true;
3488
 
648 chandransh 3489
      sb.append("providerId:");
3490
      sb.append(this.providerId);
412 ashish 3491
      first = false;
3492
      sb.append(")");
3493
      return sb.toString();
3494
    }
3495
 
3496
    public void validate() throws TException {
3497
      // check for required fields
3498
    }
3499
 
3500
  }
3501
 
3502
  public static class getEmptyAWB_result implements TBase<getEmptyAWB_result._Fields>, java.io.Serializable, Cloneable, Comparable<getEmptyAWB_result>   {
3503
    private static final TStruct STRUCT_DESC = new TStruct("getEmptyAWB_result");
3504
 
3505
    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRING, (short)0);
648 chandransh 3506
    private static final TField SE_FIELD_DESC = new TField("se", TType.STRUCT, (short)1);
412 ashish 3507
 
3508
    private String success;
648 chandransh 3509
    private LogisticsServiceException se;
412 ashish 3510
 
3511
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3512
    public enum _Fields implements TFieldIdEnum {
648 chandransh 3513
      SUCCESS((short)0, "success"),
3514
      SE((short)1, "se");
412 ashish 3515
 
3516
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
3517
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
3518
 
3519
      static {
3520
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
3521
          byId.put((int)field._thriftId, field);
3522
          byName.put(field.getFieldName(), field);
3523
        }
3524
      }
3525
 
3526
      /**
3527
       * Find the _Fields constant that matches fieldId, or null if its not found.
3528
       */
3529
      public static _Fields findByThriftId(int fieldId) {
3530
        return byId.get(fieldId);
3531
      }
3532
 
3533
      /**
3534
       * Find the _Fields constant that matches fieldId, throwing an exception
3535
       * if it is not found.
3536
       */
3537
      public static _Fields findByThriftIdOrThrow(int fieldId) {
3538
        _Fields fields = findByThriftId(fieldId);
3539
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
3540
        return fields;
3541
      }
3542
 
3543
      /**
3544
       * Find the _Fields constant that matches name, or null if its not found.
3545
       */
3546
      public static _Fields findByName(String name) {
3547
        return byName.get(name);
3548
      }
3549
 
3550
      private final short _thriftId;
3551
      private final String _fieldName;
3552
 
3553
      _Fields(short thriftId, String fieldName) {
3554
        _thriftId = thriftId;
3555
        _fieldName = fieldName;
3556
      }
3557
 
3558
      public short getThriftFieldId() {
3559
        return _thriftId;
3560
      }
3561
 
3562
      public String getFieldName() {
3563
        return _fieldName;
3564
      }
3565
    }
3566
 
3567
    // isset id assignments
3568
 
3569
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
3570
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
3571
          new FieldValueMetaData(TType.STRING)));
648 chandransh 3572
      put(_Fields.SE, new FieldMetaData("se", TFieldRequirementType.DEFAULT, 
3573
          new FieldValueMetaData(TType.STRUCT)));
412 ashish 3574
    }});
3575
 
3576
    static {
3577
      FieldMetaData.addStructMetaDataMap(getEmptyAWB_result.class, metaDataMap);
3578
    }
3579
 
3580
    public getEmptyAWB_result() {
3581
    }
3582
 
3583
    public getEmptyAWB_result(
648 chandransh 3584
      String success,
3585
      LogisticsServiceException se)
412 ashish 3586
    {
3587
      this();
3588
      this.success = success;
648 chandransh 3589
      this.se = se;
412 ashish 3590
    }
3591
 
3592
    /**
3593
     * Performs a deep copy on <i>other</i>.
3594
     */
3595
    public getEmptyAWB_result(getEmptyAWB_result other) {
3596
      if (other.isSetSuccess()) {
3597
        this.success = other.success;
3598
      }
648 chandransh 3599
      if (other.isSetSe()) {
3600
        this.se = new LogisticsServiceException(other.se);
3601
      }
412 ashish 3602
    }
3603
 
3604
    public getEmptyAWB_result deepCopy() {
3605
      return new getEmptyAWB_result(this);
3606
    }
3607
 
3608
    @Deprecated
3609
    public getEmptyAWB_result clone() {
3610
      return new getEmptyAWB_result(this);
3611
    }
3612
 
3613
    public String getSuccess() {
3614
      return this.success;
3615
    }
3616
 
3617
    public getEmptyAWB_result setSuccess(String success) {
3618
      this.success = success;
3619
      return this;
3620
    }
3621
 
3622
    public void unsetSuccess() {
3623
      this.success = null;
3624
    }
3625
 
3626
    /** Returns true if field success is set (has been asigned a value) and false otherwise */
3627
    public boolean isSetSuccess() {
3628
      return this.success != null;
3629
    }
3630
 
3631
    public void setSuccessIsSet(boolean value) {
3632
      if (!value) {
3633
        this.success = null;
3634
      }
3635
    }
3636
 
648 chandransh 3637
    public LogisticsServiceException getSe() {
3638
      return this.se;
412 ashish 3639
    }
3640
 
648 chandransh 3641
    public getEmptyAWB_result setSe(LogisticsServiceException se) {
3642
      this.se = se;
412 ashish 3643
      return this;
3644
    }
3645
 
648 chandransh 3646
    public void unsetSe() {
3647
      this.se = null;
412 ashish 3648
    }
3649
 
648 chandransh 3650
    /** Returns true if field se is set (has been asigned a value) and false otherwise */
3651
    public boolean isSetSe() {
3652
      return this.se != null;
412 ashish 3653
    }
3654
 
648 chandransh 3655
    public void setSeIsSet(boolean value) {
412 ashish 3656
      if (!value) {
648 chandransh 3657
        this.se = null;
412 ashish 3658
      }
3659
    }
3660
 
3661
    public void setFieldValue(_Fields field, Object value) {
3662
      switch (field) {
3663
      case SUCCESS:
3664
        if (value == null) {
3665
          unsetSuccess();
3666
        } else {
648 chandransh 3667
          setSuccess((String)value);
412 ashish 3668
        }
3669
        break;
3670
 
648 chandransh 3671
      case SE:
3672
        if (value == null) {
3673
          unsetSe();
3674
        } else {
3675
          setSe((LogisticsServiceException)value);
3676
        }
3677
        break;
3678
 
412 ashish 3679
      }
3680
    }
3681
 
3682
    public void setFieldValue(int fieldID, Object value) {
3683
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
3684
    }
3685
 
3686
    public Object getFieldValue(_Fields field) {
3687
      switch (field) {
3688
      case SUCCESS:
3689
        return getSuccess();
3690
 
648 chandransh 3691
      case SE:
3692
        return getSe();
3693
 
412 ashish 3694
      }
3695
      throw new IllegalStateException();
3696
    }
3697
 
3698
    public Object getFieldValue(int fieldId) {
3699
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
3700
    }
3701
 
3702
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
3703
    public boolean isSet(_Fields field) {
3704
      switch (field) {
3705
      case SUCCESS:
3706
        return isSetSuccess();
648 chandransh 3707
      case SE:
3708
        return isSetSe();
412 ashish 3709
      }
3710
      throw new IllegalStateException();
3711
    }
3712
 
3713
    public boolean isSet(int fieldID) {
3714
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
3715
    }
3716
 
3717
    @Override
3718
    public boolean equals(Object that) {
3719
      if (that == null)
3720
        return false;
648 chandransh 3721
      if (that instanceof getEmptyAWB_result)
3722
        return this.equals((getEmptyAWB_result)that);
412 ashish 3723
      return false;
3724
    }
3725
 
648 chandransh 3726
    public boolean equals(getEmptyAWB_result that) {
412 ashish 3727
      if (that == null)
3728
        return false;
3729
 
3730
      boolean this_present_success = true && this.isSetSuccess();
3731
      boolean that_present_success = true && that.isSetSuccess();
3732
      if (this_present_success || that_present_success) {
3733
        if (!(this_present_success && that_present_success))
3734
          return false;
3735
        if (!this.success.equals(that.success))
3736
          return false;
3737
      }
3738
 
648 chandransh 3739
      boolean this_present_se = true && this.isSetSe();
3740
      boolean that_present_se = true && that.isSetSe();
3741
      if (this_present_se || that_present_se) {
3742
        if (!(this_present_se && that_present_se))
3743
          return false;
3744
        if (!this.se.equals(that.se))
3745
          return false;
3746
      }
3747
 
412 ashish 3748
      return true;
3749
    }
3750
 
3751
    @Override
3752
    public int hashCode() {
3753
      return 0;
3754
    }
3755
 
648 chandransh 3756
    public int compareTo(getEmptyAWB_result other) {
412 ashish 3757
      if (!getClass().equals(other.getClass())) {
3758
        return getClass().getName().compareTo(other.getClass().getName());
3759
      }
3760
 
3761
      int lastComparison = 0;
648 chandransh 3762
      getEmptyAWB_result typedOther = (getEmptyAWB_result)other;
412 ashish 3763
 
3764
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
3765
      if (lastComparison != 0) {
3766
        return lastComparison;
3767
      }
3768
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
3769
      if (lastComparison != 0) {
3770
        return lastComparison;
3771
      }
648 chandransh 3772
      lastComparison = Boolean.valueOf(isSetSe()).compareTo(isSetSe());
412 ashish 3773
      if (lastComparison != 0) {
3774
        return lastComparison;
3775
      }
648 chandransh 3776
      lastComparison = TBaseHelper.compareTo(se, typedOther.se);
412 ashish 3777
      if (lastComparison != 0) {
3778
        return lastComparison;
3779
      }
3780
      return 0;
3781
    }
3782
 
3783
    public void read(TProtocol iprot) throws TException {
3784
      TField field;
3785
      iprot.readStructBegin();
3786
      while (true)
3787
      {
3788
        field = iprot.readFieldBegin();
3789
        if (field.type == TType.STOP) { 
3790
          break;
3791
        }
3792
        _Fields fieldId = _Fields.findByThriftId(field.id);
3793
        if (fieldId == null) {
3794
          TProtocolUtil.skip(iprot, field.type);
3795
        } else {
3796
          switch (fieldId) {
648 chandransh 3797
            case SUCCESS:
3798
              if (field.type == TType.STRING) {
3799
                this.success = iprot.readString();
412 ashish 3800
              } else { 
3801
                TProtocolUtil.skip(iprot, field.type);
3802
              }
3803
              break;
648 chandransh 3804
            case SE:
412 ashish 3805
              if (field.type == TType.STRUCT) {
648 chandransh 3806
                this.se = new LogisticsServiceException();
3807
                this.se.read(iprot);
412 ashish 3808
              } else { 
3809
                TProtocolUtil.skip(iprot, field.type);
3810
              }
3811
              break;
3812
          }
3813
          iprot.readFieldEnd();
3814
        }
3815
      }
3816
      iprot.readStructEnd();
3817
      validate();
3818
    }
3819
 
3820
    public void write(TProtocol oprot) throws TException {
3821
      oprot.writeStructBegin(STRUCT_DESC);
3822
 
3823
      if (this.isSetSuccess()) {
3824
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
648 chandransh 3825
        oprot.writeString(this.success);
412 ashish 3826
        oprot.writeFieldEnd();
648 chandransh 3827
      } else if (this.isSetSe()) {
3828
        oprot.writeFieldBegin(SE_FIELD_DESC);
3829
        this.se.write(oprot);
3830
        oprot.writeFieldEnd();
412 ashish 3831
      }
3832
      oprot.writeFieldStop();
3833
      oprot.writeStructEnd();
3834
    }
3835
 
3836
    @Override
3837
    public String toString() {
648 chandransh 3838
      StringBuilder sb = new StringBuilder("getEmptyAWB_result(");
412 ashish 3839
      boolean first = true;
3840
 
3841
      sb.append("success:");
3842
      if (this.success == null) {
3843
        sb.append("null");
3844
      } else {
3845
        sb.append(this.success);
3846
      }
3847
      first = false;
648 chandransh 3848
      if (!first) sb.append(", ");
3849
      sb.append("se:");
3850
      if (this.se == null) {
442 rajveer 3851
        sb.append("null");
3852
      } else {
648 chandransh 3853
        sb.append(this.se);
442 rajveer 3854
      }
3855
      first = false;
3856
      sb.append(")");
3857
      return sb.toString();
3858
    }
3859
 
3860
    public void validate() throws TException {
3861
      // check for required fields
3862
    }
3863
 
3864
  }
3865
 
648 chandransh 3866
  public static class getShipmentInfo_args implements TBase<getShipmentInfo_args._Fields>, java.io.Serializable, Cloneable, Comparable<getShipmentInfo_args>   {
3867
    private static final TStruct STRUCT_DESC = new TStruct("getShipmentInfo_args");
442 rajveer 3868
 
3869
    private static final TField AWB_FIELD_DESC = new TField("awb", TType.STRING, (short)1);
648 chandransh 3870
    private static final TField PROVIDER_ID_FIELD_DESC = new TField("providerId", TType.I64, (short)2);
442 rajveer 3871
 
3872
    private String awb;
648 chandransh 3873
    private long providerId;
442 rajveer 3874
 
3875
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3876
    public enum _Fields implements TFieldIdEnum {
3877
      AWB((short)1, "awb"),
648 chandransh 3878
      PROVIDER_ID((short)2, "providerId");
442 rajveer 3879
 
3880
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
3881
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
3882
 
3883
      static {
3884
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
3885
          byId.put((int)field._thriftId, field);
3886
          byName.put(field.getFieldName(), field);
3887
        }
3888
      }
3889
 
3890
      /**
3891
       * Find the _Fields constant that matches fieldId, or null if its not found.
3892
       */
3893
      public static _Fields findByThriftId(int fieldId) {
3894
        return byId.get(fieldId);
3895
      }
3896
 
3897
      /**
3898
       * Find the _Fields constant that matches fieldId, throwing an exception
3899
       * if it is not found.
3900
       */
3901
      public static _Fields findByThriftIdOrThrow(int fieldId) {
3902
        _Fields fields = findByThriftId(fieldId);
3903
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
3904
        return fields;
3905
      }
3906
 
3907
      /**
3908
       * Find the _Fields constant that matches name, or null if its not found.
3909
       */
3910
      public static _Fields findByName(String name) {
3911
        return byName.get(name);
3912
      }
3913
 
3914
      private final short _thriftId;
3915
      private final String _fieldName;
3916
 
3917
      _Fields(short thriftId, String fieldName) {
3918
        _thriftId = thriftId;
3919
        _fieldName = fieldName;
3920
      }
3921
 
3922
      public short getThriftFieldId() {
3923
        return _thriftId;
3924
      }
3925
 
3926
      public String getFieldName() {
3927
        return _fieldName;
3928
      }
3929
    }
3930
 
3931
    // isset id assignments
648 chandransh 3932
    private static final int __PROVIDERID_ISSET_ID = 0;
3933
    private BitSet __isset_bit_vector = new BitSet(1);
442 rajveer 3934
 
3935
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
3936
      put(_Fields.AWB, new FieldMetaData("awb", TFieldRequirementType.DEFAULT, 
3937
          new FieldValueMetaData(TType.STRING)));
648 chandransh 3938
      put(_Fields.PROVIDER_ID, new FieldMetaData("providerId", TFieldRequirementType.DEFAULT, 
3939
          new FieldValueMetaData(TType.I64)));
442 rajveer 3940
    }});
3941
 
3942
    static {
648 chandransh 3943
      FieldMetaData.addStructMetaDataMap(getShipmentInfo_args.class, metaDataMap);
442 rajveer 3944
    }
3945
 
648 chandransh 3946
    public getShipmentInfo_args() {
442 rajveer 3947
    }
3948
 
648 chandransh 3949
    public getShipmentInfo_args(
442 rajveer 3950
      String awb,
648 chandransh 3951
      long providerId)
442 rajveer 3952
    {
3953
      this();
3954
      this.awb = awb;
648 chandransh 3955
      this.providerId = providerId;
3956
      setProviderIdIsSet(true);
442 rajveer 3957
    }
3958
 
3959
    /**
3960
     * Performs a deep copy on <i>other</i>.
3961
     */
648 chandransh 3962
    public getShipmentInfo_args(getShipmentInfo_args other) {
3963
      __isset_bit_vector.clear();
3964
      __isset_bit_vector.or(other.__isset_bit_vector);
442 rajveer 3965
      if (other.isSetAwb()) {
3966
        this.awb = other.awb;
3967
      }
648 chandransh 3968
      this.providerId = other.providerId;
442 rajveer 3969
    }
3970
 
648 chandransh 3971
    public getShipmentInfo_args deepCopy() {
3972
      return new getShipmentInfo_args(this);
442 rajveer 3973
    }
3974
 
3975
    @Deprecated
648 chandransh 3976
    public getShipmentInfo_args clone() {
3977
      return new getShipmentInfo_args(this);
442 rajveer 3978
    }
3979
 
3980
    public String getAwb() {
3981
      return this.awb;
3982
    }
3983
 
648 chandransh 3984
    public getShipmentInfo_args setAwb(String awb) {
442 rajveer 3985
      this.awb = awb;
3986
      return this;
3987
    }
3988
 
3989
    public void unsetAwb() {
3990
      this.awb = null;
3991
    }
3992
 
3993
    /** Returns true if field awb is set (has been asigned a value) and false otherwise */
3994
    public boolean isSetAwb() {
3995
      return this.awb != null;
3996
    }
3997
 
3998
    public void setAwbIsSet(boolean value) {
3999
      if (!value) {
4000
        this.awb = null;
4001
      }
4002
    }
4003
 
648 chandransh 4004
    public long getProviderId() {
4005
      return this.providerId;
442 rajveer 4006
    }
4007
 
648 chandransh 4008
    public getShipmentInfo_args setProviderId(long providerId) {
4009
      this.providerId = providerId;
4010
      setProviderIdIsSet(true);
442 rajveer 4011
      return this;
4012
    }
4013
 
648 chandransh 4014
    public void unsetProviderId() {
4015
      __isset_bit_vector.clear(__PROVIDERID_ISSET_ID);
442 rajveer 4016
    }
4017
 
648 chandransh 4018
    /** Returns true if field providerId is set (has been asigned a value) and false otherwise */
4019
    public boolean isSetProviderId() {
4020
      return __isset_bit_vector.get(__PROVIDERID_ISSET_ID);
442 rajveer 4021
    }
4022
 
648 chandransh 4023
    public void setProviderIdIsSet(boolean value) {
4024
      __isset_bit_vector.set(__PROVIDERID_ISSET_ID, value);
442 rajveer 4025
    }
4026
 
4027
    public void setFieldValue(_Fields field, Object value) {
4028
      switch (field) {
4029
      case AWB:
4030
        if (value == null) {
4031
          unsetAwb();
4032
        } else {
4033
          setAwb((String)value);
4034
        }
4035
        break;
4036
 
648 chandransh 4037
      case PROVIDER_ID:
442 rajveer 4038
        if (value == null) {
648 chandransh 4039
          unsetProviderId();
442 rajveer 4040
        } else {
648 chandransh 4041
          setProviderId((Long)value);
442 rajveer 4042
        }
4043
        break;
4044
 
4045
      }
4046
    }
4047
 
4048
    public void setFieldValue(int fieldID, Object value) {
4049
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
4050
    }
4051
 
4052
    public Object getFieldValue(_Fields field) {
4053
      switch (field) {
4054
      case AWB:
4055
        return getAwb();
4056
 
648 chandransh 4057
      case PROVIDER_ID:
4058
        return new Long(getProviderId());
442 rajveer 4059
 
4060
      }
4061
      throw new IllegalStateException();
4062
    }
4063
 
4064
    public Object getFieldValue(int fieldId) {
4065
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
4066
    }
4067
 
4068
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
4069
    public boolean isSet(_Fields field) {
4070
      switch (field) {
4071
      case AWB:
4072
        return isSetAwb();
648 chandransh 4073
      case PROVIDER_ID:
4074
        return isSetProviderId();
442 rajveer 4075
      }
4076
      throw new IllegalStateException();
4077
    }
4078
 
4079
    public boolean isSet(int fieldID) {
4080
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
4081
    }
4082
 
4083
    @Override
4084
    public boolean equals(Object that) {
4085
      if (that == null)
4086
        return false;
648 chandransh 4087
      if (that instanceof getShipmentInfo_args)
4088
        return this.equals((getShipmentInfo_args)that);
442 rajveer 4089
      return false;
4090
    }
4091
 
648 chandransh 4092
    public boolean equals(getShipmentInfo_args that) {
442 rajveer 4093
      if (that == null)
4094
        return false;
4095
 
4096
      boolean this_present_awb = true && this.isSetAwb();
4097
      boolean that_present_awb = true && that.isSetAwb();
4098
      if (this_present_awb || that_present_awb) {
4099
        if (!(this_present_awb && that_present_awb))
4100
          return false;
4101
        if (!this.awb.equals(that.awb))
4102
          return false;
4103
      }
4104
 
648 chandransh 4105
      boolean this_present_providerId = true;
4106
      boolean that_present_providerId = true;
4107
      if (this_present_providerId || that_present_providerId) {
4108
        if (!(this_present_providerId && that_present_providerId))
442 rajveer 4109
          return false;
648 chandransh 4110
        if (this.providerId != that.providerId)
442 rajveer 4111
          return false;
4112
      }
4113
 
4114
      return true;
4115
    }
4116
 
4117
    @Override
4118
    public int hashCode() {
4119
      return 0;
4120
    }
4121
 
648 chandransh 4122
    public int compareTo(getShipmentInfo_args other) {
442 rajveer 4123
      if (!getClass().equals(other.getClass())) {
4124
        return getClass().getName().compareTo(other.getClass().getName());
4125
      }
4126
 
4127
      int lastComparison = 0;
648 chandransh 4128
      getShipmentInfo_args typedOther = (getShipmentInfo_args)other;
442 rajveer 4129
 
4130
      lastComparison = Boolean.valueOf(isSetAwb()).compareTo(isSetAwb());
4131
      if (lastComparison != 0) {
4132
        return lastComparison;
4133
      }
4134
      lastComparison = TBaseHelper.compareTo(awb, typedOther.awb);
4135
      if (lastComparison != 0) {
4136
        return lastComparison;
4137
      }
648 chandransh 4138
      lastComparison = Boolean.valueOf(isSetProviderId()).compareTo(isSetProviderId());
442 rajveer 4139
      if (lastComparison != 0) {
4140
        return lastComparison;
4141
      }
648 chandransh 4142
      lastComparison = TBaseHelper.compareTo(providerId, typedOther.providerId);
442 rajveer 4143
      if (lastComparison != 0) {
4144
        return lastComparison;
4145
      }
4146
      return 0;
4147
    }
4148
 
4149
    public void read(TProtocol iprot) throws TException {
4150
      TField field;
4151
      iprot.readStructBegin();
4152
      while (true)
4153
      {
4154
        field = iprot.readFieldBegin();
4155
        if (field.type == TType.STOP) { 
4156
          break;
4157
        }
4158
        _Fields fieldId = _Fields.findByThriftId(field.id);
4159
        if (fieldId == null) {
4160
          TProtocolUtil.skip(iprot, field.type);
4161
        } else {
4162
          switch (fieldId) {
4163
            case AWB:
4164
              if (field.type == TType.STRING) {
4165
                this.awb = iprot.readString();
4166
              } else { 
4167
                TProtocolUtil.skip(iprot, field.type);
4168
              }
4169
              break;
648 chandransh 4170
            case PROVIDER_ID:
4171
              if (field.type == TType.I64) {
4172
                this.providerId = iprot.readI64();
4173
                setProviderIdIsSet(true);
442 rajveer 4174
              } else { 
4175
                TProtocolUtil.skip(iprot, field.type);
4176
              }
4177
              break;
4178
          }
4179
          iprot.readFieldEnd();
4180
        }
4181
      }
4182
      iprot.readStructEnd();
4183
      validate();
4184
    }
4185
 
4186
    public void write(TProtocol oprot) throws TException {
4187
      validate();
4188
 
4189
      oprot.writeStructBegin(STRUCT_DESC);
4190
      if (this.awb != null) {
4191
        oprot.writeFieldBegin(AWB_FIELD_DESC);
4192
        oprot.writeString(this.awb);
4193
        oprot.writeFieldEnd();
4194
      }
648 chandransh 4195
      oprot.writeFieldBegin(PROVIDER_ID_FIELD_DESC);
4196
      oprot.writeI64(this.providerId);
4197
      oprot.writeFieldEnd();
442 rajveer 4198
      oprot.writeFieldStop();
4199
      oprot.writeStructEnd();
4200
    }
4201
 
4202
    @Override
4203
    public String toString() {
648 chandransh 4204
      StringBuilder sb = new StringBuilder("getShipmentInfo_args(");
442 rajveer 4205
      boolean first = true;
4206
 
4207
      sb.append("awb:");
4208
      if (this.awb == null) {
4209
        sb.append("null");
4210
      } else {
4211
        sb.append(this.awb);
4212
      }
4213
      first = false;
4214
      if (!first) sb.append(", ");
648 chandransh 4215
      sb.append("providerId:");
4216
      sb.append(this.providerId);
442 rajveer 4217
      first = false;
4218
      sb.append(")");
4219
      return sb.toString();
4220
    }
4221
 
4222
    public void validate() throws TException {
4223
      // check for required fields
4224
    }
4225
 
4226
  }
4227
 
412 ashish 4228
  public static class getShipmentInfo_result implements TBase<getShipmentInfo_result._Fields>, java.io.Serializable, Cloneable, Comparable<getShipmentInfo_result>   {
4229
    private static final TStruct STRUCT_DESC = new TStruct("getShipmentInfo_result");
4230
 
648 chandransh 4231
    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0);
4232
    private static final TField SE_FIELD_DESC = new TField("se", TType.STRUCT, (short)1);
412 ashish 4233
 
648 chandransh 4234
    private List<AwbUpdate> success;
4235
    private LogisticsServiceException se;
412 ashish 4236
 
4237
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
4238
    public enum _Fields implements TFieldIdEnum {
648 chandransh 4239
      SUCCESS((short)0, "success"),
4240
      SE((short)1, "se");
412 ashish 4241
 
4242
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
4243
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
4244
 
4245
      static {
4246
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
4247
          byId.put((int)field._thriftId, field);
4248
          byName.put(field.getFieldName(), field);
4249
        }
4250
      }
4251
 
4252
      /**
4253
       * Find the _Fields constant that matches fieldId, or null if its not found.
4254
       */
4255
      public static _Fields findByThriftId(int fieldId) {
4256
        return byId.get(fieldId);
4257
      }
4258
 
4259
      /**
4260
       * Find the _Fields constant that matches fieldId, throwing an exception
4261
       * if it is not found.
4262
       */
4263
      public static _Fields findByThriftIdOrThrow(int fieldId) {
4264
        _Fields fields = findByThriftId(fieldId);
4265
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
4266
        return fields;
4267
      }
4268
 
4269
      /**
4270
       * Find the _Fields constant that matches name, or null if its not found.
4271
       */
4272
      public static _Fields findByName(String name) {
4273
        return byName.get(name);
4274
      }
4275
 
4276
      private final short _thriftId;
4277
      private final String _fieldName;
4278
 
4279
      _Fields(short thriftId, String fieldName) {
4280
        _thriftId = thriftId;
4281
        _fieldName = fieldName;
4282
      }
4283
 
4284
      public short getThriftFieldId() {
4285
        return _thriftId;
4286
      }
4287
 
4288
      public String getFieldName() {
4289
        return _fieldName;
4290
      }
4291
    }
4292
 
4293
    // isset id assignments
4294
 
4295
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
4296
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
648 chandransh 4297
          new ListMetaData(TType.LIST, 
4298
              new StructMetaData(TType.STRUCT, AwbUpdate.class))));
4299
      put(_Fields.SE, new FieldMetaData("se", TFieldRequirementType.DEFAULT, 
4300
          new FieldValueMetaData(TType.STRUCT)));
412 ashish 4301
    }});
4302
 
4303
    static {
4304
      FieldMetaData.addStructMetaDataMap(getShipmentInfo_result.class, metaDataMap);
4305
    }
4306
 
4307
    public getShipmentInfo_result() {
4308
    }
4309
 
4310
    public getShipmentInfo_result(
648 chandransh 4311
      List<AwbUpdate> success,
4312
      LogisticsServiceException se)
412 ashish 4313
    {
4314
      this();
4315
      this.success = success;
648 chandransh 4316
      this.se = se;
412 ashish 4317
    }
4318
 
4319
    /**
4320
     * Performs a deep copy on <i>other</i>.
4321
     */
4322
    public getShipmentInfo_result(getShipmentInfo_result other) {
4323
      if (other.isSetSuccess()) {
648 chandransh 4324
        List<AwbUpdate> __this__success = new ArrayList<AwbUpdate>();
4325
        for (AwbUpdate other_element : other.success) {
4326
          __this__success.add(new AwbUpdate(other_element));
4327
        }
4328
        this.success = __this__success;
412 ashish 4329
      }
648 chandransh 4330
      if (other.isSetSe()) {
4331
        this.se = new LogisticsServiceException(other.se);
4332
      }
412 ashish 4333
    }
4334
 
4335
    public getShipmentInfo_result deepCopy() {
4336
      return new getShipmentInfo_result(this);
4337
    }
4338
 
4339
    @Deprecated
4340
    public getShipmentInfo_result clone() {
4341
      return new getShipmentInfo_result(this);
4342
    }
4343
 
4344
    public int getSuccessSize() {
4345
      return (this.success == null) ? 0 : this.success.size();
4346
    }
4347
 
648 chandransh 4348
    public java.util.Iterator<AwbUpdate> getSuccessIterator() {
412 ashish 4349
      return (this.success == null) ? null : this.success.iterator();
4350
    }
4351
 
648 chandransh 4352
    public void addToSuccess(AwbUpdate elem) {
412 ashish 4353
      if (this.success == null) {
648 chandransh 4354
        this.success = new ArrayList<AwbUpdate>();
412 ashish 4355
      }
4356
      this.success.add(elem);
4357
    }
4358
 
648 chandransh 4359
    public List<AwbUpdate> getSuccess() {
412 ashish 4360
      return this.success;
4361
    }
4362
 
648 chandransh 4363
    public getShipmentInfo_result setSuccess(List<AwbUpdate> success) {
412 ashish 4364
      this.success = success;
4365
      return this;
4366
    }
4367
 
4368
    public void unsetSuccess() {
4369
      this.success = null;
4370
    }
4371
 
4372
    /** Returns true if field success is set (has been asigned a value) and false otherwise */
4373
    public boolean isSetSuccess() {
4374
      return this.success != null;
4375
    }
4376
 
4377
    public void setSuccessIsSet(boolean value) {
4378
      if (!value) {
4379
        this.success = null;
4380
      }
4381
    }
4382
 
648 chandransh 4383
    public LogisticsServiceException getSe() {
4384
      return this.se;
412 ashish 4385
    }
4386
 
648 chandransh 4387
    public getShipmentInfo_result setSe(LogisticsServiceException se) {
4388
      this.se = se;
4389
      return this;
412 ashish 4390
    }
4391
 
648 chandransh 4392
    public void unsetSe() {
4393
      this.se = null;
412 ashish 4394
    }
4395
 
648 chandransh 4396
    /** Returns true if field se is set (has been asigned a value) and false otherwise */
4397
    public boolean isSetSe() {
4398
      return this.se != null;
412 ashish 4399
    }
4400
 
648 chandransh 4401
    public void setSeIsSet(boolean value) {
4402
      if (!value) {
4403
        this.se = null;
412 ashish 4404
      }
4405
    }
4406
 
4407
    public void setFieldValue(_Fields field, Object value) {
4408
      switch (field) {
648 chandransh 4409
      case SUCCESS:
412 ashish 4410
        if (value == null) {
648 chandransh 4411
          unsetSuccess();
412 ashish 4412
        } else {
648 chandransh 4413
          setSuccess((List<AwbUpdate>)value);
412 ashish 4414
        }
4415
        break;
4416
 
648 chandransh 4417
      case SE:
412 ashish 4418
        if (value == null) {
648 chandransh 4419
          unsetSe();
412 ashish 4420
        } else {
648 chandransh 4421
          setSe((LogisticsServiceException)value);
412 ashish 4422
        }
4423
        break;
4424
 
4425
      }
4426
    }
4427
 
4428
    public void setFieldValue(int fieldID, Object value) {
4429
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
4430
    }
4431
 
4432
    public Object getFieldValue(_Fields field) {
4433
      switch (field) {
648 chandransh 4434
      case SUCCESS:
4435
        return getSuccess();
412 ashish 4436
 
648 chandransh 4437
      case SE:
4438
        return getSe();
412 ashish 4439
 
4440
      }
4441
      throw new IllegalStateException();
4442
    }
4443
 
4444
    public Object getFieldValue(int fieldId) {
4445
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
4446
    }
4447
 
4448
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
4449
    public boolean isSet(_Fields field) {
4450
      switch (field) {
648 chandransh 4451
      case SUCCESS:
4452
        return isSetSuccess();
4453
      case SE:
4454
        return isSetSe();
412 ashish 4455
      }
4456
      throw new IllegalStateException();
4457
    }
4458
 
4459
    public boolean isSet(int fieldID) {
4460
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
4461
    }
4462
 
4463
    @Override
4464
    public boolean equals(Object that) {
4465
      if (that == null)
4466
        return false;
648 chandransh 4467
      if (that instanceof getShipmentInfo_result)
4468
        return this.equals((getShipmentInfo_result)that);
412 ashish 4469
      return false;
4470
    }
4471
 
648 chandransh 4472
    public boolean equals(getShipmentInfo_result that) {
412 ashish 4473
      if (that == null)
4474
        return false;
4475
 
648 chandransh 4476
      boolean this_present_success = true && this.isSetSuccess();
4477
      boolean that_present_success = true && that.isSetSuccess();
4478
      if (this_present_success || that_present_success) {
4479
        if (!(this_present_success && that_present_success))
412 ashish 4480
          return false;
648 chandransh 4481
        if (!this.success.equals(that.success))
412 ashish 4482
          return false;
4483
      }
4484
 
648 chandransh 4485
      boolean this_present_se = true && this.isSetSe();
4486
      boolean that_present_se = true && that.isSetSe();
4487
      if (this_present_se || that_present_se) {
4488
        if (!(this_present_se && that_present_se))
412 ashish 4489
          return false;
648 chandransh 4490
        if (!this.se.equals(that.se))
412 ashish 4491
          return false;
4492
      }
4493
 
4494
      return true;
4495
    }
4496
 
4497
    @Override
4498
    public int hashCode() {
4499
      return 0;
4500
    }
4501
 
648 chandransh 4502
    public int compareTo(getShipmentInfo_result other) {
412 ashish 4503
      if (!getClass().equals(other.getClass())) {
4504
        return getClass().getName().compareTo(other.getClass().getName());
4505
      }
4506
 
4507
      int lastComparison = 0;
648 chandransh 4508
      getShipmentInfo_result typedOther = (getShipmentInfo_result)other;
412 ashish 4509
 
648 chandransh 4510
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
412 ashish 4511
      if (lastComparison != 0) {
4512
        return lastComparison;
4513
      }
648 chandransh 4514
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
412 ashish 4515
      if (lastComparison != 0) {
4516
        return lastComparison;
4517
      }
648 chandransh 4518
      lastComparison = Boolean.valueOf(isSetSe()).compareTo(isSetSe());
412 ashish 4519
      if (lastComparison != 0) {
4520
        return lastComparison;
4521
      }
648 chandransh 4522
      lastComparison = TBaseHelper.compareTo(se, typedOther.se);
412 ashish 4523
      if (lastComparison != 0) {
4524
        return lastComparison;
4525
      }
4526
      return 0;
4527
    }
4528
 
4529
    public void read(TProtocol iprot) throws TException {
4530
      TField field;
4531
      iprot.readStructBegin();
4532
      while (true)
4533
      {
4534
        field = iprot.readFieldBegin();
4535
        if (field.type == TType.STOP) { 
4536
          break;
4537
        }
4538
        _Fields fieldId = _Fields.findByThriftId(field.id);
4539
        if (fieldId == null) {
4540
          TProtocolUtil.skip(iprot, field.type);
4541
        } else {
4542
          switch (fieldId) {
4543
            case SUCCESS:
4544
              if (field.type == TType.LIST) {
4545
                {
674 chandransh 4546
                  TList _list4 = iprot.readListBegin();
4547
                  this.success = new ArrayList<AwbUpdate>(_list4.size);
4548
                  for (int _i5 = 0; _i5 < _list4.size; ++_i5)
412 ashish 4549
                  {
674 chandransh 4550
                    AwbUpdate _elem6;
4551
                    _elem6 = new AwbUpdate();
4552
                    _elem6.read(iprot);
4553
                    this.success.add(_elem6);
412 ashish 4554
                  }
4555
                  iprot.readListEnd();
4556
                }
4557
              } else { 
4558
                TProtocolUtil.skip(iprot, field.type);
4559
              }
4560
              break;
648 chandransh 4561
            case SE:
4562
              if (field.type == TType.STRUCT) {
4563
                this.se = new LogisticsServiceException();
4564
                this.se.read(iprot);
4565
              } else { 
4566
                TProtocolUtil.skip(iprot, field.type);
4567
              }
4568
              break;
412 ashish 4569
          }
4570
          iprot.readFieldEnd();
4571
        }
4572
      }
4573
      iprot.readStructEnd();
4574
      validate();
4575
    }
4576
 
4577
    public void write(TProtocol oprot) throws TException {
4578
      oprot.writeStructBegin(STRUCT_DESC);
4579
 
4580
      if (this.isSetSuccess()) {
4581
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
4582
        {
4583
          oprot.writeListBegin(new TList(TType.STRUCT, this.success.size()));
674 chandransh 4584
          for (AwbUpdate _iter7 : this.success)
412 ashish 4585
          {
674 chandransh 4586
            _iter7.write(oprot);
412 ashish 4587
          }
4588
          oprot.writeListEnd();
4589
        }
4590
        oprot.writeFieldEnd();
648 chandransh 4591
      } else if (this.isSetSe()) {
4592
        oprot.writeFieldBegin(SE_FIELD_DESC);
4593
        this.se.write(oprot);
4594
        oprot.writeFieldEnd();
412 ashish 4595
      }
4596
      oprot.writeFieldStop();
4597
      oprot.writeStructEnd();
4598
    }
4599
 
4600
    @Override
4601
    public String toString() {
648 chandransh 4602
      StringBuilder sb = new StringBuilder("getShipmentInfo_result(");
412 ashish 4603
      boolean first = true;
4604
 
4605
      sb.append("success:");
4606
      if (this.success == null) {
4607
        sb.append("null");
4608
      } else {
4609
        sb.append(this.success);
4610
      }
4611
      first = false;
648 chandransh 4612
      if (!first) sb.append(", ");
4613
      sb.append("se:");
4614
      if (this.se == null) {
4615
        sb.append("null");
4616
      } else {
4617
        sb.append(this.se);
4618
      }
4619
      first = false;
412 ashish 4620
      sb.append(")");
4621
      return sb.toString();
4622
    }
4623
 
4624
    public void validate() throws TException {
4625
      // check for required fields
4626
    }
4627
 
4628
  }
4629
 
4630
}