Subversion Repositories SmartDukaan

Rev

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

Rev 352 Rev 471
Line 25... Line 25...
25
 
25
 
26
public class HelperService {
26
public class HelperService {
27
 
27
 
28
  public interface Iface {
28
  public interface Iface {
29
 
29
 
30
    public List<ItemLogistics> getLogisticsEstimation(long itemId, Map<String,String> location) throws HelperServiceException, TException;
-
 
31
 
-
 
32
    public void sendMail(Mail mail) throws HelperServiceException, TException;
30
    public void sendMail(Mail mail) throws HelperServiceException, TException;
33
 
31
 
34
    public void sendText(TextMessage message) throws HelperServiceException, TException;
32
    public void sendText(TextMessage message) throws HelperServiceException, TException;
35
 
33
 
36
    public void addMessage(Message message) throws HelperServiceException, TException;
34
    public void addMessage(Message message) throws HelperServiceException, TException;
Line 68... Line 66...
68
    public TProtocol getOutputProtocol()
66
    public TProtocol getOutputProtocol()
69
    {
67
    {
70
      return this.oprot_;
68
      return this.oprot_;
71
    }
69
    }
72
 
70
 
73
    public List<ItemLogistics> getLogisticsEstimation(long itemId, Map<String,String> location) throws HelperServiceException, TException
-
 
74
    {
-
 
75
      send_getLogisticsEstimation(itemId, location);
-
 
76
      return recv_getLogisticsEstimation();
-
 
77
    }
-
 
78
 
-
 
79
    public void send_getLogisticsEstimation(long itemId, Map<String,String> location) throws TException
-
 
80
    {
-
 
81
      oprot_.writeMessageBegin(new TMessage("getLogisticsEstimation", TMessageType.CALL, seqid_));
-
 
82
      getLogisticsEstimation_args args = new getLogisticsEstimation_args();
-
 
83
      args.itemId = itemId;
-
 
84
      args.location = location;
-
 
85
      args.write(oprot_);
-
 
86
      oprot_.writeMessageEnd();
-
 
87
      oprot_.getTransport().flush();
-
 
88
    }
-
 
89
 
-
 
90
    public List<ItemLogistics> recv_getLogisticsEstimation() throws HelperServiceException, TException
-
 
91
    {
-
 
92
      TMessage msg = iprot_.readMessageBegin();
-
 
93
      if (msg.type == TMessageType.EXCEPTION) {
-
 
94
        TApplicationException x = TApplicationException.read(iprot_);
-
 
95
        iprot_.readMessageEnd();
-
 
96
        throw x;
-
 
97
      }
-
 
98
      getLogisticsEstimation_result result = new getLogisticsEstimation_result();
-
 
99
      result.read(iprot_);
-
 
100
      iprot_.readMessageEnd();
-
 
101
      if (result.isSetSuccess()) {
-
 
102
        return result.success;
-
 
103
      }
-
 
104
      if (result.se != null) {
-
 
105
        throw result.se;
-
 
106
      }
-
 
107
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getLogisticsEstimation failed: unknown result");
-
 
108
    }
-
 
109
 
-
 
110
    public void sendMail(Mail mail) throws HelperServiceException, TException
71
    public void sendMail(Mail mail) throws HelperServiceException, TException
111
    {
72
    {
112
      send_sendMail(mail);
73
      send_sendMail(mail);
113
      recv_sendMail();
74
      recv_sendMail();
114
    }
75
    }
Line 317... Line 278...
317
  public static class Processor implements TProcessor {
278
  public static class Processor implements TProcessor {
318
    private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName());
279
    private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName());
319
    public Processor(Iface iface)
280
    public Processor(Iface iface)
320
    {
281
    {
321
      iface_ = iface;
282
      iface_ = iface;
322
      processMap_.put("getLogisticsEstimation", new getLogisticsEstimation());
-
 
323
      processMap_.put("sendMail", new sendMail());
283
      processMap_.put("sendMail", new sendMail());
324
      processMap_.put("sendText", new sendText());
284
      processMap_.put("sendText", new sendText());
325
      processMap_.put("addMessage", new addMessage());
285
      processMap_.put("addMessage", new addMessage());
326
      processMap_.put("updateMessage", new updateMessage());
286
      processMap_.put("updateMessage", new updateMessage());
327
      processMap_.put("getMessage", new getMessage());
287
      processMap_.put("getMessage", new getMessage());
Line 351... Line 311...
351
      }
311
      }
352
      fn.process(msg.seqid, iprot, oprot);
312
      fn.process(msg.seqid, iprot, oprot);
353
      return true;
313
      return true;
354
    }
314
    }
355
 
315
 
356
    private class getLogisticsEstimation implements ProcessFunction {
-
 
357
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
-
 
358
      {
-
 
359
        getLogisticsEstimation_args args = new getLogisticsEstimation_args();
-
 
360
        args.read(iprot);
-
 
361
        iprot.readMessageEnd();
-
 
362
        getLogisticsEstimation_result result = new getLogisticsEstimation_result();
-
 
363
        try {
-
 
364
          result.success = iface_.getLogisticsEstimation(args.itemId, args.location);
-
 
365
        } catch (HelperServiceException se) {
-
 
366
          result.se = se;
-
 
367
        } catch (Throwable th) {
-
 
368
          LOGGER.error("Internal error processing getLogisticsEstimation", th);
-
 
369
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing getLogisticsEstimation");
-
 
370
          oprot.writeMessageBegin(new TMessage("getLogisticsEstimation", TMessageType.EXCEPTION, seqid));
-
 
371
          x.write(oprot);
-
 
372
          oprot.writeMessageEnd();
-
 
373
          oprot.getTransport().flush();
-
 
374
          return;
-
 
375
        }
-
 
376
        oprot.writeMessageBegin(new TMessage("getLogisticsEstimation", TMessageType.REPLY, seqid));
-
 
377
        result.write(oprot);
-
 
378
        oprot.writeMessageEnd();
-
 
379
        oprot.getTransport().flush();
-
 
380
      }
-
 
381
 
-
 
382
    }
-
 
383
 
-
 
384
    private class sendMail implements ProcessFunction {
316
    private class sendMail implements ProcessFunction {
385
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
317
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
386
      {
318
      {
387
        sendMail_args args = new sendMail_args();
319
        sendMail_args args = new sendMail_args();
388
        args.read(iprot);
320
        args.read(iprot);
Line 549... Line 481...
549
 
481
 
550
    }
482
    }
551
 
483
 
552
  }
484
  }
553
 
485
 
554
  public static class getLogisticsEstimation_args implements TBase<getLogisticsEstimation_args._Fields>, java.io.Serializable, Cloneable   {
-
 
555
    private static final TStruct STRUCT_DESC = new TStruct("getLogisticsEstimation_args");
-
 
556
 
-
 
557
    private static final TField ITEM_ID_FIELD_DESC = new TField("itemId", TType.I64, (short)1);
-
 
558
    private static final TField LOCATION_FIELD_DESC = new TField("location", TType.MAP, (short)2);
-
 
559
 
-
 
560
    private long itemId;
-
 
561
    private Map<String,String> location;
-
 
562
 
-
 
563
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-
 
564
    public enum _Fields implements TFieldIdEnum {
-
 
565
      ITEM_ID((short)1, "itemId"),
-
 
566
      LOCATION((short)2, "location");
-
 
567
 
-
 
568
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
-
 
569
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
-
 
570
 
-
 
571
      static {
-
 
572
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
-
 
573
          byId.put((int)field._thriftId, field);
-
 
574
          byName.put(field.getFieldName(), field);
-
 
575
        }
-
 
576
      }
-
 
577
 
-
 
578
      /**
-
 
579
       * Find the _Fields constant that matches fieldId, or null if its not found.
-
 
580
       */
-
 
581
      public static _Fields findByThriftId(int fieldId) {
-
 
582
        return byId.get(fieldId);
-
 
583
      }
-
 
584
 
-
 
585
      /**
-
 
586
       * Find the _Fields constant that matches fieldId, throwing an exception
-
 
587
       * if it is not found.
-
 
588
       */
-
 
589
      public static _Fields findByThriftIdOrThrow(int fieldId) {
-
 
590
        _Fields fields = findByThriftId(fieldId);
-
 
591
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
-
 
592
        return fields;
-
 
593
      }
-
 
594
 
-
 
595
      /**
-
 
596
       * Find the _Fields constant that matches name, or null if its not found.
-
 
597
       */
-
 
598
      public static _Fields findByName(String name) {
-
 
599
        return byName.get(name);
-
 
600
      }
-
 
601
 
-
 
602
      private final short _thriftId;
-
 
603
      private final String _fieldName;
-
 
604
 
-
 
605
      _Fields(short thriftId, String fieldName) {
-
 
606
        _thriftId = thriftId;
-
 
607
        _fieldName = fieldName;
-
 
608
      }
-
 
609
 
-
 
610
      public short getThriftFieldId() {
-
 
611
        return _thriftId;
-
 
612
      }
-
 
613
 
-
 
614
      public String getFieldName() {
-
 
615
        return _fieldName;
-
 
616
      }
-
 
617
    }
-
 
618
 
-
 
619
    // isset id assignments
-
 
620
    private static final int __ITEMID_ISSET_ID = 0;
-
 
621
    private BitSet __isset_bit_vector = new BitSet(1);
-
 
622
 
-
 
623
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
-
 
624
      put(_Fields.ITEM_ID, new FieldMetaData("itemId", TFieldRequirementType.DEFAULT, 
-
 
625
          new FieldValueMetaData(TType.I64)));
-
 
626
      put(_Fields.LOCATION, new FieldMetaData("location", TFieldRequirementType.DEFAULT, 
-
 
627
          new MapMetaData(TType.MAP, 
-
 
628
              new FieldValueMetaData(TType.STRING), 
-
 
629
              new FieldValueMetaData(TType.STRING))));
-
 
630
    }});
-
 
631
 
-
 
632
    static {
-
 
633
      FieldMetaData.addStructMetaDataMap(getLogisticsEstimation_args.class, metaDataMap);
-
 
634
    }
-
 
635
 
-
 
636
    public getLogisticsEstimation_args() {
-
 
637
    }
-
 
638
 
-
 
639
    public getLogisticsEstimation_args(
-
 
640
      long itemId,
-
 
641
      Map<String,String> location)
-
 
642
    {
-
 
643
      this();
-
 
644
      this.itemId = itemId;
-
 
645
      setItemIdIsSet(true);
-
 
646
      this.location = location;
-
 
647
    }
-
 
648
 
-
 
649
    /**
-
 
650
     * Performs a deep copy on <i>other</i>.
-
 
651
     */
-
 
652
    public getLogisticsEstimation_args(getLogisticsEstimation_args other) {
-
 
653
      __isset_bit_vector.clear();
-
 
654
      __isset_bit_vector.or(other.__isset_bit_vector);
-
 
655
      this.itemId = other.itemId;
-
 
656
      if (other.isSetLocation()) {
-
 
657
        Map<String,String> __this__location = new HashMap<String,String>();
-
 
658
        for (Map.Entry<String, String> other_element : other.location.entrySet()) {
-
 
659
 
-
 
660
          String other_element_key = other_element.getKey();
-
 
661
          String other_element_value = other_element.getValue();
-
 
662
 
-
 
663
          String __this__location_copy_key = other_element_key;
-
 
664
 
-
 
665
          String __this__location_copy_value = other_element_value;
-
 
666
 
-
 
667
          __this__location.put(__this__location_copy_key, __this__location_copy_value);
-
 
668
        }
-
 
669
        this.location = __this__location;
-
 
670
      }
-
 
671
    }
-
 
672
 
-
 
673
    public getLogisticsEstimation_args deepCopy() {
-
 
674
      return new getLogisticsEstimation_args(this);
-
 
675
    }
-
 
676
 
-
 
677
    @Deprecated
-
 
678
    public getLogisticsEstimation_args clone() {
-
 
679
      return new getLogisticsEstimation_args(this);
-
 
680
    }
-
 
681
 
-
 
682
    public long getItemId() {
-
 
683
      return this.itemId;
-
 
684
    }
-
 
685
 
-
 
686
    public getLogisticsEstimation_args setItemId(long itemId) {
-
 
687
      this.itemId = itemId;
-
 
688
      setItemIdIsSet(true);
-
 
689
      return this;
-
 
690
    }
-
 
691
 
-
 
692
    public void unsetItemId() {
-
 
693
      __isset_bit_vector.clear(__ITEMID_ISSET_ID);
-
 
694
    }
-
 
695
 
-
 
696
    /** Returns true if field itemId is set (has been asigned a value) and false otherwise */
-
 
697
    public boolean isSetItemId() {
-
 
698
      return __isset_bit_vector.get(__ITEMID_ISSET_ID);
-
 
699
    }
-
 
700
 
-
 
701
    public void setItemIdIsSet(boolean value) {
-
 
702
      __isset_bit_vector.set(__ITEMID_ISSET_ID, value);
-
 
703
    }
-
 
704
 
-
 
705
    public int getLocationSize() {
-
 
706
      return (this.location == null) ? 0 : this.location.size();
-
 
707
    }
-
 
708
 
-
 
709
    public void putToLocation(String key, String val) {
-
 
710
      if (this.location == null) {
-
 
711
        this.location = new HashMap<String,String>();
-
 
712
      }
-
 
713
      this.location.put(key, val);
-
 
714
    }
-
 
715
 
-
 
716
    public Map<String,String> getLocation() {
-
 
717
      return this.location;
-
 
718
    }
-
 
719
 
-
 
720
    public getLogisticsEstimation_args setLocation(Map<String,String> location) {
-
 
721
      this.location = location;
-
 
722
      return this;
-
 
723
    }
-
 
724
 
-
 
725
    public void unsetLocation() {
-
 
726
      this.location = null;
-
 
727
    }
-
 
728
 
-
 
729
    /** Returns true if field location is set (has been asigned a value) and false otherwise */
-
 
730
    public boolean isSetLocation() {
-
 
731
      return this.location != null;
-
 
732
    }
-
 
733
 
-
 
734
    public void setLocationIsSet(boolean value) {
-
 
735
      if (!value) {
-
 
736
        this.location = null;
-
 
737
      }
-
 
738
    }
-
 
739
 
-
 
740
    public void setFieldValue(_Fields field, Object value) {
-
 
741
      switch (field) {
-
 
742
      case ITEM_ID:
-
 
743
        if (value == null) {
-
 
744
          unsetItemId();
-
 
745
        } else {
-
 
746
          setItemId((Long)value);
-
 
747
        }
-
 
748
        break;
-
 
749
 
-
 
750
      case LOCATION:
-
 
751
        if (value == null) {
-
 
752
          unsetLocation();
-
 
753
        } else {
-
 
754
          setLocation((Map<String,String>)value);
-
 
755
        }
-
 
756
        break;
-
 
757
 
-
 
758
      }
-
 
759
    }
-
 
760
 
-
 
761
    public void setFieldValue(int fieldID, Object value) {
-
 
762
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
-
 
763
    }
-
 
764
 
-
 
765
    public Object getFieldValue(_Fields field) {
-
 
766
      switch (field) {
-
 
767
      case ITEM_ID:
-
 
768
        return new Long(getItemId());
-
 
769
 
-
 
770
      case LOCATION:
-
 
771
        return getLocation();
-
 
772
 
-
 
773
      }
-
 
774
      throw new IllegalStateException();
-
 
775
    }
-
 
776
 
-
 
777
    public Object getFieldValue(int fieldId) {
-
 
778
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
-
 
779
    }
-
 
780
 
-
 
781
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
-
 
782
    public boolean isSet(_Fields field) {
-
 
783
      switch (field) {
-
 
784
      case ITEM_ID:
-
 
785
        return isSetItemId();
-
 
786
      case LOCATION:
-
 
787
        return isSetLocation();
-
 
788
      }
-
 
789
      throw new IllegalStateException();
-
 
790
    }
-
 
791
 
-
 
792
    public boolean isSet(int fieldID) {
-
 
793
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
-
 
794
    }
-
 
795
 
-
 
796
    @Override
-
 
797
    public boolean equals(Object that) {
-
 
798
      if (that == null)
-
 
799
        return false;
-
 
800
      if (that instanceof getLogisticsEstimation_args)
-
 
801
        return this.equals((getLogisticsEstimation_args)that);
-
 
802
      return false;
-
 
803
    }
-
 
804
 
-
 
805
    public boolean equals(getLogisticsEstimation_args that) {
-
 
806
      if (that == null)
-
 
807
        return false;
-
 
808
 
-
 
809
      boolean this_present_itemId = true;
-
 
810
      boolean that_present_itemId = true;
-
 
811
      if (this_present_itemId || that_present_itemId) {
-
 
812
        if (!(this_present_itemId && that_present_itemId))
-
 
813
          return false;
-
 
814
        if (this.itemId != that.itemId)
-
 
815
          return false;
-
 
816
      }
-
 
817
 
-
 
818
      boolean this_present_location = true && this.isSetLocation();
-
 
819
      boolean that_present_location = true && that.isSetLocation();
-
 
820
      if (this_present_location || that_present_location) {
-
 
821
        if (!(this_present_location && that_present_location))
-
 
822
          return false;
-
 
823
        if (!this.location.equals(that.location))
-
 
824
          return false;
-
 
825
      }
-
 
826
 
-
 
827
      return true;
-
 
828
    }
-
 
829
 
-
 
830
    @Override
-
 
831
    public int hashCode() {
-
 
832
      return 0;
-
 
833
    }
-
 
834
 
-
 
835
    public void read(TProtocol iprot) throws TException {
-
 
836
      TField field;
-
 
837
      iprot.readStructBegin();
-
 
838
      while (true)
-
 
839
      {
-
 
840
        field = iprot.readFieldBegin();
-
 
841
        if (field.type == TType.STOP) { 
-
 
842
          break;
-
 
843
        }
-
 
844
        _Fields fieldId = _Fields.findByThriftId(field.id);
-
 
845
        if (fieldId == null) {
-
 
846
          TProtocolUtil.skip(iprot, field.type);
-
 
847
        } else {
-
 
848
          switch (fieldId) {
-
 
849
            case ITEM_ID:
-
 
850
              if (field.type == TType.I64) {
-
 
851
                this.itemId = iprot.readI64();
-
 
852
                setItemIdIsSet(true);
-
 
853
              } else { 
-
 
854
                TProtocolUtil.skip(iprot, field.type);
-
 
855
              }
-
 
856
              break;
-
 
857
            case LOCATION:
-
 
858
              if (field.type == TType.MAP) {
-
 
859
                {
-
 
860
                  TMap _map8 = iprot.readMapBegin();
-
 
861
                  this.location = new HashMap<String,String>(2*_map8.size);
-
 
862
                  for (int _i9 = 0; _i9 < _map8.size; ++_i9)
-
 
863
                  {
-
 
864
                    String _key10;
-
 
865
                    String _val11;
-
 
866
                    _key10 = iprot.readString();
-
 
867
                    _val11 = iprot.readString();
-
 
868
                    this.location.put(_key10, _val11);
-
 
869
                  }
-
 
870
                  iprot.readMapEnd();
-
 
871
                }
-
 
872
              } else { 
-
 
873
                TProtocolUtil.skip(iprot, field.type);
-
 
874
              }
-
 
875
              break;
-
 
876
          }
-
 
877
          iprot.readFieldEnd();
-
 
878
        }
-
 
879
      }
-
 
880
      iprot.readStructEnd();
-
 
881
      validate();
-
 
882
    }
-
 
883
 
-
 
884
    public void write(TProtocol oprot) throws TException {
-
 
885
      validate();
-
 
886
 
-
 
887
      oprot.writeStructBegin(STRUCT_DESC);
-
 
888
      oprot.writeFieldBegin(ITEM_ID_FIELD_DESC);
-
 
889
      oprot.writeI64(this.itemId);
-
 
890
      oprot.writeFieldEnd();
-
 
891
      if (this.location != null) {
-
 
892
        oprot.writeFieldBegin(LOCATION_FIELD_DESC);
-
 
893
        {
-
 
894
          oprot.writeMapBegin(new TMap(TType.STRING, TType.STRING, this.location.size()));
-
 
895
          for (Map.Entry<String, String> _iter12 : this.location.entrySet())
-
 
896
          {
-
 
897
            oprot.writeString(_iter12.getKey());
-
 
898
            oprot.writeString(_iter12.getValue());
-
 
899
          }
-
 
900
          oprot.writeMapEnd();
-
 
901
        }
-
 
902
        oprot.writeFieldEnd();
-
 
903
      }
-
 
904
      oprot.writeFieldStop();
-
 
905
      oprot.writeStructEnd();
-
 
906
    }
-
 
907
 
-
 
908
    @Override
-
 
909
    public String toString() {
-
 
910
      StringBuilder sb = new StringBuilder("getLogisticsEstimation_args(");
-
 
911
      boolean first = true;
-
 
912
 
-
 
913
      sb.append("itemId:");
-
 
914
      sb.append(this.itemId);
-
 
915
      first = false;
-
 
916
      if (!first) sb.append(", ");
-
 
917
      sb.append("location:");
-
 
918
      if (this.location == null) {
-
 
919
        sb.append("null");
-
 
920
      } else {
-
 
921
        sb.append(this.location);
-
 
922
      }
-
 
923
      first = false;
-
 
924
      sb.append(")");
-
 
925
      return sb.toString();
-
 
926
    }
-
 
927
 
-
 
928
    public void validate() throws TException {
-
 
929
      // check for required fields
-
 
930
    }
-
 
931
 
-
 
932
  }
-
 
933
 
-
 
934
  public static class getLogisticsEstimation_result implements TBase<getLogisticsEstimation_result._Fields>, java.io.Serializable, Cloneable, Comparable<getLogisticsEstimation_result>   {
-
 
935
    private static final TStruct STRUCT_DESC = new TStruct("getLogisticsEstimation_result");
-
 
936
 
-
 
937
    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0);
-
 
938
    private static final TField SE_FIELD_DESC = new TField("se", TType.STRUCT, (short)1);
-
 
939
 
-
 
940
    private List<ItemLogistics> success;
-
 
941
    private HelperServiceException se;
-
 
942
 
-
 
943
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-
 
944
    public enum _Fields implements TFieldIdEnum {
-
 
945
      SUCCESS((short)0, "success"),
-
 
946
      SE((short)1, "se");
-
 
947
 
-
 
948
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
-
 
949
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
-
 
950
 
-
 
951
      static {
-
 
952
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
-
 
953
          byId.put((int)field._thriftId, field);
-
 
954
          byName.put(field.getFieldName(), field);
-
 
955
        }
-
 
956
      }
-
 
957
 
-
 
958
      /**
-
 
959
       * Find the _Fields constant that matches fieldId, or null if its not found.
-
 
960
       */
-
 
961
      public static _Fields findByThriftId(int fieldId) {
-
 
962
        return byId.get(fieldId);
-
 
963
      }
-
 
964
 
-
 
965
      /**
-
 
966
       * Find the _Fields constant that matches fieldId, throwing an exception
-
 
967
       * if it is not found.
-
 
968
       */
-
 
969
      public static _Fields findByThriftIdOrThrow(int fieldId) {
-
 
970
        _Fields fields = findByThriftId(fieldId);
-
 
971
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
-
 
972
        return fields;
-
 
973
      }
-
 
974
 
-
 
975
      /**
-
 
976
       * Find the _Fields constant that matches name, or null if its not found.
-
 
977
       */
-
 
978
      public static _Fields findByName(String name) {
-
 
979
        return byName.get(name);
-
 
980
      }
-
 
981
 
-
 
982
      private final short _thriftId;
-
 
983
      private final String _fieldName;
-
 
984
 
-
 
985
      _Fields(short thriftId, String fieldName) {
-
 
986
        _thriftId = thriftId;
-
 
987
        _fieldName = fieldName;
-
 
988
      }
-
 
989
 
-
 
990
      public short getThriftFieldId() {
-
 
991
        return _thriftId;
-
 
992
      }
-
 
993
 
-
 
994
      public String getFieldName() {
-
 
995
        return _fieldName;
-
 
996
      }
-
 
997
    }
-
 
998
 
-
 
999
    // isset id assignments
-
 
1000
 
-
 
1001
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
-
 
1002
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
-
 
1003
          new ListMetaData(TType.LIST, 
-
 
1004
              new StructMetaData(TType.STRUCT, ItemLogistics.class))));
-
 
1005
      put(_Fields.SE, new FieldMetaData("se", TFieldRequirementType.DEFAULT, 
-
 
1006
          new FieldValueMetaData(TType.STRUCT)));
-
 
1007
    }});
-
 
1008
 
-
 
1009
    static {
-
 
1010
      FieldMetaData.addStructMetaDataMap(getLogisticsEstimation_result.class, metaDataMap);
-
 
1011
    }
-
 
1012
 
-
 
1013
    public getLogisticsEstimation_result() {
-
 
1014
    }
-
 
1015
 
-
 
1016
    public getLogisticsEstimation_result(
-
 
1017
      List<ItemLogistics> success,
-
 
1018
      HelperServiceException se)
-
 
1019
    {
-
 
1020
      this();
-
 
1021
      this.success = success;
-
 
1022
      this.se = se;
-
 
1023
    }
-
 
1024
 
-
 
1025
    /**
-
 
1026
     * Performs a deep copy on <i>other</i>.
-
 
1027
     */
-
 
1028
    public getLogisticsEstimation_result(getLogisticsEstimation_result other) {
-
 
1029
      if (other.isSetSuccess()) {
-
 
1030
        List<ItemLogistics> __this__success = new ArrayList<ItemLogistics>();
-
 
1031
        for (ItemLogistics other_element : other.success) {
-
 
1032
          __this__success.add(new ItemLogistics(other_element));
-
 
1033
        }
-
 
1034
        this.success = __this__success;
-
 
1035
      }
-
 
1036
      if (other.isSetSe()) {
-
 
1037
        this.se = new HelperServiceException(other.se);
-
 
1038
      }
-
 
1039
    }
-
 
1040
 
-
 
1041
    public getLogisticsEstimation_result deepCopy() {
-
 
1042
      return new getLogisticsEstimation_result(this);
-
 
1043
    }
-
 
1044
 
-
 
1045
    @Deprecated
-
 
1046
    public getLogisticsEstimation_result clone() {
-
 
1047
      return new getLogisticsEstimation_result(this);
-
 
1048
    }
-
 
1049
 
-
 
1050
    public int getSuccessSize() {
-
 
1051
      return (this.success == null) ? 0 : this.success.size();
-
 
1052
    }
-
 
1053
 
-
 
1054
    public java.util.Iterator<ItemLogistics> getSuccessIterator() {
-
 
1055
      return (this.success == null) ? null : this.success.iterator();
-
 
1056
    }
-
 
1057
 
-
 
1058
    public void addToSuccess(ItemLogistics elem) {
-
 
1059
      if (this.success == null) {
-
 
1060
        this.success = new ArrayList<ItemLogistics>();
-
 
1061
      }
-
 
1062
      this.success.add(elem);
-
 
1063
    }
-
 
1064
 
-
 
1065
    public List<ItemLogistics> getSuccess() {
-
 
1066
      return this.success;
-
 
1067
    }
-
 
1068
 
-
 
1069
    public getLogisticsEstimation_result setSuccess(List<ItemLogistics> success) {
-
 
1070
      this.success = success;
-
 
1071
      return this;
-
 
1072
    }
-
 
1073
 
-
 
1074
    public void unsetSuccess() {
-
 
1075
      this.success = null;
-
 
1076
    }
-
 
1077
 
-
 
1078
    /** Returns true if field success is set (has been asigned a value) and false otherwise */
-
 
1079
    public boolean isSetSuccess() {
-
 
1080
      return this.success != null;
-
 
1081
    }
-
 
1082
 
-
 
1083
    public void setSuccessIsSet(boolean value) {
-
 
1084
      if (!value) {
-
 
1085
        this.success = null;
-
 
1086
      }
-
 
1087
    }
-
 
1088
 
-
 
1089
    public HelperServiceException getSe() {
-
 
1090
      return this.se;
-
 
1091
    }
-
 
1092
 
-
 
1093
    public getLogisticsEstimation_result setSe(HelperServiceException se) {
-
 
1094
      this.se = se;
-
 
1095
      return this;
-
 
1096
    }
-
 
1097
 
-
 
1098
    public void unsetSe() {
-
 
1099
      this.se = null;
-
 
1100
    }
-
 
1101
 
-
 
1102
    /** Returns true if field se is set (has been asigned a value) and false otherwise */
-
 
1103
    public boolean isSetSe() {
-
 
1104
      return this.se != null;
-
 
1105
    }
-
 
1106
 
-
 
1107
    public void setSeIsSet(boolean value) {
-
 
1108
      if (!value) {
-
 
1109
        this.se = null;
-
 
1110
      }
-
 
1111
    }
-
 
1112
 
-
 
1113
    public void setFieldValue(_Fields field, Object value) {
-
 
1114
      switch (field) {
-
 
1115
      case SUCCESS:
-
 
1116
        if (value == null) {
-
 
1117
          unsetSuccess();
-
 
1118
        } else {
-
 
1119
          setSuccess((List<ItemLogistics>)value);
-
 
1120
        }
-
 
1121
        break;
-
 
1122
 
-
 
1123
      case SE:
-
 
1124
        if (value == null) {
-
 
1125
          unsetSe();
-
 
1126
        } else {
-
 
1127
          setSe((HelperServiceException)value);
-
 
1128
        }
-
 
1129
        break;
-
 
1130
 
-
 
1131
      }
-
 
1132
    }
-
 
1133
 
-
 
1134
    public void setFieldValue(int fieldID, Object value) {
-
 
1135
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
-
 
1136
    }
-
 
1137
 
-
 
1138
    public Object getFieldValue(_Fields field) {
-
 
1139
      switch (field) {
-
 
1140
      case SUCCESS:
-
 
1141
        return getSuccess();
-
 
1142
 
-
 
1143
      case SE:
-
 
1144
        return getSe();
-
 
1145
 
-
 
1146
      }
-
 
1147
      throw new IllegalStateException();
-
 
1148
    }
-
 
1149
 
-
 
1150
    public Object getFieldValue(int fieldId) {
-
 
1151
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
-
 
1152
    }
-
 
1153
 
-
 
1154
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
-
 
1155
    public boolean isSet(_Fields field) {
-
 
1156
      switch (field) {
-
 
1157
      case SUCCESS:
-
 
1158
        return isSetSuccess();
-
 
1159
      case SE:
-
 
1160
        return isSetSe();
-
 
1161
      }
-
 
1162
      throw new IllegalStateException();
-
 
1163
    }
-
 
1164
 
-
 
1165
    public boolean isSet(int fieldID) {
-
 
1166
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
-
 
1167
    }
-
 
1168
 
-
 
1169
    @Override
-
 
1170
    public boolean equals(Object that) {
-
 
1171
      if (that == null)
-
 
1172
        return false;
-
 
1173
      if (that instanceof getLogisticsEstimation_result)
-
 
1174
        return this.equals((getLogisticsEstimation_result)that);
-
 
1175
      return false;
-
 
1176
    }
-
 
1177
 
-
 
1178
    public boolean equals(getLogisticsEstimation_result that) {
-
 
1179
      if (that == null)
-
 
1180
        return false;
-
 
1181
 
-
 
1182
      boolean this_present_success = true && this.isSetSuccess();
-
 
1183
      boolean that_present_success = true && that.isSetSuccess();
-
 
1184
      if (this_present_success || that_present_success) {
-
 
1185
        if (!(this_present_success && that_present_success))
-
 
1186
          return false;
-
 
1187
        if (!this.success.equals(that.success))
-
 
1188
          return false;
-
 
1189
      }
-
 
1190
 
-
 
1191
      boolean this_present_se = true && this.isSetSe();
-
 
1192
      boolean that_present_se = true && that.isSetSe();
-
 
1193
      if (this_present_se || that_present_se) {
-
 
1194
        if (!(this_present_se && that_present_se))
-
 
1195
          return false;
-
 
1196
        if (!this.se.equals(that.se))
-
 
1197
          return false;
-
 
1198
      }
-
 
1199
 
-
 
1200
      return true;
-
 
1201
    }
-
 
1202
 
-
 
1203
    @Override
-
 
1204
    public int hashCode() {
-
 
1205
      return 0;
-
 
1206
    }
-
 
1207
 
-
 
1208
    public int compareTo(getLogisticsEstimation_result other) {
-
 
1209
      if (!getClass().equals(other.getClass())) {
-
 
1210
        return getClass().getName().compareTo(other.getClass().getName());
-
 
1211
      }
-
 
1212
 
-
 
1213
      int lastComparison = 0;
-
 
1214
      getLogisticsEstimation_result typedOther = (getLogisticsEstimation_result)other;
-
 
1215
 
-
 
1216
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
-
 
1217
      if (lastComparison != 0) {
-
 
1218
        return lastComparison;
-
 
1219
      }
-
 
1220
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
-
 
1221
      if (lastComparison != 0) {
-
 
1222
        return lastComparison;
-
 
1223
      }
-
 
1224
      lastComparison = Boolean.valueOf(isSetSe()).compareTo(isSetSe());
-
 
1225
      if (lastComparison != 0) {
-
 
1226
        return lastComparison;
-
 
1227
      }
-
 
1228
      lastComparison = TBaseHelper.compareTo(se, typedOther.se);
-
 
1229
      if (lastComparison != 0) {
-
 
1230
        return lastComparison;
-
 
1231
      }
-
 
1232
      return 0;
-
 
1233
    }
-
 
1234
 
-
 
1235
    public void read(TProtocol iprot) throws TException {
-
 
1236
      TField field;
-
 
1237
      iprot.readStructBegin();
-
 
1238
      while (true)
-
 
1239
      {
-
 
1240
        field = iprot.readFieldBegin();
-
 
1241
        if (field.type == TType.STOP) { 
-
 
1242
          break;
-
 
1243
        }
-
 
1244
        _Fields fieldId = _Fields.findByThriftId(field.id);
-
 
1245
        if (fieldId == null) {
-
 
1246
          TProtocolUtil.skip(iprot, field.type);
-
 
1247
        } else {
-
 
1248
          switch (fieldId) {
-
 
1249
            case SUCCESS:
-
 
1250
              if (field.type == TType.LIST) {
-
 
1251
                {
-
 
1252
                  TList _list13 = iprot.readListBegin();
-
 
1253
                  this.success = new ArrayList<ItemLogistics>(_list13.size);
-
 
1254
                  for (int _i14 = 0; _i14 < _list13.size; ++_i14)
-
 
1255
                  {
-
 
1256
                    ItemLogistics _elem15;
-
 
1257
                    _elem15 = new ItemLogistics();
-
 
1258
                    _elem15.read(iprot);
-
 
1259
                    this.success.add(_elem15);
-
 
1260
                  }
-
 
1261
                  iprot.readListEnd();
-
 
1262
                }
-
 
1263
              } else { 
-
 
1264
                TProtocolUtil.skip(iprot, field.type);
-
 
1265
              }
-
 
1266
              break;
-
 
1267
            case SE:
-
 
1268
              if (field.type == TType.STRUCT) {
-
 
1269
                this.se = new HelperServiceException();
-
 
1270
                this.se.read(iprot);
-
 
1271
              } else { 
-
 
1272
                TProtocolUtil.skip(iprot, field.type);
-
 
1273
              }
-
 
1274
              break;
-
 
1275
          }
-
 
1276
          iprot.readFieldEnd();
-
 
1277
        }
-
 
1278
      }
-
 
1279
      iprot.readStructEnd();
-
 
1280
      validate();
-
 
1281
    }
-
 
1282
 
-
 
1283
    public void write(TProtocol oprot) throws TException {
-
 
1284
      oprot.writeStructBegin(STRUCT_DESC);
-
 
1285
 
-
 
1286
      if (this.isSetSuccess()) {
-
 
1287
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
-
 
1288
        {
-
 
1289
          oprot.writeListBegin(new TList(TType.STRUCT, this.success.size()));
-
 
1290
          for (ItemLogistics _iter16 : this.success)
-
 
1291
          {
-
 
1292
            _iter16.write(oprot);
-
 
1293
          }
-
 
1294
          oprot.writeListEnd();
-
 
1295
        }
-
 
1296
        oprot.writeFieldEnd();
-
 
1297
      } else if (this.isSetSe()) {
-
 
1298
        oprot.writeFieldBegin(SE_FIELD_DESC);
-
 
1299
        this.se.write(oprot);
-
 
1300
        oprot.writeFieldEnd();
-
 
1301
      }
-
 
1302
      oprot.writeFieldStop();
-
 
1303
      oprot.writeStructEnd();
-
 
1304
    }
-
 
1305
 
-
 
1306
    @Override
-
 
1307
    public String toString() {
-
 
1308
      StringBuilder sb = new StringBuilder("getLogisticsEstimation_result(");
-
 
1309
      boolean first = true;
-
 
1310
 
-
 
1311
      sb.append("success:");
-
 
1312
      if (this.success == null) {
-
 
1313
        sb.append("null");
-
 
1314
      } else {
-
 
1315
        sb.append(this.success);
-
 
1316
      }
-
 
1317
      first = false;
-
 
1318
      if (!first) sb.append(", ");
-
 
1319
      sb.append("se:");
-
 
1320
      if (this.se == null) {
-
 
1321
        sb.append("null");
-
 
1322
      } else {
-
 
1323
        sb.append(this.se);
-
 
1324
      }
-
 
1325
      first = false;
-
 
1326
      sb.append(")");
-
 
1327
      return sb.toString();
-
 
1328
    }
-
 
1329
 
-
 
1330
    public void validate() throws TException {
-
 
1331
      // check for required fields
-
 
1332
    }
-
 
1333
 
-
 
1334
  }
-
 
1335
 
-
 
1336
  public static class sendMail_args implements TBase<sendMail_args._Fields>, java.io.Serializable, Cloneable, Comparable<sendMail_args>   {
486
  public static class sendMail_args implements TBase<sendMail_args._Fields>, java.io.Serializable, Cloneable, Comparable<sendMail_args>   {
1337
    private static final TStruct STRUCT_DESC = new TStruct("sendMail_args");
487
    private static final TStruct STRUCT_DESC = new TStruct("sendMail_args");
1338
 
488
 
1339
    private static final TField MAIL_FIELD_DESC = new TField("mail", TType.STRUCT, (short)1);
489
    private static final TField MAIL_FIELD_DESC = new TField("mail", TType.STRUCT, (short)1);
1340
 
490
 
Line 4612... Line 3762...
4612
              }
3762
              }
4613
              break;
3763
              break;
4614
            case PARAMS:
3764
            case PARAMS:
4615
              if (field.type == TType.MAP) {
3765
              if (field.type == TType.MAP) {
4616
                {
3766
                {
4617
                  TMap _map17 = iprot.readMapBegin();
3767
                  TMap _map8 = iprot.readMapBegin();
4618
                  this.params = new HashMap<String,String>(2*_map17.size);
3768
                  this.params = new HashMap<String,String>(2*_map8.size);
4619
                  for (int _i18 = 0; _i18 < _map17.size; ++_i18)
3769
                  for (int _i9 = 0; _i9 < _map8.size; ++_i9)
4620
                  {
3770
                  {
4621
                    String _key19;
3771
                    String _key10;
4622
                    String _val20;
3772
                    String _val11;
4623
                    _key19 = iprot.readString();
3773
                    _key10 = iprot.readString();
4624
                    _val20 = iprot.readString();
3774
                    _val11 = iprot.readString();
4625
                    this.params.put(_key19, _val20);
3775
                    this.params.put(_key10, _val11);
4626
                  }
3776
                  }
4627
                  iprot.readMapEnd();
3777
                  iprot.readMapEnd();
4628
                }
3778
                }
4629
              } else { 
3779
              } else { 
4630
                TProtocolUtil.skip(iprot, field.type);
3780
                TProtocolUtil.skip(iprot, field.type);
Line 4647... Line 3797...
4647
      oprot.writeFieldEnd();
3797
      oprot.writeFieldEnd();
4648
      if (this.params != null) {
3798
      if (this.params != null) {
4649
        oprot.writeFieldBegin(PARAMS_FIELD_DESC);
3799
        oprot.writeFieldBegin(PARAMS_FIELD_DESC);
4650
        {
3800
        {
4651
          oprot.writeMapBegin(new TMap(TType.STRING, TType.STRING, this.params.size()));
3801
          oprot.writeMapBegin(new TMap(TType.STRING, TType.STRING, this.params.size()));
4652
          for (Map.Entry<String, String> _iter21 : this.params.entrySet())
3802
          for (Map.Entry<String, String> _iter12 : this.params.entrySet())
4653
          {
3803
          {
4654
            oprot.writeString(_iter21.getKey());
3804
            oprot.writeString(_iter12.getKey());
4655
            oprot.writeString(_iter21.getValue());
3805
            oprot.writeString(_iter12.getValue());
4656
          }
3806
          }
4657
          oprot.writeMapEnd();
3807
          oprot.writeMapEnd();
4658
        }
3808
        }
4659
        oprot.writeFieldEnd();
3809
        oprot.writeFieldEnd();
4660
      }
3810
      }