Subversion Repositories SmartDukaan

Rev

Rev 1406 | Rev 1598 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1406 Rev 1529
Line 95... Line 95...
95
 
95
 
96
    public boolean acceptOrder(long orderId) throws TransactionServiceException, TException;
96
    public boolean acceptOrder(long orderId) throws TransactionServiceException, TException;
97
 
97
 
98
    public boolean billOrder(long orderId) throws TransactionServiceException, TException;
98
    public boolean billOrder(long orderId) throws TransactionServiceException, TException;
99
 
99
 
-
 
100
    /**
-
 
101
     * Returns list of orders for given transaction Id. Also filters based on customer Id so that
-
 
102
     * only user who owns the transaction can view its order details.
-
 
103
     * 
-
 
104
     * @param transactionId
-
 
105
     * @param customerId
-
 
106
     */
100
    public List<Order> getOrdersForTransaction(long transactionId) throws TransactionServiceException, TException;
107
    public List<Order> getOrdersForTransaction(long transactionId, long customerId) throws TransactionServiceException, TException;
101
 
108
 
102
    public List<Order> getOrdersForCustomer(long customerId, long from_date, long to_date, OrderStatus status) throws TransactionServiceException, TException;
109
    public List<Order> getOrdersForCustomer(long customerId, long from_date, long to_date, OrderStatus status) throws TransactionServiceException, TException;
103
 
110
 
104
    public long createOrder(Order order) throws TransactionServiceException, TException;
111
    public long createOrder(Order order) throws TransactionServiceException, TException;
105
 
112
 
106
    public Order getOrder(long id) throws TransactionServiceException, TException;
113
    public Order getOrder(long id) throws TransactionServiceException, TException;
107
 
114
 
108
    public List<LineItem> getLineItemsForOrder(long orderId) throws TransactionServiceException, TException;
115
    public List<LineItem> getLineItemsForOrder(long orderId) throws TransactionServiceException, TException;
109
 
116
 
110
    /**
117
    /**
-
 
118
     * Returns an order for the order Id. Also checks if the order belongs to the customer whose Id is passed.
-
 
119
     * Throws exception if either order Id is invalid or order does not below to the customer whose Id is passed.
-
 
120
     * 
-
 
121
     * @param orderId
-
 
122
     * @param customerId
-
 
123
     */
-
 
124
    public Order getOrderForCustomer(long orderId, long customerId) throws TransactionServiceException, TException;
-
 
125
 
-
 
126
    /**
111
     * Create a batch of all the pending orders for the given warehouse.
127
     * Create a batch of all the pending orders for the given warehouse.
112
     * The returned list is orderd by created_timestamp.
128
     * The returned list is orderd by created_timestamp.
113
     * If there are no pending orders, an empty list is returned.
129
     * If there are no pending orders, an empty list is returned.
114
     * 
130
     * 
115
     * @param warehouseId
131
     * @param warehouseId
Line 833... Line 849...
833
        throw result.ex;
849
        throw result.ex;
834
      }
850
      }
835
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "billOrder failed: unknown result");
851
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "billOrder failed: unknown result");
836
    }
852
    }
837
 
853
 
838
    public List<Order> getOrdersForTransaction(long transactionId) throws TransactionServiceException, TException
854
    public List<Order> getOrdersForTransaction(long transactionId, long customerId) throws TransactionServiceException, TException
839
    {
855
    {
840
      send_getOrdersForTransaction(transactionId);
856
      send_getOrdersForTransaction(transactionId, customerId);
841
      return recv_getOrdersForTransaction();
857
      return recv_getOrdersForTransaction();
842
    }
858
    }
843
 
859
 
844
    public void send_getOrdersForTransaction(long transactionId) throws TException
860
    public void send_getOrdersForTransaction(long transactionId, long customerId) throws TException
845
    {
861
    {
846
      oprot_.writeMessageBegin(new TMessage("getOrdersForTransaction", TMessageType.CALL, seqid_));
862
      oprot_.writeMessageBegin(new TMessage("getOrdersForTransaction", TMessageType.CALL, seqid_));
847
      getOrdersForTransaction_args args = new getOrdersForTransaction_args();
863
      getOrdersForTransaction_args args = new getOrdersForTransaction_args();
848
      args.transactionId = transactionId;
864
      args.transactionId = transactionId;
-
 
865
      args.customerId = customerId;
849
      args.write(oprot_);
866
      args.write(oprot_);
850
      oprot_.writeMessageEnd();
867
      oprot_.writeMessageEnd();
851
      oprot_.getTransport().flush();
868
      oprot_.getTransport().flush();
852
    }
869
    }
853
 
870
 
Line 1016... Line 1033...
1016
        throw result.ex;
1033
        throw result.ex;
1017
      }
1034
      }
1018
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getLineItemsForOrder failed: unknown result");
1035
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getLineItemsForOrder failed: unknown result");
1019
    }
1036
    }
1020
 
1037
 
-
 
1038
    public Order getOrderForCustomer(long orderId, long customerId) throws TransactionServiceException, TException
-
 
1039
    {
-
 
1040
      send_getOrderForCustomer(orderId, customerId);
-
 
1041
      return recv_getOrderForCustomer();
-
 
1042
    }
-
 
1043
 
-
 
1044
    public void send_getOrderForCustomer(long orderId, long customerId) throws TException
-
 
1045
    {
-
 
1046
      oprot_.writeMessageBegin(new TMessage("getOrderForCustomer", TMessageType.CALL, seqid_));
-
 
1047
      getOrderForCustomer_args args = new getOrderForCustomer_args();
-
 
1048
      args.orderId = orderId;
-
 
1049
      args.customerId = customerId;
-
 
1050
      args.write(oprot_);
-
 
1051
      oprot_.writeMessageEnd();
-
 
1052
      oprot_.getTransport().flush();
-
 
1053
    }
-
 
1054
 
-
 
1055
    public Order recv_getOrderForCustomer() throws TransactionServiceException, TException
-
 
1056
    {
-
 
1057
      TMessage msg = iprot_.readMessageBegin();
-
 
1058
      if (msg.type == TMessageType.EXCEPTION) {
-
 
1059
        TApplicationException x = TApplicationException.read(iprot_);
-
 
1060
        iprot_.readMessageEnd();
-
 
1061
        throw x;
-
 
1062
      }
-
 
1063
      getOrderForCustomer_result result = new getOrderForCustomer_result();
-
 
1064
      result.read(iprot_);
-
 
1065
      iprot_.readMessageEnd();
-
 
1066
      if (result.isSetSuccess()) {
-
 
1067
        return result.success;
-
 
1068
      }
-
 
1069
      if (result.ex != null) {
-
 
1070
        throw result.ex;
-
 
1071
      }
-
 
1072
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getOrderForCustomer failed: unknown result");
-
 
1073
    }
-
 
1074
 
1021
    public List<Order> batchOrders(long warehouseId) throws TransactionServiceException, TException
1075
    public List<Order> batchOrders(long warehouseId) throws TransactionServiceException, TException
1022
    {
1076
    {
1023
      send_batchOrders(warehouseId);
1077
      send_batchOrders(warehouseId);
1024
      return recv_batchOrders();
1078
      return recv_batchOrders();
1025
    }
1079
    }
Line 1393... Line 1447...
1393
      processMap_.put("getOrdersForTransaction", new getOrdersForTransaction());
1447
      processMap_.put("getOrdersForTransaction", new getOrdersForTransaction());
1394
      processMap_.put("getOrdersForCustomer", new getOrdersForCustomer());
1448
      processMap_.put("getOrdersForCustomer", new getOrdersForCustomer());
1395
      processMap_.put("createOrder", new createOrder());
1449
      processMap_.put("createOrder", new createOrder());
1396
      processMap_.put("getOrder", new getOrder());
1450
      processMap_.put("getOrder", new getOrder());
1397
      processMap_.put("getLineItemsForOrder", new getLineItemsForOrder());
1451
      processMap_.put("getLineItemsForOrder", new getLineItemsForOrder());
-
 
1452
      processMap_.put("getOrderForCustomer", new getOrderForCustomer());
1398
      processMap_.put("batchOrders", new batchOrders());
1453
      processMap_.put("batchOrders", new batchOrders());
1399
      processMap_.put("markOrderAsOutOfStock", new markOrderAsOutOfStock());
1454
      processMap_.put("markOrderAsOutOfStock", new markOrderAsOutOfStock());
1400
      processMap_.put("markOrdersAsManifested", new markOrdersAsManifested());
1455
      processMap_.put("markOrdersAsManifested", new markOrdersAsManifested());
1401
      processMap_.put("markOrdersAsPickedUp", new markOrdersAsPickedUp());
1456
      processMap_.put("markOrdersAsPickedUp", new markOrdersAsPickedUp());
1402
      processMap_.put("markOrdersAsDelivered", new markOrdersAsDelivered());
1457
      processMap_.put("markOrdersAsDelivered", new markOrdersAsDelivered());
Line 1910... Line 1965...
1910
        getOrdersForTransaction_args args = new getOrdersForTransaction_args();
1965
        getOrdersForTransaction_args args = new getOrdersForTransaction_args();
1911
        args.read(iprot);
1966
        args.read(iprot);
1912
        iprot.readMessageEnd();
1967
        iprot.readMessageEnd();
1913
        getOrdersForTransaction_result result = new getOrdersForTransaction_result();
1968
        getOrdersForTransaction_result result = new getOrdersForTransaction_result();
1914
        try {
1969
        try {
1915
          result.success = iface_.getOrdersForTransaction(args.transactionId);
1970
          result.success = iface_.getOrdersForTransaction(args.transactionId, args.customerId);
1916
        } catch (TransactionServiceException ex) {
1971
        } catch (TransactionServiceException ex) {
1917
          result.ex = ex;
1972
          result.ex = ex;
1918
        } catch (Throwable th) {
1973
        } catch (Throwable th) {
1919
          LOGGER.error("Internal error processing getOrdersForTransaction", th);
1974
          LOGGER.error("Internal error processing getOrdersForTransaction", th);
1920
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing getOrdersForTransaction");
1975
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing getOrdersForTransaction");
Line 2043... Line 2098...
2043
        oprot.getTransport().flush();
2098
        oprot.getTransport().flush();
2044
      }
2099
      }
2045
 
2100
 
2046
    }
2101
    }
2047
 
2102
 
-
 
2103
    private class getOrderForCustomer implements ProcessFunction {
-
 
2104
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
-
 
2105
      {
-
 
2106
        getOrderForCustomer_args args = new getOrderForCustomer_args();
-
 
2107
        args.read(iprot);
-
 
2108
        iprot.readMessageEnd();
-
 
2109
        getOrderForCustomer_result result = new getOrderForCustomer_result();
-
 
2110
        try {
-
 
2111
          result.success = iface_.getOrderForCustomer(args.orderId, args.customerId);
-
 
2112
        } catch (TransactionServiceException ex) {
-
 
2113
          result.ex = ex;
-
 
2114
        } catch (Throwable th) {
-
 
2115
          LOGGER.error("Internal error processing getOrderForCustomer", th);
-
 
2116
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing getOrderForCustomer");
-
 
2117
          oprot.writeMessageBegin(new TMessage("getOrderForCustomer", TMessageType.EXCEPTION, seqid));
-
 
2118
          x.write(oprot);
-
 
2119
          oprot.writeMessageEnd();
-
 
2120
          oprot.getTransport().flush();
-
 
2121
          return;
-
 
2122
        }
-
 
2123
        oprot.writeMessageBegin(new TMessage("getOrderForCustomer", TMessageType.REPLY, seqid));
-
 
2124
        result.write(oprot);
-
 
2125
        oprot.writeMessageEnd();
-
 
2126
        oprot.getTransport().flush();
-
 
2127
      }
-
 
2128
 
-
 
2129
    }
-
 
2130
 
2048
    private class batchOrders implements ProcessFunction {
2131
    private class batchOrders implements ProcessFunction {
2049
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
2132
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
2050
      {
2133
      {
2051
        batchOrders_args args = new batchOrders_args();
2134
        batchOrders_args args = new batchOrders_args();
2052
        args.read(iprot);
2135
        args.read(iprot);
Line 14749... Line 14832...
14749
 
14832
 
14750
  public static class getOrdersForTransaction_args implements TBase<getOrdersForTransaction_args._Fields>, java.io.Serializable, Cloneable, Comparable<getOrdersForTransaction_args>   {
14833
  public static class getOrdersForTransaction_args implements TBase<getOrdersForTransaction_args._Fields>, java.io.Serializable, Cloneable, Comparable<getOrdersForTransaction_args>   {
14751
    private static final TStruct STRUCT_DESC = new TStruct("getOrdersForTransaction_args");
14834
    private static final TStruct STRUCT_DESC = new TStruct("getOrdersForTransaction_args");
14752
 
14835
 
14753
    private static final TField TRANSACTION_ID_FIELD_DESC = new TField("transactionId", TType.I64, (short)1);
14836
    private static final TField TRANSACTION_ID_FIELD_DESC = new TField("transactionId", TType.I64, (short)1);
-
 
14837
    private static final TField CUSTOMER_ID_FIELD_DESC = new TField("customerId", TType.I64, (short)2);
14754
 
14838
 
14755
    private long transactionId;
14839
    private long transactionId;
-
 
14840
    private long customerId;
14756
 
14841
 
14757
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
14842
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
14758
    public enum _Fields implements TFieldIdEnum {
14843
    public enum _Fields implements TFieldIdEnum {
14759
      TRANSACTION_ID((short)1, "transactionId");
14844
      TRANSACTION_ID((short)1, "transactionId"),
-
 
14845
      CUSTOMER_ID((short)2, "customerId");
14760
 
14846
 
14761
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
14847
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
14762
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
14848
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
14763
 
14849
 
14764
      static {
14850
      static {
Line 14809... Line 14895...
14809
      }
14895
      }
14810
    }
14896
    }
14811
 
14897
 
14812
    // isset id assignments
14898
    // isset id assignments
14813
    private static final int __TRANSACTIONID_ISSET_ID = 0;
14899
    private static final int __TRANSACTIONID_ISSET_ID = 0;
-
 
14900
    private static final int __CUSTOMERID_ISSET_ID = 1;
14814
    private BitSet __isset_bit_vector = new BitSet(1);
14901
    private BitSet __isset_bit_vector = new BitSet(2);
14815
 
14902
 
14816
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
14903
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
14817
      put(_Fields.TRANSACTION_ID, new FieldMetaData("transactionId", TFieldRequirementType.DEFAULT, 
14904
      put(_Fields.TRANSACTION_ID, new FieldMetaData("transactionId", TFieldRequirementType.DEFAULT, 
14818
          new FieldValueMetaData(TType.I64)));
14905
          new FieldValueMetaData(TType.I64)));
-
 
14906
      put(_Fields.CUSTOMER_ID, new FieldMetaData("customerId", TFieldRequirementType.DEFAULT, 
-
 
14907
          new FieldValueMetaData(TType.I64)));
14819
    }});
14908
    }});
14820
 
14909
 
14821
    static {
14910
    static {
14822
      FieldMetaData.addStructMetaDataMap(getOrdersForTransaction_args.class, metaDataMap);
14911
      FieldMetaData.addStructMetaDataMap(getOrdersForTransaction_args.class, metaDataMap);
14823
    }
14912
    }
14824
 
14913
 
14825
    public getOrdersForTransaction_args() {
14914
    public getOrdersForTransaction_args() {
14826
    }
14915
    }
14827
 
14916
 
14828
    public getOrdersForTransaction_args(
14917
    public getOrdersForTransaction_args(
14829
      long transactionId)
14918
      long transactionId,
-
 
14919
      long customerId)
14830
    {
14920
    {
14831
      this();
14921
      this();
14832
      this.transactionId = transactionId;
14922
      this.transactionId = transactionId;
14833
      setTransactionIdIsSet(true);
14923
      setTransactionIdIsSet(true);
-
 
14924
      this.customerId = customerId;
-
 
14925
      setCustomerIdIsSet(true);
14834
    }
14926
    }
14835
 
14927
 
14836
    /**
14928
    /**
14837
     * Performs a deep copy on <i>other</i>.
14929
     * Performs a deep copy on <i>other</i>.
14838
     */
14930
     */
14839
    public getOrdersForTransaction_args(getOrdersForTransaction_args other) {
14931
    public getOrdersForTransaction_args(getOrdersForTransaction_args other) {
14840
      __isset_bit_vector.clear();
14932
      __isset_bit_vector.clear();
14841
      __isset_bit_vector.or(other.__isset_bit_vector);
14933
      __isset_bit_vector.or(other.__isset_bit_vector);
14842
      this.transactionId = other.transactionId;
14934
      this.transactionId = other.transactionId;
-
 
14935
      this.customerId = other.customerId;
14843
    }
14936
    }
14844
 
14937
 
14845
    public getOrdersForTransaction_args deepCopy() {
14938
    public getOrdersForTransaction_args deepCopy() {
14846
      return new getOrdersForTransaction_args(this);
14939
      return new getOrdersForTransaction_args(this);
14847
    }
14940
    }
Line 14872... Line 14965...
14872
 
14965
 
14873
    public void setTransactionIdIsSet(boolean value) {
14966
    public void setTransactionIdIsSet(boolean value) {
14874
      __isset_bit_vector.set(__TRANSACTIONID_ISSET_ID, value);
14967
      __isset_bit_vector.set(__TRANSACTIONID_ISSET_ID, value);
14875
    }
14968
    }
14876
 
14969
 
-
 
14970
    public long getCustomerId() {
-
 
14971
      return this.customerId;
-
 
14972
    }
-
 
14973
 
-
 
14974
    public getOrdersForTransaction_args setCustomerId(long customerId) {
-
 
14975
      this.customerId = customerId;
-
 
14976
      setCustomerIdIsSet(true);
-
 
14977
      return this;
-
 
14978
    }
-
 
14979
 
-
 
14980
    public void unsetCustomerId() {
-
 
14981
      __isset_bit_vector.clear(__CUSTOMERID_ISSET_ID);
-
 
14982
    }
-
 
14983
 
-
 
14984
    /** Returns true if field customerId is set (has been asigned a value) and false otherwise */
-
 
14985
    public boolean isSetCustomerId() {
-
 
14986
      return __isset_bit_vector.get(__CUSTOMERID_ISSET_ID);
-
 
14987
    }
-
 
14988
 
-
 
14989
    public void setCustomerIdIsSet(boolean value) {
-
 
14990
      __isset_bit_vector.set(__CUSTOMERID_ISSET_ID, value);
-
 
14991
    }
-
 
14992
 
14877
    public void setFieldValue(_Fields field, Object value) {
14993
    public void setFieldValue(_Fields field, Object value) {
14878
      switch (field) {
14994
      switch (field) {
14879
      case TRANSACTION_ID:
14995
      case TRANSACTION_ID:
14880
        if (value == null) {
14996
        if (value == null) {
14881
          unsetTransactionId();
14997
          unsetTransactionId();
14882
        } else {
14998
        } else {
14883
          setTransactionId((Long)value);
14999
          setTransactionId((Long)value);
14884
        }
15000
        }
14885
        break;
15001
        break;
14886
 
15002
 
-
 
15003
      case CUSTOMER_ID:
-
 
15004
        if (value == null) {
-
 
15005
          unsetCustomerId();
-
 
15006
        } else {
-
 
15007
          setCustomerId((Long)value);
-
 
15008
        }
-
 
15009
        break;
-
 
15010
 
14887
      }
15011
      }
14888
    }
15012
    }
14889
 
15013
 
14890
    public void setFieldValue(int fieldID, Object value) {
15014
    public void setFieldValue(int fieldID, Object value) {
14891
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
15015
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
Line 14894... Line 15018...
14894
    public Object getFieldValue(_Fields field) {
15018
    public Object getFieldValue(_Fields field) {
14895
      switch (field) {
15019
      switch (field) {
14896
      case TRANSACTION_ID:
15020
      case TRANSACTION_ID:
14897
        return new Long(getTransactionId());
15021
        return new Long(getTransactionId());
14898
 
15022
 
-
 
15023
      case CUSTOMER_ID:
-
 
15024
        return new Long(getCustomerId());
-
 
15025
 
14899
      }
15026
      }
14900
      throw new IllegalStateException();
15027
      throw new IllegalStateException();
14901
    }
15028
    }
14902
 
15029
 
14903
    public Object getFieldValue(int fieldId) {
15030
    public Object getFieldValue(int fieldId) {
Line 14907... Line 15034...
14907
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
15034
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
14908
    public boolean isSet(_Fields field) {
15035
    public boolean isSet(_Fields field) {
14909
      switch (field) {
15036
      switch (field) {
14910
      case TRANSACTION_ID:
15037
      case TRANSACTION_ID:
14911
        return isSetTransactionId();
15038
        return isSetTransactionId();
-
 
15039
      case CUSTOMER_ID:
-
 
15040
        return isSetCustomerId();
14912
      }
15041
      }
14913
      throw new IllegalStateException();
15042
      throw new IllegalStateException();
14914
    }
15043
    }
14915
 
15044
 
14916
    public boolean isSet(int fieldID) {
15045
    public boolean isSet(int fieldID) {
Line 14937... Line 15066...
14937
          return false;
15066
          return false;
14938
        if (this.transactionId != that.transactionId)
15067
        if (this.transactionId != that.transactionId)
14939
          return false;
15068
          return false;
14940
      }
15069
      }
14941
 
15070
 
-
 
15071
      boolean this_present_customerId = true;
-
 
15072
      boolean that_present_customerId = true;
-
 
15073
      if (this_present_customerId || that_present_customerId) {
-
 
15074
        if (!(this_present_customerId && that_present_customerId))
-
 
15075
          return false;
-
 
15076
        if (this.customerId != that.customerId)
-
 
15077
          return false;
-
 
15078
      }
-
 
15079
 
14942
      return true;
15080
      return true;
14943
    }
15081
    }
14944
 
15082
 
14945
    @Override
15083
    @Override
14946
    public int hashCode() {
15084
    public int hashCode() {
Line 14961... Line 15099...
14961
      }
15099
      }
14962
      lastComparison = TBaseHelper.compareTo(transactionId, typedOther.transactionId);
15100
      lastComparison = TBaseHelper.compareTo(transactionId, typedOther.transactionId);
14963
      if (lastComparison != 0) {
15101
      if (lastComparison != 0) {
14964
        return lastComparison;
15102
        return lastComparison;
14965
      }
15103
      }
-
 
15104
      lastComparison = Boolean.valueOf(isSetCustomerId()).compareTo(isSetCustomerId());
-
 
15105
      if (lastComparison != 0) {
-
 
15106
        return lastComparison;
-
 
15107
      }
-
 
15108
      lastComparison = TBaseHelper.compareTo(customerId, typedOther.customerId);
-
 
15109
      if (lastComparison != 0) {
-
 
15110
        return lastComparison;
-
 
15111
      }
14966
      return 0;
15112
      return 0;
14967
    }
15113
    }
14968
 
15114
 
14969
    public void read(TProtocol iprot) throws TException {
15115
    public void read(TProtocol iprot) throws TException {
14970
      TField field;
15116
      TField field;
Line 14986... Line 15132...
14986
                setTransactionIdIsSet(true);
15132
                setTransactionIdIsSet(true);
14987
              } else { 
15133
              } else { 
14988
                TProtocolUtil.skip(iprot, field.type);
15134
                TProtocolUtil.skip(iprot, field.type);
14989
              }
15135
              }
14990
              break;
15136
              break;
-
 
15137
            case CUSTOMER_ID:
-
 
15138
              if (field.type == TType.I64) {
-
 
15139
                this.customerId = iprot.readI64();
-
 
15140
                setCustomerIdIsSet(true);
-
 
15141
              } else { 
-
 
15142
                TProtocolUtil.skip(iprot, field.type);
-
 
15143
              }
-
 
15144
              break;
14991
          }
15145
          }
14992
          iprot.readFieldEnd();
15146
          iprot.readFieldEnd();
14993
        }
15147
        }
14994
      }
15148
      }
14995
      iprot.readStructEnd();
15149
      iprot.readStructEnd();
Line 15001... Line 15155...
15001
 
15155
 
15002
      oprot.writeStructBegin(STRUCT_DESC);
15156
      oprot.writeStructBegin(STRUCT_DESC);
15003
      oprot.writeFieldBegin(TRANSACTION_ID_FIELD_DESC);
15157
      oprot.writeFieldBegin(TRANSACTION_ID_FIELD_DESC);
15004
      oprot.writeI64(this.transactionId);
15158
      oprot.writeI64(this.transactionId);
15005
      oprot.writeFieldEnd();
15159
      oprot.writeFieldEnd();
-
 
15160
      oprot.writeFieldBegin(CUSTOMER_ID_FIELD_DESC);
-
 
15161
      oprot.writeI64(this.customerId);
-
 
15162
      oprot.writeFieldEnd();
15006
      oprot.writeFieldStop();
15163
      oprot.writeFieldStop();
15007
      oprot.writeStructEnd();
15164
      oprot.writeStructEnd();
15008
    }
15165
    }
15009
 
15166
 
15010
    @Override
15167
    @Override
Line 15013... Line 15170...
15013
      boolean first = true;
15170
      boolean first = true;
15014
 
15171
 
15015
      sb.append("transactionId:");
15172
      sb.append("transactionId:");
15016
      sb.append(this.transactionId);
15173
      sb.append(this.transactionId);
15017
      first = false;
15174
      first = false;
-
 
15175
      if (!first) sb.append(", ");
-
 
15176
      sb.append("customerId:");
-
 
15177
      sb.append(this.customerId);
-
 
15178
      first = false;
15018
      sb.append(")");
15179
      sb.append(")");
15019
      return sb.toString();
15180
      return sb.toString();
15020
    }
15181
    }
15021
 
15182
 
15022
    public void validate() throws TException {
15183
    public void validate() throws TException {
Line 18311... Line 18472...
18311
      boolean first = true;
18472
      boolean first = true;
18312
 
18473
 
18313
      sb.append("success:");
18474
      sb.append("success:");
18314
      if (this.success == null) {
18475
      if (this.success == null) {
18315
        sb.append("null");
18476
        sb.append("null");
-
 
18477
      } else {
-
 
18478
        sb.append(this.success);
-
 
18479
      }
-
 
18480
      first = false;
-
 
18481
      if (!first) sb.append(", ");
-
 
18482
      sb.append("ex:");
-
 
18483
      if (this.ex == null) {
-
 
18484
        sb.append("null");
-
 
18485
      } else {
-
 
18486
        sb.append(this.ex);
-
 
18487
      }
-
 
18488
      first = false;
-
 
18489
      sb.append(")");
-
 
18490
      return sb.toString();
-
 
18491
    }
-
 
18492
 
-
 
18493
    public void validate() throws TException {
-
 
18494
      // check for required fields
-
 
18495
    }
-
 
18496
 
-
 
18497
  }
-
 
18498
 
-
 
18499
  public static class getOrderForCustomer_args implements TBase<getOrderForCustomer_args._Fields>, java.io.Serializable, Cloneable, Comparable<getOrderForCustomer_args>   {
-
 
18500
    private static final TStruct STRUCT_DESC = new TStruct("getOrderForCustomer_args");
-
 
18501
 
-
 
18502
    private static final TField ORDER_ID_FIELD_DESC = new TField("orderId", TType.I64, (short)1);
-
 
18503
    private static final TField CUSTOMER_ID_FIELD_DESC = new TField("customerId", TType.I64, (short)2);
-
 
18504
 
-
 
18505
    private long orderId;
-
 
18506
    private long customerId;
-
 
18507
 
-
 
18508
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-
 
18509
    public enum _Fields implements TFieldIdEnum {
-
 
18510
      ORDER_ID((short)1, "orderId"),
-
 
18511
      CUSTOMER_ID((short)2, "customerId");
-
 
18512
 
-
 
18513
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
-
 
18514
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
-
 
18515
 
-
 
18516
      static {
-
 
18517
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
-
 
18518
          byId.put((int)field._thriftId, field);
-
 
18519
          byName.put(field.getFieldName(), field);
-
 
18520
        }
-
 
18521
      }
-
 
18522
 
-
 
18523
      /**
-
 
18524
       * Find the _Fields constant that matches fieldId, or null if its not found.
-
 
18525
       */
-
 
18526
      public static _Fields findByThriftId(int fieldId) {
-
 
18527
        return byId.get(fieldId);
-
 
18528
      }
-
 
18529
 
-
 
18530
      /**
-
 
18531
       * Find the _Fields constant that matches fieldId, throwing an exception
-
 
18532
       * if it is not found.
-
 
18533
       */
-
 
18534
      public static _Fields findByThriftIdOrThrow(int fieldId) {
-
 
18535
        _Fields fields = findByThriftId(fieldId);
-
 
18536
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
-
 
18537
        return fields;
-
 
18538
      }
-
 
18539
 
-
 
18540
      /**
-
 
18541
       * Find the _Fields constant that matches name, or null if its not found.
-
 
18542
       */
-
 
18543
      public static _Fields findByName(String name) {
-
 
18544
        return byName.get(name);
-
 
18545
      }
-
 
18546
 
-
 
18547
      private final short _thriftId;
-
 
18548
      private final String _fieldName;
-
 
18549
 
-
 
18550
      _Fields(short thriftId, String fieldName) {
-
 
18551
        _thriftId = thriftId;
-
 
18552
        _fieldName = fieldName;
-
 
18553
      }
-
 
18554
 
-
 
18555
      public short getThriftFieldId() {
-
 
18556
        return _thriftId;
-
 
18557
      }
-
 
18558
 
-
 
18559
      public String getFieldName() {
-
 
18560
        return _fieldName;
-
 
18561
      }
-
 
18562
    }
-
 
18563
 
-
 
18564
    // isset id assignments
-
 
18565
    private static final int __ORDERID_ISSET_ID = 0;
-
 
18566
    private static final int __CUSTOMERID_ISSET_ID = 1;
-
 
18567
    private BitSet __isset_bit_vector = new BitSet(2);
-
 
18568
 
-
 
18569
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
-
 
18570
      put(_Fields.ORDER_ID, new FieldMetaData("orderId", TFieldRequirementType.DEFAULT, 
-
 
18571
          new FieldValueMetaData(TType.I64)));
-
 
18572
      put(_Fields.CUSTOMER_ID, new FieldMetaData("customerId", TFieldRequirementType.DEFAULT, 
-
 
18573
          new FieldValueMetaData(TType.I64)));
-
 
18574
    }});
-
 
18575
 
-
 
18576
    static {
-
 
18577
      FieldMetaData.addStructMetaDataMap(getOrderForCustomer_args.class, metaDataMap);
-
 
18578
    }
-
 
18579
 
-
 
18580
    public getOrderForCustomer_args() {
-
 
18581
    }
-
 
18582
 
-
 
18583
    public getOrderForCustomer_args(
-
 
18584
      long orderId,
-
 
18585
      long customerId)
-
 
18586
    {
-
 
18587
      this();
-
 
18588
      this.orderId = orderId;
-
 
18589
      setOrderIdIsSet(true);
-
 
18590
      this.customerId = customerId;
-
 
18591
      setCustomerIdIsSet(true);
-
 
18592
    }
-
 
18593
 
-
 
18594
    /**
-
 
18595
     * Performs a deep copy on <i>other</i>.
-
 
18596
     */
-
 
18597
    public getOrderForCustomer_args(getOrderForCustomer_args other) {
-
 
18598
      __isset_bit_vector.clear();
-
 
18599
      __isset_bit_vector.or(other.__isset_bit_vector);
-
 
18600
      this.orderId = other.orderId;
-
 
18601
      this.customerId = other.customerId;
-
 
18602
    }
-
 
18603
 
-
 
18604
    public getOrderForCustomer_args deepCopy() {
-
 
18605
      return new getOrderForCustomer_args(this);
-
 
18606
    }
-
 
18607
 
-
 
18608
    @Deprecated
-
 
18609
    public getOrderForCustomer_args clone() {
-
 
18610
      return new getOrderForCustomer_args(this);
-
 
18611
    }
-
 
18612
 
-
 
18613
    public long getOrderId() {
-
 
18614
      return this.orderId;
-
 
18615
    }
-
 
18616
 
-
 
18617
    public getOrderForCustomer_args setOrderId(long orderId) {
-
 
18618
      this.orderId = orderId;
-
 
18619
      setOrderIdIsSet(true);
-
 
18620
      return this;
-
 
18621
    }
-
 
18622
 
-
 
18623
    public void unsetOrderId() {
-
 
18624
      __isset_bit_vector.clear(__ORDERID_ISSET_ID);
-
 
18625
    }
-
 
18626
 
-
 
18627
    /** Returns true if field orderId is set (has been asigned a value) and false otherwise */
-
 
18628
    public boolean isSetOrderId() {
-
 
18629
      return __isset_bit_vector.get(__ORDERID_ISSET_ID);
-
 
18630
    }
-
 
18631
 
-
 
18632
    public void setOrderIdIsSet(boolean value) {
-
 
18633
      __isset_bit_vector.set(__ORDERID_ISSET_ID, value);
-
 
18634
    }
-
 
18635
 
-
 
18636
    public long getCustomerId() {
-
 
18637
      return this.customerId;
-
 
18638
    }
-
 
18639
 
-
 
18640
    public getOrderForCustomer_args setCustomerId(long customerId) {
-
 
18641
      this.customerId = customerId;
-
 
18642
      setCustomerIdIsSet(true);
-
 
18643
      return this;
-
 
18644
    }
-
 
18645
 
-
 
18646
    public void unsetCustomerId() {
-
 
18647
      __isset_bit_vector.clear(__CUSTOMERID_ISSET_ID);
-
 
18648
    }
-
 
18649
 
-
 
18650
    /** Returns true if field customerId is set (has been asigned a value) and false otherwise */
-
 
18651
    public boolean isSetCustomerId() {
-
 
18652
      return __isset_bit_vector.get(__CUSTOMERID_ISSET_ID);
-
 
18653
    }
-
 
18654
 
-
 
18655
    public void setCustomerIdIsSet(boolean value) {
-
 
18656
      __isset_bit_vector.set(__CUSTOMERID_ISSET_ID, value);
-
 
18657
    }
-
 
18658
 
-
 
18659
    public void setFieldValue(_Fields field, Object value) {
-
 
18660
      switch (field) {
-
 
18661
      case ORDER_ID:
-
 
18662
        if (value == null) {
-
 
18663
          unsetOrderId();
-
 
18664
        } else {
-
 
18665
          setOrderId((Long)value);
-
 
18666
        }
-
 
18667
        break;
-
 
18668
 
-
 
18669
      case CUSTOMER_ID:
-
 
18670
        if (value == null) {
-
 
18671
          unsetCustomerId();
-
 
18672
        } else {
-
 
18673
          setCustomerId((Long)value);
-
 
18674
        }
-
 
18675
        break;
-
 
18676
 
-
 
18677
      }
-
 
18678
    }
-
 
18679
 
-
 
18680
    public void setFieldValue(int fieldID, Object value) {
-
 
18681
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
-
 
18682
    }
-
 
18683
 
-
 
18684
    public Object getFieldValue(_Fields field) {
-
 
18685
      switch (field) {
-
 
18686
      case ORDER_ID:
-
 
18687
        return new Long(getOrderId());
-
 
18688
 
-
 
18689
      case CUSTOMER_ID:
-
 
18690
        return new Long(getCustomerId());
-
 
18691
 
-
 
18692
      }
-
 
18693
      throw new IllegalStateException();
-
 
18694
    }
-
 
18695
 
-
 
18696
    public Object getFieldValue(int fieldId) {
-
 
18697
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
-
 
18698
    }
-
 
18699
 
-
 
18700
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
-
 
18701
    public boolean isSet(_Fields field) {
-
 
18702
      switch (field) {
-
 
18703
      case ORDER_ID:
-
 
18704
        return isSetOrderId();
-
 
18705
      case CUSTOMER_ID:
-
 
18706
        return isSetCustomerId();
-
 
18707
      }
-
 
18708
      throw new IllegalStateException();
-
 
18709
    }
-
 
18710
 
-
 
18711
    public boolean isSet(int fieldID) {
-
 
18712
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
-
 
18713
    }
-
 
18714
 
-
 
18715
    @Override
-
 
18716
    public boolean equals(Object that) {
-
 
18717
      if (that == null)
-
 
18718
        return false;
-
 
18719
      if (that instanceof getOrderForCustomer_args)
-
 
18720
        return this.equals((getOrderForCustomer_args)that);
-
 
18721
      return false;
-
 
18722
    }
-
 
18723
 
-
 
18724
    public boolean equals(getOrderForCustomer_args that) {
-
 
18725
      if (that == null)
-
 
18726
        return false;
-
 
18727
 
-
 
18728
      boolean this_present_orderId = true;
-
 
18729
      boolean that_present_orderId = true;
-
 
18730
      if (this_present_orderId || that_present_orderId) {
-
 
18731
        if (!(this_present_orderId && that_present_orderId))
-
 
18732
          return false;
-
 
18733
        if (this.orderId != that.orderId)
-
 
18734
          return false;
-
 
18735
      }
-
 
18736
 
-
 
18737
      boolean this_present_customerId = true;
-
 
18738
      boolean that_present_customerId = true;
-
 
18739
      if (this_present_customerId || that_present_customerId) {
-
 
18740
        if (!(this_present_customerId && that_present_customerId))
-
 
18741
          return false;
-
 
18742
        if (this.customerId != that.customerId)
-
 
18743
          return false;
-
 
18744
      }
-
 
18745
 
-
 
18746
      return true;
-
 
18747
    }
-
 
18748
 
-
 
18749
    @Override
-
 
18750
    public int hashCode() {
-
 
18751
      return 0;
-
 
18752
    }
-
 
18753
 
-
 
18754
    public int compareTo(getOrderForCustomer_args other) {
-
 
18755
      if (!getClass().equals(other.getClass())) {
-
 
18756
        return getClass().getName().compareTo(other.getClass().getName());
-
 
18757
      }
-
 
18758
 
-
 
18759
      int lastComparison = 0;
-
 
18760
      getOrderForCustomer_args typedOther = (getOrderForCustomer_args)other;
-
 
18761
 
-
 
18762
      lastComparison = Boolean.valueOf(isSetOrderId()).compareTo(isSetOrderId());
-
 
18763
      if (lastComparison != 0) {
-
 
18764
        return lastComparison;
-
 
18765
      }
-
 
18766
      lastComparison = TBaseHelper.compareTo(orderId, typedOther.orderId);
-
 
18767
      if (lastComparison != 0) {
-
 
18768
        return lastComparison;
-
 
18769
      }
-
 
18770
      lastComparison = Boolean.valueOf(isSetCustomerId()).compareTo(isSetCustomerId());
-
 
18771
      if (lastComparison != 0) {
-
 
18772
        return lastComparison;
-
 
18773
      }
-
 
18774
      lastComparison = TBaseHelper.compareTo(customerId, typedOther.customerId);
-
 
18775
      if (lastComparison != 0) {
-
 
18776
        return lastComparison;
-
 
18777
      }
-
 
18778
      return 0;
-
 
18779
    }
-
 
18780
 
-
 
18781
    public void read(TProtocol iprot) throws TException {
-
 
18782
      TField field;
-
 
18783
      iprot.readStructBegin();
-
 
18784
      while (true)
-
 
18785
      {
-
 
18786
        field = iprot.readFieldBegin();
-
 
18787
        if (field.type == TType.STOP) { 
-
 
18788
          break;
-
 
18789
        }
-
 
18790
        _Fields fieldId = _Fields.findByThriftId(field.id);
-
 
18791
        if (fieldId == null) {
-
 
18792
          TProtocolUtil.skip(iprot, field.type);
-
 
18793
        } else {
-
 
18794
          switch (fieldId) {
-
 
18795
            case ORDER_ID:
-
 
18796
              if (field.type == TType.I64) {
-
 
18797
                this.orderId = iprot.readI64();
-
 
18798
                setOrderIdIsSet(true);
-
 
18799
              } else { 
-
 
18800
                TProtocolUtil.skip(iprot, field.type);
-
 
18801
              }
-
 
18802
              break;
-
 
18803
            case CUSTOMER_ID:
-
 
18804
              if (field.type == TType.I64) {
-
 
18805
                this.customerId = iprot.readI64();
-
 
18806
                setCustomerIdIsSet(true);
-
 
18807
              } else { 
-
 
18808
                TProtocolUtil.skip(iprot, field.type);
-
 
18809
              }
-
 
18810
              break;
-
 
18811
          }
-
 
18812
          iprot.readFieldEnd();
-
 
18813
        }
-
 
18814
      }
-
 
18815
      iprot.readStructEnd();
-
 
18816
      validate();
-
 
18817
    }
-
 
18818
 
-
 
18819
    public void write(TProtocol oprot) throws TException {
-
 
18820
      validate();
-
 
18821
 
-
 
18822
      oprot.writeStructBegin(STRUCT_DESC);
-
 
18823
      oprot.writeFieldBegin(ORDER_ID_FIELD_DESC);
-
 
18824
      oprot.writeI64(this.orderId);
-
 
18825
      oprot.writeFieldEnd();
-
 
18826
      oprot.writeFieldBegin(CUSTOMER_ID_FIELD_DESC);
-
 
18827
      oprot.writeI64(this.customerId);
-
 
18828
      oprot.writeFieldEnd();
-
 
18829
      oprot.writeFieldStop();
-
 
18830
      oprot.writeStructEnd();
-
 
18831
    }
-
 
18832
 
-
 
18833
    @Override
-
 
18834
    public String toString() {
-
 
18835
      StringBuilder sb = new StringBuilder("getOrderForCustomer_args(");
-
 
18836
      boolean first = true;
-
 
18837
 
-
 
18838
      sb.append("orderId:");
-
 
18839
      sb.append(this.orderId);
-
 
18840
      first = false;
-
 
18841
      if (!first) sb.append(", ");
-
 
18842
      sb.append("customerId:");
-
 
18843
      sb.append(this.customerId);
-
 
18844
      first = false;
-
 
18845
      sb.append(")");
-
 
18846
      return sb.toString();
-
 
18847
    }
-
 
18848
 
-
 
18849
    public void validate() throws TException {
-
 
18850
      // check for required fields
-
 
18851
    }
-
 
18852
 
-
 
18853
  }
-
 
18854
 
-
 
18855
  public static class getOrderForCustomer_result implements TBase<getOrderForCustomer_result._Fields>, java.io.Serializable, Cloneable, Comparable<getOrderForCustomer_result>   {
-
 
18856
    private static final TStruct STRUCT_DESC = new TStruct("getOrderForCustomer_result");
-
 
18857
 
-
 
18858
    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRUCT, (short)0);
-
 
18859
    private static final TField EX_FIELD_DESC = new TField("ex", TType.STRUCT, (short)1);
-
 
18860
 
-
 
18861
    private Order success;
-
 
18862
    private TransactionServiceException ex;
-
 
18863
 
-
 
18864
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-
 
18865
    public enum _Fields implements TFieldIdEnum {
-
 
18866
      SUCCESS((short)0, "success"),
-
 
18867
      EX((short)1, "ex");
-
 
18868
 
-
 
18869
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
-
 
18870
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
-
 
18871
 
-
 
18872
      static {
-
 
18873
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
-
 
18874
          byId.put((int)field._thriftId, field);
-
 
18875
          byName.put(field.getFieldName(), field);
-
 
18876
        }
-
 
18877
      }
-
 
18878
 
-
 
18879
      /**
-
 
18880
       * Find the _Fields constant that matches fieldId, or null if its not found.
-
 
18881
       */
-
 
18882
      public static _Fields findByThriftId(int fieldId) {
-
 
18883
        return byId.get(fieldId);
-
 
18884
      }
-
 
18885
 
-
 
18886
      /**
-
 
18887
       * Find the _Fields constant that matches fieldId, throwing an exception
-
 
18888
       * if it is not found.
-
 
18889
       */
-
 
18890
      public static _Fields findByThriftIdOrThrow(int fieldId) {
-
 
18891
        _Fields fields = findByThriftId(fieldId);
-
 
18892
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
-
 
18893
        return fields;
-
 
18894
      }
-
 
18895
 
-
 
18896
      /**
-
 
18897
       * Find the _Fields constant that matches name, or null if its not found.
-
 
18898
       */
-
 
18899
      public static _Fields findByName(String name) {
-
 
18900
        return byName.get(name);
-
 
18901
      }
-
 
18902
 
-
 
18903
      private final short _thriftId;
-
 
18904
      private final String _fieldName;
-
 
18905
 
-
 
18906
      _Fields(short thriftId, String fieldName) {
-
 
18907
        _thriftId = thriftId;
-
 
18908
        _fieldName = fieldName;
-
 
18909
      }
-
 
18910
 
-
 
18911
      public short getThriftFieldId() {
-
 
18912
        return _thriftId;
-
 
18913
      }
-
 
18914
 
-
 
18915
      public String getFieldName() {
-
 
18916
        return _fieldName;
-
 
18917
      }
-
 
18918
    }
-
 
18919
 
-
 
18920
    // isset id assignments
-
 
18921
 
-
 
18922
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
-
 
18923
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
-
 
18924
          new StructMetaData(TType.STRUCT, Order.class)));
-
 
18925
      put(_Fields.EX, new FieldMetaData("ex", TFieldRequirementType.DEFAULT, 
-
 
18926
          new FieldValueMetaData(TType.STRUCT)));
-
 
18927
    }});
-
 
18928
 
-
 
18929
    static {
-
 
18930
      FieldMetaData.addStructMetaDataMap(getOrderForCustomer_result.class, metaDataMap);
-
 
18931
    }
-
 
18932
 
-
 
18933
    public getOrderForCustomer_result() {
-
 
18934
    }
-
 
18935
 
-
 
18936
    public getOrderForCustomer_result(
-
 
18937
      Order success,
-
 
18938
      TransactionServiceException ex)
-
 
18939
    {
-
 
18940
      this();
-
 
18941
      this.success = success;
-
 
18942
      this.ex = ex;
-
 
18943
    }
-
 
18944
 
-
 
18945
    /**
-
 
18946
     * Performs a deep copy on <i>other</i>.
-
 
18947
     */
-
 
18948
    public getOrderForCustomer_result(getOrderForCustomer_result other) {
-
 
18949
      if (other.isSetSuccess()) {
-
 
18950
        this.success = new Order(other.success);
-
 
18951
      }
-
 
18952
      if (other.isSetEx()) {
-
 
18953
        this.ex = new TransactionServiceException(other.ex);
-
 
18954
      }
-
 
18955
    }
-
 
18956
 
-
 
18957
    public getOrderForCustomer_result deepCopy() {
-
 
18958
      return new getOrderForCustomer_result(this);
-
 
18959
    }
-
 
18960
 
-
 
18961
    @Deprecated
-
 
18962
    public getOrderForCustomer_result clone() {
-
 
18963
      return new getOrderForCustomer_result(this);
-
 
18964
    }
-
 
18965
 
-
 
18966
    public Order getSuccess() {
-
 
18967
      return this.success;
-
 
18968
    }
-
 
18969
 
-
 
18970
    public getOrderForCustomer_result setSuccess(Order success) {
-
 
18971
      this.success = success;
-
 
18972
      return this;
-
 
18973
    }
-
 
18974
 
-
 
18975
    public void unsetSuccess() {
-
 
18976
      this.success = null;
-
 
18977
    }
-
 
18978
 
-
 
18979
    /** Returns true if field success is set (has been asigned a value) and false otherwise */
-
 
18980
    public boolean isSetSuccess() {
-
 
18981
      return this.success != null;
-
 
18982
    }
-
 
18983
 
-
 
18984
    public void setSuccessIsSet(boolean value) {
-
 
18985
      if (!value) {
-
 
18986
        this.success = null;
-
 
18987
      }
-
 
18988
    }
-
 
18989
 
-
 
18990
    public TransactionServiceException getEx() {
-
 
18991
      return this.ex;
-
 
18992
    }
-
 
18993
 
-
 
18994
    public getOrderForCustomer_result setEx(TransactionServiceException ex) {
-
 
18995
      this.ex = ex;
-
 
18996
      return this;
-
 
18997
    }
-
 
18998
 
-
 
18999
    public void unsetEx() {
-
 
19000
      this.ex = null;
-
 
19001
    }
-
 
19002
 
-
 
19003
    /** Returns true if field ex is set (has been asigned a value) and false otherwise */
-
 
19004
    public boolean isSetEx() {
-
 
19005
      return this.ex != null;
-
 
19006
    }
-
 
19007
 
-
 
19008
    public void setExIsSet(boolean value) {
-
 
19009
      if (!value) {
-
 
19010
        this.ex = null;
-
 
19011
      }
-
 
19012
    }
-
 
19013
 
-
 
19014
    public void setFieldValue(_Fields field, Object value) {
-
 
19015
      switch (field) {
-
 
19016
      case SUCCESS:
-
 
19017
        if (value == null) {
-
 
19018
          unsetSuccess();
-
 
19019
        } else {
-
 
19020
          setSuccess((Order)value);
-
 
19021
        }
-
 
19022
        break;
-
 
19023
 
-
 
19024
      case EX:
-
 
19025
        if (value == null) {
-
 
19026
          unsetEx();
-
 
19027
        } else {
-
 
19028
          setEx((TransactionServiceException)value);
-
 
19029
        }
-
 
19030
        break;
-
 
19031
 
-
 
19032
      }
-
 
19033
    }
-
 
19034
 
-
 
19035
    public void setFieldValue(int fieldID, Object value) {
-
 
19036
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
-
 
19037
    }
-
 
19038
 
-
 
19039
    public Object getFieldValue(_Fields field) {
-
 
19040
      switch (field) {
-
 
19041
      case SUCCESS:
-
 
19042
        return getSuccess();
-
 
19043
 
-
 
19044
      case EX:
-
 
19045
        return getEx();
-
 
19046
 
-
 
19047
      }
-
 
19048
      throw new IllegalStateException();
-
 
19049
    }
-
 
19050
 
-
 
19051
    public Object getFieldValue(int fieldId) {
-
 
19052
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
-
 
19053
    }
-
 
19054
 
-
 
19055
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
-
 
19056
    public boolean isSet(_Fields field) {
-
 
19057
      switch (field) {
-
 
19058
      case SUCCESS:
-
 
19059
        return isSetSuccess();
-
 
19060
      case EX:
-
 
19061
        return isSetEx();
-
 
19062
      }
-
 
19063
      throw new IllegalStateException();
-
 
19064
    }
-
 
19065
 
-
 
19066
    public boolean isSet(int fieldID) {
-
 
19067
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
-
 
19068
    }
-
 
19069
 
-
 
19070
    @Override
-
 
19071
    public boolean equals(Object that) {
-
 
19072
      if (that == null)
-
 
19073
        return false;
-
 
19074
      if (that instanceof getOrderForCustomer_result)
-
 
19075
        return this.equals((getOrderForCustomer_result)that);
-
 
19076
      return false;
-
 
19077
    }
-
 
19078
 
-
 
19079
    public boolean equals(getOrderForCustomer_result that) {
-
 
19080
      if (that == null)
-
 
19081
        return false;
-
 
19082
 
-
 
19083
      boolean this_present_success = true && this.isSetSuccess();
-
 
19084
      boolean that_present_success = true && that.isSetSuccess();
-
 
19085
      if (this_present_success || that_present_success) {
-
 
19086
        if (!(this_present_success && that_present_success))
-
 
19087
          return false;
-
 
19088
        if (!this.success.equals(that.success))
-
 
19089
          return false;
-
 
19090
      }
-
 
19091
 
-
 
19092
      boolean this_present_ex = true && this.isSetEx();
-
 
19093
      boolean that_present_ex = true && that.isSetEx();
-
 
19094
      if (this_present_ex || that_present_ex) {
-
 
19095
        if (!(this_present_ex && that_present_ex))
-
 
19096
          return false;
-
 
19097
        if (!this.ex.equals(that.ex))
-
 
19098
          return false;
-
 
19099
      }
-
 
19100
 
-
 
19101
      return true;
-
 
19102
    }
-
 
19103
 
-
 
19104
    @Override
-
 
19105
    public int hashCode() {
-
 
19106
      return 0;
-
 
19107
    }
-
 
19108
 
-
 
19109
    public int compareTo(getOrderForCustomer_result other) {
-
 
19110
      if (!getClass().equals(other.getClass())) {
-
 
19111
        return getClass().getName().compareTo(other.getClass().getName());
-
 
19112
      }
-
 
19113
 
-
 
19114
      int lastComparison = 0;
-
 
19115
      getOrderForCustomer_result typedOther = (getOrderForCustomer_result)other;
-
 
19116
 
-
 
19117
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
-
 
19118
      if (lastComparison != 0) {
-
 
19119
        return lastComparison;
-
 
19120
      }
-
 
19121
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
-
 
19122
      if (lastComparison != 0) {
-
 
19123
        return lastComparison;
-
 
19124
      }
-
 
19125
      lastComparison = Boolean.valueOf(isSetEx()).compareTo(isSetEx());
-
 
19126
      if (lastComparison != 0) {
-
 
19127
        return lastComparison;
-
 
19128
      }
-
 
19129
      lastComparison = TBaseHelper.compareTo(ex, typedOther.ex);
-
 
19130
      if (lastComparison != 0) {
-
 
19131
        return lastComparison;
-
 
19132
      }
-
 
19133
      return 0;
-
 
19134
    }
-
 
19135
 
-
 
19136
    public void read(TProtocol iprot) throws TException {
-
 
19137
      TField field;
-
 
19138
      iprot.readStructBegin();
-
 
19139
      while (true)
-
 
19140
      {
-
 
19141
        field = iprot.readFieldBegin();
-
 
19142
        if (field.type == TType.STOP) { 
-
 
19143
          break;
-
 
19144
        }
-
 
19145
        _Fields fieldId = _Fields.findByThriftId(field.id);
-
 
19146
        if (fieldId == null) {
-
 
19147
          TProtocolUtil.skip(iprot, field.type);
-
 
19148
        } else {
-
 
19149
          switch (fieldId) {
-
 
19150
            case SUCCESS:
-
 
19151
              if (field.type == TType.STRUCT) {
-
 
19152
                this.success = new Order();
-
 
19153
                this.success.read(iprot);
-
 
19154
              } else { 
-
 
19155
                TProtocolUtil.skip(iprot, field.type);
-
 
19156
              }
-
 
19157
              break;
-
 
19158
            case EX:
-
 
19159
              if (field.type == TType.STRUCT) {
-
 
19160
                this.ex = new TransactionServiceException();
-
 
19161
                this.ex.read(iprot);
-
 
19162
              } else { 
-
 
19163
                TProtocolUtil.skip(iprot, field.type);
-
 
19164
              }
-
 
19165
              break;
-
 
19166
          }
-
 
19167
          iprot.readFieldEnd();
-
 
19168
        }
-
 
19169
      }
-
 
19170
      iprot.readStructEnd();
-
 
19171
      validate();
-
 
19172
    }
-
 
19173
 
-
 
19174
    public void write(TProtocol oprot) throws TException {
-
 
19175
      oprot.writeStructBegin(STRUCT_DESC);
-
 
19176
 
-
 
19177
      if (this.isSetSuccess()) {
-
 
19178
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
-
 
19179
        this.success.write(oprot);
-
 
19180
        oprot.writeFieldEnd();
-
 
19181
      } else if (this.isSetEx()) {
-
 
19182
        oprot.writeFieldBegin(EX_FIELD_DESC);
-
 
19183
        this.ex.write(oprot);
-
 
19184
        oprot.writeFieldEnd();
-
 
19185
      }
-
 
19186
      oprot.writeFieldStop();
-
 
19187
      oprot.writeStructEnd();
-
 
19188
    }
-
 
19189
 
-
 
19190
    @Override
-
 
19191
    public String toString() {
-
 
19192
      StringBuilder sb = new StringBuilder("getOrderForCustomer_result(");
-
 
19193
      boolean first = true;
-
 
19194
 
-
 
19195
      sb.append("success:");
-
 
19196
      if (this.success == null) {
-
 
19197
        sb.append("null");
18316
      } else {
19198
      } else {
18317
        sb.append(this.success);
19199
        sb.append(this.success);
18318
      }
19200
      }
18319
      first = false;
19201
      first = false;
18320
      if (!first) sb.append(", ");
19202
      if (!first) sb.append(", ");