Subversion Repositories SmartDukaan

Rev

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

Rev 2357 Rev 2808
Line 234... Line 234...
234
     * 
234
     * 
235
     * @param vendorCategory
235
     * @param vendorCategory
236
     */
236
     */
237
    public List<Item> getItemsByVendorCategory(String vendorCategory) throws TException;
237
    public List<Item> getItemsByVendorCategory(String vendorCategory) throws TException;
238
 
238
 
-
 
239
    /**
-
 
240
     * Returns list of catalog ids of items with same similarity index as of the given itemId
-
 
241
     * 
-
 
242
     * @param beginIndex
-
 
243
     * @param totalItems
-
 
244
     * @param itemId
-
 
245
     */
-
 
246
    public List<Long> getSimilarItemsCatalogIds(long beginIndex, long totalItems, long itemId) throws TException;
-
 
247
 
239
  }
248
  }
240
 
249
 
241
  public static class Client implements Iface {
250
  public static class Client implements Iface {
242
    public Client(TProtocol prot)
251
    public Client(TProtocol prot)
243
    {
252
    {
Line 2028... Line 2037...
2028
        return result.success;
2037
        return result.success;
2029
      }
2038
      }
2030
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getItemsByVendorCategory failed: unknown result");
2039
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getItemsByVendorCategory failed: unknown result");
2031
    }
2040
    }
2032
 
2041
 
-
 
2042
    public List<Long> getSimilarItemsCatalogIds(long beginIndex, long totalItems, long itemId) throws TException
-
 
2043
    {
-
 
2044
      send_getSimilarItemsCatalogIds(beginIndex, totalItems, itemId);
-
 
2045
      return recv_getSimilarItemsCatalogIds();
-
 
2046
    }
-
 
2047
 
-
 
2048
    public void send_getSimilarItemsCatalogIds(long beginIndex, long totalItems, long itemId) throws TException
-
 
2049
    {
-
 
2050
      oprot_.writeMessageBegin(new TMessage("getSimilarItemsCatalogIds", TMessageType.CALL, seqid_));
-
 
2051
      getSimilarItemsCatalogIds_args args = new getSimilarItemsCatalogIds_args();
-
 
2052
      args.beginIndex = beginIndex;
-
 
2053
      args.totalItems = totalItems;
-
 
2054
      args.itemId = itemId;
-
 
2055
      args.write(oprot_);
-
 
2056
      oprot_.writeMessageEnd();
-
 
2057
      oprot_.getTransport().flush();
-
 
2058
    }
-
 
2059
 
-
 
2060
    public List<Long> recv_getSimilarItemsCatalogIds() throws TException
-
 
2061
    {
-
 
2062
      TMessage msg = iprot_.readMessageBegin();
-
 
2063
      if (msg.type == TMessageType.EXCEPTION) {
-
 
2064
        TApplicationException x = TApplicationException.read(iprot_);
-
 
2065
        iprot_.readMessageEnd();
-
 
2066
        throw x;
-
 
2067
      }
-
 
2068
      getSimilarItemsCatalogIds_result result = new getSimilarItemsCatalogIds_result();
-
 
2069
      result.read(iprot_);
-
 
2070
      iprot_.readMessageEnd();
-
 
2071
      if (result.isSetSuccess()) {
-
 
2072
        return result.success;
-
 
2073
      }
-
 
2074
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getSimilarItemsCatalogIds failed: unknown result");
-
 
2075
    }
-
 
2076
 
2033
  }
2077
  }
2034
  public static class Processor implements TProcessor {
2078
  public static class Processor implements TProcessor {
2035
    private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName());
2079
    private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName());
2036
    public Processor(Iface iface)
2080
    public Processor(Iface iface)
2037
    {
2081
    {
Line 2084... Line 2128...
2084
      processMap_.put("getVendorItemMappings", new getVendorItemMappings());
2128
      processMap_.put("getVendorItemMappings", new getVendorItemMappings());
2085
      processMap_.put("checkSimilarItem", new checkSimilarItem());
2129
      processMap_.put("checkSimilarItem", new checkSimilarItem());
2086
      processMap_.put("changeItemRiskyFlag", new changeItemRiskyFlag());
2130
      processMap_.put("changeItemRiskyFlag", new changeItemRiskyFlag());
2087
      processMap_.put("getItemsByRiskyFlag", new getItemsByRiskyFlag());
2131
      processMap_.put("getItemsByRiskyFlag", new getItemsByRiskyFlag());
2088
      processMap_.put("getItemsByVendorCategory", new getItemsByVendorCategory());
2132
      processMap_.put("getItemsByVendorCategory", new getItemsByVendorCategory());
-
 
2133
      processMap_.put("getSimilarItemsCatalogIds", new getSimilarItemsCatalogIds());
2089
    }
2134
    }
2090
 
2135
 
2091
    protected static interface ProcessFunction {
2136
    protected static interface ProcessFunction {
2092
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException;
2137
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException;
2093
    }
2138
    }
Line 3394... Line 3439...
3394
        oprot.getTransport().flush();
3439
        oprot.getTransport().flush();
3395
      }
3440
      }
3396
 
3441
 
3397
    }
3442
    }
3398
 
3443
 
-
 
3444
    private class getSimilarItemsCatalogIds implements ProcessFunction {
-
 
3445
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
-
 
3446
      {
-
 
3447
        getSimilarItemsCatalogIds_args args = new getSimilarItemsCatalogIds_args();
-
 
3448
        args.read(iprot);
-
 
3449
        iprot.readMessageEnd();
-
 
3450
        getSimilarItemsCatalogIds_result result = new getSimilarItemsCatalogIds_result();
-
 
3451
        result.success = iface_.getSimilarItemsCatalogIds(args.beginIndex, args.totalItems, args.itemId);
-
 
3452
        oprot.writeMessageBegin(new TMessage("getSimilarItemsCatalogIds", TMessageType.REPLY, seqid));
-
 
3453
        result.write(oprot);
-
 
3454
        oprot.writeMessageEnd();
-
 
3455
        oprot.getTransport().flush();
-
 
3456
      }
-
 
3457
 
-
 
3458
    }
-
 
3459
 
3399
  }
3460
  }
3400
 
3461
 
3401
  public static class closeSession_args implements TBase<closeSession_args._Fields>, java.io.Serializable, Cloneable, Comparable<closeSession_args>   {
3462
  public static class closeSession_args implements TBase<closeSession_args._Fields>, java.io.Serializable, Cloneable, Comparable<closeSession_args>   {
3402
    private static final TStruct STRUCT_DESC = new TStruct("closeSession_args");
3463
    private static final TStruct STRUCT_DESC = new TStruct("closeSession_args");
3403
 
3464
 
Line 36202... Line 36263...
36202
      boolean first = true;
36263
      boolean first = true;
36203
 
36264
 
36204
      sb.append("success:");
36265
      sb.append("success:");
36205
      if (this.success == null) {
36266
      if (this.success == null) {
36206
        sb.append("null");
36267
        sb.append("null");
-
 
36268
      } else {
-
 
36269
        sb.append(this.success);
-
 
36270
      }
-
 
36271
      first = false;
-
 
36272
      sb.append(")");
-
 
36273
      return sb.toString();
-
 
36274
    }
-
 
36275
 
-
 
36276
    public void validate() throws TException {
-
 
36277
      // check for required fields
-
 
36278
    }
-
 
36279
 
-
 
36280
  }
-
 
36281
 
-
 
36282
  public static class getSimilarItemsCatalogIds_args implements TBase<getSimilarItemsCatalogIds_args._Fields>, java.io.Serializable, Cloneable, Comparable<getSimilarItemsCatalogIds_args>   {
-
 
36283
    private static final TStruct STRUCT_DESC = new TStruct("getSimilarItemsCatalogIds_args");
-
 
36284
 
-
 
36285
    private static final TField BEGIN_INDEX_FIELD_DESC = new TField("beginIndex", TType.I64, (short)1);
-
 
36286
    private static final TField TOTAL_ITEMS_FIELD_DESC = new TField("totalItems", TType.I64, (short)2);
-
 
36287
    private static final TField ITEM_ID_FIELD_DESC = new TField("itemId", TType.I64, (short)3);
-
 
36288
 
-
 
36289
    private long beginIndex;
-
 
36290
    private long totalItems;
-
 
36291
    private long itemId;
-
 
36292
 
-
 
36293
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-
 
36294
    public enum _Fields implements TFieldIdEnum {
-
 
36295
      BEGIN_INDEX((short)1, "beginIndex"),
-
 
36296
      TOTAL_ITEMS((short)2, "totalItems"),
-
 
36297
      ITEM_ID((short)3, "itemId");
-
 
36298
 
-
 
36299
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
-
 
36300
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
-
 
36301
 
-
 
36302
      static {
-
 
36303
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
-
 
36304
          byId.put((int)field._thriftId, field);
-
 
36305
          byName.put(field.getFieldName(), field);
-
 
36306
        }
-
 
36307
      }
-
 
36308
 
-
 
36309
      /**
-
 
36310
       * Find the _Fields constant that matches fieldId, or null if its not found.
-
 
36311
       */
-
 
36312
      public static _Fields findByThriftId(int fieldId) {
-
 
36313
        return byId.get(fieldId);
-
 
36314
      }
-
 
36315
 
-
 
36316
      /**
-
 
36317
       * Find the _Fields constant that matches fieldId, throwing an exception
-
 
36318
       * if it is not found.
-
 
36319
       */
-
 
36320
      public static _Fields findByThriftIdOrThrow(int fieldId) {
-
 
36321
        _Fields fields = findByThriftId(fieldId);
-
 
36322
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
-
 
36323
        return fields;
-
 
36324
      }
-
 
36325
 
-
 
36326
      /**
-
 
36327
       * Find the _Fields constant that matches name, or null if its not found.
-
 
36328
       */
-
 
36329
      public static _Fields findByName(String name) {
-
 
36330
        return byName.get(name);
-
 
36331
      }
-
 
36332
 
-
 
36333
      private final short _thriftId;
-
 
36334
      private final String _fieldName;
-
 
36335
 
-
 
36336
      _Fields(short thriftId, String fieldName) {
-
 
36337
        _thriftId = thriftId;
-
 
36338
        _fieldName = fieldName;
-
 
36339
      }
-
 
36340
 
-
 
36341
      public short getThriftFieldId() {
-
 
36342
        return _thriftId;
-
 
36343
      }
-
 
36344
 
-
 
36345
      public String getFieldName() {
-
 
36346
        return _fieldName;
-
 
36347
      }
-
 
36348
    }
-
 
36349
 
-
 
36350
    // isset id assignments
-
 
36351
    private static final int __BEGININDEX_ISSET_ID = 0;
-
 
36352
    private static final int __TOTALITEMS_ISSET_ID = 1;
-
 
36353
    private static final int __ITEMID_ISSET_ID = 2;
-
 
36354
    private BitSet __isset_bit_vector = new BitSet(3);
-
 
36355
 
-
 
36356
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
-
 
36357
      put(_Fields.BEGIN_INDEX, new FieldMetaData("beginIndex", TFieldRequirementType.DEFAULT, 
-
 
36358
          new FieldValueMetaData(TType.I64)));
-
 
36359
      put(_Fields.TOTAL_ITEMS, new FieldMetaData("totalItems", TFieldRequirementType.DEFAULT, 
-
 
36360
          new FieldValueMetaData(TType.I64)));
-
 
36361
      put(_Fields.ITEM_ID, new FieldMetaData("itemId", TFieldRequirementType.DEFAULT, 
-
 
36362
          new FieldValueMetaData(TType.I64)));
-
 
36363
    }});
-
 
36364
 
-
 
36365
    static {
-
 
36366
      FieldMetaData.addStructMetaDataMap(getSimilarItemsCatalogIds_args.class, metaDataMap);
-
 
36367
    }
-
 
36368
 
-
 
36369
    public getSimilarItemsCatalogIds_args() {
-
 
36370
    }
-
 
36371
 
-
 
36372
    public getSimilarItemsCatalogIds_args(
-
 
36373
      long beginIndex,
-
 
36374
      long totalItems,
-
 
36375
      long itemId)
-
 
36376
    {
-
 
36377
      this();
-
 
36378
      this.beginIndex = beginIndex;
-
 
36379
      setBeginIndexIsSet(true);
-
 
36380
      this.totalItems = totalItems;
-
 
36381
      setTotalItemsIsSet(true);
-
 
36382
      this.itemId = itemId;
-
 
36383
      setItemIdIsSet(true);
-
 
36384
    }
-
 
36385
 
-
 
36386
    /**
-
 
36387
     * Performs a deep copy on <i>other</i>.
-
 
36388
     */
-
 
36389
    public getSimilarItemsCatalogIds_args(getSimilarItemsCatalogIds_args other) {
-
 
36390
      __isset_bit_vector.clear();
-
 
36391
      __isset_bit_vector.or(other.__isset_bit_vector);
-
 
36392
      this.beginIndex = other.beginIndex;
-
 
36393
      this.totalItems = other.totalItems;
-
 
36394
      this.itemId = other.itemId;
-
 
36395
    }
-
 
36396
 
-
 
36397
    public getSimilarItemsCatalogIds_args deepCopy() {
-
 
36398
      return new getSimilarItemsCatalogIds_args(this);
-
 
36399
    }
-
 
36400
 
-
 
36401
    @Deprecated
-
 
36402
    public getSimilarItemsCatalogIds_args clone() {
-
 
36403
      return new getSimilarItemsCatalogIds_args(this);
-
 
36404
    }
-
 
36405
 
-
 
36406
    public long getBeginIndex() {
-
 
36407
      return this.beginIndex;
-
 
36408
    }
-
 
36409
 
-
 
36410
    public getSimilarItemsCatalogIds_args setBeginIndex(long beginIndex) {
-
 
36411
      this.beginIndex = beginIndex;
-
 
36412
      setBeginIndexIsSet(true);
-
 
36413
      return this;
-
 
36414
    }
-
 
36415
 
-
 
36416
    public void unsetBeginIndex() {
-
 
36417
      __isset_bit_vector.clear(__BEGININDEX_ISSET_ID);
-
 
36418
    }
-
 
36419
 
-
 
36420
    /** Returns true if field beginIndex is set (has been asigned a value) and false otherwise */
-
 
36421
    public boolean isSetBeginIndex() {
-
 
36422
      return __isset_bit_vector.get(__BEGININDEX_ISSET_ID);
-
 
36423
    }
-
 
36424
 
-
 
36425
    public void setBeginIndexIsSet(boolean value) {
-
 
36426
      __isset_bit_vector.set(__BEGININDEX_ISSET_ID, value);
-
 
36427
    }
-
 
36428
 
-
 
36429
    public long getTotalItems() {
-
 
36430
      return this.totalItems;
-
 
36431
    }
-
 
36432
 
-
 
36433
    public getSimilarItemsCatalogIds_args setTotalItems(long totalItems) {
-
 
36434
      this.totalItems = totalItems;
-
 
36435
      setTotalItemsIsSet(true);
-
 
36436
      return this;
-
 
36437
    }
-
 
36438
 
-
 
36439
    public void unsetTotalItems() {
-
 
36440
      __isset_bit_vector.clear(__TOTALITEMS_ISSET_ID);
-
 
36441
    }
-
 
36442
 
-
 
36443
    /** Returns true if field totalItems is set (has been asigned a value) and false otherwise */
-
 
36444
    public boolean isSetTotalItems() {
-
 
36445
      return __isset_bit_vector.get(__TOTALITEMS_ISSET_ID);
-
 
36446
    }
-
 
36447
 
-
 
36448
    public void setTotalItemsIsSet(boolean value) {
-
 
36449
      __isset_bit_vector.set(__TOTALITEMS_ISSET_ID, value);
-
 
36450
    }
-
 
36451
 
-
 
36452
    public long getItemId() {
-
 
36453
      return this.itemId;
-
 
36454
    }
-
 
36455
 
-
 
36456
    public getSimilarItemsCatalogIds_args setItemId(long itemId) {
-
 
36457
      this.itemId = itemId;
-
 
36458
      setItemIdIsSet(true);
-
 
36459
      return this;
-
 
36460
    }
-
 
36461
 
-
 
36462
    public void unsetItemId() {
-
 
36463
      __isset_bit_vector.clear(__ITEMID_ISSET_ID);
-
 
36464
    }
-
 
36465
 
-
 
36466
    /** Returns true if field itemId is set (has been asigned a value) and false otherwise */
-
 
36467
    public boolean isSetItemId() {
-
 
36468
      return __isset_bit_vector.get(__ITEMID_ISSET_ID);
-
 
36469
    }
-
 
36470
 
-
 
36471
    public void setItemIdIsSet(boolean value) {
-
 
36472
      __isset_bit_vector.set(__ITEMID_ISSET_ID, value);
-
 
36473
    }
-
 
36474
 
-
 
36475
    public void setFieldValue(_Fields field, Object value) {
-
 
36476
      switch (field) {
-
 
36477
      case BEGIN_INDEX:
-
 
36478
        if (value == null) {
-
 
36479
          unsetBeginIndex();
-
 
36480
        } else {
-
 
36481
          setBeginIndex((Long)value);
-
 
36482
        }
-
 
36483
        break;
-
 
36484
 
-
 
36485
      case TOTAL_ITEMS:
-
 
36486
        if (value == null) {
-
 
36487
          unsetTotalItems();
-
 
36488
        } else {
-
 
36489
          setTotalItems((Long)value);
-
 
36490
        }
-
 
36491
        break;
-
 
36492
 
-
 
36493
      case ITEM_ID:
-
 
36494
        if (value == null) {
-
 
36495
          unsetItemId();
-
 
36496
        } else {
-
 
36497
          setItemId((Long)value);
-
 
36498
        }
-
 
36499
        break;
-
 
36500
 
-
 
36501
      }
-
 
36502
    }
-
 
36503
 
-
 
36504
    public void setFieldValue(int fieldID, Object value) {
-
 
36505
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
-
 
36506
    }
-
 
36507
 
-
 
36508
    public Object getFieldValue(_Fields field) {
-
 
36509
      switch (field) {
-
 
36510
      case BEGIN_INDEX:
-
 
36511
        return new Long(getBeginIndex());
-
 
36512
 
-
 
36513
      case TOTAL_ITEMS:
-
 
36514
        return new Long(getTotalItems());
-
 
36515
 
-
 
36516
      case ITEM_ID:
-
 
36517
        return new Long(getItemId());
-
 
36518
 
-
 
36519
      }
-
 
36520
      throw new IllegalStateException();
-
 
36521
    }
-
 
36522
 
-
 
36523
    public Object getFieldValue(int fieldId) {
-
 
36524
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
-
 
36525
    }
-
 
36526
 
-
 
36527
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
-
 
36528
    public boolean isSet(_Fields field) {
-
 
36529
      switch (field) {
-
 
36530
      case BEGIN_INDEX:
-
 
36531
        return isSetBeginIndex();
-
 
36532
      case TOTAL_ITEMS:
-
 
36533
        return isSetTotalItems();
-
 
36534
      case ITEM_ID:
-
 
36535
        return isSetItemId();
-
 
36536
      }
-
 
36537
      throw new IllegalStateException();
-
 
36538
    }
-
 
36539
 
-
 
36540
    public boolean isSet(int fieldID) {
-
 
36541
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
-
 
36542
    }
-
 
36543
 
-
 
36544
    @Override
-
 
36545
    public boolean equals(Object that) {
-
 
36546
      if (that == null)
-
 
36547
        return false;
-
 
36548
      if (that instanceof getSimilarItemsCatalogIds_args)
-
 
36549
        return this.equals((getSimilarItemsCatalogIds_args)that);
-
 
36550
      return false;
-
 
36551
    }
-
 
36552
 
-
 
36553
    public boolean equals(getSimilarItemsCatalogIds_args that) {
-
 
36554
      if (that == null)
-
 
36555
        return false;
-
 
36556
 
-
 
36557
      boolean this_present_beginIndex = true;
-
 
36558
      boolean that_present_beginIndex = true;
-
 
36559
      if (this_present_beginIndex || that_present_beginIndex) {
-
 
36560
        if (!(this_present_beginIndex && that_present_beginIndex))
-
 
36561
          return false;
-
 
36562
        if (this.beginIndex != that.beginIndex)
-
 
36563
          return false;
-
 
36564
      }
-
 
36565
 
-
 
36566
      boolean this_present_totalItems = true;
-
 
36567
      boolean that_present_totalItems = true;
-
 
36568
      if (this_present_totalItems || that_present_totalItems) {
-
 
36569
        if (!(this_present_totalItems && that_present_totalItems))
-
 
36570
          return false;
-
 
36571
        if (this.totalItems != that.totalItems)
-
 
36572
          return false;
-
 
36573
      }
-
 
36574
 
-
 
36575
      boolean this_present_itemId = true;
-
 
36576
      boolean that_present_itemId = true;
-
 
36577
      if (this_present_itemId || that_present_itemId) {
-
 
36578
        if (!(this_present_itemId && that_present_itemId))
-
 
36579
          return false;
-
 
36580
        if (this.itemId != that.itemId)
-
 
36581
          return false;
-
 
36582
      }
-
 
36583
 
-
 
36584
      return true;
-
 
36585
    }
-
 
36586
 
-
 
36587
    @Override
-
 
36588
    public int hashCode() {
-
 
36589
      return 0;
-
 
36590
    }
-
 
36591
 
-
 
36592
    public int compareTo(getSimilarItemsCatalogIds_args other) {
-
 
36593
      if (!getClass().equals(other.getClass())) {
-
 
36594
        return getClass().getName().compareTo(other.getClass().getName());
-
 
36595
      }
-
 
36596
 
-
 
36597
      int lastComparison = 0;
-
 
36598
      getSimilarItemsCatalogIds_args typedOther = (getSimilarItemsCatalogIds_args)other;
-
 
36599
 
-
 
36600
      lastComparison = Boolean.valueOf(isSetBeginIndex()).compareTo(isSetBeginIndex());
-
 
36601
      if (lastComparison != 0) {
-
 
36602
        return lastComparison;
-
 
36603
      }
-
 
36604
      lastComparison = TBaseHelper.compareTo(beginIndex, typedOther.beginIndex);
-
 
36605
      if (lastComparison != 0) {
-
 
36606
        return lastComparison;
-
 
36607
      }
-
 
36608
      lastComparison = Boolean.valueOf(isSetTotalItems()).compareTo(isSetTotalItems());
-
 
36609
      if (lastComparison != 0) {
-
 
36610
        return lastComparison;
-
 
36611
      }
-
 
36612
      lastComparison = TBaseHelper.compareTo(totalItems, typedOther.totalItems);
-
 
36613
      if (lastComparison != 0) {
-
 
36614
        return lastComparison;
-
 
36615
      }
-
 
36616
      lastComparison = Boolean.valueOf(isSetItemId()).compareTo(isSetItemId());
-
 
36617
      if (lastComparison != 0) {
-
 
36618
        return lastComparison;
-
 
36619
      }
-
 
36620
      lastComparison = TBaseHelper.compareTo(itemId, typedOther.itemId);
-
 
36621
      if (lastComparison != 0) {
-
 
36622
        return lastComparison;
-
 
36623
      }
-
 
36624
      return 0;
-
 
36625
    }
-
 
36626
 
-
 
36627
    public void read(TProtocol iprot) throws TException {
-
 
36628
      TField field;
-
 
36629
      iprot.readStructBegin();
-
 
36630
      while (true)
-
 
36631
      {
-
 
36632
        field = iprot.readFieldBegin();
-
 
36633
        if (field.type == TType.STOP) { 
-
 
36634
          break;
-
 
36635
        }
-
 
36636
        _Fields fieldId = _Fields.findByThriftId(field.id);
-
 
36637
        if (fieldId == null) {
-
 
36638
          TProtocolUtil.skip(iprot, field.type);
-
 
36639
        } else {
-
 
36640
          switch (fieldId) {
-
 
36641
            case BEGIN_INDEX:
-
 
36642
              if (field.type == TType.I64) {
-
 
36643
                this.beginIndex = iprot.readI64();
-
 
36644
                setBeginIndexIsSet(true);
-
 
36645
              } else { 
-
 
36646
                TProtocolUtil.skip(iprot, field.type);
-
 
36647
              }
-
 
36648
              break;
-
 
36649
            case TOTAL_ITEMS:
-
 
36650
              if (field.type == TType.I64) {
-
 
36651
                this.totalItems = iprot.readI64();
-
 
36652
                setTotalItemsIsSet(true);
-
 
36653
              } else { 
-
 
36654
                TProtocolUtil.skip(iprot, field.type);
-
 
36655
              }
-
 
36656
              break;
-
 
36657
            case ITEM_ID:
-
 
36658
              if (field.type == TType.I64) {
-
 
36659
                this.itemId = iprot.readI64();
-
 
36660
                setItemIdIsSet(true);
-
 
36661
              } else { 
-
 
36662
                TProtocolUtil.skip(iprot, field.type);
-
 
36663
              }
-
 
36664
              break;
-
 
36665
          }
-
 
36666
          iprot.readFieldEnd();
-
 
36667
        }
-
 
36668
      }
-
 
36669
      iprot.readStructEnd();
-
 
36670
      validate();
-
 
36671
    }
-
 
36672
 
-
 
36673
    public void write(TProtocol oprot) throws TException {
-
 
36674
      validate();
-
 
36675
 
-
 
36676
      oprot.writeStructBegin(STRUCT_DESC);
-
 
36677
      oprot.writeFieldBegin(BEGIN_INDEX_FIELD_DESC);
-
 
36678
      oprot.writeI64(this.beginIndex);
-
 
36679
      oprot.writeFieldEnd();
-
 
36680
      oprot.writeFieldBegin(TOTAL_ITEMS_FIELD_DESC);
-
 
36681
      oprot.writeI64(this.totalItems);
-
 
36682
      oprot.writeFieldEnd();
-
 
36683
      oprot.writeFieldBegin(ITEM_ID_FIELD_DESC);
-
 
36684
      oprot.writeI64(this.itemId);
-
 
36685
      oprot.writeFieldEnd();
-
 
36686
      oprot.writeFieldStop();
-
 
36687
      oprot.writeStructEnd();
-
 
36688
    }
-
 
36689
 
-
 
36690
    @Override
-
 
36691
    public String toString() {
-
 
36692
      StringBuilder sb = new StringBuilder("getSimilarItemsCatalogIds_args(");
-
 
36693
      boolean first = true;
-
 
36694
 
-
 
36695
      sb.append("beginIndex:");
-
 
36696
      sb.append(this.beginIndex);
-
 
36697
      first = false;
-
 
36698
      if (!first) sb.append(", ");
-
 
36699
      sb.append("totalItems:");
-
 
36700
      sb.append(this.totalItems);
-
 
36701
      first = false;
-
 
36702
      if (!first) sb.append(", ");
-
 
36703
      sb.append("itemId:");
-
 
36704
      sb.append(this.itemId);
-
 
36705
      first = false;
-
 
36706
      sb.append(")");
-
 
36707
      return sb.toString();
-
 
36708
    }
-
 
36709
 
-
 
36710
    public void validate() throws TException {
-
 
36711
      // check for required fields
-
 
36712
    }
-
 
36713
 
-
 
36714
  }
-
 
36715
 
-
 
36716
  public static class getSimilarItemsCatalogIds_result implements TBase<getSimilarItemsCatalogIds_result._Fields>, java.io.Serializable, Cloneable, Comparable<getSimilarItemsCatalogIds_result>   {
-
 
36717
    private static final TStruct STRUCT_DESC = new TStruct("getSimilarItemsCatalogIds_result");
-
 
36718
 
-
 
36719
    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0);
-
 
36720
 
-
 
36721
    private List<Long> success;
-
 
36722
 
-
 
36723
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-
 
36724
    public enum _Fields implements TFieldIdEnum {
-
 
36725
      SUCCESS((short)0, "success");
-
 
36726
 
-
 
36727
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
-
 
36728
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
-
 
36729
 
-
 
36730
      static {
-
 
36731
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
-
 
36732
          byId.put((int)field._thriftId, field);
-
 
36733
          byName.put(field.getFieldName(), field);
-
 
36734
        }
-
 
36735
      }
-
 
36736
 
-
 
36737
      /**
-
 
36738
       * Find the _Fields constant that matches fieldId, or null if its not found.
-
 
36739
       */
-
 
36740
      public static _Fields findByThriftId(int fieldId) {
-
 
36741
        return byId.get(fieldId);
-
 
36742
      }
-
 
36743
 
-
 
36744
      /**
-
 
36745
       * Find the _Fields constant that matches fieldId, throwing an exception
-
 
36746
       * if it is not found.
-
 
36747
       */
-
 
36748
      public static _Fields findByThriftIdOrThrow(int fieldId) {
-
 
36749
        _Fields fields = findByThriftId(fieldId);
-
 
36750
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
-
 
36751
        return fields;
-
 
36752
      }
-
 
36753
 
-
 
36754
      /**
-
 
36755
       * Find the _Fields constant that matches name, or null if its not found.
-
 
36756
       */
-
 
36757
      public static _Fields findByName(String name) {
-
 
36758
        return byName.get(name);
-
 
36759
      }
-
 
36760
 
-
 
36761
      private final short _thriftId;
-
 
36762
      private final String _fieldName;
-
 
36763
 
-
 
36764
      _Fields(short thriftId, String fieldName) {
-
 
36765
        _thriftId = thriftId;
-
 
36766
        _fieldName = fieldName;
-
 
36767
      }
-
 
36768
 
-
 
36769
      public short getThriftFieldId() {
-
 
36770
        return _thriftId;
-
 
36771
      }
-
 
36772
 
-
 
36773
      public String getFieldName() {
-
 
36774
        return _fieldName;
-
 
36775
      }
-
 
36776
    }
-
 
36777
 
-
 
36778
    // isset id assignments
-
 
36779
 
-
 
36780
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
-
 
36781
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
-
 
36782
          new ListMetaData(TType.LIST, 
-
 
36783
              new FieldValueMetaData(TType.I64))));
-
 
36784
    }});
-
 
36785
 
-
 
36786
    static {
-
 
36787
      FieldMetaData.addStructMetaDataMap(getSimilarItemsCatalogIds_result.class, metaDataMap);
-
 
36788
    }
-
 
36789
 
-
 
36790
    public getSimilarItemsCatalogIds_result() {
-
 
36791
    }
-
 
36792
 
-
 
36793
    public getSimilarItemsCatalogIds_result(
-
 
36794
      List<Long> success)
-
 
36795
    {
-
 
36796
      this();
-
 
36797
      this.success = success;
-
 
36798
    }
-
 
36799
 
-
 
36800
    /**
-
 
36801
     * Performs a deep copy on <i>other</i>.
-
 
36802
     */
-
 
36803
    public getSimilarItemsCatalogIds_result(getSimilarItemsCatalogIds_result other) {
-
 
36804
      if (other.isSetSuccess()) {
-
 
36805
        List<Long> __this__success = new ArrayList<Long>();
-
 
36806
        for (Long other_element : other.success) {
-
 
36807
          __this__success.add(other_element);
-
 
36808
        }
-
 
36809
        this.success = __this__success;
-
 
36810
      }
-
 
36811
    }
-
 
36812
 
-
 
36813
    public getSimilarItemsCatalogIds_result deepCopy() {
-
 
36814
      return new getSimilarItemsCatalogIds_result(this);
-
 
36815
    }
-
 
36816
 
-
 
36817
    @Deprecated
-
 
36818
    public getSimilarItemsCatalogIds_result clone() {
-
 
36819
      return new getSimilarItemsCatalogIds_result(this);
-
 
36820
    }
-
 
36821
 
-
 
36822
    public int getSuccessSize() {
-
 
36823
      return (this.success == null) ? 0 : this.success.size();
-
 
36824
    }
-
 
36825
 
-
 
36826
    public java.util.Iterator<Long> getSuccessIterator() {
-
 
36827
      return (this.success == null) ? null : this.success.iterator();
-
 
36828
    }
-
 
36829
 
-
 
36830
    public void addToSuccess(long elem) {
-
 
36831
      if (this.success == null) {
-
 
36832
        this.success = new ArrayList<Long>();
-
 
36833
      }
-
 
36834
      this.success.add(elem);
-
 
36835
    }
-
 
36836
 
-
 
36837
    public List<Long> getSuccess() {
-
 
36838
      return this.success;
-
 
36839
    }
-
 
36840
 
-
 
36841
    public getSimilarItemsCatalogIds_result setSuccess(List<Long> success) {
-
 
36842
      this.success = success;
-
 
36843
      return this;
-
 
36844
    }
-
 
36845
 
-
 
36846
    public void unsetSuccess() {
-
 
36847
      this.success = null;
-
 
36848
    }
-
 
36849
 
-
 
36850
    /** Returns true if field success is set (has been asigned a value) and false otherwise */
-
 
36851
    public boolean isSetSuccess() {
-
 
36852
      return this.success != null;
-
 
36853
    }
-
 
36854
 
-
 
36855
    public void setSuccessIsSet(boolean value) {
-
 
36856
      if (!value) {
-
 
36857
        this.success = null;
-
 
36858
      }
-
 
36859
    }
-
 
36860
 
-
 
36861
    public void setFieldValue(_Fields field, Object value) {
-
 
36862
      switch (field) {
-
 
36863
      case SUCCESS:
-
 
36864
        if (value == null) {
-
 
36865
          unsetSuccess();
-
 
36866
        } else {
-
 
36867
          setSuccess((List<Long>)value);
-
 
36868
        }
-
 
36869
        break;
-
 
36870
 
-
 
36871
      }
-
 
36872
    }
-
 
36873
 
-
 
36874
    public void setFieldValue(int fieldID, Object value) {
-
 
36875
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
-
 
36876
    }
-
 
36877
 
-
 
36878
    public Object getFieldValue(_Fields field) {
-
 
36879
      switch (field) {
-
 
36880
      case SUCCESS:
-
 
36881
        return getSuccess();
-
 
36882
 
-
 
36883
      }
-
 
36884
      throw new IllegalStateException();
-
 
36885
    }
-
 
36886
 
-
 
36887
    public Object getFieldValue(int fieldId) {
-
 
36888
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
-
 
36889
    }
-
 
36890
 
-
 
36891
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
-
 
36892
    public boolean isSet(_Fields field) {
-
 
36893
      switch (field) {
-
 
36894
      case SUCCESS:
-
 
36895
        return isSetSuccess();
-
 
36896
      }
-
 
36897
      throw new IllegalStateException();
-
 
36898
    }
-
 
36899
 
-
 
36900
    public boolean isSet(int fieldID) {
-
 
36901
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
-
 
36902
    }
-
 
36903
 
-
 
36904
    @Override
-
 
36905
    public boolean equals(Object that) {
-
 
36906
      if (that == null)
-
 
36907
        return false;
-
 
36908
      if (that instanceof getSimilarItemsCatalogIds_result)
-
 
36909
        return this.equals((getSimilarItemsCatalogIds_result)that);
-
 
36910
      return false;
-
 
36911
    }
-
 
36912
 
-
 
36913
    public boolean equals(getSimilarItemsCatalogIds_result that) {
-
 
36914
      if (that == null)
-
 
36915
        return false;
-
 
36916
 
-
 
36917
      boolean this_present_success = true && this.isSetSuccess();
-
 
36918
      boolean that_present_success = true && that.isSetSuccess();
-
 
36919
      if (this_present_success || that_present_success) {
-
 
36920
        if (!(this_present_success && that_present_success))
-
 
36921
          return false;
-
 
36922
        if (!this.success.equals(that.success))
-
 
36923
          return false;
-
 
36924
      }
-
 
36925
 
-
 
36926
      return true;
-
 
36927
    }
-
 
36928
 
-
 
36929
    @Override
-
 
36930
    public int hashCode() {
-
 
36931
      return 0;
-
 
36932
    }
-
 
36933
 
-
 
36934
    public int compareTo(getSimilarItemsCatalogIds_result other) {
-
 
36935
      if (!getClass().equals(other.getClass())) {
-
 
36936
        return getClass().getName().compareTo(other.getClass().getName());
-
 
36937
      }
-
 
36938
 
-
 
36939
      int lastComparison = 0;
-
 
36940
      getSimilarItemsCatalogIds_result typedOther = (getSimilarItemsCatalogIds_result)other;
-
 
36941
 
-
 
36942
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
-
 
36943
      if (lastComparison != 0) {
-
 
36944
        return lastComparison;
-
 
36945
      }
-
 
36946
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
-
 
36947
      if (lastComparison != 0) {
-
 
36948
        return lastComparison;
-
 
36949
      }
-
 
36950
      return 0;
-
 
36951
    }
-
 
36952
 
-
 
36953
    public void read(TProtocol iprot) throws TException {
-
 
36954
      TField field;
-
 
36955
      iprot.readStructBegin();
-
 
36956
      while (true)
-
 
36957
      {
-
 
36958
        field = iprot.readFieldBegin();
-
 
36959
        if (field.type == TType.STOP) { 
-
 
36960
          break;
-
 
36961
        }
-
 
36962
        _Fields fieldId = _Fields.findByThriftId(field.id);
-
 
36963
        if (fieldId == null) {
-
 
36964
          TProtocolUtil.skip(iprot, field.type);
-
 
36965
        } else {
-
 
36966
          switch (fieldId) {
-
 
36967
            case SUCCESS:
-
 
36968
              if (field.type == TType.LIST) {
-
 
36969
                {
-
 
36970
                  TList _list95 = iprot.readListBegin();
-
 
36971
                  this.success = new ArrayList<Long>(_list95.size);
-
 
36972
                  for (int _i96 = 0; _i96 < _list95.size; ++_i96)
-
 
36973
                  {
-
 
36974
                    long _elem97;
-
 
36975
                    _elem97 = iprot.readI64();
-
 
36976
                    this.success.add(_elem97);
-
 
36977
                  }
-
 
36978
                  iprot.readListEnd();
-
 
36979
                }
-
 
36980
              } else { 
-
 
36981
                TProtocolUtil.skip(iprot, field.type);
-
 
36982
              }
-
 
36983
              break;
-
 
36984
          }
-
 
36985
          iprot.readFieldEnd();
-
 
36986
        }
-
 
36987
      }
-
 
36988
      iprot.readStructEnd();
-
 
36989
      validate();
-
 
36990
    }
-
 
36991
 
-
 
36992
    public void write(TProtocol oprot) throws TException {
-
 
36993
      oprot.writeStructBegin(STRUCT_DESC);
-
 
36994
 
-
 
36995
      if (this.isSetSuccess()) {
-
 
36996
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
-
 
36997
        {
-
 
36998
          oprot.writeListBegin(new TList(TType.I64, this.success.size()));
-
 
36999
          for (long _iter98 : this.success)
-
 
37000
          {
-
 
37001
            oprot.writeI64(_iter98);
-
 
37002
          }
-
 
37003
          oprot.writeListEnd();
-
 
37004
        }
-
 
37005
        oprot.writeFieldEnd();
-
 
37006
      }
-
 
37007
      oprot.writeFieldStop();
-
 
37008
      oprot.writeStructEnd();
-
 
37009
    }
-
 
37010
 
-
 
37011
    @Override
-
 
37012
    public String toString() {
-
 
37013
      StringBuilder sb = new StringBuilder("getSimilarItemsCatalogIds_result(");
-
 
37014
      boolean first = true;
-
 
37015
 
-
 
37016
      sb.append("success:");
-
 
37017
      if (this.success == null) {
-
 
37018
        sb.append("null");
36207
      } else {
37019
      } else {
36208
        sb.append(this.success);
37020
        sb.append(this.success);
36209
      }
37021
      }
36210
      first = false;
37022
      first = false;
36211
      sb.append(")");
37023
      sb.append(")");