Subversion Repositories SmartDukaan

Rev

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

Rev 2820 Rev 2832
Line 41... Line 41...
41
     * @param id
41
     * @param id
42
     */
42
     */
43
    public PurchaseOrder getPurchaseOrder(long id) throws WarehouseServiceException, TException;
43
    public PurchaseOrder getPurchaseOrder(long id) throws WarehouseServiceException, TException;
44
 
44
 
45
    /**
45
    /**
-
 
46
     * Returns the supplier with the given order id. Throws an exception if there is no such supplier.
-
 
47
     * 
-
 
48
     * @param id
-
 
49
     */
-
 
50
    public Supplier getSupplier(long id) throws WarehouseServiceException, TException;
-
 
51
 
-
 
52
    /**
46
     * Creates a purchase for the given purchase order.
53
     * Creates a purchase for the given purchase order.
47
     * Throws an exception if no more purchases are allowed against the given purchase order.
54
     * Throws an exception if no more purchases are allowed against the given purchase order.
48
     * 
55
     * 
49
     * @param purchaseOrderId
56
     * @param purchaseOrderId
50
     * @param invoiceNumber
57
     * @param invoiceNumber
Line 185... Line 192...
185
        throw result.wex;
192
        throw result.wex;
186
      }
193
      }
187
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getPurchaseOrder failed: unknown result");
194
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getPurchaseOrder failed: unknown result");
188
    }
195
    }
189
 
196
 
-
 
197
    public Supplier getSupplier(long id) throws WarehouseServiceException, TException
-
 
198
    {
-
 
199
      send_getSupplier(id);
-
 
200
      return recv_getSupplier();
-
 
201
    }
-
 
202
 
-
 
203
    public void send_getSupplier(long id) throws TException
-
 
204
    {
-
 
205
      oprot_.writeMessageBegin(new TMessage("getSupplier", TMessageType.CALL, seqid_));
-
 
206
      getSupplier_args args = new getSupplier_args();
-
 
207
      args.id = id;
-
 
208
      args.write(oprot_);
-
 
209
      oprot_.writeMessageEnd();
-
 
210
      oprot_.getTransport().flush();
-
 
211
    }
-
 
212
 
-
 
213
    public Supplier recv_getSupplier() throws WarehouseServiceException, TException
-
 
214
    {
-
 
215
      TMessage msg = iprot_.readMessageBegin();
-
 
216
      if (msg.type == TMessageType.EXCEPTION) {
-
 
217
        TApplicationException x = TApplicationException.read(iprot_);
-
 
218
        iprot_.readMessageEnd();
-
 
219
        throw x;
-
 
220
      }
-
 
221
      getSupplier_result result = new getSupplier_result();
-
 
222
      result.read(iprot_);
-
 
223
      iprot_.readMessageEnd();
-
 
224
      if (result.isSetSuccess()) {
-
 
225
        return result.success;
-
 
226
      }
-
 
227
      if (result.wex != null) {
-
 
228
        throw result.wex;
-
 
229
      }
-
 
230
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getSupplier failed: unknown result");
-
 
231
    }
-
 
232
 
190
    public long startPurchase(long purchaseOrderId, String invoiceNumber, double freightCharges) throws WarehouseServiceException, TException
233
    public long startPurchase(long purchaseOrderId, String invoiceNumber, double freightCharges) throws WarehouseServiceException, TException
191
    {
234
    {
192
      send_startPurchase(purchaseOrderId, invoiceNumber, freightCharges);
235
      send_startPurchase(purchaseOrderId, invoiceNumber, freightCharges);
193
      return recv_startPurchase();
236
      return recv_startPurchase();
194
    }
237
    }
Line 339... Line 382...
339
    public Processor(Iface iface)
382
    public Processor(Iface iface)
340
    {
383
    {
341
      iface_ = iface;
384
      iface_ = iface;
342
      processMap_.put("createPurchaseOrder", new createPurchaseOrder());
385
      processMap_.put("createPurchaseOrder", new createPurchaseOrder());
343
      processMap_.put("getPurchaseOrder", new getPurchaseOrder());
386
      processMap_.put("getPurchaseOrder", new getPurchaseOrder());
-
 
387
      processMap_.put("getSupplier", new getSupplier());
344
      processMap_.put("startPurchase", new startPurchase());
388
      processMap_.put("startPurchase", new startPurchase());
345
      processMap_.put("closePurchase", new closePurchase());
389
      processMap_.put("closePurchase", new closePurchase());
346
      processMap_.put("scanIn", new scanIn());
390
      processMap_.put("scanIn", new scanIn());
347
      processMap_.put("scanOut", new scanOut());
391
      processMap_.put("scanOut", new scanOut());
348
    }
392
    }
Line 427... Line 471...
427
        oprot.getTransport().flush();
471
        oprot.getTransport().flush();
428
      }
472
      }
429
 
473
 
430
    }
474
    }
431
 
475
 
-
 
476
    private class getSupplier implements ProcessFunction {
-
 
477
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
-
 
478
      {
-
 
479
        getSupplier_args args = new getSupplier_args();
-
 
480
        args.read(iprot);
-
 
481
        iprot.readMessageEnd();
-
 
482
        getSupplier_result result = new getSupplier_result();
-
 
483
        try {
-
 
484
          result.success = iface_.getSupplier(args.id);
-
 
485
        } catch (WarehouseServiceException wex) {
-
 
486
          result.wex = wex;
-
 
487
        } catch (Throwable th) {
-
 
488
          LOGGER.error("Internal error processing getSupplier", th);
-
 
489
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing getSupplier");
-
 
490
          oprot.writeMessageBegin(new TMessage("getSupplier", TMessageType.EXCEPTION, seqid));
-
 
491
          x.write(oprot);
-
 
492
          oprot.writeMessageEnd();
-
 
493
          oprot.getTransport().flush();
-
 
494
          return;
-
 
495
        }
-
 
496
        oprot.writeMessageBegin(new TMessage("getSupplier", TMessageType.REPLY, seqid));
-
 
497
        result.write(oprot);
-
 
498
        oprot.writeMessageEnd();
-
 
499
        oprot.getTransport().flush();
-
 
500
      }
-
 
501
 
-
 
502
    }
-
 
503
 
432
    private class startPurchase implements ProcessFunction {
504
    private class startPurchase implements ProcessFunction {
433
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
505
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
434
      {
506
      {
435
        startPurchase_args args = new startPurchase_args();
507
        startPurchase_args args = new startPurchase_args();
436
        args.read(iprot);
508
        args.read(iprot);
Line 1809... Line 1881...
1809
      boolean first = true;
1881
      boolean first = true;
1810
 
1882
 
1811
      sb.append("success:");
1883
      sb.append("success:");
1812
      if (this.success == null) {
1884
      if (this.success == null) {
1813
        sb.append("null");
1885
        sb.append("null");
-
 
1886
      } else {
-
 
1887
        sb.append(this.success);
-
 
1888
      }
-
 
1889
      first = false;
-
 
1890
      if (!first) sb.append(", ");
-
 
1891
      sb.append("wex:");
-
 
1892
      if (this.wex == null) {
-
 
1893
        sb.append("null");
-
 
1894
      } else {
-
 
1895
        sb.append(this.wex);
-
 
1896
      }
-
 
1897
      first = false;
-
 
1898
      sb.append(")");
-
 
1899
      return sb.toString();
-
 
1900
    }
-
 
1901
 
-
 
1902
    public void validate() throws TException {
-
 
1903
      // check for required fields
-
 
1904
    }
-
 
1905
 
-
 
1906
  }
-
 
1907
 
-
 
1908
  public static class getSupplier_args implements TBase<getSupplier_args._Fields>, java.io.Serializable, Cloneable, Comparable<getSupplier_args>   {
-
 
1909
    private static final TStruct STRUCT_DESC = new TStruct("getSupplier_args");
-
 
1910
 
-
 
1911
    private static final TField ID_FIELD_DESC = new TField("id", TType.I64, (short)1);
-
 
1912
 
-
 
1913
    private long id;
-
 
1914
 
-
 
1915
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-
 
1916
    public enum _Fields implements TFieldIdEnum {
-
 
1917
      ID((short)1, "id");
-
 
1918
 
-
 
1919
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
-
 
1920
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
-
 
1921
 
-
 
1922
      static {
-
 
1923
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
-
 
1924
          byId.put((int)field._thriftId, field);
-
 
1925
          byName.put(field.getFieldName(), field);
-
 
1926
        }
-
 
1927
      }
-
 
1928
 
-
 
1929
      /**
-
 
1930
       * Find the _Fields constant that matches fieldId, or null if its not found.
-
 
1931
       */
-
 
1932
      public static _Fields findByThriftId(int fieldId) {
-
 
1933
        return byId.get(fieldId);
-
 
1934
      }
-
 
1935
 
-
 
1936
      /**
-
 
1937
       * Find the _Fields constant that matches fieldId, throwing an exception
-
 
1938
       * if it is not found.
-
 
1939
       */
-
 
1940
      public static _Fields findByThriftIdOrThrow(int fieldId) {
-
 
1941
        _Fields fields = findByThriftId(fieldId);
-
 
1942
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
-
 
1943
        return fields;
-
 
1944
      }
-
 
1945
 
-
 
1946
      /**
-
 
1947
       * Find the _Fields constant that matches name, or null if its not found.
-
 
1948
       */
-
 
1949
      public static _Fields findByName(String name) {
-
 
1950
        return byName.get(name);
-
 
1951
      }
-
 
1952
 
-
 
1953
      private final short _thriftId;
-
 
1954
      private final String _fieldName;
-
 
1955
 
-
 
1956
      _Fields(short thriftId, String fieldName) {
-
 
1957
        _thriftId = thriftId;
-
 
1958
        _fieldName = fieldName;
-
 
1959
      }
-
 
1960
 
-
 
1961
      public short getThriftFieldId() {
-
 
1962
        return _thriftId;
-
 
1963
      }
-
 
1964
 
-
 
1965
      public String getFieldName() {
-
 
1966
        return _fieldName;
-
 
1967
      }
-
 
1968
    }
-
 
1969
 
-
 
1970
    // isset id assignments
-
 
1971
    private static final int __ID_ISSET_ID = 0;
-
 
1972
    private BitSet __isset_bit_vector = new BitSet(1);
-
 
1973
 
-
 
1974
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
-
 
1975
      put(_Fields.ID, new FieldMetaData("id", TFieldRequirementType.DEFAULT, 
-
 
1976
          new FieldValueMetaData(TType.I64)));
-
 
1977
    }});
-
 
1978
 
-
 
1979
    static {
-
 
1980
      FieldMetaData.addStructMetaDataMap(getSupplier_args.class, metaDataMap);
-
 
1981
    }
-
 
1982
 
-
 
1983
    public getSupplier_args() {
-
 
1984
    }
-
 
1985
 
-
 
1986
    public getSupplier_args(
-
 
1987
      long id)
-
 
1988
    {
-
 
1989
      this();
-
 
1990
      this.id = id;
-
 
1991
      setIdIsSet(true);
-
 
1992
    }
-
 
1993
 
-
 
1994
    /**
-
 
1995
     * Performs a deep copy on <i>other</i>.
-
 
1996
     */
-
 
1997
    public getSupplier_args(getSupplier_args other) {
-
 
1998
      __isset_bit_vector.clear();
-
 
1999
      __isset_bit_vector.or(other.__isset_bit_vector);
-
 
2000
      this.id = other.id;
-
 
2001
    }
-
 
2002
 
-
 
2003
    public getSupplier_args deepCopy() {
-
 
2004
      return new getSupplier_args(this);
-
 
2005
    }
-
 
2006
 
-
 
2007
    @Deprecated
-
 
2008
    public getSupplier_args clone() {
-
 
2009
      return new getSupplier_args(this);
-
 
2010
    }
-
 
2011
 
-
 
2012
    public long getId() {
-
 
2013
      return this.id;
-
 
2014
    }
-
 
2015
 
-
 
2016
    public getSupplier_args setId(long id) {
-
 
2017
      this.id = id;
-
 
2018
      setIdIsSet(true);
-
 
2019
      return this;
-
 
2020
    }
-
 
2021
 
-
 
2022
    public void unsetId() {
-
 
2023
      __isset_bit_vector.clear(__ID_ISSET_ID);
-
 
2024
    }
-
 
2025
 
-
 
2026
    /** Returns true if field id is set (has been asigned a value) and false otherwise */
-
 
2027
    public boolean isSetId() {
-
 
2028
      return __isset_bit_vector.get(__ID_ISSET_ID);
-
 
2029
    }
-
 
2030
 
-
 
2031
    public void setIdIsSet(boolean value) {
-
 
2032
      __isset_bit_vector.set(__ID_ISSET_ID, value);
-
 
2033
    }
-
 
2034
 
-
 
2035
    public void setFieldValue(_Fields field, Object value) {
-
 
2036
      switch (field) {
-
 
2037
      case ID:
-
 
2038
        if (value == null) {
-
 
2039
          unsetId();
-
 
2040
        } else {
-
 
2041
          setId((Long)value);
-
 
2042
        }
-
 
2043
        break;
-
 
2044
 
-
 
2045
      }
-
 
2046
    }
-
 
2047
 
-
 
2048
    public void setFieldValue(int fieldID, Object value) {
-
 
2049
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
-
 
2050
    }
-
 
2051
 
-
 
2052
    public Object getFieldValue(_Fields field) {
-
 
2053
      switch (field) {
-
 
2054
      case ID:
-
 
2055
        return new Long(getId());
-
 
2056
 
-
 
2057
      }
-
 
2058
      throw new IllegalStateException();
-
 
2059
    }
-
 
2060
 
-
 
2061
    public Object getFieldValue(int fieldId) {
-
 
2062
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
-
 
2063
    }
-
 
2064
 
-
 
2065
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
-
 
2066
    public boolean isSet(_Fields field) {
-
 
2067
      switch (field) {
-
 
2068
      case ID:
-
 
2069
        return isSetId();
-
 
2070
      }
-
 
2071
      throw new IllegalStateException();
-
 
2072
    }
-
 
2073
 
-
 
2074
    public boolean isSet(int fieldID) {
-
 
2075
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
-
 
2076
    }
-
 
2077
 
-
 
2078
    @Override
-
 
2079
    public boolean equals(Object that) {
-
 
2080
      if (that == null)
-
 
2081
        return false;
-
 
2082
      if (that instanceof getSupplier_args)
-
 
2083
        return this.equals((getSupplier_args)that);
-
 
2084
      return false;
-
 
2085
    }
-
 
2086
 
-
 
2087
    public boolean equals(getSupplier_args that) {
-
 
2088
      if (that == null)
-
 
2089
        return false;
-
 
2090
 
-
 
2091
      boolean this_present_id = true;
-
 
2092
      boolean that_present_id = true;
-
 
2093
      if (this_present_id || that_present_id) {
-
 
2094
        if (!(this_present_id && that_present_id))
-
 
2095
          return false;
-
 
2096
        if (this.id != that.id)
-
 
2097
          return false;
-
 
2098
      }
-
 
2099
 
-
 
2100
      return true;
-
 
2101
    }
-
 
2102
 
-
 
2103
    @Override
-
 
2104
    public int hashCode() {
-
 
2105
      return 0;
-
 
2106
    }
-
 
2107
 
-
 
2108
    public int compareTo(getSupplier_args other) {
-
 
2109
      if (!getClass().equals(other.getClass())) {
-
 
2110
        return getClass().getName().compareTo(other.getClass().getName());
-
 
2111
      }
-
 
2112
 
-
 
2113
      int lastComparison = 0;
-
 
2114
      getSupplier_args typedOther = (getSupplier_args)other;
-
 
2115
 
-
 
2116
      lastComparison = Boolean.valueOf(isSetId()).compareTo(isSetId());
-
 
2117
      if (lastComparison != 0) {
-
 
2118
        return lastComparison;
-
 
2119
      }
-
 
2120
      lastComparison = TBaseHelper.compareTo(id, typedOther.id);
-
 
2121
      if (lastComparison != 0) {
-
 
2122
        return lastComparison;
-
 
2123
      }
-
 
2124
      return 0;
-
 
2125
    }
-
 
2126
 
-
 
2127
    public void read(TProtocol iprot) throws TException {
-
 
2128
      TField field;
-
 
2129
      iprot.readStructBegin();
-
 
2130
      while (true)
-
 
2131
      {
-
 
2132
        field = iprot.readFieldBegin();
-
 
2133
        if (field.type == TType.STOP) { 
-
 
2134
          break;
-
 
2135
        }
-
 
2136
        _Fields fieldId = _Fields.findByThriftId(field.id);
-
 
2137
        if (fieldId == null) {
-
 
2138
          TProtocolUtil.skip(iprot, field.type);
-
 
2139
        } else {
-
 
2140
          switch (fieldId) {
-
 
2141
            case ID:
-
 
2142
              if (field.type == TType.I64) {
-
 
2143
                this.id = iprot.readI64();
-
 
2144
                setIdIsSet(true);
-
 
2145
              } else { 
-
 
2146
                TProtocolUtil.skip(iprot, field.type);
-
 
2147
              }
-
 
2148
              break;
-
 
2149
          }
-
 
2150
          iprot.readFieldEnd();
-
 
2151
        }
-
 
2152
      }
-
 
2153
      iprot.readStructEnd();
-
 
2154
      validate();
-
 
2155
    }
-
 
2156
 
-
 
2157
    public void write(TProtocol oprot) throws TException {
-
 
2158
      validate();
-
 
2159
 
-
 
2160
      oprot.writeStructBegin(STRUCT_DESC);
-
 
2161
      oprot.writeFieldBegin(ID_FIELD_DESC);
-
 
2162
      oprot.writeI64(this.id);
-
 
2163
      oprot.writeFieldEnd();
-
 
2164
      oprot.writeFieldStop();
-
 
2165
      oprot.writeStructEnd();
-
 
2166
    }
-
 
2167
 
-
 
2168
    @Override
-
 
2169
    public String toString() {
-
 
2170
      StringBuilder sb = new StringBuilder("getSupplier_args(");
-
 
2171
      boolean first = true;
-
 
2172
 
-
 
2173
      sb.append("id:");
-
 
2174
      sb.append(this.id);
-
 
2175
      first = false;
-
 
2176
      sb.append(")");
-
 
2177
      return sb.toString();
-
 
2178
    }
-
 
2179
 
-
 
2180
    public void validate() throws TException {
-
 
2181
      // check for required fields
-
 
2182
    }
-
 
2183
 
-
 
2184
  }
-
 
2185
 
-
 
2186
  public static class getSupplier_result implements TBase<getSupplier_result._Fields>, java.io.Serializable, Cloneable, Comparable<getSupplier_result>   {
-
 
2187
    private static final TStruct STRUCT_DESC = new TStruct("getSupplier_result");
-
 
2188
 
-
 
2189
    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRUCT, (short)0);
-
 
2190
    private static final TField WEX_FIELD_DESC = new TField("wex", TType.STRUCT, (short)1);
-
 
2191
 
-
 
2192
    private Supplier success;
-
 
2193
    private WarehouseServiceException wex;
-
 
2194
 
-
 
2195
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-
 
2196
    public enum _Fields implements TFieldIdEnum {
-
 
2197
      SUCCESS((short)0, "success"),
-
 
2198
      WEX((short)1, "wex");
-
 
2199
 
-
 
2200
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
-
 
2201
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
-
 
2202
 
-
 
2203
      static {
-
 
2204
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
-
 
2205
          byId.put((int)field._thriftId, field);
-
 
2206
          byName.put(field.getFieldName(), field);
-
 
2207
        }
-
 
2208
      }
-
 
2209
 
-
 
2210
      /**
-
 
2211
       * Find the _Fields constant that matches fieldId, or null if its not found.
-
 
2212
       */
-
 
2213
      public static _Fields findByThriftId(int fieldId) {
-
 
2214
        return byId.get(fieldId);
-
 
2215
      }
-
 
2216
 
-
 
2217
      /**
-
 
2218
       * Find the _Fields constant that matches fieldId, throwing an exception
-
 
2219
       * if it is not found.
-
 
2220
       */
-
 
2221
      public static _Fields findByThriftIdOrThrow(int fieldId) {
-
 
2222
        _Fields fields = findByThriftId(fieldId);
-
 
2223
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
-
 
2224
        return fields;
-
 
2225
      }
-
 
2226
 
-
 
2227
      /**
-
 
2228
       * Find the _Fields constant that matches name, or null if its not found.
-
 
2229
       */
-
 
2230
      public static _Fields findByName(String name) {
-
 
2231
        return byName.get(name);
-
 
2232
      }
-
 
2233
 
-
 
2234
      private final short _thriftId;
-
 
2235
      private final String _fieldName;
-
 
2236
 
-
 
2237
      _Fields(short thriftId, String fieldName) {
-
 
2238
        _thriftId = thriftId;
-
 
2239
        _fieldName = fieldName;
-
 
2240
      }
-
 
2241
 
-
 
2242
      public short getThriftFieldId() {
-
 
2243
        return _thriftId;
-
 
2244
      }
-
 
2245
 
-
 
2246
      public String getFieldName() {
-
 
2247
        return _fieldName;
-
 
2248
      }
-
 
2249
    }
-
 
2250
 
-
 
2251
    // isset id assignments
-
 
2252
 
-
 
2253
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
-
 
2254
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
-
 
2255
          new StructMetaData(TType.STRUCT, Supplier.class)));
-
 
2256
      put(_Fields.WEX, new FieldMetaData("wex", TFieldRequirementType.DEFAULT, 
-
 
2257
          new FieldValueMetaData(TType.STRUCT)));
-
 
2258
    }});
-
 
2259
 
-
 
2260
    static {
-
 
2261
      FieldMetaData.addStructMetaDataMap(getSupplier_result.class, metaDataMap);
-
 
2262
    }
-
 
2263
 
-
 
2264
    public getSupplier_result() {
-
 
2265
    }
-
 
2266
 
-
 
2267
    public getSupplier_result(
-
 
2268
      Supplier success,
-
 
2269
      WarehouseServiceException wex)
-
 
2270
    {
-
 
2271
      this();
-
 
2272
      this.success = success;
-
 
2273
      this.wex = wex;
-
 
2274
    }
-
 
2275
 
-
 
2276
    /**
-
 
2277
     * Performs a deep copy on <i>other</i>.
-
 
2278
     */
-
 
2279
    public getSupplier_result(getSupplier_result other) {
-
 
2280
      if (other.isSetSuccess()) {
-
 
2281
        this.success = new Supplier(other.success);
-
 
2282
      }
-
 
2283
      if (other.isSetWex()) {
-
 
2284
        this.wex = new WarehouseServiceException(other.wex);
-
 
2285
      }
-
 
2286
    }
-
 
2287
 
-
 
2288
    public getSupplier_result deepCopy() {
-
 
2289
      return new getSupplier_result(this);
-
 
2290
    }
-
 
2291
 
-
 
2292
    @Deprecated
-
 
2293
    public getSupplier_result clone() {
-
 
2294
      return new getSupplier_result(this);
-
 
2295
    }
-
 
2296
 
-
 
2297
    public Supplier getSuccess() {
-
 
2298
      return this.success;
-
 
2299
    }
-
 
2300
 
-
 
2301
    public getSupplier_result setSuccess(Supplier success) {
-
 
2302
      this.success = success;
-
 
2303
      return this;
-
 
2304
    }
-
 
2305
 
-
 
2306
    public void unsetSuccess() {
-
 
2307
      this.success = null;
-
 
2308
    }
-
 
2309
 
-
 
2310
    /** Returns true if field success is set (has been asigned a value) and false otherwise */
-
 
2311
    public boolean isSetSuccess() {
-
 
2312
      return this.success != null;
-
 
2313
    }
-
 
2314
 
-
 
2315
    public void setSuccessIsSet(boolean value) {
-
 
2316
      if (!value) {
-
 
2317
        this.success = null;
-
 
2318
      }
-
 
2319
    }
-
 
2320
 
-
 
2321
    public WarehouseServiceException getWex() {
-
 
2322
      return this.wex;
-
 
2323
    }
-
 
2324
 
-
 
2325
    public getSupplier_result setWex(WarehouseServiceException wex) {
-
 
2326
      this.wex = wex;
-
 
2327
      return this;
-
 
2328
    }
-
 
2329
 
-
 
2330
    public void unsetWex() {
-
 
2331
      this.wex = null;
-
 
2332
    }
-
 
2333
 
-
 
2334
    /** Returns true if field wex is set (has been asigned a value) and false otherwise */
-
 
2335
    public boolean isSetWex() {
-
 
2336
      return this.wex != null;
-
 
2337
    }
-
 
2338
 
-
 
2339
    public void setWexIsSet(boolean value) {
-
 
2340
      if (!value) {
-
 
2341
        this.wex = null;
-
 
2342
      }
-
 
2343
    }
-
 
2344
 
-
 
2345
    public void setFieldValue(_Fields field, Object value) {
-
 
2346
      switch (field) {
-
 
2347
      case SUCCESS:
-
 
2348
        if (value == null) {
-
 
2349
          unsetSuccess();
-
 
2350
        } else {
-
 
2351
          setSuccess((Supplier)value);
-
 
2352
        }
-
 
2353
        break;
-
 
2354
 
-
 
2355
      case WEX:
-
 
2356
        if (value == null) {
-
 
2357
          unsetWex();
-
 
2358
        } else {
-
 
2359
          setWex((WarehouseServiceException)value);
-
 
2360
        }
-
 
2361
        break;
-
 
2362
 
-
 
2363
      }
-
 
2364
    }
-
 
2365
 
-
 
2366
    public void setFieldValue(int fieldID, Object value) {
-
 
2367
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
-
 
2368
    }
-
 
2369
 
-
 
2370
    public Object getFieldValue(_Fields field) {
-
 
2371
      switch (field) {
-
 
2372
      case SUCCESS:
-
 
2373
        return getSuccess();
-
 
2374
 
-
 
2375
      case WEX:
-
 
2376
        return getWex();
-
 
2377
 
-
 
2378
      }
-
 
2379
      throw new IllegalStateException();
-
 
2380
    }
-
 
2381
 
-
 
2382
    public Object getFieldValue(int fieldId) {
-
 
2383
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
-
 
2384
    }
-
 
2385
 
-
 
2386
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
-
 
2387
    public boolean isSet(_Fields field) {
-
 
2388
      switch (field) {
-
 
2389
      case SUCCESS:
-
 
2390
        return isSetSuccess();
-
 
2391
      case WEX:
-
 
2392
        return isSetWex();
-
 
2393
      }
-
 
2394
      throw new IllegalStateException();
-
 
2395
    }
-
 
2396
 
-
 
2397
    public boolean isSet(int fieldID) {
-
 
2398
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
-
 
2399
    }
-
 
2400
 
-
 
2401
    @Override
-
 
2402
    public boolean equals(Object that) {
-
 
2403
      if (that == null)
-
 
2404
        return false;
-
 
2405
      if (that instanceof getSupplier_result)
-
 
2406
        return this.equals((getSupplier_result)that);
-
 
2407
      return false;
-
 
2408
    }
-
 
2409
 
-
 
2410
    public boolean equals(getSupplier_result that) {
-
 
2411
      if (that == null)
-
 
2412
        return false;
-
 
2413
 
-
 
2414
      boolean this_present_success = true && this.isSetSuccess();
-
 
2415
      boolean that_present_success = true && that.isSetSuccess();
-
 
2416
      if (this_present_success || that_present_success) {
-
 
2417
        if (!(this_present_success && that_present_success))
-
 
2418
          return false;
-
 
2419
        if (!this.success.equals(that.success))
-
 
2420
          return false;
-
 
2421
      }
-
 
2422
 
-
 
2423
      boolean this_present_wex = true && this.isSetWex();
-
 
2424
      boolean that_present_wex = true && that.isSetWex();
-
 
2425
      if (this_present_wex || that_present_wex) {
-
 
2426
        if (!(this_present_wex && that_present_wex))
-
 
2427
          return false;
-
 
2428
        if (!this.wex.equals(that.wex))
-
 
2429
          return false;
-
 
2430
      }
-
 
2431
 
-
 
2432
      return true;
-
 
2433
    }
-
 
2434
 
-
 
2435
    @Override
-
 
2436
    public int hashCode() {
-
 
2437
      return 0;
-
 
2438
    }
-
 
2439
 
-
 
2440
    public int compareTo(getSupplier_result other) {
-
 
2441
      if (!getClass().equals(other.getClass())) {
-
 
2442
        return getClass().getName().compareTo(other.getClass().getName());
-
 
2443
      }
-
 
2444
 
-
 
2445
      int lastComparison = 0;
-
 
2446
      getSupplier_result typedOther = (getSupplier_result)other;
-
 
2447
 
-
 
2448
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
-
 
2449
      if (lastComparison != 0) {
-
 
2450
        return lastComparison;
-
 
2451
      }
-
 
2452
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
-
 
2453
      if (lastComparison != 0) {
-
 
2454
        return lastComparison;
-
 
2455
      }
-
 
2456
      lastComparison = Boolean.valueOf(isSetWex()).compareTo(isSetWex());
-
 
2457
      if (lastComparison != 0) {
-
 
2458
        return lastComparison;
-
 
2459
      }
-
 
2460
      lastComparison = TBaseHelper.compareTo(wex, typedOther.wex);
-
 
2461
      if (lastComparison != 0) {
-
 
2462
        return lastComparison;
-
 
2463
      }
-
 
2464
      return 0;
-
 
2465
    }
-
 
2466
 
-
 
2467
    public void read(TProtocol iprot) throws TException {
-
 
2468
      TField field;
-
 
2469
      iprot.readStructBegin();
-
 
2470
      while (true)
-
 
2471
      {
-
 
2472
        field = iprot.readFieldBegin();
-
 
2473
        if (field.type == TType.STOP) { 
-
 
2474
          break;
-
 
2475
        }
-
 
2476
        _Fields fieldId = _Fields.findByThriftId(field.id);
-
 
2477
        if (fieldId == null) {
-
 
2478
          TProtocolUtil.skip(iprot, field.type);
-
 
2479
        } else {
-
 
2480
          switch (fieldId) {
-
 
2481
            case SUCCESS:
-
 
2482
              if (field.type == TType.STRUCT) {
-
 
2483
                this.success = new Supplier();
-
 
2484
                this.success.read(iprot);
-
 
2485
              } else { 
-
 
2486
                TProtocolUtil.skip(iprot, field.type);
-
 
2487
              }
-
 
2488
              break;
-
 
2489
            case WEX:
-
 
2490
              if (field.type == TType.STRUCT) {
-
 
2491
                this.wex = new WarehouseServiceException();
-
 
2492
                this.wex.read(iprot);
-
 
2493
              } else { 
-
 
2494
                TProtocolUtil.skip(iprot, field.type);
-
 
2495
              }
-
 
2496
              break;
-
 
2497
          }
-
 
2498
          iprot.readFieldEnd();
-
 
2499
        }
-
 
2500
      }
-
 
2501
      iprot.readStructEnd();
-
 
2502
      validate();
-
 
2503
    }
-
 
2504
 
-
 
2505
    public void write(TProtocol oprot) throws TException {
-
 
2506
      oprot.writeStructBegin(STRUCT_DESC);
-
 
2507
 
-
 
2508
      if (this.isSetSuccess()) {
-
 
2509
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
-
 
2510
        this.success.write(oprot);
-
 
2511
        oprot.writeFieldEnd();
-
 
2512
      } else if (this.isSetWex()) {
-
 
2513
        oprot.writeFieldBegin(WEX_FIELD_DESC);
-
 
2514
        this.wex.write(oprot);
-
 
2515
        oprot.writeFieldEnd();
-
 
2516
      }
-
 
2517
      oprot.writeFieldStop();
-
 
2518
      oprot.writeStructEnd();
-
 
2519
    }
-
 
2520
 
-
 
2521
    @Override
-
 
2522
    public String toString() {
-
 
2523
      StringBuilder sb = new StringBuilder("getSupplier_result(");
-
 
2524
      boolean first = true;
-
 
2525
 
-
 
2526
      sb.append("success:");
-
 
2527
      if (this.success == null) {
-
 
2528
        sb.append("null");
1814
      } else {
2529
      } else {
1815
        sb.append(this.success);
2530
        sb.append(this.success);
1816
      }
2531
      }
1817
      first = false;
2532
      first = false;
1818
      if (!first) sb.append(", ");
2533
      if (!first) sb.append(", ");