Subversion Repositories SmartDukaan

Rev

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

Rev 715 Rev 730
Line 70... Line 70...
70
     * @param awb
70
     * @param awb
71
     * @param providerId
71
     * @param providerId
72
     */
72
     */
73
    public List<AwbUpdate> getShipmentInfo(String awb, long providerId) throws LogisticsServiceException, TException;
73
    public List<AwbUpdate> getShipmentInfo(String awb, long providerId) throws LogisticsServiceException, TException;
74
 
74
 
-
 
75
    /**
-
 
76
     * Returns the short three letter code of a pincode for the given provider.
-
 
77
     *    Raises an exception if the pin code is not serviced by the given provider.
-
 
78
     * 
-
 
79
     * @param providerId
-
 
80
     * @param pinCode
-
 
81
     */
-
 
82
    public String getDestinationCode(long providerId, String pinCode) throws LogisticsServiceException, TException;
-
 
83
 
75
  }
84
  }
76
 
85
 
77
  public static class Client implements Iface {
86
  public static class Client implements Iface {
78
    public Client(TProtocol prot)
87
    public Client(TProtocol prot)
79
    {
88
    {
Line 317... Line 326...
317
        throw result.se;
326
        throw result.se;
318
      }
327
      }
319
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getShipmentInfo failed: unknown result");
328
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getShipmentInfo failed: unknown result");
320
    }
329
    }
321
 
330
 
-
 
331
    public String getDestinationCode(long providerId, String pinCode) throws LogisticsServiceException, TException
-
 
332
    {
-
 
333
      send_getDestinationCode(providerId, pinCode);
-
 
334
      return recv_getDestinationCode();
-
 
335
    }
-
 
336
 
-
 
337
    public void send_getDestinationCode(long providerId, String pinCode) throws TException
-
 
338
    {
-
 
339
      oprot_.writeMessageBegin(new TMessage("getDestinationCode", TMessageType.CALL, seqid_));
-
 
340
      getDestinationCode_args args = new getDestinationCode_args();
-
 
341
      args.providerId = providerId;
-
 
342
      args.pinCode = pinCode;
-
 
343
      args.write(oprot_);
-
 
344
      oprot_.writeMessageEnd();
-
 
345
      oprot_.getTransport().flush();
-
 
346
    }
-
 
347
 
-
 
348
    public String recv_getDestinationCode() throws LogisticsServiceException, TException
-
 
349
    {
-
 
350
      TMessage msg = iprot_.readMessageBegin();
-
 
351
      if (msg.type == TMessageType.EXCEPTION) {
-
 
352
        TApplicationException x = TApplicationException.read(iprot_);
-
 
353
        iprot_.readMessageEnd();
-
 
354
        throw x;
-
 
355
      }
-
 
356
      getDestinationCode_result result = new getDestinationCode_result();
-
 
357
      result.read(iprot_);
-
 
358
      iprot_.readMessageEnd();
-
 
359
      if (result.isSetSuccess()) {
-
 
360
        return result.success;
-
 
361
      }
-
 
362
      if (result.se != null) {
-
 
363
        throw result.se;
-
 
364
      }
-
 
365
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getDestinationCode failed: unknown result");
-
 
366
    }
-
 
367
 
322
  }
368
  }
323
  public static class Processor implements TProcessor {
369
  public static class Processor implements TProcessor {
324
    private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName());
370
    private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName());
325
    public Processor(Iface iface)
371
    public Processor(Iface iface)
326
    {
372
    {
Line 329... Line 375...
329
      processMap_.put("getAllProviders", new getAllProviders());
375
      processMap_.put("getAllProviders", new getAllProviders());
330
      processMap_.put("getLogisticsEstimation", new getLogisticsEstimation());
376
      processMap_.put("getLogisticsEstimation", new getLogisticsEstimation());
331
      processMap_.put("getLogisticsInfo", new getLogisticsInfo());
377
      processMap_.put("getLogisticsInfo", new getLogisticsInfo());
332
      processMap_.put("getEmptyAWB", new getEmptyAWB());
378
      processMap_.put("getEmptyAWB", new getEmptyAWB());
333
      processMap_.put("getShipmentInfo", new getShipmentInfo());
379
      processMap_.put("getShipmentInfo", new getShipmentInfo());
-
 
380
      processMap_.put("getDestinationCode", new getDestinationCode());
334
    }
381
    }
335
 
382
 
336
    protected static interface ProcessFunction {
383
    protected static interface ProcessFunction {
337
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException;
384
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException;
338
    }
385
    }
Line 524... Line 571...
524
        oprot.getTransport().flush();
571
        oprot.getTransport().flush();
525
      }
572
      }
526
 
573
 
527
    }
574
    }
528
 
575
 
-
 
576
    private class getDestinationCode implements ProcessFunction {
-
 
577
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
-
 
578
      {
-
 
579
        getDestinationCode_args args = new getDestinationCode_args();
-
 
580
        args.read(iprot);
-
 
581
        iprot.readMessageEnd();
-
 
582
        getDestinationCode_result result = new getDestinationCode_result();
-
 
583
        try {
-
 
584
          result.success = iface_.getDestinationCode(args.providerId, args.pinCode);
-
 
585
        } catch (LogisticsServiceException se) {
-
 
586
          result.se = se;
-
 
587
        } catch (Throwable th) {
-
 
588
          LOGGER.error("Internal error processing getDestinationCode", th);
-
 
589
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing getDestinationCode");
-
 
590
          oprot.writeMessageBegin(new TMessage("getDestinationCode", TMessageType.EXCEPTION, seqid));
-
 
591
          x.write(oprot);
-
 
592
          oprot.writeMessageEnd();
-
 
593
          oprot.getTransport().flush();
-
 
594
          return;
-
 
595
        }
-
 
596
        oprot.writeMessageBegin(new TMessage("getDestinationCode", TMessageType.REPLY, seqid));
-
 
597
        result.write(oprot);
-
 
598
        oprot.writeMessageEnd();
-
 
599
        oprot.getTransport().flush();
-
 
600
      }
-
 
601
 
-
 
602
    }
-
 
603
 
529
  }
604
  }
530
 
605
 
531
  public static class getProvider_args implements TBase<getProvider_args._Fields>, java.io.Serializable, Cloneable, Comparable<getProvider_args>   {
606
  public static class getProvider_args implements TBase<getProvider_args._Fields>, java.io.Serializable, Cloneable, Comparable<getProvider_args>   {
532
    private static final TStruct STRUCT_DESC = new TStruct("getProvider_args");
607
    private static final TStruct STRUCT_DESC = new TStruct("getProvider_args");
533
 
608
 
Line 4600... Line 4675...
4600
      boolean first = true;
4675
      boolean first = true;
4601
 
4676
 
4602
      sb.append("success:");
4677
      sb.append("success:");
4603
      if (this.success == null) {
4678
      if (this.success == null) {
4604
        sb.append("null");
4679
        sb.append("null");
-
 
4680
      } else {
-
 
4681
        sb.append(this.success);
-
 
4682
      }
-
 
4683
      first = false;
-
 
4684
      if (!first) sb.append(", ");
-
 
4685
      sb.append("se:");
-
 
4686
      if (this.se == null) {
-
 
4687
        sb.append("null");
-
 
4688
      } else {
-
 
4689
        sb.append(this.se);
-
 
4690
      }
-
 
4691
      first = false;
-
 
4692
      sb.append(")");
-
 
4693
      return sb.toString();
-
 
4694
    }
-
 
4695
 
-
 
4696
    public void validate() throws TException {
-
 
4697
      // check for required fields
-
 
4698
    }
-
 
4699
 
-
 
4700
  }
-
 
4701
 
-
 
4702
  public static class getDestinationCode_args implements TBase<getDestinationCode_args._Fields>, java.io.Serializable, Cloneable, Comparable<getDestinationCode_args>   {
-
 
4703
    private static final TStruct STRUCT_DESC = new TStruct("getDestinationCode_args");
-
 
4704
 
-
 
4705
    private static final TField PROVIDER_ID_FIELD_DESC = new TField("providerId", TType.I64, (short)1);
-
 
4706
    private static final TField PIN_CODE_FIELD_DESC = new TField("pinCode", TType.STRING, (short)2);
-
 
4707
 
-
 
4708
    private long providerId;
-
 
4709
    private String pinCode;
-
 
4710
 
-
 
4711
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-
 
4712
    public enum _Fields implements TFieldIdEnum {
-
 
4713
      PROVIDER_ID((short)1, "providerId"),
-
 
4714
      PIN_CODE((short)2, "pinCode");
-
 
4715
 
-
 
4716
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
-
 
4717
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
-
 
4718
 
-
 
4719
      static {
-
 
4720
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
-
 
4721
          byId.put((int)field._thriftId, field);
-
 
4722
          byName.put(field.getFieldName(), field);
-
 
4723
        }
-
 
4724
      }
-
 
4725
 
-
 
4726
      /**
-
 
4727
       * Find the _Fields constant that matches fieldId, or null if its not found.
-
 
4728
       */
-
 
4729
      public static _Fields findByThriftId(int fieldId) {
-
 
4730
        return byId.get(fieldId);
-
 
4731
      }
-
 
4732
 
-
 
4733
      /**
-
 
4734
       * Find the _Fields constant that matches fieldId, throwing an exception
-
 
4735
       * if it is not found.
-
 
4736
       */
-
 
4737
      public static _Fields findByThriftIdOrThrow(int fieldId) {
-
 
4738
        _Fields fields = findByThriftId(fieldId);
-
 
4739
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
-
 
4740
        return fields;
-
 
4741
      }
-
 
4742
 
-
 
4743
      /**
-
 
4744
       * Find the _Fields constant that matches name, or null if its not found.
-
 
4745
       */
-
 
4746
      public static _Fields findByName(String name) {
-
 
4747
        return byName.get(name);
-
 
4748
      }
-
 
4749
 
-
 
4750
      private final short _thriftId;
-
 
4751
      private final String _fieldName;
-
 
4752
 
-
 
4753
      _Fields(short thriftId, String fieldName) {
-
 
4754
        _thriftId = thriftId;
-
 
4755
        _fieldName = fieldName;
-
 
4756
      }
-
 
4757
 
-
 
4758
      public short getThriftFieldId() {
-
 
4759
        return _thriftId;
-
 
4760
      }
-
 
4761
 
-
 
4762
      public String getFieldName() {
-
 
4763
        return _fieldName;
-
 
4764
      }
-
 
4765
    }
-
 
4766
 
-
 
4767
    // isset id assignments
-
 
4768
    private static final int __PROVIDERID_ISSET_ID = 0;
-
 
4769
    private BitSet __isset_bit_vector = new BitSet(1);
-
 
4770
 
-
 
4771
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
-
 
4772
      put(_Fields.PROVIDER_ID, new FieldMetaData("providerId", TFieldRequirementType.DEFAULT, 
-
 
4773
          new FieldValueMetaData(TType.I64)));
-
 
4774
      put(_Fields.PIN_CODE, new FieldMetaData("pinCode", TFieldRequirementType.DEFAULT, 
-
 
4775
          new FieldValueMetaData(TType.STRING)));
-
 
4776
    }});
-
 
4777
 
-
 
4778
    static {
-
 
4779
      FieldMetaData.addStructMetaDataMap(getDestinationCode_args.class, metaDataMap);
-
 
4780
    }
-
 
4781
 
-
 
4782
    public getDestinationCode_args() {
-
 
4783
    }
-
 
4784
 
-
 
4785
    public getDestinationCode_args(
-
 
4786
      long providerId,
-
 
4787
      String pinCode)
-
 
4788
    {
-
 
4789
      this();
-
 
4790
      this.providerId = providerId;
-
 
4791
      setProviderIdIsSet(true);
-
 
4792
      this.pinCode = pinCode;
-
 
4793
    }
-
 
4794
 
-
 
4795
    /**
-
 
4796
     * Performs a deep copy on <i>other</i>.
-
 
4797
     */
-
 
4798
    public getDestinationCode_args(getDestinationCode_args other) {
-
 
4799
      __isset_bit_vector.clear();
-
 
4800
      __isset_bit_vector.or(other.__isset_bit_vector);
-
 
4801
      this.providerId = other.providerId;
-
 
4802
      if (other.isSetPinCode()) {
-
 
4803
        this.pinCode = other.pinCode;
-
 
4804
      }
-
 
4805
    }
-
 
4806
 
-
 
4807
    public getDestinationCode_args deepCopy() {
-
 
4808
      return new getDestinationCode_args(this);
-
 
4809
    }
-
 
4810
 
-
 
4811
    @Deprecated
-
 
4812
    public getDestinationCode_args clone() {
-
 
4813
      return new getDestinationCode_args(this);
-
 
4814
    }
-
 
4815
 
-
 
4816
    public long getProviderId() {
-
 
4817
      return this.providerId;
-
 
4818
    }
-
 
4819
 
-
 
4820
    public getDestinationCode_args setProviderId(long providerId) {
-
 
4821
      this.providerId = providerId;
-
 
4822
      setProviderIdIsSet(true);
-
 
4823
      return this;
-
 
4824
    }
-
 
4825
 
-
 
4826
    public void unsetProviderId() {
-
 
4827
      __isset_bit_vector.clear(__PROVIDERID_ISSET_ID);
-
 
4828
    }
-
 
4829
 
-
 
4830
    /** Returns true if field providerId is set (has been asigned a value) and false otherwise */
-
 
4831
    public boolean isSetProviderId() {
-
 
4832
      return __isset_bit_vector.get(__PROVIDERID_ISSET_ID);
-
 
4833
    }
-
 
4834
 
-
 
4835
    public void setProviderIdIsSet(boolean value) {
-
 
4836
      __isset_bit_vector.set(__PROVIDERID_ISSET_ID, value);
-
 
4837
    }
-
 
4838
 
-
 
4839
    public String getPinCode() {
-
 
4840
      return this.pinCode;
-
 
4841
    }
-
 
4842
 
-
 
4843
    public getDestinationCode_args setPinCode(String pinCode) {
-
 
4844
      this.pinCode = pinCode;
-
 
4845
      return this;
-
 
4846
    }
-
 
4847
 
-
 
4848
    public void unsetPinCode() {
-
 
4849
      this.pinCode = null;
-
 
4850
    }
-
 
4851
 
-
 
4852
    /** Returns true if field pinCode is set (has been asigned a value) and false otherwise */
-
 
4853
    public boolean isSetPinCode() {
-
 
4854
      return this.pinCode != null;
-
 
4855
    }
-
 
4856
 
-
 
4857
    public void setPinCodeIsSet(boolean value) {
-
 
4858
      if (!value) {
-
 
4859
        this.pinCode = null;
-
 
4860
      }
-
 
4861
    }
-
 
4862
 
-
 
4863
    public void setFieldValue(_Fields field, Object value) {
-
 
4864
      switch (field) {
-
 
4865
      case PROVIDER_ID:
-
 
4866
        if (value == null) {
-
 
4867
          unsetProviderId();
-
 
4868
        } else {
-
 
4869
          setProviderId((Long)value);
-
 
4870
        }
-
 
4871
        break;
-
 
4872
 
-
 
4873
      case PIN_CODE:
-
 
4874
        if (value == null) {
-
 
4875
          unsetPinCode();
-
 
4876
        } else {
-
 
4877
          setPinCode((String)value);
-
 
4878
        }
-
 
4879
        break;
-
 
4880
 
-
 
4881
      }
-
 
4882
    }
-
 
4883
 
-
 
4884
    public void setFieldValue(int fieldID, Object value) {
-
 
4885
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
-
 
4886
    }
-
 
4887
 
-
 
4888
    public Object getFieldValue(_Fields field) {
-
 
4889
      switch (field) {
-
 
4890
      case PROVIDER_ID:
-
 
4891
        return new Long(getProviderId());
-
 
4892
 
-
 
4893
      case PIN_CODE:
-
 
4894
        return getPinCode();
-
 
4895
 
-
 
4896
      }
-
 
4897
      throw new IllegalStateException();
-
 
4898
    }
-
 
4899
 
-
 
4900
    public Object getFieldValue(int fieldId) {
-
 
4901
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
-
 
4902
    }
-
 
4903
 
-
 
4904
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
-
 
4905
    public boolean isSet(_Fields field) {
-
 
4906
      switch (field) {
-
 
4907
      case PROVIDER_ID:
-
 
4908
        return isSetProviderId();
-
 
4909
      case PIN_CODE:
-
 
4910
        return isSetPinCode();
-
 
4911
      }
-
 
4912
      throw new IllegalStateException();
-
 
4913
    }
-
 
4914
 
-
 
4915
    public boolean isSet(int fieldID) {
-
 
4916
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
-
 
4917
    }
-
 
4918
 
-
 
4919
    @Override
-
 
4920
    public boolean equals(Object that) {
-
 
4921
      if (that == null)
-
 
4922
        return false;
-
 
4923
      if (that instanceof getDestinationCode_args)
-
 
4924
        return this.equals((getDestinationCode_args)that);
-
 
4925
      return false;
-
 
4926
    }
-
 
4927
 
-
 
4928
    public boolean equals(getDestinationCode_args that) {
-
 
4929
      if (that == null)
-
 
4930
        return false;
-
 
4931
 
-
 
4932
      boolean this_present_providerId = true;
-
 
4933
      boolean that_present_providerId = true;
-
 
4934
      if (this_present_providerId || that_present_providerId) {
-
 
4935
        if (!(this_present_providerId && that_present_providerId))
-
 
4936
          return false;
-
 
4937
        if (this.providerId != that.providerId)
-
 
4938
          return false;
-
 
4939
      }
-
 
4940
 
-
 
4941
      boolean this_present_pinCode = true && this.isSetPinCode();
-
 
4942
      boolean that_present_pinCode = true && that.isSetPinCode();
-
 
4943
      if (this_present_pinCode || that_present_pinCode) {
-
 
4944
        if (!(this_present_pinCode && that_present_pinCode))
-
 
4945
          return false;
-
 
4946
        if (!this.pinCode.equals(that.pinCode))
-
 
4947
          return false;
-
 
4948
      }
-
 
4949
 
-
 
4950
      return true;
-
 
4951
    }
-
 
4952
 
-
 
4953
    @Override
-
 
4954
    public int hashCode() {
-
 
4955
      return 0;
-
 
4956
    }
-
 
4957
 
-
 
4958
    public int compareTo(getDestinationCode_args other) {
-
 
4959
      if (!getClass().equals(other.getClass())) {
-
 
4960
        return getClass().getName().compareTo(other.getClass().getName());
-
 
4961
      }
-
 
4962
 
-
 
4963
      int lastComparison = 0;
-
 
4964
      getDestinationCode_args typedOther = (getDestinationCode_args)other;
-
 
4965
 
-
 
4966
      lastComparison = Boolean.valueOf(isSetProviderId()).compareTo(isSetProviderId());
-
 
4967
      if (lastComparison != 0) {
-
 
4968
        return lastComparison;
-
 
4969
      }
-
 
4970
      lastComparison = TBaseHelper.compareTo(providerId, typedOther.providerId);
-
 
4971
      if (lastComparison != 0) {
-
 
4972
        return lastComparison;
-
 
4973
      }
-
 
4974
      lastComparison = Boolean.valueOf(isSetPinCode()).compareTo(isSetPinCode());
-
 
4975
      if (lastComparison != 0) {
-
 
4976
        return lastComparison;
-
 
4977
      }
-
 
4978
      lastComparison = TBaseHelper.compareTo(pinCode, typedOther.pinCode);
-
 
4979
      if (lastComparison != 0) {
-
 
4980
        return lastComparison;
-
 
4981
      }
-
 
4982
      return 0;
-
 
4983
    }
-
 
4984
 
-
 
4985
    public void read(TProtocol iprot) throws TException {
-
 
4986
      TField field;
-
 
4987
      iprot.readStructBegin();
-
 
4988
      while (true)
-
 
4989
      {
-
 
4990
        field = iprot.readFieldBegin();
-
 
4991
        if (field.type == TType.STOP) { 
-
 
4992
          break;
-
 
4993
        }
-
 
4994
        _Fields fieldId = _Fields.findByThriftId(field.id);
-
 
4995
        if (fieldId == null) {
-
 
4996
          TProtocolUtil.skip(iprot, field.type);
-
 
4997
        } else {
-
 
4998
          switch (fieldId) {
-
 
4999
            case PROVIDER_ID:
-
 
5000
              if (field.type == TType.I64) {
-
 
5001
                this.providerId = iprot.readI64();
-
 
5002
                setProviderIdIsSet(true);
-
 
5003
              } else { 
-
 
5004
                TProtocolUtil.skip(iprot, field.type);
-
 
5005
              }
-
 
5006
              break;
-
 
5007
            case PIN_CODE:
-
 
5008
              if (field.type == TType.STRING) {
-
 
5009
                this.pinCode = iprot.readString();
-
 
5010
              } else { 
-
 
5011
                TProtocolUtil.skip(iprot, field.type);
-
 
5012
              }
-
 
5013
              break;
-
 
5014
          }
-
 
5015
          iprot.readFieldEnd();
-
 
5016
        }
-
 
5017
      }
-
 
5018
      iprot.readStructEnd();
-
 
5019
      validate();
-
 
5020
    }
-
 
5021
 
-
 
5022
    public void write(TProtocol oprot) throws TException {
-
 
5023
      validate();
-
 
5024
 
-
 
5025
      oprot.writeStructBegin(STRUCT_DESC);
-
 
5026
      oprot.writeFieldBegin(PROVIDER_ID_FIELD_DESC);
-
 
5027
      oprot.writeI64(this.providerId);
-
 
5028
      oprot.writeFieldEnd();
-
 
5029
      if (this.pinCode != null) {
-
 
5030
        oprot.writeFieldBegin(PIN_CODE_FIELD_DESC);
-
 
5031
        oprot.writeString(this.pinCode);
-
 
5032
        oprot.writeFieldEnd();
-
 
5033
      }
-
 
5034
      oprot.writeFieldStop();
-
 
5035
      oprot.writeStructEnd();
-
 
5036
    }
-
 
5037
 
-
 
5038
    @Override
-
 
5039
    public String toString() {
-
 
5040
      StringBuilder sb = new StringBuilder("getDestinationCode_args(");
-
 
5041
      boolean first = true;
-
 
5042
 
-
 
5043
      sb.append("providerId:");
-
 
5044
      sb.append(this.providerId);
-
 
5045
      first = false;
-
 
5046
      if (!first) sb.append(", ");
-
 
5047
      sb.append("pinCode:");
-
 
5048
      if (this.pinCode == null) {
-
 
5049
        sb.append("null");
-
 
5050
      } else {
-
 
5051
        sb.append(this.pinCode);
-
 
5052
      }
-
 
5053
      first = false;
-
 
5054
      sb.append(")");
-
 
5055
      return sb.toString();
-
 
5056
    }
-
 
5057
 
-
 
5058
    public void validate() throws TException {
-
 
5059
      // check for required fields
-
 
5060
    }
-
 
5061
 
-
 
5062
  }
-
 
5063
 
-
 
5064
  public static class getDestinationCode_result implements TBase<getDestinationCode_result._Fields>, java.io.Serializable, Cloneable, Comparable<getDestinationCode_result>   {
-
 
5065
    private static final TStruct STRUCT_DESC = new TStruct("getDestinationCode_result");
-
 
5066
 
-
 
5067
    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRING, (short)0);
-
 
5068
    private static final TField SE_FIELD_DESC = new TField("se", TType.STRUCT, (short)1);
-
 
5069
 
-
 
5070
    private String success;
-
 
5071
    private LogisticsServiceException se;
-
 
5072
 
-
 
5073
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-
 
5074
    public enum _Fields implements TFieldIdEnum {
-
 
5075
      SUCCESS((short)0, "success"),
-
 
5076
      SE((short)1, "se");
-
 
5077
 
-
 
5078
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
-
 
5079
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
-
 
5080
 
-
 
5081
      static {
-
 
5082
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
-
 
5083
          byId.put((int)field._thriftId, field);
-
 
5084
          byName.put(field.getFieldName(), field);
-
 
5085
        }
-
 
5086
      }
-
 
5087
 
-
 
5088
      /**
-
 
5089
       * Find the _Fields constant that matches fieldId, or null if its not found.
-
 
5090
       */
-
 
5091
      public static _Fields findByThriftId(int fieldId) {
-
 
5092
        return byId.get(fieldId);
-
 
5093
      }
-
 
5094
 
-
 
5095
      /**
-
 
5096
       * Find the _Fields constant that matches fieldId, throwing an exception
-
 
5097
       * if it is not found.
-
 
5098
       */
-
 
5099
      public static _Fields findByThriftIdOrThrow(int fieldId) {
-
 
5100
        _Fields fields = findByThriftId(fieldId);
-
 
5101
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
-
 
5102
        return fields;
-
 
5103
      }
-
 
5104
 
-
 
5105
      /**
-
 
5106
       * Find the _Fields constant that matches name, or null if its not found.
-
 
5107
       */
-
 
5108
      public static _Fields findByName(String name) {
-
 
5109
        return byName.get(name);
-
 
5110
      }
-
 
5111
 
-
 
5112
      private final short _thriftId;
-
 
5113
      private final String _fieldName;
-
 
5114
 
-
 
5115
      _Fields(short thriftId, String fieldName) {
-
 
5116
        _thriftId = thriftId;
-
 
5117
        _fieldName = fieldName;
-
 
5118
      }
-
 
5119
 
-
 
5120
      public short getThriftFieldId() {
-
 
5121
        return _thriftId;
-
 
5122
      }
-
 
5123
 
-
 
5124
      public String getFieldName() {
-
 
5125
        return _fieldName;
-
 
5126
      }
-
 
5127
    }
-
 
5128
 
-
 
5129
    // isset id assignments
-
 
5130
 
-
 
5131
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
-
 
5132
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
-
 
5133
          new FieldValueMetaData(TType.STRING)));
-
 
5134
      put(_Fields.SE, new FieldMetaData("se", TFieldRequirementType.DEFAULT, 
-
 
5135
          new FieldValueMetaData(TType.STRUCT)));
-
 
5136
    }});
-
 
5137
 
-
 
5138
    static {
-
 
5139
      FieldMetaData.addStructMetaDataMap(getDestinationCode_result.class, metaDataMap);
-
 
5140
    }
-
 
5141
 
-
 
5142
    public getDestinationCode_result() {
-
 
5143
    }
-
 
5144
 
-
 
5145
    public getDestinationCode_result(
-
 
5146
      String success,
-
 
5147
      LogisticsServiceException se)
-
 
5148
    {
-
 
5149
      this();
-
 
5150
      this.success = success;
-
 
5151
      this.se = se;
-
 
5152
    }
-
 
5153
 
-
 
5154
    /**
-
 
5155
     * Performs a deep copy on <i>other</i>.
-
 
5156
     */
-
 
5157
    public getDestinationCode_result(getDestinationCode_result other) {
-
 
5158
      if (other.isSetSuccess()) {
-
 
5159
        this.success = other.success;
-
 
5160
      }
-
 
5161
      if (other.isSetSe()) {
-
 
5162
        this.se = new LogisticsServiceException(other.se);
-
 
5163
      }
-
 
5164
    }
-
 
5165
 
-
 
5166
    public getDestinationCode_result deepCopy() {
-
 
5167
      return new getDestinationCode_result(this);
-
 
5168
    }
-
 
5169
 
-
 
5170
    @Deprecated
-
 
5171
    public getDestinationCode_result clone() {
-
 
5172
      return new getDestinationCode_result(this);
-
 
5173
    }
-
 
5174
 
-
 
5175
    public String getSuccess() {
-
 
5176
      return this.success;
-
 
5177
    }
-
 
5178
 
-
 
5179
    public getDestinationCode_result setSuccess(String success) {
-
 
5180
      this.success = success;
-
 
5181
      return this;
-
 
5182
    }
-
 
5183
 
-
 
5184
    public void unsetSuccess() {
-
 
5185
      this.success = null;
-
 
5186
    }
-
 
5187
 
-
 
5188
    /** Returns true if field success is set (has been asigned a value) and false otherwise */
-
 
5189
    public boolean isSetSuccess() {
-
 
5190
      return this.success != null;
-
 
5191
    }
-
 
5192
 
-
 
5193
    public void setSuccessIsSet(boolean value) {
-
 
5194
      if (!value) {
-
 
5195
        this.success = null;
-
 
5196
      }
-
 
5197
    }
-
 
5198
 
-
 
5199
    public LogisticsServiceException getSe() {
-
 
5200
      return this.se;
-
 
5201
    }
-
 
5202
 
-
 
5203
    public getDestinationCode_result setSe(LogisticsServiceException se) {
-
 
5204
      this.se = se;
-
 
5205
      return this;
-
 
5206
    }
-
 
5207
 
-
 
5208
    public void unsetSe() {
-
 
5209
      this.se = null;
-
 
5210
    }
-
 
5211
 
-
 
5212
    /** Returns true if field se is set (has been asigned a value) and false otherwise */
-
 
5213
    public boolean isSetSe() {
-
 
5214
      return this.se != null;
-
 
5215
    }
-
 
5216
 
-
 
5217
    public void setSeIsSet(boolean value) {
-
 
5218
      if (!value) {
-
 
5219
        this.se = null;
-
 
5220
      }
-
 
5221
    }
-
 
5222
 
-
 
5223
    public void setFieldValue(_Fields field, Object value) {
-
 
5224
      switch (field) {
-
 
5225
      case SUCCESS:
-
 
5226
        if (value == null) {
-
 
5227
          unsetSuccess();
-
 
5228
        } else {
-
 
5229
          setSuccess((String)value);
-
 
5230
        }
-
 
5231
        break;
-
 
5232
 
-
 
5233
      case SE:
-
 
5234
        if (value == null) {
-
 
5235
          unsetSe();
-
 
5236
        } else {
-
 
5237
          setSe((LogisticsServiceException)value);
-
 
5238
        }
-
 
5239
        break;
-
 
5240
 
-
 
5241
      }
-
 
5242
    }
-
 
5243
 
-
 
5244
    public void setFieldValue(int fieldID, Object value) {
-
 
5245
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
-
 
5246
    }
-
 
5247
 
-
 
5248
    public Object getFieldValue(_Fields field) {
-
 
5249
      switch (field) {
-
 
5250
      case SUCCESS:
-
 
5251
        return getSuccess();
-
 
5252
 
-
 
5253
      case SE:
-
 
5254
        return getSe();
-
 
5255
 
-
 
5256
      }
-
 
5257
      throw new IllegalStateException();
-
 
5258
    }
-
 
5259
 
-
 
5260
    public Object getFieldValue(int fieldId) {
-
 
5261
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
-
 
5262
    }
-
 
5263
 
-
 
5264
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
-
 
5265
    public boolean isSet(_Fields field) {
-
 
5266
      switch (field) {
-
 
5267
      case SUCCESS:
-
 
5268
        return isSetSuccess();
-
 
5269
      case SE:
-
 
5270
        return isSetSe();
-
 
5271
      }
-
 
5272
      throw new IllegalStateException();
-
 
5273
    }
-
 
5274
 
-
 
5275
    public boolean isSet(int fieldID) {
-
 
5276
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
-
 
5277
    }
-
 
5278
 
-
 
5279
    @Override
-
 
5280
    public boolean equals(Object that) {
-
 
5281
      if (that == null)
-
 
5282
        return false;
-
 
5283
      if (that instanceof getDestinationCode_result)
-
 
5284
        return this.equals((getDestinationCode_result)that);
-
 
5285
      return false;
-
 
5286
    }
-
 
5287
 
-
 
5288
    public boolean equals(getDestinationCode_result that) {
-
 
5289
      if (that == null)
-
 
5290
        return false;
-
 
5291
 
-
 
5292
      boolean this_present_success = true && this.isSetSuccess();
-
 
5293
      boolean that_present_success = true && that.isSetSuccess();
-
 
5294
      if (this_present_success || that_present_success) {
-
 
5295
        if (!(this_present_success && that_present_success))
-
 
5296
          return false;
-
 
5297
        if (!this.success.equals(that.success))
-
 
5298
          return false;
-
 
5299
      }
-
 
5300
 
-
 
5301
      boolean this_present_se = true && this.isSetSe();
-
 
5302
      boolean that_present_se = true && that.isSetSe();
-
 
5303
      if (this_present_se || that_present_se) {
-
 
5304
        if (!(this_present_se && that_present_se))
-
 
5305
          return false;
-
 
5306
        if (!this.se.equals(that.se))
-
 
5307
          return false;
-
 
5308
      }
-
 
5309
 
-
 
5310
      return true;
-
 
5311
    }
-
 
5312
 
-
 
5313
    @Override
-
 
5314
    public int hashCode() {
-
 
5315
      return 0;
-
 
5316
    }
-
 
5317
 
-
 
5318
    public int compareTo(getDestinationCode_result other) {
-
 
5319
      if (!getClass().equals(other.getClass())) {
-
 
5320
        return getClass().getName().compareTo(other.getClass().getName());
-
 
5321
      }
-
 
5322
 
-
 
5323
      int lastComparison = 0;
-
 
5324
      getDestinationCode_result typedOther = (getDestinationCode_result)other;
-
 
5325
 
-
 
5326
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
-
 
5327
      if (lastComparison != 0) {
-
 
5328
        return lastComparison;
-
 
5329
      }
-
 
5330
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
-
 
5331
      if (lastComparison != 0) {
-
 
5332
        return lastComparison;
-
 
5333
      }
-
 
5334
      lastComparison = Boolean.valueOf(isSetSe()).compareTo(isSetSe());
-
 
5335
      if (lastComparison != 0) {
-
 
5336
        return lastComparison;
-
 
5337
      }
-
 
5338
      lastComparison = TBaseHelper.compareTo(se, typedOther.se);
-
 
5339
      if (lastComparison != 0) {
-
 
5340
        return lastComparison;
-
 
5341
      }
-
 
5342
      return 0;
-
 
5343
    }
-
 
5344
 
-
 
5345
    public void read(TProtocol iprot) throws TException {
-
 
5346
      TField field;
-
 
5347
      iprot.readStructBegin();
-
 
5348
      while (true)
-
 
5349
      {
-
 
5350
        field = iprot.readFieldBegin();
-
 
5351
        if (field.type == TType.STOP) { 
-
 
5352
          break;
-
 
5353
        }
-
 
5354
        _Fields fieldId = _Fields.findByThriftId(field.id);
-
 
5355
        if (fieldId == null) {
-
 
5356
          TProtocolUtil.skip(iprot, field.type);
-
 
5357
        } else {
-
 
5358
          switch (fieldId) {
-
 
5359
            case SUCCESS:
-
 
5360
              if (field.type == TType.STRING) {
-
 
5361
                this.success = iprot.readString();
-
 
5362
              } else { 
-
 
5363
                TProtocolUtil.skip(iprot, field.type);
-
 
5364
              }
-
 
5365
              break;
-
 
5366
            case SE:
-
 
5367
              if (field.type == TType.STRUCT) {
-
 
5368
                this.se = new LogisticsServiceException();
-
 
5369
                this.se.read(iprot);
-
 
5370
              } else { 
-
 
5371
                TProtocolUtil.skip(iprot, field.type);
-
 
5372
              }
-
 
5373
              break;
-
 
5374
          }
-
 
5375
          iprot.readFieldEnd();
-
 
5376
        }
-
 
5377
      }
-
 
5378
      iprot.readStructEnd();
-
 
5379
      validate();
-
 
5380
    }
-
 
5381
 
-
 
5382
    public void write(TProtocol oprot) throws TException {
-
 
5383
      oprot.writeStructBegin(STRUCT_DESC);
-
 
5384
 
-
 
5385
      if (this.isSetSuccess()) {
-
 
5386
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
-
 
5387
        oprot.writeString(this.success);
-
 
5388
        oprot.writeFieldEnd();
-
 
5389
      } else if (this.isSetSe()) {
-
 
5390
        oprot.writeFieldBegin(SE_FIELD_DESC);
-
 
5391
        this.se.write(oprot);
-
 
5392
        oprot.writeFieldEnd();
-
 
5393
      }
-
 
5394
      oprot.writeFieldStop();
-
 
5395
      oprot.writeStructEnd();
-
 
5396
    }
-
 
5397
 
-
 
5398
    @Override
-
 
5399
    public String toString() {
-
 
5400
      StringBuilder sb = new StringBuilder("getDestinationCode_result(");
-
 
5401
      boolean first = true;
-
 
5402
 
-
 
5403
      sb.append("success:");
-
 
5404
      if (this.success == null) {
-
 
5405
        sb.append("null");
4605
      } else {
5406
      } else {
4606
        sb.append(this.success);
5407
        sb.append(this.success);
4607
      }
5408
      }
4608
      first = false;
5409
      first = false;
4609
      if (!first) sb.append(", ");
5410
      if (!first) sb.append(", ");