Subversion Repositories SmartDukaan

Rev

Rev 648 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 648 Rev 668
Line 26... Line 26...
26
public class LogisticsService {
26
public class LogisticsService {
27
 
27
 
28
  public interface Iface {
28
  public interface Iface {
29
 
29
 
30
    /**
30
    /**
-
 
31
     * Returns a provider for a given provider ID. Throws an exception if none found.
-
 
32
     * 
-
 
33
     * @param providerId
-
 
34
     */
-
 
35
    public Provider getProvider(long providerId) throws LogisticsServiceException, TException;
-
 
36
 
-
 
37
    /**
31
     * Returns a LogisticsInfo structure w/o an airway bill number. Use this method during the estimation phase.
38
     * 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
39
     * 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.
40
     * is allocated to a warehouse zone but there are no actual warehouses in that zone, an exception is raised.
34
     * 
41
     * 
35
     * @param itemId
42
     * @param itemId
Line 87... Line 94...
87
    public TProtocol getOutputProtocol()
94
    public TProtocol getOutputProtocol()
88
    {
95
    {
89
      return this.oprot_;
96
      return this.oprot_;
90
    }
97
    }
91
 
98
 
-
 
99
    public Provider getProvider(long providerId) throws LogisticsServiceException, TException
-
 
100
    {
-
 
101
      send_getProvider(providerId);
-
 
102
      return recv_getProvider();
-
 
103
    }
-
 
104
 
-
 
105
    public void send_getProvider(long providerId) throws TException
-
 
106
    {
-
 
107
      oprot_.writeMessageBegin(new TMessage("getProvider", TMessageType.CALL, seqid_));
-
 
108
      getProvider_args args = new getProvider_args();
-
 
109
      args.providerId = providerId;
-
 
110
      args.write(oprot_);
-
 
111
      oprot_.writeMessageEnd();
-
 
112
      oprot_.getTransport().flush();
-
 
113
    }
-
 
114
 
-
 
115
    public Provider recv_getProvider() throws LogisticsServiceException, TException
-
 
116
    {
-
 
117
      TMessage msg = iprot_.readMessageBegin();
-
 
118
      if (msg.type == TMessageType.EXCEPTION) {
-
 
119
        TApplicationException x = TApplicationException.read(iprot_);
-
 
120
        iprot_.readMessageEnd();
-
 
121
        throw x;
-
 
122
      }
-
 
123
      getProvider_result result = new getProvider_result();
-
 
124
      result.read(iprot_);
-
 
125
      iprot_.readMessageEnd();
-
 
126
      if (result.isSetSuccess()) {
-
 
127
        return result.success;
-
 
128
      }
-
 
129
      if (result.lse != null) {
-
 
130
        throw result.lse;
-
 
131
      }
-
 
132
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getProvider failed: unknown result");
-
 
133
    }
-
 
134
 
92
    public LogisticsInfo getLogisticsEstimation(long itemId, String destination_pin) throws LogisticsServiceException, TException
135
    public LogisticsInfo getLogisticsEstimation(long itemId, String destination_pin) throws LogisticsServiceException, TException
93
    {
136
    {
94
      send_getLogisticsEstimation(itemId, destination_pin);
137
      send_getLogisticsEstimation(itemId, destination_pin);
95
      return recv_getLogisticsEstimation();
138
      return recv_getLogisticsEstimation();
96
    }
139
    }
Line 240... Line 283...
240
  public static class Processor implements TProcessor {
283
  public static class Processor implements TProcessor {
241
    private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName());
284
    private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName());
242
    public Processor(Iface iface)
285
    public Processor(Iface iface)
243
    {
286
    {
244
      iface_ = iface;
287
      iface_ = iface;
-
 
288
      processMap_.put("getProvider", new getProvider());
245
      processMap_.put("getLogisticsEstimation", new getLogisticsEstimation());
289
      processMap_.put("getLogisticsEstimation", new getLogisticsEstimation());
246
      processMap_.put("getLogisticsInfo", new getLogisticsInfo());
290
      processMap_.put("getLogisticsInfo", new getLogisticsInfo());
247
      processMap_.put("getEmptyAWB", new getEmptyAWB());
291
      processMap_.put("getEmptyAWB", new getEmptyAWB());
248
      processMap_.put("getShipmentInfo", new getShipmentInfo());
292
      processMap_.put("getShipmentInfo", new getShipmentInfo());
249
    }
293
    }
Line 271... Line 315...
271
      }
315
      }
272
      fn.process(msg.seqid, iprot, oprot);
316
      fn.process(msg.seqid, iprot, oprot);
273
      return true;
317
      return true;
274
    }
318
    }
275
 
319
 
-
 
320
    private class getProvider implements ProcessFunction {
-
 
321
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
-
 
322
      {
-
 
323
        getProvider_args args = new getProvider_args();
-
 
324
        args.read(iprot);
-
 
325
        iprot.readMessageEnd();
-
 
326
        getProvider_result result = new getProvider_result();
-
 
327
        try {
-
 
328
          result.success = iface_.getProvider(args.providerId);
-
 
329
        } catch (LogisticsServiceException lse) {
-
 
330
          result.lse = lse;
-
 
331
        } catch (Throwable th) {
-
 
332
          LOGGER.error("Internal error processing getProvider", th);
-
 
333
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing getProvider");
-
 
334
          oprot.writeMessageBegin(new TMessage("getProvider", TMessageType.EXCEPTION, seqid));
-
 
335
          x.write(oprot);
-
 
336
          oprot.writeMessageEnd();
-
 
337
          oprot.getTransport().flush();
-
 
338
          return;
-
 
339
        }
-
 
340
        oprot.writeMessageBegin(new TMessage("getProvider", TMessageType.REPLY, seqid));
-
 
341
        result.write(oprot);
-
 
342
        oprot.writeMessageEnd();
-
 
343
        oprot.getTransport().flush();
-
 
344
      }
-
 
345
 
-
 
346
    }
-
 
347
 
276
    private class getLogisticsEstimation implements ProcessFunction {
348
    private class getLogisticsEstimation implements ProcessFunction {
277
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
349
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
278
      {
350
      {
279
        getLogisticsEstimation_args args = new getLogisticsEstimation_args();
351
        getLogisticsEstimation_args args = new getLogisticsEstimation_args();
280
        args.read(iprot);
352
        args.read(iprot);
Line 385... Line 457...
385
 
457
 
386
    }
458
    }
387
 
459
 
388
  }
460
  }
389
 
461
 
-
 
462
  public static class getProvider_args implements TBase<getProvider_args._Fields>, java.io.Serializable, Cloneable, Comparable<getProvider_args>   {
-
 
463
    private static final TStruct STRUCT_DESC = new TStruct("getProvider_args");
-
 
464
 
-
 
465
    private static final TField PROVIDER_ID_FIELD_DESC = new TField("providerId", TType.I64, (short)1);
-
 
466
 
-
 
467
    private long providerId;
-
 
468
 
-
 
469
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-
 
470
    public enum _Fields implements TFieldIdEnum {
-
 
471
      PROVIDER_ID((short)1, "providerId");
-
 
472
 
-
 
473
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
-
 
474
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
-
 
475
 
-
 
476
      static {
-
 
477
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
-
 
478
          byId.put((int)field._thriftId, field);
-
 
479
          byName.put(field.getFieldName(), field);
-
 
480
        }
-
 
481
      }
-
 
482
 
-
 
483
      /**
-
 
484
       * Find the _Fields constant that matches fieldId, or null if its not found.
-
 
485
       */
-
 
486
      public static _Fields findByThriftId(int fieldId) {
-
 
487
        return byId.get(fieldId);
-
 
488
      }
-
 
489
 
-
 
490
      /**
-
 
491
       * Find the _Fields constant that matches fieldId, throwing an exception
-
 
492
       * if it is not found.
-
 
493
       */
-
 
494
      public static _Fields findByThriftIdOrThrow(int fieldId) {
-
 
495
        _Fields fields = findByThriftId(fieldId);
-
 
496
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
-
 
497
        return fields;
-
 
498
      }
-
 
499
 
-
 
500
      /**
-
 
501
       * Find the _Fields constant that matches name, or null if its not found.
-
 
502
       */
-
 
503
      public static _Fields findByName(String name) {
-
 
504
        return byName.get(name);
-
 
505
      }
-
 
506
 
-
 
507
      private final short _thriftId;
-
 
508
      private final String _fieldName;
-
 
509
 
-
 
510
      _Fields(short thriftId, String fieldName) {
-
 
511
        _thriftId = thriftId;
-
 
512
        _fieldName = fieldName;
-
 
513
      }
-
 
514
 
-
 
515
      public short getThriftFieldId() {
-
 
516
        return _thriftId;
-
 
517
      }
-
 
518
 
-
 
519
      public String getFieldName() {
-
 
520
        return _fieldName;
-
 
521
      }
-
 
522
    }
-
 
523
 
-
 
524
    // isset id assignments
-
 
525
    private static final int __PROVIDERID_ISSET_ID = 0;
-
 
526
    private BitSet __isset_bit_vector = new BitSet(1);
-
 
527
 
-
 
528
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
-
 
529
      put(_Fields.PROVIDER_ID, new FieldMetaData("providerId", TFieldRequirementType.DEFAULT, 
-
 
530
          new FieldValueMetaData(TType.I64)));
-
 
531
    }});
-
 
532
 
-
 
533
    static {
-
 
534
      FieldMetaData.addStructMetaDataMap(getProvider_args.class, metaDataMap);
-
 
535
    }
-
 
536
 
-
 
537
    public getProvider_args() {
-
 
538
    }
-
 
539
 
-
 
540
    public getProvider_args(
-
 
541
      long providerId)
-
 
542
    {
-
 
543
      this();
-
 
544
      this.providerId = providerId;
-
 
545
      setProviderIdIsSet(true);
-
 
546
    }
-
 
547
 
-
 
548
    /**
-
 
549
     * Performs a deep copy on <i>other</i>.
-
 
550
     */
-
 
551
    public getProvider_args(getProvider_args other) {
-
 
552
      __isset_bit_vector.clear();
-
 
553
      __isset_bit_vector.or(other.__isset_bit_vector);
-
 
554
      this.providerId = other.providerId;
-
 
555
    }
-
 
556
 
-
 
557
    public getProvider_args deepCopy() {
-
 
558
      return new getProvider_args(this);
-
 
559
    }
-
 
560
 
-
 
561
    @Deprecated
-
 
562
    public getProvider_args clone() {
-
 
563
      return new getProvider_args(this);
-
 
564
    }
-
 
565
 
-
 
566
    public long getProviderId() {
-
 
567
      return this.providerId;
-
 
568
    }
-
 
569
 
-
 
570
    public getProvider_args setProviderId(long providerId) {
-
 
571
      this.providerId = providerId;
-
 
572
      setProviderIdIsSet(true);
-
 
573
      return this;
-
 
574
    }
-
 
575
 
-
 
576
    public void unsetProviderId() {
-
 
577
      __isset_bit_vector.clear(__PROVIDERID_ISSET_ID);
-
 
578
    }
-
 
579
 
-
 
580
    /** Returns true if field providerId is set (has been asigned a value) and false otherwise */
-
 
581
    public boolean isSetProviderId() {
-
 
582
      return __isset_bit_vector.get(__PROVIDERID_ISSET_ID);
-
 
583
    }
-
 
584
 
-
 
585
    public void setProviderIdIsSet(boolean value) {
-
 
586
      __isset_bit_vector.set(__PROVIDERID_ISSET_ID, value);
-
 
587
    }
-
 
588
 
-
 
589
    public void setFieldValue(_Fields field, Object value) {
-
 
590
      switch (field) {
-
 
591
      case PROVIDER_ID:
-
 
592
        if (value == null) {
-
 
593
          unsetProviderId();
-
 
594
        } else {
-
 
595
          setProviderId((Long)value);
-
 
596
        }
-
 
597
        break;
-
 
598
 
-
 
599
      }
-
 
600
    }
-
 
601
 
-
 
602
    public void setFieldValue(int fieldID, Object value) {
-
 
603
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
-
 
604
    }
-
 
605
 
-
 
606
    public Object getFieldValue(_Fields field) {
-
 
607
      switch (field) {
-
 
608
      case PROVIDER_ID:
-
 
609
        return new Long(getProviderId());
-
 
610
 
-
 
611
      }
-
 
612
      throw new IllegalStateException();
-
 
613
    }
-
 
614
 
-
 
615
    public Object getFieldValue(int fieldId) {
-
 
616
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
-
 
617
    }
-
 
618
 
-
 
619
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
-
 
620
    public boolean isSet(_Fields field) {
-
 
621
      switch (field) {
-
 
622
      case PROVIDER_ID:
-
 
623
        return isSetProviderId();
-
 
624
      }
-
 
625
      throw new IllegalStateException();
-
 
626
    }
-
 
627
 
-
 
628
    public boolean isSet(int fieldID) {
-
 
629
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
-
 
630
    }
-
 
631
 
-
 
632
    @Override
-
 
633
    public boolean equals(Object that) {
-
 
634
      if (that == null)
-
 
635
        return false;
-
 
636
      if (that instanceof getProvider_args)
-
 
637
        return this.equals((getProvider_args)that);
-
 
638
      return false;
-
 
639
    }
-
 
640
 
-
 
641
    public boolean equals(getProvider_args that) {
-
 
642
      if (that == null)
-
 
643
        return false;
-
 
644
 
-
 
645
      boolean this_present_providerId = true;
-
 
646
      boolean that_present_providerId = true;
-
 
647
      if (this_present_providerId || that_present_providerId) {
-
 
648
        if (!(this_present_providerId && that_present_providerId))
-
 
649
          return false;
-
 
650
        if (this.providerId != that.providerId)
-
 
651
          return false;
-
 
652
      }
-
 
653
 
-
 
654
      return true;
-
 
655
    }
-
 
656
 
-
 
657
    @Override
-
 
658
    public int hashCode() {
-
 
659
      return 0;
-
 
660
    }
-
 
661
 
-
 
662
    public int compareTo(getProvider_args other) {
-
 
663
      if (!getClass().equals(other.getClass())) {
-
 
664
        return getClass().getName().compareTo(other.getClass().getName());
-
 
665
      }
-
 
666
 
-
 
667
      int lastComparison = 0;
-
 
668
      getProvider_args typedOther = (getProvider_args)other;
-
 
669
 
-
 
670
      lastComparison = Boolean.valueOf(isSetProviderId()).compareTo(isSetProviderId());
-
 
671
      if (lastComparison != 0) {
-
 
672
        return lastComparison;
-
 
673
      }
-
 
674
      lastComparison = TBaseHelper.compareTo(providerId, typedOther.providerId);
-
 
675
      if (lastComparison != 0) {
-
 
676
        return lastComparison;
-
 
677
      }
-
 
678
      return 0;
-
 
679
    }
-
 
680
 
-
 
681
    public void read(TProtocol iprot) throws TException {
-
 
682
      TField field;
-
 
683
      iprot.readStructBegin();
-
 
684
      while (true)
-
 
685
      {
-
 
686
        field = iprot.readFieldBegin();
-
 
687
        if (field.type == TType.STOP) { 
-
 
688
          break;
-
 
689
        }
-
 
690
        _Fields fieldId = _Fields.findByThriftId(field.id);
-
 
691
        if (fieldId == null) {
-
 
692
          TProtocolUtil.skip(iprot, field.type);
-
 
693
        } else {
-
 
694
          switch (fieldId) {
-
 
695
            case PROVIDER_ID:
-
 
696
              if (field.type == TType.I64) {
-
 
697
                this.providerId = iprot.readI64();
-
 
698
                setProviderIdIsSet(true);
-
 
699
              } else { 
-
 
700
                TProtocolUtil.skip(iprot, field.type);
-
 
701
              }
-
 
702
              break;
-
 
703
          }
-
 
704
          iprot.readFieldEnd();
-
 
705
        }
-
 
706
      }
-
 
707
      iprot.readStructEnd();
-
 
708
      validate();
-
 
709
    }
-
 
710
 
-
 
711
    public void write(TProtocol oprot) throws TException {
-
 
712
      validate();
-
 
713
 
-
 
714
      oprot.writeStructBegin(STRUCT_DESC);
-
 
715
      oprot.writeFieldBegin(PROVIDER_ID_FIELD_DESC);
-
 
716
      oprot.writeI64(this.providerId);
-
 
717
      oprot.writeFieldEnd();
-
 
718
      oprot.writeFieldStop();
-
 
719
      oprot.writeStructEnd();
-
 
720
    }
-
 
721
 
-
 
722
    @Override
-
 
723
    public String toString() {
-
 
724
      StringBuilder sb = new StringBuilder("getProvider_args(");
-
 
725
      boolean first = true;
-
 
726
 
-
 
727
      sb.append("providerId:");
-
 
728
      sb.append(this.providerId);
-
 
729
      first = false;
-
 
730
      sb.append(")");
-
 
731
      return sb.toString();
-
 
732
    }
-
 
733
 
-
 
734
    public void validate() throws TException {
-
 
735
      // check for required fields
-
 
736
    }
-
 
737
 
-
 
738
  }
-
 
739
 
-
 
740
  public static class getProvider_result implements TBase<getProvider_result._Fields>, java.io.Serializable, Cloneable, Comparable<getProvider_result>   {
-
 
741
    private static final TStruct STRUCT_DESC = new TStruct("getProvider_result");
-
 
742
 
-
 
743
    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRUCT, (short)0);
-
 
744
    private static final TField LSE_FIELD_DESC = new TField("lse", TType.STRUCT, (short)1);
-
 
745
 
-
 
746
    private Provider success;
-
 
747
    private LogisticsServiceException lse;
-
 
748
 
-
 
749
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-
 
750
    public enum _Fields implements TFieldIdEnum {
-
 
751
      SUCCESS((short)0, "success"),
-
 
752
      LSE((short)1, "lse");
-
 
753
 
-
 
754
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
-
 
755
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
-
 
756
 
-
 
757
      static {
-
 
758
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
-
 
759
          byId.put((int)field._thriftId, field);
-
 
760
          byName.put(field.getFieldName(), field);
-
 
761
        }
-
 
762
      }
-
 
763
 
-
 
764
      /**
-
 
765
       * Find the _Fields constant that matches fieldId, or null if its not found.
-
 
766
       */
-
 
767
      public static _Fields findByThriftId(int fieldId) {
-
 
768
        return byId.get(fieldId);
-
 
769
      }
-
 
770
 
-
 
771
      /**
-
 
772
       * Find the _Fields constant that matches fieldId, throwing an exception
-
 
773
       * if it is not found.
-
 
774
       */
-
 
775
      public static _Fields findByThriftIdOrThrow(int fieldId) {
-
 
776
        _Fields fields = findByThriftId(fieldId);
-
 
777
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
-
 
778
        return fields;
-
 
779
      }
-
 
780
 
-
 
781
      /**
-
 
782
       * Find the _Fields constant that matches name, or null if its not found.
-
 
783
       */
-
 
784
      public static _Fields findByName(String name) {
-
 
785
        return byName.get(name);
-
 
786
      }
-
 
787
 
-
 
788
      private final short _thriftId;
-
 
789
      private final String _fieldName;
-
 
790
 
-
 
791
      _Fields(short thriftId, String fieldName) {
-
 
792
        _thriftId = thriftId;
-
 
793
        _fieldName = fieldName;
-
 
794
      }
-
 
795
 
-
 
796
      public short getThriftFieldId() {
-
 
797
        return _thriftId;
-
 
798
      }
-
 
799
 
-
 
800
      public String getFieldName() {
-
 
801
        return _fieldName;
-
 
802
      }
-
 
803
    }
-
 
804
 
-
 
805
    // isset id assignments
-
 
806
 
-
 
807
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
-
 
808
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
-
 
809
          new StructMetaData(TType.STRUCT, Provider.class)));
-
 
810
      put(_Fields.LSE, new FieldMetaData("lse", TFieldRequirementType.DEFAULT, 
-
 
811
          new FieldValueMetaData(TType.STRUCT)));
-
 
812
    }});
-
 
813
 
-
 
814
    static {
-
 
815
      FieldMetaData.addStructMetaDataMap(getProvider_result.class, metaDataMap);
-
 
816
    }
-
 
817
 
-
 
818
    public getProvider_result() {
-
 
819
    }
-
 
820
 
-
 
821
    public getProvider_result(
-
 
822
      Provider success,
-
 
823
      LogisticsServiceException lse)
-
 
824
    {
-
 
825
      this();
-
 
826
      this.success = success;
-
 
827
      this.lse = lse;
-
 
828
    }
-
 
829
 
-
 
830
    /**
-
 
831
     * Performs a deep copy on <i>other</i>.
-
 
832
     */
-
 
833
    public getProvider_result(getProvider_result other) {
-
 
834
      if (other.isSetSuccess()) {
-
 
835
        this.success = new Provider(other.success);
-
 
836
      }
-
 
837
      if (other.isSetLse()) {
-
 
838
        this.lse = new LogisticsServiceException(other.lse);
-
 
839
      }
-
 
840
    }
-
 
841
 
-
 
842
    public getProvider_result deepCopy() {
-
 
843
      return new getProvider_result(this);
-
 
844
    }
-
 
845
 
-
 
846
    @Deprecated
-
 
847
    public getProvider_result clone() {
-
 
848
      return new getProvider_result(this);
-
 
849
    }
-
 
850
 
-
 
851
    public Provider getSuccess() {
-
 
852
      return this.success;
-
 
853
    }
-
 
854
 
-
 
855
    public getProvider_result setSuccess(Provider success) {
-
 
856
      this.success = success;
-
 
857
      return this;
-
 
858
    }
-
 
859
 
-
 
860
    public void unsetSuccess() {
-
 
861
      this.success = null;
-
 
862
    }
-
 
863
 
-
 
864
    /** Returns true if field success is set (has been asigned a value) and false otherwise */
-
 
865
    public boolean isSetSuccess() {
-
 
866
      return this.success != null;
-
 
867
    }
-
 
868
 
-
 
869
    public void setSuccessIsSet(boolean value) {
-
 
870
      if (!value) {
-
 
871
        this.success = null;
-
 
872
      }
-
 
873
    }
-
 
874
 
-
 
875
    public LogisticsServiceException getLse() {
-
 
876
      return this.lse;
-
 
877
    }
-
 
878
 
-
 
879
    public getProvider_result setLse(LogisticsServiceException lse) {
-
 
880
      this.lse = lse;
-
 
881
      return this;
-
 
882
    }
-
 
883
 
-
 
884
    public void unsetLse() {
-
 
885
      this.lse = null;
-
 
886
    }
-
 
887
 
-
 
888
    /** Returns true if field lse is set (has been asigned a value) and false otherwise */
-
 
889
    public boolean isSetLse() {
-
 
890
      return this.lse != null;
-
 
891
    }
-
 
892
 
-
 
893
    public void setLseIsSet(boolean value) {
-
 
894
      if (!value) {
-
 
895
        this.lse = null;
-
 
896
      }
-
 
897
    }
-
 
898
 
-
 
899
    public void setFieldValue(_Fields field, Object value) {
-
 
900
      switch (field) {
-
 
901
      case SUCCESS:
-
 
902
        if (value == null) {
-
 
903
          unsetSuccess();
-
 
904
        } else {
-
 
905
          setSuccess((Provider)value);
-
 
906
        }
-
 
907
        break;
-
 
908
 
-
 
909
      case LSE:
-
 
910
        if (value == null) {
-
 
911
          unsetLse();
-
 
912
        } else {
-
 
913
          setLse((LogisticsServiceException)value);
-
 
914
        }
-
 
915
        break;
-
 
916
 
-
 
917
      }
-
 
918
    }
-
 
919
 
-
 
920
    public void setFieldValue(int fieldID, Object value) {
-
 
921
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
-
 
922
    }
-
 
923
 
-
 
924
    public Object getFieldValue(_Fields field) {
-
 
925
      switch (field) {
-
 
926
      case SUCCESS:
-
 
927
        return getSuccess();
-
 
928
 
-
 
929
      case LSE:
-
 
930
        return getLse();
-
 
931
 
-
 
932
      }
-
 
933
      throw new IllegalStateException();
-
 
934
    }
-
 
935
 
-
 
936
    public Object getFieldValue(int fieldId) {
-
 
937
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
-
 
938
    }
-
 
939
 
-
 
940
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
-
 
941
    public boolean isSet(_Fields field) {
-
 
942
      switch (field) {
-
 
943
      case SUCCESS:
-
 
944
        return isSetSuccess();
-
 
945
      case LSE:
-
 
946
        return isSetLse();
-
 
947
      }
-
 
948
      throw new IllegalStateException();
-
 
949
    }
-
 
950
 
-
 
951
    public boolean isSet(int fieldID) {
-
 
952
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
-
 
953
    }
-
 
954
 
-
 
955
    @Override
-
 
956
    public boolean equals(Object that) {
-
 
957
      if (that == null)
-
 
958
        return false;
-
 
959
      if (that instanceof getProvider_result)
-
 
960
        return this.equals((getProvider_result)that);
-
 
961
      return false;
-
 
962
    }
-
 
963
 
-
 
964
    public boolean equals(getProvider_result that) {
-
 
965
      if (that == null)
-
 
966
        return false;
-
 
967
 
-
 
968
      boolean this_present_success = true && this.isSetSuccess();
-
 
969
      boolean that_present_success = true && that.isSetSuccess();
-
 
970
      if (this_present_success || that_present_success) {
-
 
971
        if (!(this_present_success && that_present_success))
-
 
972
          return false;
-
 
973
        if (!this.success.equals(that.success))
-
 
974
          return false;
-
 
975
      }
-
 
976
 
-
 
977
      boolean this_present_lse = true && this.isSetLse();
-
 
978
      boolean that_present_lse = true && that.isSetLse();
-
 
979
      if (this_present_lse || that_present_lse) {
-
 
980
        if (!(this_present_lse && that_present_lse))
-
 
981
          return false;
-
 
982
        if (!this.lse.equals(that.lse))
-
 
983
          return false;
-
 
984
      }
-
 
985
 
-
 
986
      return true;
-
 
987
    }
-
 
988
 
-
 
989
    @Override
-
 
990
    public int hashCode() {
-
 
991
      return 0;
-
 
992
    }
-
 
993
 
-
 
994
    public int compareTo(getProvider_result other) {
-
 
995
      if (!getClass().equals(other.getClass())) {
-
 
996
        return getClass().getName().compareTo(other.getClass().getName());
-
 
997
      }
-
 
998
 
-
 
999
      int lastComparison = 0;
-
 
1000
      getProvider_result typedOther = (getProvider_result)other;
-
 
1001
 
-
 
1002
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
-
 
1003
      if (lastComparison != 0) {
-
 
1004
        return lastComparison;
-
 
1005
      }
-
 
1006
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
-
 
1007
      if (lastComparison != 0) {
-
 
1008
        return lastComparison;
-
 
1009
      }
-
 
1010
      lastComparison = Boolean.valueOf(isSetLse()).compareTo(isSetLse());
-
 
1011
      if (lastComparison != 0) {
-
 
1012
        return lastComparison;
-
 
1013
      }
-
 
1014
      lastComparison = TBaseHelper.compareTo(lse, typedOther.lse);
-
 
1015
      if (lastComparison != 0) {
-
 
1016
        return lastComparison;
-
 
1017
      }
-
 
1018
      return 0;
-
 
1019
    }
-
 
1020
 
-
 
1021
    public void read(TProtocol iprot) throws TException {
-
 
1022
      TField field;
-
 
1023
      iprot.readStructBegin();
-
 
1024
      while (true)
-
 
1025
      {
-
 
1026
        field = iprot.readFieldBegin();
-
 
1027
        if (field.type == TType.STOP) { 
-
 
1028
          break;
-
 
1029
        }
-
 
1030
        _Fields fieldId = _Fields.findByThriftId(field.id);
-
 
1031
        if (fieldId == null) {
-
 
1032
          TProtocolUtil.skip(iprot, field.type);
-
 
1033
        } else {
-
 
1034
          switch (fieldId) {
-
 
1035
            case SUCCESS:
-
 
1036
              if (field.type == TType.STRUCT) {
-
 
1037
                this.success = new Provider();
-
 
1038
                this.success.read(iprot);
-
 
1039
              } else { 
-
 
1040
                TProtocolUtil.skip(iprot, field.type);
-
 
1041
              }
-
 
1042
              break;
-
 
1043
            case LSE:
-
 
1044
              if (field.type == TType.STRUCT) {
-
 
1045
                this.lse = new LogisticsServiceException();
-
 
1046
                this.lse.read(iprot);
-
 
1047
              } else { 
-
 
1048
                TProtocolUtil.skip(iprot, field.type);
-
 
1049
              }
-
 
1050
              break;
-
 
1051
          }
-
 
1052
          iprot.readFieldEnd();
-
 
1053
        }
-
 
1054
      }
-
 
1055
      iprot.readStructEnd();
-
 
1056
      validate();
-
 
1057
    }
-
 
1058
 
-
 
1059
    public void write(TProtocol oprot) throws TException {
-
 
1060
      oprot.writeStructBegin(STRUCT_DESC);
-
 
1061
 
-
 
1062
      if (this.isSetSuccess()) {
-
 
1063
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
-
 
1064
        this.success.write(oprot);
-
 
1065
        oprot.writeFieldEnd();
-
 
1066
      } else if (this.isSetLse()) {
-
 
1067
        oprot.writeFieldBegin(LSE_FIELD_DESC);
-
 
1068
        this.lse.write(oprot);
-
 
1069
        oprot.writeFieldEnd();
-
 
1070
      }
-
 
1071
      oprot.writeFieldStop();
-
 
1072
      oprot.writeStructEnd();
-
 
1073
    }
-
 
1074
 
-
 
1075
    @Override
-
 
1076
    public String toString() {
-
 
1077
      StringBuilder sb = new StringBuilder("getProvider_result(");
-
 
1078
      boolean first = true;
-
 
1079
 
-
 
1080
      sb.append("success:");
-
 
1081
      if (this.success == null) {
-
 
1082
        sb.append("null");
-
 
1083
      } else {
-
 
1084
        sb.append(this.success);
-
 
1085
      }
-
 
1086
      first = false;
-
 
1087
      if (!first) sb.append(", ");
-
 
1088
      sb.append("lse:");
-
 
1089
      if (this.lse == null) {
-
 
1090
        sb.append("null");
-
 
1091
      } else {
-
 
1092
        sb.append(this.lse);
-
 
1093
      }
-
 
1094
      first = false;
-
 
1095
      sb.append(")");
-
 
1096
      return sb.toString();
-
 
1097
    }
-
 
1098
 
-
 
1099
    public void validate() throws TException {
-
 
1100
      // check for required fields
-
 
1101
    }
-
 
1102
 
-
 
1103
  }
-
 
1104
 
390
  public static class getLogisticsEstimation_args implements TBase<getLogisticsEstimation_args._Fields>, java.io.Serializable, Cloneable, Comparable<getLogisticsEstimation_args>   {
1105
  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");
1106
    private static final TStruct STRUCT_DESC = new TStruct("getLogisticsEstimation_args");
392
 
1107
 
393
    private static final TField ITEM_ID_FIELD_DESC = new TField("itemId", TType.I64, (short)1);
1108
    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);
1109
    private static final TField DESTINATION_PIN_FIELD_DESC = new TField("destination_pin", TType.STRING, (short)2);