Subversion Repositories SmartDukaan

Rev

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

Rev 3555 Rev 4189
Line 58... Line 58...
58
     * 
58
     * 
59
     * @param ruleName
59
     * @param ruleName
60
     */
60
     */
61
    public String getRuleDocString(String ruleName) throws org.apache.thrift.TException;
61
    public String getRuleDocString(String ruleName) throws org.apache.thrift.TException;
62
 
62
 
-
 
63
    public List<ItemCouponDiscount> getItemDiscountMap(List<Long> itemIds) throws PromotionException, org.apache.thrift.TException;
-
 
64
 
63
  }
65
  }
64
 
66
 
65
  public interface AsyncIface extends in.shop2020.generic.GenericService .AsyncIface {
67
  public interface AsyncIface extends in.shop2020.generic.GenericService .AsyncIface {
66
 
68
 
67
    public void createPromotion(String name, String ruleExecutionSrc, long startOn, long endOn, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.createPromotion_call> resultHandler) throws org.apache.thrift.TException;
69
    public void createPromotion(String name, String ruleExecutionSrc, long startOn, long endOn, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.createPromotion_call> resultHandler) throws org.apache.thrift.TException;
Line 82... Line 84...
82
 
84
 
83
    public void getSuccessfulPaymentCountForCoupon(String couponCode, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getSuccessfulPaymentCountForCoupon_call> resultHandler) throws org.apache.thrift.TException;
85
    public void getSuccessfulPaymentCountForCoupon(String couponCode, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getSuccessfulPaymentCountForCoupon_call> resultHandler) throws org.apache.thrift.TException;
84
 
86
 
85
    public void getRuleDocString(String ruleName, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getRuleDocString_call> resultHandler) throws org.apache.thrift.TException;
87
    public void getRuleDocString(String ruleName, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getRuleDocString_call> resultHandler) throws org.apache.thrift.TException;
86
 
88
 
-
 
89
    public void getItemDiscountMap(List<Long> itemIds, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getItemDiscountMap_call> resultHandler) throws org.apache.thrift.TException;
-
 
90
 
87
  }
91
  }
88
 
92
 
89
  public static class Client extends in.shop2020.generic.GenericService.Client implements Iface {
93
  public static class Client extends in.shop2020.generic.GenericService.Client implements Iface {
90
    public static class Factory implements org.apache.thrift.TServiceClientFactory<Client> {
94
    public static class Factory implements org.apache.thrift.TServiceClientFactory<Client> {
91
      public Factory() {}
95
      public Factory() {}
Line 358... Line 362...
358
        return result.success;
362
        return result.success;
359
      }
363
      }
360
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getRuleDocString failed: unknown result");
364
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getRuleDocString failed: unknown result");
361
    }
365
    }
362
 
366
 
-
 
367
    public List<ItemCouponDiscount> getItemDiscountMap(List<Long> itemIds) throws PromotionException, org.apache.thrift.TException
-
 
368
    {
-
 
369
      send_getItemDiscountMap(itemIds);
-
 
370
      return recv_getItemDiscountMap();
-
 
371
    }
-
 
372
 
-
 
373
    public void send_getItemDiscountMap(List<Long> itemIds) throws org.apache.thrift.TException
-
 
374
    {
-
 
375
      getItemDiscountMap_args args = new getItemDiscountMap_args();
-
 
376
      args.setItemIds(itemIds);
-
 
377
      sendBase("getItemDiscountMap", args);
-
 
378
    }
-
 
379
 
-
 
380
    public List<ItemCouponDiscount> recv_getItemDiscountMap() throws PromotionException, org.apache.thrift.TException
-
 
381
    {
-
 
382
      getItemDiscountMap_result result = new getItemDiscountMap_result();
-
 
383
      receiveBase(result, "getItemDiscountMap");
-
 
384
      if (result.isSetSuccess()) {
-
 
385
        return result.success;
-
 
386
      }
-
 
387
      if (result.pex != null) {
-
 
388
        throw result.pex;
-
 
389
      }
-
 
390
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getItemDiscountMap failed: unknown result");
-
 
391
    }
-
 
392
 
363
  }
393
  }
364
  public static class AsyncClient extends in.shop2020.generic.GenericService.AsyncClient implements AsyncIface {
394
  public static class AsyncClient extends in.shop2020.generic.GenericService.AsyncClient implements AsyncIface {
365
    public static class Factory implements org.apache.thrift.async.TAsyncClientFactory<AsyncClient> {
395
    public static class Factory implements org.apache.thrift.async.TAsyncClientFactory<AsyncClient> {
366
      private org.apache.thrift.async.TAsyncClientManager clientManager;
396
      private org.apache.thrift.async.TAsyncClientManager clientManager;
367
      private org.apache.thrift.protocol.TProtocolFactory protocolFactory;
397
      private org.apache.thrift.protocol.TProtocolFactory protocolFactory;
Line 714... Line 744...
714
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
744
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
715
        return (new Client(prot)).recv_getRuleDocString();
745
        return (new Client(prot)).recv_getRuleDocString();
716
      }
746
      }
717
    }
747
    }
718
 
748
 
-
 
749
    public void getItemDiscountMap(List<Long> itemIds, org.apache.thrift.async.AsyncMethodCallback<getItemDiscountMap_call> resultHandler) throws org.apache.thrift.TException {
-
 
750
      checkReady();
-
 
751
      getItemDiscountMap_call method_call = new getItemDiscountMap_call(itemIds, resultHandler, this, ___protocolFactory, ___transport);
-
 
752
      this.___currentMethod = method_call;
-
 
753
      ___manager.call(method_call);
-
 
754
    }
-
 
755
 
-
 
756
    public static class getItemDiscountMap_call extends org.apache.thrift.async.TAsyncMethodCall {
-
 
757
      private List<Long> itemIds;
-
 
758
      public getItemDiscountMap_call(List<Long> itemIds, org.apache.thrift.async.AsyncMethodCallback<getItemDiscountMap_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 {
-
 
759
        super(client, protocolFactory, transport, resultHandler, false);
-
 
760
        this.itemIds = itemIds;
-
 
761
      }
-
 
762
 
-
 
763
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
-
 
764
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getItemDiscountMap", org.apache.thrift.protocol.TMessageType.CALL, 0));
-
 
765
        getItemDiscountMap_args args = new getItemDiscountMap_args();
-
 
766
        args.setItemIds(itemIds);
-
 
767
        args.write(prot);
-
 
768
        prot.writeMessageEnd();
-
 
769
      }
-
 
770
 
-
 
771
      public List<ItemCouponDiscount> getResult() throws PromotionException, org.apache.thrift.TException {
-
 
772
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
-
 
773
          throw new IllegalStateException("Method call not finished!");
-
 
774
        }
-
 
775
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
-
 
776
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
-
 
777
        return (new Client(prot)).recv_getItemDiscountMap();
-
 
778
      }
-
 
779
    }
-
 
780
 
719
  }
781
  }
720
 
782
 
721
  public static class Processor<I extends Iface> extends in.shop2020.generic.GenericService.Processor implements org.apache.thrift.TProcessor {
783
  public static class Processor<I extends Iface> extends in.shop2020.generic.GenericService.Processor implements org.apache.thrift.TProcessor {
722
    private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName());
784
    private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName());
723
    public Processor(I iface) {
785
    public Processor(I iface) {
Line 737... Line 799...
737
      processMap.put("trackCouponUsage", new trackCouponUsage());
799
      processMap.put("trackCouponUsage", new trackCouponUsage());
738
      processMap.put("getCouponUsageCountByUser", new getCouponUsageCountByUser());
800
      processMap.put("getCouponUsageCountByUser", new getCouponUsageCountByUser());
739
      processMap.put("getActiveCoupons", new getActiveCoupons());
801
      processMap.put("getActiveCoupons", new getActiveCoupons());
740
      processMap.put("getSuccessfulPaymentCountForCoupon", new getSuccessfulPaymentCountForCoupon());
802
      processMap.put("getSuccessfulPaymentCountForCoupon", new getSuccessfulPaymentCountForCoupon());
741
      processMap.put("getRuleDocString", new getRuleDocString());
803
      processMap.put("getRuleDocString", new getRuleDocString());
-
 
804
      processMap.put("getItemDiscountMap", new getItemDiscountMap());
742
      return processMap;
805
      return processMap;
743
    }
806
    }
744
 
807
 
745
    private static class createPromotion<I extends Iface> extends org.apache.thrift.ProcessFunction<I, createPromotion_args> {
808
    private static class createPromotion<I extends Iface> extends org.apache.thrift.ProcessFunction<I, createPromotion_args> {
746
      public createPromotion() {
809
      public createPromotion() {
Line 938... Line 1001...
938
        result.success = iface.getRuleDocString(args.ruleName);
1001
        result.success = iface.getRuleDocString(args.ruleName);
939
        return result;
1002
        return result;
940
      }
1003
      }
941
    }
1004
    }
942
 
1005
 
-
 
1006
    private static class getItemDiscountMap<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getItemDiscountMap_args> {
-
 
1007
      public getItemDiscountMap() {
-
 
1008
        super("getItemDiscountMap");
-
 
1009
      }
-
 
1010
 
-
 
1011
      protected getItemDiscountMap_args getEmptyArgsInstance() {
-
 
1012
        return new getItemDiscountMap_args();
-
 
1013
      }
-
 
1014
 
-
 
1015
      protected getItemDiscountMap_result getResult(I iface, getItemDiscountMap_args args) throws org.apache.thrift.TException {
-
 
1016
        getItemDiscountMap_result result = new getItemDiscountMap_result();
-
 
1017
        try {
-
 
1018
          result.success = iface.getItemDiscountMap(args.itemIds);
-
 
1019
        } catch (PromotionException pex) {
-
 
1020
          result.pex = pex;
-
 
1021
        }
-
 
1022
        return result;
-
 
1023
      }
-
 
1024
    }
-
 
1025
 
943
  }
1026
  }
944
 
1027
 
945
  public static class createPromotion_args implements org.apache.thrift.TBase<createPromotion_args, createPromotion_args._Fields>, java.io.Serializable, Cloneable   {
1028
  public static class createPromotion_args implements org.apache.thrift.TBase<createPromotion_args, createPromotion_args._Fields>, java.io.Serializable, Cloneable   {
946
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createPromotion_args");
1029
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createPromotion_args");
947
 
1030
 
Line 7902... Line 7985...
7902
      }
7985
      }
7903
      first = false;
7986
      first = false;
7904
      sb.append(")");
7987
      sb.append(")");
7905
      return sb.toString();
7988
      return sb.toString();
7906
    }
7989
    }
-
 
7990
 
-
 
7991
    public void validate() throws org.apache.thrift.TException {
-
 
7992
      // check for required fields
-
 
7993
    }
-
 
7994
 
-
 
7995
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
-
 
7996
      try {
-
 
7997
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
-
 
7998
      } catch (org.apache.thrift.TException te) {
-
 
7999
        throw new java.io.IOException(te);
-
 
8000
      }
-
 
8001
    }
-
 
8002
 
-
 
8003
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
-
 
8004
      try {
-
 
8005
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
-
 
8006
      } catch (org.apache.thrift.TException te) {
-
 
8007
        throw new java.io.IOException(te);
-
 
8008
      }
-
 
8009
    }
-
 
8010
 
-
 
8011
  }
-
 
8012
 
-
 
8013
  public static class getItemDiscountMap_args implements org.apache.thrift.TBase<getItemDiscountMap_args, getItemDiscountMap_args._Fields>, java.io.Serializable, Cloneable   {
-
 
8014
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getItemDiscountMap_args");
-
 
8015
 
-
 
8016
    private static final org.apache.thrift.protocol.TField ITEM_IDS_FIELD_DESC = new org.apache.thrift.protocol.TField("itemIds", org.apache.thrift.protocol.TType.LIST, (short)1);
-
 
8017
 
-
 
8018
    private List<Long> itemIds; // required
-
 
8019
 
-
 
8020
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-
 
8021
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
-
 
8022
      ITEM_IDS((short)1, "itemIds");
-
 
8023
 
-
 
8024
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
-
 
8025
 
-
 
8026
      static {
-
 
8027
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
-
 
8028
          byName.put(field.getFieldName(), field);
-
 
8029
        }
-
 
8030
      }
-
 
8031
 
-
 
8032
      /**
-
 
8033
       * Find the _Fields constant that matches fieldId, or null if its not found.
-
 
8034
       */
-
 
8035
      public static _Fields findByThriftId(int fieldId) {
-
 
8036
        switch(fieldId) {
-
 
8037
          case 1: // ITEM_IDS
-
 
8038
            return ITEM_IDS;
-
 
8039
          default:
-
 
8040
            return null;
-
 
8041
        }
-
 
8042
      }
-
 
8043
 
-
 
8044
      /**
-
 
8045
       * Find the _Fields constant that matches fieldId, throwing an exception
-
 
8046
       * if it is not found.
-
 
8047
       */
-
 
8048
      public static _Fields findByThriftIdOrThrow(int fieldId) {
-
 
8049
        _Fields fields = findByThriftId(fieldId);
-
 
8050
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
-
 
8051
        return fields;
-
 
8052
      }
-
 
8053
 
-
 
8054
      /**
-
 
8055
       * Find the _Fields constant that matches name, or null if its not found.
-
 
8056
       */
-
 
8057
      public static _Fields findByName(String name) {
-
 
8058
        return byName.get(name);
-
 
8059
      }
-
 
8060
 
-
 
8061
      private final short _thriftId;
-
 
8062
      private final String _fieldName;
-
 
8063
 
-
 
8064
      _Fields(short thriftId, String fieldName) {
-
 
8065
        _thriftId = thriftId;
-
 
8066
        _fieldName = fieldName;
-
 
8067
      }
-
 
8068
 
-
 
8069
      public short getThriftFieldId() {
-
 
8070
        return _thriftId;
-
 
8071
      }
-
 
8072
 
-
 
8073
      public String getFieldName() {
-
 
8074
        return _fieldName;
-
 
8075
      }
-
 
8076
    }
-
 
8077
 
-
 
8078
    // isset id assignments
-
 
8079
 
-
 
8080
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
-
 
8081
    static {
-
 
8082
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
-
 
8083
      tmpMap.put(_Fields.ITEM_IDS, new org.apache.thrift.meta_data.FieldMetaData("itemIds", org.apache.thrift.TFieldRequirementType.DEFAULT, 
-
 
8084
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
-
 
8085
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))));
-
 
8086
      metaDataMap = Collections.unmodifiableMap(tmpMap);
-
 
8087
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getItemDiscountMap_args.class, metaDataMap);
-
 
8088
    }
-
 
8089
 
-
 
8090
    public getItemDiscountMap_args() {
-
 
8091
    }
-
 
8092
 
-
 
8093
    public getItemDiscountMap_args(
-
 
8094
      List<Long> itemIds)
-
 
8095
    {
-
 
8096
      this();
-
 
8097
      this.itemIds = itemIds;
-
 
8098
    }
-
 
8099
 
-
 
8100
    /**
-
 
8101
     * Performs a deep copy on <i>other</i>.
-
 
8102
     */
-
 
8103
    public getItemDiscountMap_args(getItemDiscountMap_args other) {
-
 
8104
      if (other.isSetItemIds()) {
-
 
8105
        List<Long> __this__itemIds = new ArrayList<Long>();
-
 
8106
        for (Long other_element : other.itemIds) {
-
 
8107
          __this__itemIds.add(other_element);
-
 
8108
        }
-
 
8109
        this.itemIds = __this__itemIds;
-
 
8110
      }
-
 
8111
    }
-
 
8112
 
-
 
8113
    public getItemDiscountMap_args deepCopy() {
-
 
8114
      return new getItemDiscountMap_args(this);
-
 
8115
    }
-
 
8116
 
-
 
8117
    @Override
-
 
8118
    public void clear() {
-
 
8119
      this.itemIds = null;
-
 
8120
    }
-
 
8121
 
-
 
8122
    public int getItemIdsSize() {
-
 
8123
      return (this.itemIds == null) ? 0 : this.itemIds.size();
-
 
8124
    }
-
 
8125
 
-
 
8126
    public java.util.Iterator<Long> getItemIdsIterator() {
-
 
8127
      return (this.itemIds == null) ? null : this.itemIds.iterator();
-
 
8128
    }
-
 
8129
 
-
 
8130
    public void addToItemIds(long elem) {
-
 
8131
      if (this.itemIds == null) {
-
 
8132
        this.itemIds = new ArrayList<Long>();
-
 
8133
      }
-
 
8134
      this.itemIds.add(elem);
-
 
8135
    }
-
 
8136
 
-
 
8137
    public List<Long> getItemIds() {
-
 
8138
      return this.itemIds;
-
 
8139
    }
-
 
8140
 
-
 
8141
    public void setItemIds(List<Long> itemIds) {
-
 
8142
      this.itemIds = itemIds;
-
 
8143
    }
-
 
8144
 
-
 
8145
    public void unsetItemIds() {
-
 
8146
      this.itemIds = null;
-
 
8147
    }
-
 
8148
 
-
 
8149
    /** Returns true if field itemIds is set (has been assigned a value) and false otherwise */
-
 
8150
    public boolean isSetItemIds() {
-
 
8151
      return this.itemIds != null;
-
 
8152
    }
-
 
8153
 
-
 
8154
    public void setItemIdsIsSet(boolean value) {
-
 
8155
      if (!value) {
-
 
8156
        this.itemIds = null;
-
 
8157
      }
-
 
8158
    }
-
 
8159
 
-
 
8160
    public void setFieldValue(_Fields field, Object value) {
-
 
8161
      switch (field) {
-
 
8162
      case ITEM_IDS:
-
 
8163
        if (value == null) {
-
 
8164
          unsetItemIds();
-
 
8165
        } else {
-
 
8166
          setItemIds((List<Long>)value);
-
 
8167
        }
-
 
8168
        break;
-
 
8169
 
-
 
8170
      }
-
 
8171
    }
-
 
8172
 
-
 
8173
    public Object getFieldValue(_Fields field) {
-
 
8174
      switch (field) {
-
 
8175
      case ITEM_IDS:
-
 
8176
        return getItemIds();
-
 
8177
 
-
 
8178
      }
-
 
8179
      throw new IllegalStateException();
-
 
8180
    }
-
 
8181
 
-
 
8182
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
-
 
8183
    public boolean isSet(_Fields field) {
-
 
8184
      if (field == null) {
-
 
8185
        throw new IllegalArgumentException();
-
 
8186
      }
-
 
8187
 
-
 
8188
      switch (field) {
-
 
8189
      case ITEM_IDS:
-
 
8190
        return isSetItemIds();
-
 
8191
      }
-
 
8192
      throw new IllegalStateException();
-
 
8193
    }
-
 
8194
 
-
 
8195
    @Override
-
 
8196
    public boolean equals(Object that) {
-
 
8197
      if (that == null)
-
 
8198
        return false;
-
 
8199
      if (that instanceof getItemDiscountMap_args)
-
 
8200
        return this.equals((getItemDiscountMap_args)that);
-
 
8201
      return false;
-
 
8202
    }
-
 
8203
 
-
 
8204
    public boolean equals(getItemDiscountMap_args that) {
-
 
8205
      if (that == null)
-
 
8206
        return false;
-
 
8207
 
-
 
8208
      boolean this_present_itemIds = true && this.isSetItemIds();
-
 
8209
      boolean that_present_itemIds = true && that.isSetItemIds();
-
 
8210
      if (this_present_itemIds || that_present_itemIds) {
-
 
8211
        if (!(this_present_itemIds && that_present_itemIds))
-
 
8212
          return false;
-
 
8213
        if (!this.itemIds.equals(that.itemIds))
-
 
8214
          return false;
-
 
8215
      }
-
 
8216
 
-
 
8217
      return true;
-
 
8218
    }
-
 
8219
 
-
 
8220
    @Override
-
 
8221
    public int hashCode() {
-
 
8222
      return 0;
-
 
8223
    }
-
 
8224
 
-
 
8225
    public int compareTo(getItemDiscountMap_args other) {
-
 
8226
      if (!getClass().equals(other.getClass())) {
-
 
8227
        return getClass().getName().compareTo(other.getClass().getName());
-
 
8228
      }
-
 
8229
 
-
 
8230
      int lastComparison = 0;
-
 
8231
      getItemDiscountMap_args typedOther = (getItemDiscountMap_args)other;
-
 
8232
 
-
 
8233
      lastComparison = Boolean.valueOf(isSetItemIds()).compareTo(typedOther.isSetItemIds());
-
 
8234
      if (lastComparison != 0) {
-
 
8235
        return lastComparison;
-
 
8236
      }
-
 
8237
      if (isSetItemIds()) {
-
 
8238
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.itemIds, typedOther.itemIds);
-
 
8239
        if (lastComparison != 0) {
-
 
8240
          return lastComparison;
-
 
8241
        }
-
 
8242
      }
-
 
8243
      return 0;
-
 
8244
    }
-
 
8245
 
-
 
8246
    public _Fields fieldForId(int fieldId) {
-
 
8247
      return _Fields.findByThriftId(fieldId);
-
 
8248
    }
-
 
8249
 
-
 
8250
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
-
 
8251
      org.apache.thrift.protocol.TField field;
-
 
8252
      iprot.readStructBegin();
-
 
8253
      while (true)
-
 
8254
      {
-
 
8255
        field = iprot.readFieldBegin();
-
 
8256
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
-
 
8257
          break;
-
 
8258
        }
-
 
8259
        switch (field.id) {
-
 
8260
          case 1: // ITEM_IDS
-
 
8261
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
-
 
8262
              {
-
 
8263
                org.apache.thrift.protocol.TList _list24 = iprot.readListBegin();
-
 
8264
                this.itemIds = new ArrayList<Long>(_list24.size);
-
 
8265
                for (int _i25 = 0; _i25 < _list24.size; ++_i25)
-
 
8266
                {
-
 
8267
                  long _elem26; // required
-
 
8268
                  _elem26 = iprot.readI64();
-
 
8269
                  this.itemIds.add(_elem26);
-
 
8270
                }
-
 
8271
                iprot.readListEnd();
-
 
8272
              }
-
 
8273
            } else { 
-
 
8274
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
-
 
8275
            }
-
 
8276
            break;
-
 
8277
          default:
-
 
8278
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
-
 
8279
        }
-
 
8280
        iprot.readFieldEnd();
-
 
8281
      }
-
 
8282
      iprot.readStructEnd();
-
 
8283
      validate();
-
 
8284
    }
-
 
8285
 
-
 
8286
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
-
 
8287
      validate();
-
 
8288
 
-
 
8289
      oprot.writeStructBegin(STRUCT_DESC);
-
 
8290
      if (this.itemIds != null) {
-
 
8291
        oprot.writeFieldBegin(ITEM_IDS_FIELD_DESC);
-
 
8292
        {
-
 
8293
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, this.itemIds.size()));
-
 
8294
          for (long _iter27 : this.itemIds)
-
 
8295
          {
-
 
8296
            oprot.writeI64(_iter27);
-
 
8297
          }
-
 
8298
          oprot.writeListEnd();
-
 
8299
        }
-
 
8300
        oprot.writeFieldEnd();
-
 
8301
      }
-
 
8302
      oprot.writeFieldStop();
-
 
8303
      oprot.writeStructEnd();
-
 
8304
    }
-
 
8305
 
-
 
8306
    @Override
-
 
8307
    public String toString() {
-
 
8308
      StringBuilder sb = new StringBuilder("getItemDiscountMap_args(");
-
 
8309
      boolean first = true;
-
 
8310
 
-
 
8311
      sb.append("itemIds:");
-
 
8312
      if (this.itemIds == null) {
-
 
8313
        sb.append("null");
-
 
8314
      } else {
-
 
8315
        sb.append(this.itemIds);
-
 
8316
      }
-
 
8317
      first = false;
-
 
8318
      sb.append(")");
-
 
8319
      return sb.toString();
-
 
8320
    }
-
 
8321
 
-
 
8322
    public void validate() throws org.apache.thrift.TException {
-
 
8323
      // check for required fields
-
 
8324
    }
-
 
8325
 
-
 
8326
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
-
 
8327
      try {
-
 
8328
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
-
 
8329
      } catch (org.apache.thrift.TException te) {
-
 
8330
        throw new java.io.IOException(te);
-
 
8331
      }
-
 
8332
    }
-
 
8333
 
-
 
8334
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
-
 
8335
      try {
-
 
8336
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
-
 
8337
      } catch (org.apache.thrift.TException te) {
-
 
8338
        throw new java.io.IOException(te);
-
 
8339
      }
-
 
8340
    }
-
 
8341
 
-
 
8342
  }
-
 
8343
 
-
 
8344
  public static class getItemDiscountMap_result implements org.apache.thrift.TBase<getItemDiscountMap_result, getItemDiscountMap_result._Fields>, java.io.Serializable, Cloneable   {
-
 
8345
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getItemDiscountMap_result");
-
 
8346
 
-
 
8347
    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0);
-
 
8348
    private static final org.apache.thrift.protocol.TField PEX_FIELD_DESC = new org.apache.thrift.protocol.TField("pex", org.apache.thrift.protocol.TType.STRUCT, (short)1);
-
 
8349
 
-
 
8350
    private List<ItemCouponDiscount> success; // required
-
 
8351
    private PromotionException pex; // required
-
 
8352
 
-
 
8353
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-
 
8354
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
-
 
8355
      SUCCESS((short)0, "success"),
-
 
8356
      PEX((short)1, "pex");
-
 
8357
 
-
 
8358
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
-
 
8359
 
-
 
8360
      static {
-
 
8361
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
-
 
8362
          byName.put(field.getFieldName(), field);
-
 
8363
        }
-
 
8364
      }
-
 
8365
 
-
 
8366
      /**
-
 
8367
       * Find the _Fields constant that matches fieldId, or null if its not found.
-
 
8368
       */
-
 
8369
      public static _Fields findByThriftId(int fieldId) {
-
 
8370
        switch(fieldId) {
-
 
8371
          case 0: // SUCCESS
-
 
8372
            return SUCCESS;
-
 
8373
          case 1: // PEX
-
 
8374
            return PEX;
-
 
8375
          default:
-
 
8376
            return null;
-
 
8377
        }
-
 
8378
      }
-
 
8379
 
-
 
8380
      /**
-
 
8381
       * Find the _Fields constant that matches fieldId, throwing an exception
-
 
8382
       * if it is not found.
-
 
8383
       */
-
 
8384
      public static _Fields findByThriftIdOrThrow(int fieldId) {
-
 
8385
        _Fields fields = findByThriftId(fieldId);
-
 
8386
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
-
 
8387
        return fields;
-
 
8388
      }
-
 
8389
 
-
 
8390
      /**
-
 
8391
       * Find the _Fields constant that matches name, or null if its not found.
-
 
8392
       */
-
 
8393
      public static _Fields findByName(String name) {
-
 
8394
        return byName.get(name);
-
 
8395
      }
-
 
8396
 
-
 
8397
      private final short _thriftId;
-
 
8398
      private final String _fieldName;
-
 
8399
 
-
 
8400
      _Fields(short thriftId, String fieldName) {
-
 
8401
        _thriftId = thriftId;
-
 
8402
        _fieldName = fieldName;
-
 
8403
      }
-
 
8404
 
-
 
8405
      public short getThriftFieldId() {
-
 
8406
        return _thriftId;
-
 
8407
      }
-
 
8408
 
-
 
8409
      public String getFieldName() {
-
 
8410
        return _fieldName;
-
 
8411
      }
-
 
8412
    }
-
 
8413
 
-
 
8414
    // isset id assignments
-
 
8415
 
-
 
8416
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
-
 
8417
    static {
-
 
8418
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
-
 
8419
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
-
 
8420
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
-
 
8421
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ItemCouponDiscount.class))));
-
 
8422
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
-
 
8423
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
-
 
8424
      metaDataMap = Collections.unmodifiableMap(tmpMap);
-
 
8425
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getItemDiscountMap_result.class, metaDataMap);
-
 
8426
    }
-
 
8427
 
-
 
8428
    public getItemDiscountMap_result() {
-
 
8429
    }
-
 
8430
 
-
 
8431
    public getItemDiscountMap_result(
-
 
8432
      List<ItemCouponDiscount> success,
-
 
8433
      PromotionException pex)
-
 
8434
    {
-
 
8435
      this();
-
 
8436
      this.success = success;
-
 
8437
      this.pex = pex;
-
 
8438
    }
-
 
8439
 
-
 
8440
    /**
-
 
8441
     * Performs a deep copy on <i>other</i>.
-
 
8442
     */
-
 
8443
    public getItemDiscountMap_result(getItemDiscountMap_result other) {
-
 
8444
      if (other.isSetSuccess()) {
-
 
8445
        List<ItemCouponDiscount> __this__success = new ArrayList<ItemCouponDiscount>();
-
 
8446
        for (ItemCouponDiscount other_element : other.success) {
-
 
8447
          __this__success.add(new ItemCouponDiscount(other_element));
-
 
8448
        }
-
 
8449
        this.success = __this__success;
-
 
8450
      }
-
 
8451
      if (other.isSetPex()) {
-
 
8452
        this.pex = new PromotionException(other.pex);
-
 
8453
      }
-
 
8454
    }
-
 
8455
 
-
 
8456
    public getItemDiscountMap_result deepCopy() {
-
 
8457
      return new getItemDiscountMap_result(this);
-
 
8458
    }
-
 
8459
 
-
 
8460
    @Override
-
 
8461
    public void clear() {
-
 
8462
      this.success = null;
-
 
8463
      this.pex = null;
-
 
8464
    }
-
 
8465
 
-
 
8466
    public int getSuccessSize() {
-
 
8467
      return (this.success == null) ? 0 : this.success.size();
-
 
8468
    }
-
 
8469
 
-
 
8470
    public java.util.Iterator<ItemCouponDiscount> getSuccessIterator() {
-
 
8471
      return (this.success == null) ? null : this.success.iterator();
-
 
8472
    }
-
 
8473
 
-
 
8474
    public void addToSuccess(ItemCouponDiscount elem) {
-
 
8475
      if (this.success == null) {
-
 
8476
        this.success = new ArrayList<ItemCouponDiscount>();
-
 
8477
      }
-
 
8478
      this.success.add(elem);
-
 
8479
    }
-
 
8480
 
-
 
8481
    public List<ItemCouponDiscount> getSuccess() {
-
 
8482
      return this.success;
-
 
8483
    }
-
 
8484
 
-
 
8485
    public void setSuccess(List<ItemCouponDiscount> success) {
-
 
8486
      this.success = success;
-
 
8487
    }
-
 
8488
 
-
 
8489
    public void unsetSuccess() {
-
 
8490
      this.success = null;
-
 
8491
    }
-
 
8492
 
-
 
8493
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
-
 
8494
    public boolean isSetSuccess() {
-
 
8495
      return this.success != null;
-
 
8496
    }
-
 
8497
 
-
 
8498
    public void setSuccessIsSet(boolean value) {
-
 
8499
      if (!value) {
-
 
8500
        this.success = null;
-
 
8501
      }
-
 
8502
    }
-
 
8503
 
-
 
8504
    public PromotionException getPex() {
-
 
8505
      return this.pex;
-
 
8506
    }
-
 
8507
 
-
 
8508
    public void setPex(PromotionException pex) {
-
 
8509
      this.pex = pex;
-
 
8510
    }
-
 
8511
 
-
 
8512
    public void unsetPex() {
-
 
8513
      this.pex = null;
-
 
8514
    }
-
 
8515
 
-
 
8516
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
-
 
8517
    public boolean isSetPex() {
-
 
8518
      return this.pex != null;
-
 
8519
    }
-
 
8520
 
-
 
8521
    public void setPexIsSet(boolean value) {
-
 
8522
      if (!value) {
-
 
8523
        this.pex = null;
-
 
8524
      }
-
 
8525
    }
-
 
8526
 
-
 
8527
    public void setFieldValue(_Fields field, Object value) {
-
 
8528
      switch (field) {
-
 
8529
      case SUCCESS:
-
 
8530
        if (value == null) {
-
 
8531
          unsetSuccess();
-
 
8532
        } else {
-
 
8533
          setSuccess((List<ItemCouponDiscount>)value);
-
 
8534
        }
-
 
8535
        break;
-
 
8536
 
-
 
8537
      case PEX:
-
 
8538
        if (value == null) {
-
 
8539
          unsetPex();
-
 
8540
        } else {
-
 
8541
          setPex((PromotionException)value);
-
 
8542
        }
-
 
8543
        break;
-
 
8544
 
-
 
8545
      }
-
 
8546
    }
-
 
8547
 
-
 
8548
    public Object getFieldValue(_Fields field) {
-
 
8549
      switch (field) {
-
 
8550
      case SUCCESS:
-
 
8551
        return getSuccess();
-
 
8552
 
-
 
8553
      case PEX:
-
 
8554
        return getPex();
-
 
8555
 
-
 
8556
      }
-
 
8557
      throw new IllegalStateException();
-
 
8558
    }
-
 
8559
 
-
 
8560
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
-
 
8561
    public boolean isSet(_Fields field) {
-
 
8562
      if (field == null) {
-
 
8563
        throw new IllegalArgumentException();
-
 
8564
      }
-
 
8565
 
-
 
8566
      switch (field) {
-
 
8567
      case SUCCESS:
-
 
8568
        return isSetSuccess();
-
 
8569
      case PEX:
-
 
8570
        return isSetPex();
-
 
8571
      }
-
 
8572
      throw new IllegalStateException();
-
 
8573
    }
-
 
8574
 
-
 
8575
    @Override
-
 
8576
    public boolean equals(Object that) {
-
 
8577
      if (that == null)
-
 
8578
        return false;
-
 
8579
      if (that instanceof getItemDiscountMap_result)
-
 
8580
        return this.equals((getItemDiscountMap_result)that);
-
 
8581
      return false;
-
 
8582
    }
-
 
8583
 
-
 
8584
    public boolean equals(getItemDiscountMap_result that) {
-
 
8585
      if (that == null)
-
 
8586
        return false;
-
 
8587
 
-
 
8588
      boolean this_present_success = true && this.isSetSuccess();
-
 
8589
      boolean that_present_success = true && that.isSetSuccess();
-
 
8590
      if (this_present_success || that_present_success) {
-
 
8591
        if (!(this_present_success && that_present_success))
-
 
8592
          return false;
-
 
8593
        if (!this.success.equals(that.success))
-
 
8594
          return false;
-
 
8595
      }
-
 
8596
 
-
 
8597
      boolean this_present_pex = true && this.isSetPex();
-
 
8598
      boolean that_present_pex = true && that.isSetPex();
-
 
8599
      if (this_present_pex || that_present_pex) {
-
 
8600
        if (!(this_present_pex && that_present_pex))
-
 
8601
          return false;
-
 
8602
        if (!this.pex.equals(that.pex))
-
 
8603
          return false;
-
 
8604
      }
-
 
8605
 
-
 
8606
      return true;
-
 
8607
    }
-
 
8608
 
-
 
8609
    @Override
-
 
8610
    public int hashCode() {
-
 
8611
      return 0;
-
 
8612
    }
-
 
8613
 
-
 
8614
    public int compareTo(getItemDiscountMap_result other) {
-
 
8615
      if (!getClass().equals(other.getClass())) {
-
 
8616
        return getClass().getName().compareTo(other.getClass().getName());
-
 
8617
      }
-
 
8618
 
-
 
8619
      int lastComparison = 0;
-
 
8620
      getItemDiscountMap_result typedOther = (getItemDiscountMap_result)other;
-
 
8621
 
-
 
8622
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
-
 
8623
      if (lastComparison != 0) {
-
 
8624
        return lastComparison;
-
 
8625
      }
-
 
8626
      if (isSetSuccess()) {
-
 
8627
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
-
 
8628
        if (lastComparison != 0) {
-
 
8629
          return lastComparison;
-
 
8630
        }
-
 
8631
      }
-
 
8632
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
-
 
8633
      if (lastComparison != 0) {
-
 
8634
        return lastComparison;
-
 
8635
      }
-
 
8636
      if (isSetPex()) {
-
 
8637
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
-
 
8638
        if (lastComparison != 0) {
-
 
8639
          return lastComparison;
-
 
8640
        }
-
 
8641
      }
-
 
8642
      return 0;
-
 
8643
    }
-
 
8644
 
-
 
8645
    public _Fields fieldForId(int fieldId) {
-
 
8646
      return _Fields.findByThriftId(fieldId);
-
 
8647
    }
-
 
8648
 
-
 
8649
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
-
 
8650
      org.apache.thrift.protocol.TField field;
-
 
8651
      iprot.readStructBegin();
-
 
8652
      while (true)
-
 
8653
      {
-
 
8654
        field = iprot.readFieldBegin();
-
 
8655
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
-
 
8656
          break;
-
 
8657
        }
-
 
8658
        switch (field.id) {
-
 
8659
          case 0: // SUCCESS
-
 
8660
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
-
 
8661
              {
-
 
8662
                org.apache.thrift.protocol.TList _list28 = iprot.readListBegin();
-
 
8663
                this.success = new ArrayList<ItemCouponDiscount>(_list28.size);
-
 
8664
                for (int _i29 = 0; _i29 < _list28.size; ++_i29)
-
 
8665
                {
-
 
8666
                  ItemCouponDiscount _elem30; // required
-
 
8667
                  _elem30 = new ItemCouponDiscount();
-
 
8668
                  _elem30.read(iprot);
-
 
8669
                  this.success.add(_elem30);
-
 
8670
                }
-
 
8671
                iprot.readListEnd();
-
 
8672
              }
-
 
8673
            } else { 
-
 
8674
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
-
 
8675
            }
-
 
8676
            break;
-
 
8677
          case 1: // PEX
-
 
8678
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
-
 
8679
              this.pex = new PromotionException();
-
 
8680
              this.pex.read(iprot);
-
 
8681
            } else { 
-
 
8682
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
-
 
8683
            }
-
 
8684
            break;
-
 
8685
          default:
-
 
8686
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
-
 
8687
        }
-
 
8688
        iprot.readFieldEnd();
-
 
8689
      }
-
 
8690
      iprot.readStructEnd();
-
 
8691
      validate();
-
 
8692
    }
-
 
8693
 
-
 
8694
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
-
 
8695
      oprot.writeStructBegin(STRUCT_DESC);
-
 
8696
 
-
 
8697
      if (this.isSetSuccess()) {
-
 
8698
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
-
 
8699
        {
-
 
8700
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
-
 
8701
          for (ItemCouponDiscount _iter31 : this.success)
-
 
8702
          {
-
 
8703
            _iter31.write(oprot);
-
 
8704
          }
-
 
8705
          oprot.writeListEnd();
-
 
8706
        }
-
 
8707
        oprot.writeFieldEnd();
-
 
8708
      } else if (this.isSetPex()) {
-
 
8709
        oprot.writeFieldBegin(PEX_FIELD_DESC);
-
 
8710
        this.pex.write(oprot);
-
 
8711
        oprot.writeFieldEnd();
-
 
8712
      }
-
 
8713
      oprot.writeFieldStop();
-
 
8714
      oprot.writeStructEnd();
-
 
8715
    }
-
 
8716
 
-
 
8717
    @Override
-
 
8718
    public String toString() {
-
 
8719
      StringBuilder sb = new StringBuilder("getItemDiscountMap_result(");
-
 
8720
      boolean first = true;
-
 
8721
 
-
 
8722
      sb.append("success:");
-
 
8723
      if (this.success == null) {
-
 
8724
        sb.append("null");
-
 
8725
      } else {
-
 
8726
        sb.append(this.success);
-
 
8727
      }
-
 
8728
      first = false;
-
 
8729
      if (!first) sb.append(", ");
-
 
8730
      sb.append("pex:");
-
 
8731
      if (this.pex == null) {
-
 
8732
        sb.append("null");
-
 
8733
      } else {
-
 
8734
        sb.append(this.pex);
-
 
8735
      }
-
 
8736
      first = false;
-
 
8737
      sb.append(")");
-
 
8738
      return sb.toString();
-
 
8739
    }
7907
 
8740
 
7908
    public void validate() throws org.apache.thrift.TException {
8741
    public void validate() throws org.apache.thrift.TException {
7909
      // check for required fields
8742
      // check for required fields
7910
    }
8743
    }
7911
 
8744