Subversion Repositories SmartDukaan

Rev

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

Rev 4496 Rev 4555
Line 78... Line 78...
78
     * @param open
78
     * @param open
79
     */
79
     */
80
    public List<Purchase> getAllPurchases(long purchaseOrderId, boolean open) throws PurchaseServiceException, org.apache.thrift.TException;
80
    public List<Purchase> getAllPurchases(long purchaseOrderId, boolean open) throws PurchaseServiceException, org.apache.thrift.TException;
81
 
81
 
82
    /**
82
    /**
83
     * Returns the price at which we bought an item from a supplier
83
     * Returns the purchase order object for a given purchase
84
     * 
84
     * 
85
     * @param purchaseId
85
     * @param purchaseId
86
     * @param itemId
-
 
87
     */
86
     */
88
    public long getPrice(long purchaseId, long itemId) throws org.apache.thrift.TException;
87
    public PurchaseOrder getPurchaseOrderForPurchase(long purchaseId) throws org.apache.thrift.TException;
89
 
88
 
90
  }
89
  }
91
 
90
 
92
  public interface AsyncIface extends in.shop2020.generic.GenericService .AsyncIface {
91
  public interface AsyncIface extends in.shop2020.generic.GenericService .AsyncIface {
93
 
92
 
Line 103... Line 102...
103
 
102
 
104
    public void closePurchase(long purchaseId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.closePurchase_call> resultHandler) throws org.apache.thrift.TException;
103
    public void closePurchase(long purchaseId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.closePurchase_call> resultHandler) throws org.apache.thrift.TException;
105
 
104
 
106
    public void getAllPurchases(long purchaseOrderId, boolean open, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getAllPurchases_call> resultHandler) throws org.apache.thrift.TException;
105
    public void getAllPurchases(long purchaseOrderId, boolean open, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getAllPurchases_call> resultHandler) throws org.apache.thrift.TException;
107
 
106
 
108
    public void getPrice(long purchaseId, long itemId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getPrice_call> resultHandler) throws org.apache.thrift.TException;
107
    public void getPurchaseOrderForPurchase(long purchaseId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getPurchaseOrderForPurchase_call> resultHandler) throws org.apache.thrift.TException;
109
 
108
 
110
  }
109
  }
111
 
110
 
112
  public static class Client extends in.shop2020.generic.GenericService.Client implements Iface {
111
  public static class Client extends in.shop2020.generic.GenericService.Client implements Iface {
113
    public static class Factory implements org.apache.thrift.TServiceClientFactory<Client> {
112
    public static class Factory implements org.apache.thrift.TServiceClientFactory<Client> {
Line 312... Line 311...
312
        throw result.e;
311
        throw result.e;
313
      }
312
      }
314
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getAllPurchases failed: unknown result");
313
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getAllPurchases failed: unknown result");
315
    }
314
    }
316
 
315
 
317
    public long getPrice(long purchaseId, long itemId) throws org.apache.thrift.TException
316
    public PurchaseOrder getPurchaseOrderForPurchase(long purchaseId) throws org.apache.thrift.TException
318
    {
317
    {
319
      send_getPrice(purchaseId, itemId);
318
      send_getPurchaseOrderForPurchase(purchaseId);
320
      return recv_getPrice();
319
      return recv_getPurchaseOrderForPurchase();
321
    }
320
    }
322
 
321
 
323
    public void send_getPrice(long purchaseId, long itemId) throws org.apache.thrift.TException
322
    public void send_getPurchaseOrderForPurchase(long purchaseId) throws org.apache.thrift.TException
324
    {
323
    {
325
      getPrice_args args = new getPrice_args();
324
      getPurchaseOrderForPurchase_args args = new getPurchaseOrderForPurchase_args();
326
      args.setPurchaseId(purchaseId);
325
      args.setPurchaseId(purchaseId);
327
      args.setItemId(itemId);
-
 
328
      sendBase("getPrice", args);
326
      sendBase("getPurchaseOrderForPurchase", args);
329
    }
327
    }
330
 
328
 
331
    public long recv_getPrice() throws org.apache.thrift.TException
329
    public PurchaseOrder recv_getPurchaseOrderForPurchase() throws org.apache.thrift.TException
332
    {
330
    {
333
      getPrice_result result = new getPrice_result();
331
      getPurchaseOrderForPurchase_result result = new getPurchaseOrderForPurchase_result();
334
      receiveBase(result, "getPrice");
332
      receiveBase(result, "getPurchaseOrderForPurchase");
335
      if (result.isSetSuccess()) {
333
      if (result.isSetSuccess()) {
336
        return result.success;
334
        return result.success;
337
      }
335
      }
338
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getPrice failed: unknown result");
336
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getPurchaseOrderForPurchase failed: unknown result");
339
    }
337
    }
340
 
338
 
341
  }
339
  }
342
  public static class AsyncClient extends in.shop2020.generic.GenericService.AsyncClient implements AsyncIface {
340
  public static class AsyncClient extends in.shop2020.generic.GenericService.AsyncClient implements AsyncIface {
343
    public static class Factory implements org.apache.thrift.async.TAsyncClientFactory<AsyncClient> {
341
    public static class Factory implements org.apache.thrift.async.TAsyncClientFactory<AsyncClient> {
Line 587... Line 585...
587
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
585
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
588
        return (new Client(prot)).recv_getAllPurchases();
586
        return (new Client(prot)).recv_getAllPurchases();
589
      }
587
      }
590
    }
588
    }
591
 
589
 
592
    public void getPrice(long purchaseId, long itemId, org.apache.thrift.async.AsyncMethodCallback<getPrice_call> resultHandler) throws org.apache.thrift.TException {
590
    public void getPurchaseOrderForPurchase(long purchaseId, org.apache.thrift.async.AsyncMethodCallback<getPurchaseOrderForPurchase_call> resultHandler) throws org.apache.thrift.TException {
593
      checkReady();
591
      checkReady();
594
      getPrice_call method_call = new getPrice_call(purchaseId, itemId, resultHandler, this, ___protocolFactory, ___transport);
592
      getPurchaseOrderForPurchase_call method_call = new getPurchaseOrderForPurchase_call(purchaseId, resultHandler, this, ___protocolFactory, ___transport);
595
      this.___currentMethod = method_call;
593
      this.___currentMethod = method_call;
596
      ___manager.call(method_call);
594
      ___manager.call(method_call);
597
    }
595
    }
598
 
596
 
599
    public static class getPrice_call extends org.apache.thrift.async.TAsyncMethodCall {
597
    public static class getPurchaseOrderForPurchase_call extends org.apache.thrift.async.TAsyncMethodCall {
600
      private long purchaseId;
598
      private long purchaseId;
601
      private long itemId;
-
 
602
      public getPrice_call(long purchaseId, long itemId, org.apache.thrift.async.AsyncMethodCallback<getPrice_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
599
      public getPurchaseOrderForPurchase_call(long purchaseId, org.apache.thrift.async.AsyncMethodCallback<getPurchaseOrderForPurchase_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
603
        super(client, protocolFactory, transport, resultHandler, false);
600
        super(client, protocolFactory, transport, resultHandler, false);
604
        this.purchaseId = purchaseId;
601
        this.purchaseId = purchaseId;
605
        this.itemId = itemId;
-
 
606
      }
602
      }
607
 
603
 
608
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
604
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
609
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getPrice", org.apache.thrift.protocol.TMessageType.CALL, 0));
605
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getPurchaseOrderForPurchase", org.apache.thrift.protocol.TMessageType.CALL, 0));
610
        getPrice_args args = new getPrice_args();
606
        getPurchaseOrderForPurchase_args args = new getPurchaseOrderForPurchase_args();
611
        args.setPurchaseId(purchaseId);
607
        args.setPurchaseId(purchaseId);
612
        args.setItemId(itemId);
-
 
613
        args.write(prot);
608
        args.write(prot);
614
        prot.writeMessageEnd();
609
        prot.writeMessageEnd();
615
      }
610
      }
616
 
611
 
617
      public long getResult() throws org.apache.thrift.TException {
612
      public PurchaseOrder getResult() throws org.apache.thrift.TException {
618
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
613
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
619
          throw new IllegalStateException("Method call not finished!");
614
          throw new IllegalStateException("Method call not finished!");
620
        }
615
        }
621
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
616
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
622
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
617
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
623
        return (new Client(prot)).recv_getPrice();
618
        return (new Client(prot)).recv_getPurchaseOrderForPurchase();
624
      }
619
      }
625
    }
620
    }
626
 
621
 
627
  }
622
  }
628
 
623
 
Line 642... Line 637...
642
      processMap.put("getAllPurchaseOrders", new getAllPurchaseOrders());
637
      processMap.put("getAllPurchaseOrders", new getAllPurchaseOrders());
643
      processMap.put("getSupplier", new getSupplier());
638
      processMap.put("getSupplier", new getSupplier());
644
      processMap.put("startPurchase", new startPurchase());
639
      processMap.put("startPurchase", new startPurchase());
645
      processMap.put("closePurchase", new closePurchase());
640
      processMap.put("closePurchase", new closePurchase());
646
      processMap.put("getAllPurchases", new getAllPurchases());
641
      processMap.put("getAllPurchases", new getAllPurchases());
647
      processMap.put("getPrice", new getPrice());
642
      processMap.put("getPurchaseOrderForPurchase", new getPurchaseOrderForPurchase());
648
      return processMap;
643
      return processMap;
649
    }
644
    }
650
 
645
 
651
    private static class createPurchaseOrder<I extends Iface> extends org.apache.thrift.ProcessFunction<I, createPurchaseOrder_args> {
646
    private static class createPurchaseOrder<I extends Iface> extends org.apache.thrift.ProcessFunction<I, createPurchaseOrder_args> {
652
      public createPurchaseOrder() {
647
      public createPurchaseOrder() {
Line 789... Line 784...
789
        }
784
        }
790
        return result;
785
        return result;
791
      }
786
      }
792
    }
787
    }
793
 
788
 
794
    private static class getPrice<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getPrice_args> {
789
    private static class getPurchaseOrderForPurchase<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getPurchaseOrderForPurchase_args> {
795
      public getPrice() {
790
      public getPurchaseOrderForPurchase() {
796
        super("getPrice");
791
        super("getPurchaseOrderForPurchase");
797
      }
792
      }
798
 
793
 
799
      protected getPrice_args getEmptyArgsInstance() {
794
      protected getPurchaseOrderForPurchase_args getEmptyArgsInstance() {
800
        return new getPrice_args();
795
        return new getPurchaseOrderForPurchase_args();
801
      }
796
      }
802
 
797
 
803
      protected getPrice_result getResult(I iface, getPrice_args args) throws org.apache.thrift.TException {
798
      protected getPurchaseOrderForPurchase_result getResult(I iface, getPurchaseOrderForPurchase_args args) throws org.apache.thrift.TException {
804
        getPrice_result result = new getPrice_result();
799
        getPurchaseOrderForPurchase_result result = new getPurchaseOrderForPurchase_result();
805
        result.success = iface.getPrice(args.purchaseId, args.itemId);
800
        result.success = iface.getPurchaseOrderForPurchase(args.purchaseId);
806
        result.setSuccessIsSet(true);
-
 
807
        return result;
801
        return result;
808
      }
802
      }
809
    }
803
    }
810
 
804
 
811
  }
805
  }
Line 5870... Line 5864...
5870
      }
5864
      }
5871
    }
5865
    }
5872
 
5866
 
5873
  }
5867
  }
5874
 
5868
 
5875
  public static class getPrice_args implements org.apache.thrift.TBase<getPrice_args, getPrice_args._Fields>, java.io.Serializable, Cloneable   {
5869
  public static class getPurchaseOrderForPurchase_args implements org.apache.thrift.TBase<getPurchaseOrderForPurchase_args, getPurchaseOrderForPurchase_args._Fields>, java.io.Serializable, Cloneable   {
5876
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getPrice_args");
5870
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getPurchaseOrderForPurchase_args");
5877
 
5871
 
5878
    private static final org.apache.thrift.protocol.TField PURCHASE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("purchaseId", org.apache.thrift.protocol.TType.I64, (short)1);
5872
    private static final org.apache.thrift.protocol.TField PURCHASE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("purchaseId", org.apache.thrift.protocol.TType.I64, (short)1);
5879
    private static final org.apache.thrift.protocol.TField ITEM_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("itemId", org.apache.thrift.protocol.TType.I64, (short)2);
-
 
5880
 
5873
 
5881
    private long purchaseId; // required
5874
    private long purchaseId; // required
5882
    private long itemId; // required
-
 
5883
 
5875
 
5884
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
5876
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
5885
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
5877
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
5886
      PURCHASE_ID((short)1, "purchaseId"),
5878
      PURCHASE_ID((short)1, "purchaseId");
5887
      ITEM_ID((short)2, "itemId");
-
 
5888
 
5879
 
5889
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
5880
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
5890
 
5881
 
5891
      static {
5882
      static {
5892
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
5883
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
Line 5899... Line 5890...
5899
       */
5890
       */
5900
      public static _Fields findByThriftId(int fieldId) {
5891
      public static _Fields findByThriftId(int fieldId) {
5901
        switch(fieldId) {
5892
        switch(fieldId) {
5902
          case 1: // PURCHASE_ID
5893
          case 1: // PURCHASE_ID
5903
            return PURCHASE_ID;
5894
            return PURCHASE_ID;
5904
          case 2: // ITEM_ID
-
 
5905
            return ITEM_ID;
-
 
5906
          default:
5895
          default:
5907
            return null;
5896
            return null;
5908
        }
5897
        }
5909
      }
5898
      }
5910
 
5899
 
Line 5942... Line 5931...
5942
      }
5931
      }
5943
    }
5932
    }
5944
 
5933
 
5945
    // isset id assignments
5934
    // isset id assignments
5946
    private static final int __PURCHASEID_ISSET_ID = 0;
5935
    private static final int __PURCHASEID_ISSET_ID = 0;
5947
    private static final int __ITEMID_ISSET_ID = 1;
-
 
5948
    private BitSet __isset_bit_vector = new BitSet(2);
5936
    private BitSet __isset_bit_vector = new BitSet(1);
5949
 
5937
 
5950
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
5938
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
5951
    static {
5939
    static {
5952
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
5940
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
5953
      tmpMap.put(_Fields.PURCHASE_ID, new org.apache.thrift.meta_data.FieldMetaData("purchaseId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
5941
      tmpMap.put(_Fields.PURCHASE_ID, new org.apache.thrift.meta_data.FieldMetaData("purchaseId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
5954
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
5942
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
5955
      tmpMap.put(_Fields.ITEM_ID, new org.apache.thrift.meta_data.FieldMetaData("itemId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
-
 
5956
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
-
 
5957
      metaDataMap = Collections.unmodifiableMap(tmpMap);
5943
      metaDataMap = Collections.unmodifiableMap(tmpMap);
5958
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPrice_args.class, metaDataMap);
5944
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPurchaseOrderForPurchase_args.class, metaDataMap);
5959
    }
5945
    }
5960
 
5946
 
5961
    public getPrice_args() {
5947
    public getPurchaseOrderForPurchase_args() {
5962
    }
5948
    }
5963
 
5949
 
5964
    public getPrice_args(
5950
    public getPurchaseOrderForPurchase_args(
5965
      long purchaseId,
5951
      long purchaseId)
5966
      long itemId)
-
 
5967
    {
5952
    {
5968
      this();
5953
      this();
5969
      this.purchaseId = purchaseId;
5954
      this.purchaseId = purchaseId;
5970
      setPurchaseIdIsSet(true);
5955
      setPurchaseIdIsSet(true);
5971
      this.itemId = itemId;
-
 
5972
      setItemIdIsSet(true);
-
 
5973
    }
5956
    }
5974
 
5957
 
5975
    /**
5958
    /**
5976
     * Performs a deep copy on <i>other</i>.
5959
     * Performs a deep copy on <i>other</i>.
5977
     */
5960
     */
5978
    public getPrice_args(getPrice_args other) {
5961
    public getPurchaseOrderForPurchase_args(getPurchaseOrderForPurchase_args other) {
5979
      __isset_bit_vector.clear();
5962
      __isset_bit_vector.clear();
5980
      __isset_bit_vector.or(other.__isset_bit_vector);
5963
      __isset_bit_vector.or(other.__isset_bit_vector);
5981
      this.purchaseId = other.purchaseId;
5964
      this.purchaseId = other.purchaseId;
5982
      this.itemId = other.itemId;
-
 
5983
    }
5965
    }
5984
 
5966
 
5985
    public getPrice_args deepCopy() {
5967
    public getPurchaseOrderForPurchase_args deepCopy() {
5986
      return new getPrice_args(this);
5968
      return new getPurchaseOrderForPurchase_args(this);
5987
    }
5969
    }
5988
 
5970
 
5989
    @Override
5971
    @Override
5990
    public void clear() {
5972
    public void clear() {
5991
      setPurchaseIdIsSet(false);
5973
      setPurchaseIdIsSet(false);
5992
      this.purchaseId = 0;
5974
      this.purchaseId = 0;
5993
      setItemIdIsSet(false);
-
 
5994
      this.itemId = 0;
-
 
5995
    }
5975
    }
5996
 
5976
 
5997
    public long getPurchaseId() {
5977
    public long getPurchaseId() {
5998
      return this.purchaseId;
5978
      return this.purchaseId;
5999
    }
5979
    }
Line 6014... Line 5994...
6014
 
5994
 
6015
    public void setPurchaseIdIsSet(boolean value) {
5995
    public void setPurchaseIdIsSet(boolean value) {
6016
      __isset_bit_vector.set(__PURCHASEID_ISSET_ID, value);
5996
      __isset_bit_vector.set(__PURCHASEID_ISSET_ID, value);
6017
    }
5997
    }
6018
 
5998
 
6019
    public long getItemId() {
-
 
6020
      return this.itemId;
-
 
6021
    }
-
 
6022
 
-
 
6023
    public void setItemId(long itemId) {
-
 
6024
      this.itemId = itemId;
-
 
6025
      setItemIdIsSet(true);
-
 
6026
    }
-
 
6027
 
-
 
6028
    public void unsetItemId() {
-
 
6029
      __isset_bit_vector.clear(__ITEMID_ISSET_ID);
-
 
6030
    }
-
 
6031
 
-
 
6032
    /** Returns true if field itemId is set (has been assigned a value) and false otherwise */
-
 
6033
    public boolean isSetItemId() {
-
 
6034
      return __isset_bit_vector.get(__ITEMID_ISSET_ID);
-
 
6035
    }
-
 
6036
 
-
 
6037
    public void setItemIdIsSet(boolean value) {
-
 
6038
      __isset_bit_vector.set(__ITEMID_ISSET_ID, value);
-
 
6039
    }
-
 
6040
 
-
 
6041
    public void setFieldValue(_Fields field, Object value) {
5999
    public void setFieldValue(_Fields field, Object value) {
6042
      switch (field) {
6000
      switch (field) {
6043
      case PURCHASE_ID:
6001
      case PURCHASE_ID:
6044
        if (value == null) {
6002
        if (value == null) {
6045
          unsetPurchaseId();
6003
          unsetPurchaseId();
6046
        } else {
6004
        } else {
6047
          setPurchaseId((Long)value);
6005
          setPurchaseId((Long)value);
6048
        }
6006
        }
6049
        break;
6007
        break;
6050
 
6008
 
6051
      case ITEM_ID:
-
 
6052
        if (value == null) {
-
 
6053
          unsetItemId();
-
 
6054
        } else {
-
 
6055
          setItemId((Long)value);
-
 
6056
        }
-
 
6057
        break;
-
 
6058
 
-
 
6059
      }
6009
      }
6060
    }
6010
    }
6061
 
6011
 
6062
    public Object getFieldValue(_Fields field) {
6012
    public Object getFieldValue(_Fields field) {
6063
      switch (field) {
6013
      switch (field) {
6064
      case PURCHASE_ID:
6014
      case PURCHASE_ID:
6065
        return Long.valueOf(getPurchaseId());
6015
        return Long.valueOf(getPurchaseId());
6066
 
6016
 
6067
      case ITEM_ID:
-
 
6068
        return Long.valueOf(getItemId());
-
 
6069
 
-
 
6070
      }
6017
      }
6071
      throw new IllegalStateException();
6018
      throw new IllegalStateException();
6072
    }
6019
    }
6073
 
6020
 
6074
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
6021
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
Line 6078... Line 6025...
6078
      }
6025
      }
6079
 
6026
 
6080
      switch (field) {
6027
      switch (field) {
6081
      case PURCHASE_ID:
6028
      case PURCHASE_ID:
6082
        return isSetPurchaseId();
6029
        return isSetPurchaseId();
6083
      case ITEM_ID:
-
 
6084
        return isSetItemId();
-
 
6085
      }
6030
      }
6086
      throw new IllegalStateException();
6031
      throw new IllegalStateException();
6087
    }
6032
    }
6088
 
6033
 
6089
    @Override
6034
    @Override
6090
    public boolean equals(Object that) {
6035
    public boolean equals(Object that) {
6091
      if (that == null)
6036
      if (that == null)
6092
        return false;
6037
        return false;
6093
      if (that instanceof getPrice_args)
6038
      if (that instanceof getPurchaseOrderForPurchase_args)
6094
        return this.equals((getPrice_args)that);
6039
        return this.equals((getPurchaseOrderForPurchase_args)that);
6095
      return false;
6040
      return false;
6096
    }
6041
    }
6097
 
6042
 
6098
    public boolean equals(getPrice_args that) {
6043
    public boolean equals(getPurchaseOrderForPurchase_args that) {
6099
      if (that == null)
6044
      if (that == null)
6100
        return false;
6045
        return false;
6101
 
6046
 
6102
      boolean this_present_purchaseId = true;
6047
      boolean this_present_purchaseId = true;
6103
      boolean that_present_purchaseId = true;
6048
      boolean that_present_purchaseId = true;
Line 6106... Line 6051...
6106
          return false;
6051
          return false;
6107
        if (this.purchaseId != that.purchaseId)
6052
        if (this.purchaseId != that.purchaseId)
6108
          return false;
6053
          return false;
6109
      }
6054
      }
6110
 
6055
 
6111
      boolean this_present_itemId = true;
-
 
6112
      boolean that_present_itemId = true;
-
 
6113
      if (this_present_itemId || that_present_itemId) {
-
 
6114
        if (!(this_present_itemId && that_present_itemId))
-
 
6115
          return false;
-
 
6116
        if (this.itemId != that.itemId)
-
 
6117
          return false;
-
 
6118
      }
-
 
6119
 
-
 
6120
      return true;
6056
      return true;
6121
    }
6057
    }
6122
 
6058
 
6123
    @Override
6059
    @Override
6124
    public int hashCode() {
6060
    public int hashCode() {
6125
      return 0;
6061
      return 0;
6126
    }
6062
    }
6127
 
6063
 
6128
    public int compareTo(getPrice_args other) {
6064
    public int compareTo(getPurchaseOrderForPurchase_args other) {
6129
      if (!getClass().equals(other.getClass())) {
6065
      if (!getClass().equals(other.getClass())) {
6130
        return getClass().getName().compareTo(other.getClass().getName());
6066
        return getClass().getName().compareTo(other.getClass().getName());
6131
      }
6067
      }
6132
 
6068
 
6133
      int lastComparison = 0;
6069
      int lastComparison = 0;
6134
      getPrice_args typedOther = (getPrice_args)other;
6070
      getPurchaseOrderForPurchase_args typedOther = (getPurchaseOrderForPurchase_args)other;
6135
 
6071
 
6136
      lastComparison = Boolean.valueOf(isSetPurchaseId()).compareTo(typedOther.isSetPurchaseId());
6072
      lastComparison = Boolean.valueOf(isSetPurchaseId()).compareTo(typedOther.isSetPurchaseId());
6137
      if (lastComparison != 0) {
6073
      if (lastComparison != 0) {
6138
        return lastComparison;
6074
        return lastComparison;
6139
      }
6075
      }
Line 6141... Line 6077...
6141
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.purchaseId, typedOther.purchaseId);
6077
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.purchaseId, typedOther.purchaseId);
6142
        if (lastComparison != 0) {
6078
        if (lastComparison != 0) {
6143
          return lastComparison;
6079
          return lastComparison;
6144
        }
6080
        }
6145
      }
6081
      }
6146
      lastComparison = Boolean.valueOf(isSetItemId()).compareTo(typedOther.isSetItemId());
-
 
6147
      if (lastComparison != 0) {
-
 
6148
        return lastComparison;
-
 
6149
      }
-
 
6150
      if (isSetItemId()) {
-
 
6151
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.itemId, typedOther.itemId);
-
 
6152
        if (lastComparison != 0) {
-
 
6153
          return lastComparison;
-
 
6154
        }
-
 
6155
      }
-
 
6156
      return 0;
6082
      return 0;
6157
    }
6083
    }
6158
 
6084
 
6159
    public _Fields fieldForId(int fieldId) {
6085
    public _Fields fieldForId(int fieldId) {
6160
      return _Fields.findByThriftId(fieldId);
6086
      return _Fields.findByThriftId(fieldId);
Line 6176... Line 6102...
6176
              setPurchaseIdIsSet(true);
6102
              setPurchaseIdIsSet(true);
6177
            } else { 
6103
            } else { 
6178
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6104
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6179
            }
6105
            }
6180
            break;
6106
            break;
6181
          case 2: // ITEM_ID
-
 
6182
            if (field.type == org.apache.thrift.protocol.TType.I64) {
-
 
6183
              this.itemId = iprot.readI64();
-
 
6184
              setItemIdIsSet(true);
-
 
6185
            } else { 
-
 
6186
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
-
 
6187
            }
-
 
6188
            break;
-
 
6189
          default:
6107
          default:
6190
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6108
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6191
        }
6109
        }
6192
        iprot.readFieldEnd();
6110
        iprot.readFieldEnd();
6193
      }
6111
      }
Line 6200... Line 6118...
6200
 
6118
 
6201
      oprot.writeStructBegin(STRUCT_DESC);
6119
      oprot.writeStructBegin(STRUCT_DESC);
6202
      oprot.writeFieldBegin(PURCHASE_ID_FIELD_DESC);
6120
      oprot.writeFieldBegin(PURCHASE_ID_FIELD_DESC);
6203
      oprot.writeI64(this.purchaseId);
6121
      oprot.writeI64(this.purchaseId);
6204
      oprot.writeFieldEnd();
6122
      oprot.writeFieldEnd();
6205
      oprot.writeFieldBegin(ITEM_ID_FIELD_DESC);
-
 
6206
      oprot.writeI64(this.itemId);
-
 
6207
      oprot.writeFieldEnd();
-
 
6208
      oprot.writeFieldStop();
6123
      oprot.writeFieldStop();
6209
      oprot.writeStructEnd();
6124
      oprot.writeStructEnd();
6210
    }
6125
    }
6211
 
6126
 
6212
    @Override
6127
    @Override
6213
    public String toString() {
6128
    public String toString() {
6214
      StringBuilder sb = new StringBuilder("getPrice_args(");
6129
      StringBuilder sb = new StringBuilder("getPurchaseOrderForPurchase_args(");
6215
      boolean first = true;
6130
      boolean first = true;
6216
 
6131
 
6217
      sb.append("purchaseId:");
6132
      sb.append("purchaseId:");
6218
      sb.append(this.purchaseId);
6133
      sb.append(this.purchaseId);
6219
      first = false;
6134
      first = false;
6220
      if (!first) sb.append(", ");
-
 
6221
      sb.append("itemId:");
-
 
6222
      sb.append(this.itemId);
-
 
6223
      first = false;
-
 
6224
      sb.append(")");
6135
      sb.append(")");
6225
      return sb.toString();
6136
      return sb.toString();
6226
    }
6137
    }
6227
 
6138
 
6228
    public void validate() throws org.apache.thrift.TException {
6139
    public void validate() throws org.apache.thrift.TException {
Line 6237... Line 6148...
6237
      }
6148
      }
6238
    }
6149
    }
6239
 
6150
 
6240
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
6151
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
6241
      try {
6152
      try {
-
 
6153
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
-
 
6154
        __isset_bit_vector = new BitSet(1);
6242
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
6155
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
6243
      } catch (org.apache.thrift.TException te) {
6156
      } catch (org.apache.thrift.TException te) {
6244
        throw new java.io.IOException(te);
6157
        throw new java.io.IOException(te);
6245
      }
6158
      }
6246
    }
6159
    }
6247
 
6160
 
6248
  }
6161
  }
6249
 
6162
 
6250
  public static class getPrice_result implements org.apache.thrift.TBase<getPrice_result, getPrice_result._Fields>, java.io.Serializable, Cloneable   {
6163
  public static class getPurchaseOrderForPurchase_result implements org.apache.thrift.TBase<getPurchaseOrderForPurchase_result, getPurchaseOrderForPurchase_result._Fields>, java.io.Serializable, Cloneable   {
6251
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getPrice_result");
6164
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getPurchaseOrderForPurchase_result");
6252
 
6165
 
6253
    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I64, (short)0);
6166
    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0);
6254
 
6167
 
6255
    private long success; // required
6168
    private PurchaseOrder success; // required
6256
 
6169
 
6257
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
6170
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
6258
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
6171
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
6259
      SUCCESS((short)0, "success");
6172
      SUCCESS((short)0, "success");
6260
 
6173
 
Line 6311... Line 6224...
6311
        return _fieldName;
6224
        return _fieldName;
6312
      }
6225
      }
6313
    }
6226
    }
6314
 
6227
 
6315
    // isset id assignments
6228
    // isset id assignments
6316
    private static final int __SUCCESS_ISSET_ID = 0;
-
 
6317
    private BitSet __isset_bit_vector = new BitSet(1);
-
 
6318
 
6229
 
6319
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
6230
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
6320
    static {
6231
    static {
6321
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
6232
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
6322
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
6233
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
6323
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
6234
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, PurchaseOrder.class)));
6324
      metaDataMap = Collections.unmodifiableMap(tmpMap);
6235
      metaDataMap = Collections.unmodifiableMap(tmpMap);
6325
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPrice_result.class, metaDataMap);
6236
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPurchaseOrderForPurchase_result.class, metaDataMap);
6326
    }
6237
    }
6327
 
6238
 
6328
    public getPrice_result() {
6239
    public getPurchaseOrderForPurchase_result() {
6329
    }
6240
    }
6330
 
6241
 
6331
    public getPrice_result(
6242
    public getPurchaseOrderForPurchase_result(
6332
      long success)
6243
      PurchaseOrder success)
6333
    {
6244
    {
6334
      this();
6245
      this();
6335
      this.success = success;
6246
      this.success = success;
6336
      setSuccessIsSet(true);
-
 
6337
    }
6247
    }
6338
 
6248
 
6339
    /**
6249
    /**
6340
     * Performs a deep copy on <i>other</i>.
6250
     * Performs a deep copy on <i>other</i>.
6341
     */
6251
     */
6342
    public getPrice_result(getPrice_result other) {
6252
    public getPurchaseOrderForPurchase_result(getPurchaseOrderForPurchase_result other) {
6343
      __isset_bit_vector.clear();
6253
      if (other.isSetSuccess()) {
6344
      __isset_bit_vector.or(other.__isset_bit_vector);
6254
        this.success = new PurchaseOrder(other.success);
6345
      this.success = other.success;
6255
      }
6346
    }
6256
    }
6347
 
6257
 
6348
    public getPrice_result deepCopy() {
6258
    public getPurchaseOrderForPurchase_result deepCopy() {
6349
      return new getPrice_result(this);
6259
      return new getPurchaseOrderForPurchase_result(this);
6350
    }
6260
    }
6351
 
6261
 
6352
    @Override
6262
    @Override
6353
    public void clear() {
6263
    public void clear() {
6354
      setSuccessIsSet(false);
-
 
6355
      this.success = 0;
6264
      this.success = null;
6356
    }
6265
    }
6357
 
6266
 
6358
    public long getSuccess() {
6267
    public PurchaseOrder getSuccess() {
6359
      return this.success;
6268
      return this.success;
6360
    }
6269
    }
6361
 
6270
 
6362
    public void setSuccess(long success) {
6271
    public void setSuccess(PurchaseOrder success) {
6363
      this.success = success;
6272
      this.success = success;
6364
      setSuccessIsSet(true);
-
 
6365
    }
6273
    }
6366
 
6274
 
6367
    public void unsetSuccess() {
6275
    public void unsetSuccess() {
6368
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
6276
      this.success = null;
6369
    }
6277
    }
6370
 
6278
 
6371
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
6279
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
6372
    public boolean isSetSuccess() {
6280
    public boolean isSetSuccess() {
6373
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
6281
      return this.success != null;
6374
    }
6282
    }
6375
 
6283
 
6376
    public void setSuccessIsSet(boolean value) {
6284
    public void setSuccessIsSet(boolean value) {
-
 
6285
      if (!value) {
6377
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
6286
        this.success = null;
-
 
6287
      }
6378
    }
6288
    }
6379
 
6289
 
6380
    public void setFieldValue(_Fields field, Object value) {
6290
    public void setFieldValue(_Fields field, Object value) {
6381
      switch (field) {
6291
      switch (field) {
6382
      case SUCCESS:
6292
      case SUCCESS:
6383
        if (value == null) {
6293
        if (value == null) {
6384
          unsetSuccess();
6294
          unsetSuccess();
6385
        } else {
6295
        } else {
6386
          setSuccess((Long)value);
6296
          setSuccess((PurchaseOrder)value);
6387
        }
6297
        }
6388
        break;
6298
        break;
6389
 
6299
 
6390
      }
6300
      }
6391
    }
6301
    }
6392
 
6302
 
6393
    public Object getFieldValue(_Fields field) {
6303
    public Object getFieldValue(_Fields field) {
6394
      switch (field) {
6304
      switch (field) {
6395
      case SUCCESS:
6305
      case SUCCESS:
6396
        return Long.valueOf(getSuccess());
6306
        return getSuccess();
6397
 
6307
 
6398
      }
6308
      }
6399
      throw new IllegalStateException();
6309
      throw new IllegalStateException();
6400
    }
6310
    }
6401
 
6311
 
Line 6414... Line 6324...
6414
 
6324
 
6415
    @Override
6325
    @Override
6416
    public boolean equals(Object that) {
6326
    public boolean equals(Object that) {
6417
      if (that == null)
6327
      if (that == null)
6418
        return false;
6328
        return false;
6419
      if (that instanceof getPrice_result)
6329
      if (that instanceof getPurchaseOrderForPurchase_result)
6420
        return this.equals((getPrice_result)that);
6330
        return this.equals((getPurchaseOrderForPurchase_result)that);
6421
      return false;
6331
      return false;
6422
    }
6332
    }
6423
 
6333
 
6424
    public boolean equals(getPrice_result that) {
6334
    public boolean equals(getPurchaseOrderForPurchase_result that) {
6425
      if (that == null)
6335
      if (that == null)
6426
        return false;
6336
        return false;
6427
 
6337
 
6428
      boolean this_present_success = true;
6338
      boolean this_present_success = true && this.isSetSuccess();
6429
      boolean that_present_success = true;
6339
      boolean that_present_success = true && that.isSetSuccess();
6430
      if (this_present_success || that_present_success) {
6340
      if (this_present_success || that_present_success) {
6431
        if (!(this_present_success && that_present_success))
6341
        if (!(this_present_success && that_present_success))
6432
          return false;
6342
          return false;
6433
        if (this.success != that.success)
6343
        if (!this.success.equals(that.success))
6434
          return false;
6344
          return false;
6435
      }
6345
      }
6436
 
6346
 
6437
      return true;
6347
      return true;
6438
    }
6348
    }
Line 6440... Line 6350...
6440
    @Override
6350
    @Override
6441
    public int hashCode() {
6351
    public int hashCode() {
6442
      return 0;
6352
      return 0;
6443
    }
6353
    }
6444
 
6354
 
6445
    public int compareTo(getPrice_result other) {
6355
    public int compareTo(getPurchaseOrderForPurchase_result other) {
6446
      if (!getClass().equals(other.getClass())) {
6356
      if (!getClass().equals(other.getClass())) {
6447
        return getClass().getName().compareTo(other.getClass().getName());
6357
        return getClass().getName().compareTo(other.getClass().getName());
6448
      }
6358
      }
6449
 
6359
 
6450
      int lastComparison = 0;
6360
      int lastComparison = 0;
6451
      getPrice_result typedOther = (getPrice_result)other;
6361
      getPurchaseOrderForPurchase_result typedOther = (getPurchaseOrderForPurchase_result)other;
6452
 
6362
 
6453
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
6363
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
6454
      if (lastComparison != 0) {
6364
      if (lastComparison != 0) {
6455
        return lastComparison;
6365
        return lastComparison;
6456
      }
6366
      }
Line 6476... Line 6386...
6476
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
6386
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
6477
          break;
6387
          break;
6478
        }
6388
        }
6479
        switch (field.id) {
6389
        switch (field.id) {
6480
          case 0: // SUCCESS
6390
          case 0: // SUCCESS
6481
            if (field.type == org.apache.thrift.protocol.TType.I64) {
6391
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
6482
              this.success = iprot.readI64();
6392
              this.success = new PurchaseOrder();
6483
              setSuccessIsSet(true);
6393
              this.success.read(iprot);
6484
            } else { 
6394
            } else { 
6485
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6395
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6486
            }
6396
            }
6487
            break;
6397
            break;
6488
          default:
6398
          default:
Line 6497... Line 6407...
6497
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
6407
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
6498
      oprot.writeStructBegin(STRUCT_DESC);
6408
      oprot.writeStructBegin(STRUCT_DESC);
6499
 
6409
 
6500
      if (this.isSetSuccess()) {
6410
      if (this.isSetSuccess()) {
6501
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
6411
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
6502
        oprot.writeI64(this.success);
6412
        this.success.write(oprot);
6503
        oprot.writeFieldEnd();
6413
        oprot.writeFieldEnd();
6504
      }
6414
      }
6505
      oprot.writeFieldStop();
6415
      oprot.writeFieldStop();
6506
      oprot.writeStructEnd();
6416
      oprot.writeStructEnd();
6507
    }
6417
    }
6508
 
6418
 
6509
    @Override
6419
    @Override
6510
    public String toString() {
6420
    public String toString() {
6511
      StringBuilder sb = new StringBuilder("getPrice_result(");
6421
      StringBuilder sb = new StringBuilder("getPurchaseOrderForPurchase_result(");
6512
      boolean first = true;
6422
      boolean first = true;
6513
 
6423
 
6514
      sb.append("success:");
6424
      sb.append("success:");
-
 
6425
      if (this.success == null) {
-
 
6426
        sb.append("null");
-
 
6427
      } else {
6515
      sb.append(this.success);
6428
        sb.append(this.success);
-
 
6429
      }
6516
      first = false;
6430
      first = false;
6517
      sb.append(")");
6431
      sb.append(")");
6518
      return sb.toString();
6432
      return sb.toString();
6519
    }
6433
    }
6520
 
6434