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