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