Subversion Repositories SmartDukaan

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
100 ashish 1
/**
2
 * Autogenerated by Thrift
3
 *
4
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
 */
6
package in.shop2020.model.v1.catalog;
7
 
8
import java.util.List;
9
import java.util.ArrayList;
10
import java.util.Map;
11
import java.util.HashMap;
12
import java.util.EnumMap;
13
import java.util.Set;
14
import java.util.HashSet;
15
import java.util.EnumSet;
16
import java.util.Collections;
17
import java.util.BitSet;
18
import java.util.Arrays;
19
import org.slf4j.Logger;
20
import org.slf4j.LoggerFactory;
21
 
22
import org.apache.thrift.*;
23
import org.apache.thrift.meta_data.*;
24
import org.apache.thrift.protocol.*;
25
 
26
public class CatalogService {
27
 
28
  public interface Iface {
29
 
30
    /**
31
     * Availability and inventory attributes
32
     * 
33
     * @param category
34
     */
103 ashish 35
    public long addCategory(Category category) throws CatalogServiceException, TException;
100 ashish 36
 
103 ashish 37
    public long addItem(Item item) throws CatalogServiceException, TException;
100 ashish 38
 
103 ashish 39
    public long addItemToCategory(long item_id, long category_id) throws CatalogServiceException, TException;
100 ashish 40
 
103 ashish 41
    public long addWarehouse(Warehouse warehouse) throws CatalogServiceException, TException;
100 ashish 42
 
103 ashish 43
    public long addVendor(Vendor vendor) throws CatalogServiceException, TException;
100 ashish 44
 
45
    public void updateInventory(long item_id, long warehouse_id, long quantity, long timestamp) throws CatalogServiceException, TException;
46
 
103 ashish 47
    public void retireCategory(long category_id) throws CatalogServiceException, TException;
48
 
49
    public void retireVendor(long vendor_id) throws CatalogServiceException, TException;
50
 
51
    public void retireWarehouse(long warehouse_id) throws CatalogServiceException, TException;
52
 
53
    public void startItemOn(long item_id, long timestamp) throws CatalogServiceException, TException;
54
 
55
    public void retireItemOn(long item_id, long timestamp) throws CatalogServiceException, TException;
56
 
57
    public void changeItemStatus(long item_id, long timestamp, status newstatus) throws CatalogServiceException, TException;
58
 
100 ashish 59
    public Category getCategory(long id) throws CatalogServiceException, TException;
60
 
103 ashish 61
    public List<Category> getAllCategories(boolean isActive) throws CatalogServiceException, TException;
100 ashish 62
 
63
    public Item getItem(long item_id) throws CatalogServiceException, TException;
64
 
103 ashish 65
    public List<Item> getAllItemsForCategory(long category_id, boolean isActive) throws CatalogServiceException, TException;
100 ashish 66
 
103 ashish 67
    public List<Item> getAllItems(boolean isActive) throws CatalogServiceException, TException;
100 ashish 68
 
103 ashish 69
    public List<Item> getAllItemsByStatus(status itemStatus) throws CatalogServiceException, TException;
70
 
100 ashish 71
    public ItemInventory getItemInventory(long item_id) throws CatalogServiceException, TException;
72
 
103 ashish 73
    public long getItemAvailibilityAtWarehouse(long warehouse_id, long item_id) throws CatalogServiceException, TException;
74
 
100 ashish 75
    public ItemInventoryHistory getItemInventoryHistory(long id, long item_id, long warehouse_id, long from_date, long to_date) throws CatalogServiceException, TException;
76
 
103 ashish 77
    public List<Warehouse> getAllWarehouses(boolean isActive) throws CatalogServiceException, TException;
78
 
100 ashish 79
    public Warehouse getWarehouse(long warehouse_id) throws CatalogServiceException, TException;
80
 
103 ashish 81
    public List<Warehouse> getAllWarehousesForItem(long item_id) throws CatalogServiceException, TException;
100 ashish 82
 
103 ashish 83
    public List<Item> getAllItemsForWarehouse(long warehouse_id) throws CatalogServiceException, TException;
100 ashish 84
 
103 ashish 85
    public Vendor getVendor(long vendor_id) throws CatalogServiceException, TException;
86
 
87
    public List<Vendor> getAllVendors(boolean isActive) throws CatalogServiceException, TException;
88
 
100 ashish 89
  }
90
 
91
  public static class Client implements Iface {
92
    public Client(TProtocol prot)
93
    {
94
      this(prot, prot);
95
    }
96
 
97
    public Client(TProtocol iprot, TProtocol oprot)
98
    {
99
      iprot_ = iprot;
100
      oprot_ = oprot;
101
    }
102
 
103
    protected TProtocol iprot_;
104
    protected TProtocol oprot_;
105
 
106
    protected int seqid_;
107
 
108
    public TProtocol getInputProtocol()
109
    {
110
      return this.iprot_;
111
    }
112
 
113
    public TProtocol getOutputProtocol()
114
    {
115
      return this.oprot_;
116
    }
117
 
103 ashish 118
    public long addCategory(Category category) throws CatalogServiceException, TException
100 ashish 119
    {
120
      send_addCategory(category);
103 ashish 121
      return recv_addCategory();
100 ashish 122
    }
123
 
124
    public void send_addCategory(Category category) throws TException
125
    {
126
      oprot_.writeMessageBegin(new TMessage("addCategory", TMessageType.CALL, seqid_));
127
      addCategory_args args = new addCategory_args();
128
      args.category = category;
129
      args.write(oprot_);
130
      oprot_.writeMessageEnd();
131
      oprot_.getTransport().flush();
132
    }
133
 
103 ashish 134
    public long recv_addCategory() throws CatalogServiceException, TException
100 ashish 135
    {
136
      TMessage msg = iprot_.readMessageBegin();
137
      if (msg.type == TMessageType.EXCEPTION) {
138
        TApplicationException x = TApplicationException.read(iprot_);
139
        iprot_.readMessageEnd();
140
        throw x;
141
      }
142
      addCategory_result result = new addCategory_result();
143
      result.read(iprot_);
144
      iprot_.readMessageEnd();
103 ashish 145
      if (result.isSetSuccess()) {
146
        return result.success;
147
      }
100 ashish 148
      if (result.cex != null) {
149
        throw result.cex;
150
      }
103 ashish 151
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "addCategory failed: unknown result");
100 ashish 152
    }
153
 
103 ashish 154
    public long addItem(Item item) throws CatalogServiceException, TException
100 ashish 155
    {
103 ashish 156
      send_addItem(item);
157
      return recv_addItem();
100 ashish 158
    }
159
 
103 ashish 160
    public void send_addItem(Item item) throws TException
100 ashish 161
    {
103 ashish 162
      oprot_.writeMessageBegin(new TMessage("addItem", TMessageType.CALL, seqid_));
163
      addItem_args args = new addItem_args();
164
      args.item = item;
165
      args.write(oprot_);
166
      oprot_.writeMessageEnd();
167
      oprot_.getTransport().flush();
168
    }
169
 
170
    public long recv_addItem() throws CatalogServiceException, TException
171
    {
172
      TMessage msg = iprot_.readMessageBegin();
173
      if (msg.type == TMessageType.EXCEPTION) {
174
        TApplicationException x = TApplicationException.read(iprot_);
175
        iprot_.readMessageEnd();
176
        throw x;
177
      }
178
      addItem_result result = new addItem_result();
179
      result.read(iprot_);
180
      iprot_.readMessageEnd();
181
      if (result.isSetSuccess()) {
182
        return result.success;
183
      }
184
      if (result.cex != null) {
185
        throw result.cex;
186
      }
187
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "addItem failed: unknown result");
188
    }
189
 
190
    public long addItemToCategory(long item_id, long category_id) throws CatalogServiceException, TException
191
    {
192
      send_addItemToCategory(item_id, category_id);
193
      return recv_addItemToCategory();
194
    }
195
 
196
    public void send_addItemToCategory(long item_id, long category_id) throws TException
197
    {
100 ashish 198
      oprot_.writeMessageBegin(new TMessage("addItemToCategory", TMessageType.CALL, seqid_));
199
      addItemToCategory_args args = new addItemToCategory_args();
103 ashish 200
      args.item_id = item_id;
100 ashish 201
      args.category_id = category_id;
202
      args.write(oprot_);
203
      oprot_.writeMessageEnd();
204
      oprot_.getTransport().flush();
205
    }
206
 
103 ashish 207
    public long recv_addItemToCategory() throws CatalogServiceException, TException
100 ashish 208
    {
209
      TMessage msg = iprot_.readMessageBegin();
210
      if (msg.type == TMessageType.EXCEPTION) {
211
        TApplicationException x = TApplicationException.read(iprot_);
212
        iprot_.readMessageEnd();
213
        throw x;
214
      }
215
      addItemToCategory_result result = new addItemToCategory_result();
216
      result.read(iprot_);
217
      iprot_.readMessageEnd();
103 ashish 218
      if (result.isSetSuccess()) {
219
        return result.success;
220
      }
100 ashish 221
      if (result.cex != null) {
222
        throw result.cex;
223
      }
103 ashish 224
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "addItemToCategory failed: unknown result");
100 ashish 225
    }
226
 
103 ashish 227
    public long addWarehouse(Warehouse warehouse) throws CatalogServiceException, TException
100 ashish 228
    {
103 ashish 229
      send_addWarehouse(warehouse);
230
      return recv_addWarehouse();
100 ashish 231
    }
232
 
103 ashish 233
    public void send_addWarehouse(Warehouse warehouse) throws TException
100 ashish 234
    {
103 ashish 235
      oprot_.writeMessageBegin(new TMessage("addWarehouse", TMessageType.CALL, seqid_));
236
      addWarehouse_args args = new addWarehouse_args();
237
      args.warehouse = warehouse;
238
      args.write(oprot_);
239
      oprot_.writeMessageEnd();
240
      oprot_.getTransport().flush();
241
    }
242
 
243
    public long recv_addWarehouse() throws CatalogServiceException, TException
244
    {
245
      TMessage msg = iprot_.readMessageBegin();
246
      if (msg.type == TMessageType.EXCEPTION) {
247
        TApplicationException x = TApplicationException.read(iprot_);
248
        iprot_.readMessageEnd();
249
        throw x;
250
      }
251
      addWarehouse_result result = new addWarehouse_result();
252
      result.read(iprot_);
253
      iprot_.readMessageEnd();
254
      if (result.isSetSuccess()) {
255
        return result.success;
256
      }
257
      if (result.cex != null) {
258
        throw result.cex;
259
      }
260
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "addWarehouse failed: unknown result");
261
    }
262
 
263
    public long addVendor(Vendor vendor) throws CatalogServiceException, TException
264
    {
265
      send_addVendor(vendor);
266
      return recv_addVendor();
267
    }
268
 
269
    public void send_addVendor(Vendor vendor) throws TException
270
    {
271
      oprot_.writeMessageBegin(new TMessage("addVendor", TMessageType.CALL, seqid_));
272
      addVendor_args args = new addVendor_args();
273
      args.vendor = vendor;
274
      args.write(oprot_);
275
      oprot_.writeMessageEnd();
276
      oprot_.getTransport().flush();
277
    }
278
 
279
    public long recv_addVendor() throws CatalogServiceException, TException
280
    {
281
      TMessage msg = iprot_.readMessageBegin();
282
      if (msg.type == TMessageType.EXCEPTION) {
283
        TApplicationException x = TApplicationException.read(iprot_);
284
        iprot_.readMessageEnd();
285
        throw x;
286
      }
287
      addVendor_result result = new addVendor_result();
288
      result.read(iprot_);
289
      iprot_.readMessageEnd();
290
      if (result.isSetSuccess()) {
291
        return result.success;
292
      }
293
      if (result.cex != null) {
294
        throw result.cex;
295
      }
296
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "addVendor failed: unknown result");
297
    }
298
 
299
    public void updateInventory(long item_id, long warehouse_id, long quantity, long timestamp) throws CatalogServiceException, TException
300
    {
301
      send_updateInventory(item_id, warehouse_id, quantity, timestamp);
302
      recv_updateInventory();
303
    }
304
 
305
    public void send_updateInventory(long item_id, long warehouse_id, long quantity, long timestamp) throws TException
306
    {
307
      oprot_.writeMessageBegin(new TMessage("updateInventory", TMessageType.CALL, seqid_));
308
      updateInventory_args args = new updateInventory_args();
100 ashish 309
      args.item_id = item_id;
103 ashish 310
      args.warehouse_id = warehouse_id;
311
      args.quantity = quantity;
312
      args.timestamp = timestamp;
100 ashish 313
      args.write(oprot_);
314
      oprot_.writeMessageEnd();
315
      oprot_.getTransport().flush();
316
    }
317
 
103 ashish 318
    public void recv_updateInventory() throws CatalogServiceException, TException
100 ashish 319
    {
320
      TMessage msg = iprot_.readMessageBegin();
321
      if (msg.type == TMessageType.EXCEPTION) {
322
        TApplicationException x = TApplicationException.read(iprot_);
323
        iprot_.readMessageEnd();
324
        throw x;
325
      }
103 ashish 326
      updateInventory_result result = new updateInventory_result();
100 ashish 327
      result.read(iprot_);
328
      iprot_.readMessageEnd();
329
      if (result.cex != null) {
330
        throw result.cex;
331
      }
332
      return;
333
    }
334
 
103 ashish 335
    public void retireCategory(long category_id) throws CatalogServiceException, TException
100 ashish 336
    {
103 ashish 337
      send_retireCategory(category_id);
338
      recv_retireCategory();
100 ashish 339
    }
340
 
103 ashish 341
    public void send_retireCategory(long category_id) throws TException
100 ashish 342
    {
103 ashish 343
      oprot_.writeMessageBegin(new TMessage("retireCategory", TMessageType.CALL, seqid_));
344
      retireCategory_args args = new retireCategory_args();
345
      args.category_id = category_id;
100 ashish 346
      args.write(oprot_);
347
      oprot_.writeMessageEnd();
348
      oprot_.getTransport().flush();
349
    }
350
 
103 ashish 351
    public void recv_retireCategory() throws CatalogServiceException, TException
100 ashish 352
    {
353
      TMessage msg = iprot_.readMessageBegin();
354
      if (msg.type == TMessageType.EXCEPTION) {
355
        TApplicationException x = TApplicationException.read(iprot_);
356
        iprot_.readMessageEnd();
357
        throw x;
358
      }
103 ashish 359
      retireCategory_result result = new retireCategory_result();
100 ashish 360
      result.read(iprot_);
361
      iprot_.readMessageEnd();
362
      if (result.cex != null) {
363
        throw result.cex;
364
      }
365
      return;
366
    }
367
 
103 ashish 368
    public void retireVendor(long vendor_id) throws CatalogServiceException, TException
100 ashish 369
    {
103 ashish 370
      send_retireVendor(vendor_id);
371
      recv_retireVendor();
100 ashish 372
    }
373
 
103 ashish 374
    public void send_retireVendor(long vendor_id) throws TException
100 ashish 375
    {
103 ashish 376
      oprot_.writeMessageBegin(new TMessage("retireVendor", TMessageType.CALL, seqid_));
377
      retireVendor_args args = new retireVendor_args();
378
      args.vendor_id = vendor_id;
100 ashish 379
      args.write(oprot_);
380
      oprot_.writeMessageEnd();
381
      oprot_.getTransport().flush();
382
    }
383
 
103 ashish 384
    public void recv_retireVendor() throws CatalogServiceException, TException
100 ashish 385
    {
386
      TMessage msg = iprot_.readMessageBegin();
387
      if (msg.type == TMessageType.EXCEPTION) {
388
        TApplicationException x = TApplicationException.read(iprot_);
389
        iprot_.readMessageEnd();
390
        throw x;
391
      }
103 ashish 392
      retireVendor_result result = new retireVendor_result();
100 ashish 393
      result.read(iprot_);
394
      iprot_.readMessageEnd();
395
      if (result.cex != null) {
396
        throw result.cex;
397
      }
398
      return;
399
    }
400
 
103 ashish 401
    public void retireWarehouse(long warehouse_id) throws CatalogServiceException, TException
100 ashish 402
    {
103 ashish 403
      send_retireWarehouse(warehouse_id);
404
      recv_retireWarehouse();
100 ashish 405
    }
406
 
103 ashish 407
    public void send_retireWarehouse(long warehouse_id) throws TException
100 ashish 408
    {
103 ashish 409
      oprot_.writeMessageBegin(new TMessage("retireWarehouse", TMessageType.CALL, seqid_));
410
      retireWarehouse_args args = new retireWarehouse_args();
411
      args.warehouse_id = warehouse_id;
100 ashish 412
      args.write(oprot_);
413
      oprot_.writeMessageEnd();
414
      oprot_.getTransport().flush();
415
    }
416
 
103 ashish 417
    public void recv_retireWarehouse() throws CatalogServiceException, TException
100 ashish 418
    {
419
      TMessage msg = iprot_.readMessageBegin();
420
      if (msg.type == TMessageType.EXCEPTION) {
421
        TApplicationException x = TApplicationException.read(iprot_);
422
        iprot_.readMessageEnd();
423
        throw x;
424
      }
103 ashish 425
      retireWarehouse_result result = new retireWarehouse_result();
100 ashish 426
      result.read(iprot_);
427
      iprot_.readMessageEnd();
428
      if (result.cex != null) {
429
        throw result.cex;
430
      }
431
      return;
432
    }
433
 
103 ashish 434
    public void startItemOn(long item_id, long timestamp) throws CatalogServiceException, TException
100 ashish 435
    {
103 ashish 436
      send_startItemOn(item_id, timestamp);
437
      recv_startItemOn();
100 ashish 438
    }
439
 
103 ashish 440
    public void send_startItemOn(long item_id, long timestamp) throws TException
100 ashish 441
    {
103 ashish 442
      oprot_.writeMessageBegin(new TMessage("startItemOn", TMessageType.CALL, seqid_));
443
      startItemOn_args args = new startItemOn_args();
100 ashish 444
      args.item_id = item_id;
445
      args.timestamp = timestamp;
446
      args.write(oprot_);
447
      oprot_.writeMessageEnd();
448
      oprot_.getTransport().flush();
449
    }
450
 
103 ashish 451
    public void recv_startItemOn() throws CatalogServiceException, TException
100 ashish 452
    {
453
      TMessage msg = iprot_.readMessageBegin();
454
      if (msg.type == TMessageType.EXCEPTION) {
455
        TApplicationException x = TApplicationException.read(iprot_);
456
        iprot_.readMessageEnd();
457
        throw x;
458
      }
103 ashish 459
      startItemOn_result result = new startItemOn_result();
100 ashish 460
      result.read(iprot_);
461
      iprot_.readMessageEnd();
462
      if (result.cex != null) {
463
        throw result.cex;
464
      }
465
      return;
466
    }
467
 
103 ashish 468
    public void retireItemOn(long item_id, long timestamp) throws CatalogServiceException, TException
469
    {
470
      send_retireItemOn(item_id, timestamp);
471
      recv_retireItemOn();
472
    }
473
 
474
    public void send_retireItemOn(long item_id, long timestamp) throws TException
475
    {
476
      oprot_.writeMessageBegin(new TMessage("retireItemOn", TMessageType.CALL, seqid_));
477
      retireItemOn_args args = new retireItemOn_args();
478
      args.item_id = item_id;
479
      args.timestamp = timestamp;
480
      args.write(oprot_);
481
      oprot_.writeMessageEnd();
482
      oprot_.getTransport().flush();
483
    }
484
 
485
    public void recv_retireItemOn() throws CatalogServiceException, TException
486
    {
487
      TMessage msg = iprot_.readMessageBegin();
488
      if (msg.type == TMessageType.EXCEPTION) {
489
        TApplicationException x = TApplicationException.read(iprot_);
490
        iprot_.readMessageEnd();
491
        throw x;
492
      }
493
      retireItemOn_result result = new retireItemOn_result();
494
      result.read(iprot_);
495
      iprot_.readMessageEnd();
496
      if (result.cex != null) {
497
        throw result.cex;
498
      }
499
      return;
500
    }
501
 
502
    public void changeItemStatus(long item_id, long timestamp, status newstatus) throws CatalogServiceException, TException
503
    {
504
      send_changeItemStatus(item_id, timestamp, newstatus);
505
      recv_changeItemStatus();
506
    }
507
 
508
    public void send_changeItemStatus(long item_id, long timestamp, status newstatus) throws TException
509
    {
510
      oprot_.writeMessageBegin(new TMessage("changeItemStatus", TMessageType.CALL, seqid_));
511
      changeItemStatus_args args = new changeItemStatus_args();
512
      args.item_id = item_id;
513
      args.timestamp = timestamp;
514
      args.newstatus = newstatus;
515
      args.write(oprot_);
516
      oprot_.writeMessageEnd();
517
      oprot_.getTransport().flush();
518
    }
519
 
520
    public void recv_changeItemStatus() throws CatalogServiceException, TException
521
    {
522
      TMessage msg = iprot_.readMessageBegin();
523
      if (msg.type == TMessageType.EXCEPTION) {
524
        TApplicationException x = TApplicationException.read(iprot_);
525
        iprot_.readMessageEnd();
526
        throw x;
527
      }
528
      changeItemStatus_result result = new changeItemStatus_result();
529
      result.read(iprot_);
530
      iprot_.readMessageEnd();
531
      if (result.cex != null) {
532
        throw result.cex;
533
      }
534
      return;
535
    }
536
 
100 ashish 537
    public Category getCategory(long id) throws CatalogServiceException, TException
538
    {
539
      send_getCategory(id);
540
      return recv_getCategory();
541
    }
542
 
543
    public void send_getCategory(long id) throws TException
544
    {
545
      oprot_.writeMessageBegin(new TMessage("getCategory", TMessageType.CALL, seqid_));
546
      getCategory_args args = new getCategory_args();
547
      args.id = id;
548
      args.write(oprot_);
549
      oprot_.writeMessageEnd();
550
      oprot_.getTransport().flush();
551
    }
552
 
553
    public Category recv_getCategory() throws CatalogServiceException, TException
554
    {
555
      TMessage msg = iprot_.readMessageBegin();
556
      if (msg.type == TMessageType.EXCEPTION) {
557
        TApplicationException x = TApplicationException.read(iprot_);
558
        iprot_.readMessageEnd();
559
        throw x;
560
      }
561
      getCategory_result result = new getCategory_result();
562
      result.read(iprot_);
563
      iprot_.readMessageEnd();
564
      if (result.isSetSuccess()) {
565
        return result.success;
566
      }
567
      if (result.cex != null) {
568
        throw result.cex;
569
      }
570
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getCategory failed: unknown result");
571
    }
572
 
103 ashish 573
    public List<Category> getAllCategories(boolean isActive) throws CatalogServiceException, TException
100 ashish 574
    {
103 ashish 575
      send_getAllCategories(isActive);
100 ashish 576
      return recv_getAllCategories();
577
    }
578
 
103 ashish 579
    public void send_getAllCategories(boolean isActive) throws TException
100 ashish 580
    {
581
      oprot_.writeMessageBegin(new TMessage("getAllCategories", TMessageType.CALL, seqid_));
582
      getAllCategories_args args = new getAllCategories_args();
103 ashish 583
      args.isActive = isActive;
100 ashish 584
      args.write(oprot_);
585
      oprot_.writeMessageEnd();
586
      oprot_.getTransport().flush();
587
    }
588
 
589
    public List<Category> recv_getAllCategories() throws CatalogServiceException, TException
590
    {
591
      TMessage msg = iprot_.readMessageBegin();
592
      if (msg.type == TMessageType.EXCEPTION) {
593
        TApplicationException x = TApplicationException.read(iprot_);
594
        iprot_.readMessageEnd();
595
        throw x;
596
      }
597
      getAllCategories_result result = new getAllCategories_result();
598
      result.read(iprot_);
599
      iprot_.readMessageEnd();
600
      if (result.isSetSuccess()) {
601
        return result.success;
602
      }
603
      if (result.cex != null) {
604
        throw result.cex;
605
      }
606
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getAllCategories failed: unknown result");
607
    }
608
 
609
    public Item getItem(long item_id) throws CatalogServiceException, TException
610
    {
611
      send_getItem(item_id);
612
      return recv_getItem();
613
    }
614
 
615
    public void send_getItem(long item_id) throws TException
616
    {
617
      oprot_.writeMessageBegin(new TMessage("getItem", TMessageType.CALL, seqid_));
618
      getItem_args args = new getItem_args();
619
      args.item_id = item_id;
620
      args.write(oprot_);
621
      oprot_.writeMessageEnd();
622
      oprot_.getTransport().flush();
623
    }
624
 
625
    public Item recv_getItem() throws CatalogServiceException, TException
626
    {
627
      TMessage msg = iprot_.readMessageBegin();
628
      if (msg.type == TMessageType.EXCEPTION) {
629
        TApplicationException x = TApplicationException.read(iprot_);
630
        iprot_.readMessageEnd();
631
        throw x;
632
      }
633
      getItem_result result = new getItem_result();
634
      result.read(iprot_);
635
      iprot_.readMessageEnd();
636
      if (result.isSetSuccess()) {
637
        return result.success;
638
      }
639
      if (result.cex != null) {
640
        throw result.cex;
641
      }
642
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getItem failed: unknown result");
643
    }
644
 
103 ashish 645
    public List<Item> getAllItemsForCategory(long category_id, boolean isActive) throws CatalogServiceException, TException
100 ashish 646
    {
103 ashish 647
      send_getAllItemsForCategory(category_id, isActive);
100 ashish 648
      return recv_getAllItemsForCategory();
649
    }
650
 
103 ashish 651
    public void send_getAllItemsForCategory(long category_id, boolean isActive) throws TException
100 ashish 652
    {
653
      oprot_.writeMessageBegin(new TMessage("getAllItemsForCategory", TMessageType.CALL, seqid_));
654
      getAllItemsForCategory_args args = new getAllItemsForCategory_args();
655
      args.category_id = category_id;
103 ashish 656
      args.isActive = isActive;
100 ashish 657
      args.write(oprot_);
658
      oprot_.writeMessageEnd();
659
      oprot_.getTransport().flush();
660
    }
661
 
662
    public List<Item> recv_getAllItemsForCategory() throws CatalogServiceException, TException
663
    {
664
      TMessage msg = iprot_.readMessageBegin();
665
      if (msg.type == TMessageType.EXCEPTION) {
666
        TApplicationException x = TApplicationException.read(iprot_);
667
        iprot_.readMessageEnd();
668
        throw x;
669
      }
670
      getAllItemsForCategory_result result = new getAllItemsForCategory_result();
671
      result.read(iprot_);
672
      iprot_.readMessageEnd();
673
      if (result.isSetSuccess()) {
674
        return result.success;
675
      }
676
      if (result.cex != null) {
677
        throw result.cex;
678
      }
679
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getAllItemsForCategory failed: unknown result");
680
    }
681
 
103 ashish 682
    public List<Item> getAllItems(boolean isActive) throws CatalogServiceException, TException
100 ashish 683
    {
103 ashish 684
      send_getAllItems(isActive);
685
      return recv_getAllItems();
100 ashish 686
    }
687
 
103 ashish 688
    public void send_getAllItems(boolean isActive) throws TException
100 ashish 689
    {
103 ashish 690
      oprot_.writeMessageBegin(new TMessage("getAllItems", TMessageType.CALL, seqid_));
691
      getAllItems_args args = new getAllItems_args();
692
      args.isActive = isActive;
100 ashish 693
      args.write(oprot_);
694
      oprot_.writeMessageEnd();
695
      oprot_.getTransport().flush();
696
    }
697
 
103 ashish 698
    public List<Item> recv_getAllItems() throws CatalogServiceException, TException
100 ashish 699
    {
700
      TMessage msg = iprot_.readMessageBegin();
701
      if (msg.type == TMessageType.EXCEPTION) {
702
        TApplicationException x = TApplicationException.read(iprot_);
703
        iprot_.readMessageEnd();
704
        throw x;
705
      }
103 ashish 706
      getAllItems_result result = new getAllItems_result();
100 ashish 707
      result.read(iprot_);
708
      iprot_.readMessageEnd();
709
      if (result.isSetSuccess()) {
710
        return result.success;
711
      }
712
      if (result.cex != null) {
713
        throw result.cex;
714
      }
103 ashish 715
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getAllItems failed: unknown result");
100 ashish 716
    }
717
 
103 ashish 718
    public List<Item> getAllItemsByStatus(status itemStatus) throws CatalogServiceException, TException
719
    {
720
      send_getAllItemsByStatus(itemStatus);
721
      return recv_getAllItemsByStatus();
722
    }
723
 
724
    public void send_getAllItemsByStatus(status itemStatus) throws TException
725
    {
726
      oprot_.writeMessageBegin(new TMessage("getAllItemsByStatus", TMessageType.CALL, seqid_));
727
      getAllItemsByStatus_args args = new getAllItemsByStatus_args();
728
      args.itemStatus = itemStatus;
729
      args.write(oprot_);
730
      oprot_.writeMessageEnd();
731
      oprot_.getTransport().flush();
732
    }
733
 
734
    public List<Item> recv_getAllItemsByStatus() throws CatalogServiceException, TException
735
    {
736
      TMessage msg = iprot_.readMessageBegin();
737
      if (msg.type == TMessageType.EXCEPTION) {
738
        TApplicationException x = TApplicationException.read(iprot_);
739
        iprot_.readMessageEnd();
740
        throw x;
741
      }
742
      getAllItemsByStatus_result result = new getAllItemsByStatus_result();
743
      result.read(iprot_);
744
      iprot_.readMessageEnd();
745
      if (result.isSetSuccess()) {
746
        return result.success;
747
      }
748
      if (result.cex != null) {
749
        throw result.cex;
750
      }
751
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getAllItemsByStatus failed: unknown result");
752
    }
753
 
100 ashish 754
    public ItemInventory getItemInventory(long item_id) throws CatalogServiceException, TException
755
    {
756
      send_getItemInventory(item_id);
757
      return recv_getItemInventory();
758
    }
759
 
760
    public void send_getItemInventory(long item_id) throws TException
761
    {
762
      oprot_.writeMessageBegin(new TMessage("getItemInventory", TMessageType.CALL, seqid_));
763
      getItemInventory_args args = new getItemInventory_args();
764
      args.item_id = item_id;
765
      args.write(oprot_);
766
      oprot_.writeMessageEnd();
767
      oprot_.getTransport().flush();
768
    }
769
 
770
    public ItemInventory recv_getItemInventory() throws CatalogServiceException, TException
771
    {
772
      TMessage msg = iprot_.readMessageBegin();
773
      if (msg.type == TMessageType.EXCEPTION) {
774
        TApplicationException x = TApplicationException.read(iprot_);
775
        iprot_.readMessageEnd();
776
        throw x;
777
      }
778
      getItemInventory_result result = new getItemInventory_result();
779
      result.read(iprot_);
780
      iprot_.readMessageEnd();
781
      if (result.isSetSuccess()) {
782
        return result.success;
783
      }
784
      if (result.cex != null) {
785
        throw result.cex;
786
      }
787
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getItemInventory failed: unknown result");
788
    }
789
 
103 ashish 790
    public long getItemAvailibilityAtWarehouse(long warehouse_id, long item_id) throws CatalogServiceException, TException
791
    {
792
      send_getItemAvailibilityAtWarehouse(warehouse_id, item_id);
793
      return recv_getItemAvailibilityAtWarehouse();
794
    }
795
 
796
    public void send_getItemAvailibilityAtWarehouse(long warehouse_id, long item_id) throws TException
797
    {
798
      oprot_.writeMessageBegin(new TMessage("getItemAvailibilityAtWarehouse", TMessageType.CALL, seqid_));
799
      getItemAvailibilityAtWarehouse_args args = new getItemAvailibilityAtWarehouse_args();
800
      args.warehouse_id = warehouse_id;
801
      args.item_id = item_id;
802
      args.write(oprot_);
803
      oprot_.writeMessageEnd();
804
      oprot_.getTransport().flush();
805
    }
806
 
807
    public long recv_getItemAvailibilityAtWarehouse() throws CatalogServiceException, TException
808
    {
809
      TMessage msg = iprot_.readMessageBegin();
810
      if (msg.type == TMessageType.EXCEPTION) {
811
        TApplicationException x = TApplicationException.read(iprot_);
812
        iprot_.readMessageEnd();
813
        throw x;
814
      }
815
      getItemAvailibilityAtWarehouse_result result = new getItemAvailibilityAtWarehouse_result();
816
      result.read(iprot_);
817
      iprot_.readMessageEnd();
818
      if (result.isSetSuccess()) {
819
        return result.success;
820
      }
821
      if (result.cex != null) {
822
        throw result.cex;
823
      }
824
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getItemAvailibilityAtWarehouse failed: unknown result");
825
    }
826
 
100 ashish 827
    public ItemInventoryHistory getItemInventoryHistory(long id, long item_id, long warehouse_id, long from_date, long to_date) throws CatalogServiceException, TException
828
    {
829
      send_getItemInventoryHistory(id, item_id, warehouse_id, from_date, to_date);
830
      return recv_getItemInventoryHistory();
831
    }
832
 
833
    public void send_getItemInventoryHistory(long id, long item_id, long warehouse_id, long from_date, long to_date) throws TException
834
    {
835
      oprot_.writeMessageBegin(new TMessage("getItemInventoryHistory", TMessageType.CALL, seqid_));
836
      getItemInventoryHistory_args args = new getItemInventoryHistory_args();
837
      args.id = id;
838
      args.item_id = item_id;
839
      args.warehouse_id = warehouse_id;
840
      args.from_date = from_date;
841
      args.to_date = to_date;
842
      args.write(oprot_);
843
      oprot_.writeMessageEnd();
844
      oprot_.getTransport().flush();
845
    }
846
 
847
    public ItemInventoryHistory recv_getItemInventoryHistory() throws CatalogServiceException, TException
848
    {
849
      TMessage msg = iprot_.readMessageBegin();
850
      if (msg.type == TMessageType.EXCEPTION) {
851
        TApplicationException x = TApplicationException.read(iprot_);
852
        iprot_.readMessageEnd();
853
        throw x;
854
      }
855
      getItemInventoryHistory_result result = new getItemInventoryHistory_result();
856
      result.read(iprot_);
857
      iprot_.readMessageEnd();
858
      if (result.isSetSuccess()) {
859
        return result.success;
860
      }
861
      if (result.cex != null) {
862
        throw result.cex;
863
      }
864
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getItemInventoryHistory failed: unknown result");
865
    }
866
 
103 ashish 867
    public List<Warehouse> getAllWarehouses(boolean isActive) throws CatalogServiceException, TException
868
    {
869
      send_getAllWarehouses(isActive);
870
      return recv_getAllWarehouses();
871
    }
872
 
873
    public void send_getAllWarehouses(boolean isActive) throws TException
874
    {
875
      oprot_.writeMessageBegin(new TMessage("getAllWarehouses", TMessageType.CALL, seqid_));
876
      getAllWarehouses_args args = new getAllWarehouses_args();
877
      args.isActive = isActive;
878
      args.write(oprot_);
879
      oprot_.writeMessageEnd();
880
      oprot_.getTransport().flush();
881
    }
882
 
883
    public List<Warehouse> recv_getAllWarehouses() throws CatalogServiceException, TException
884
    {
885
      TMessage msg = iprot_.readMessageBegin();
886
      if (msg.type == TMessageType.EXCEPTION) {
887
        TApplicationException x = TApplicationException.read(iprot_);
888
        iprot_.readMessageEnd();
889
        throw x;
890
      }
891
      getAllWarehouses_result result = new getAllWarehouses_result();
892
      result.read(iprot_);
893
      iprot_.readMessageEnd();
894
      if (result.isSetSuccess()) {
895
        return result.success;
896
      }
897
      if (result.cex != null) {
898
        throw result.cex;
899
      }
900
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getAllWarehouses failed: unknown result");
901
    }
902
 
100 ashish 903
    public Warehouse getWarehouse(long warehouse_id) throws CatalogServiceException, TException
904
    {
905
      send_getWarehouse(warehouse_id);
906
      return recv_getWarehouse();
907
    }
908
 
909
    public void send_getWarehouse(long warehouse_id) throws TException
910
    {
911
      oprot_.writeMessageBegin(new TMessage("getWarehouse", TMessageType.CALL, seqid_));
912
      getWarehouse_args args = new getWarehouse_args();
913
      args.warehouse_id = warehouse_id;
914
      args.write(oprot_);
915
      oprot_.writeMessageEnd();
916
      oprot_.getTransport().flush();
917
    }
918
 
919
    public Warehouse recv_getWarehouse() throws CatalogServiceException, TException
920
    {
921
      TMessage msg = iprot_.readMessageBegin();
922
      if (msg.type == TMessageType.EXCEPTION) {
923
        TApplicationException x = TApplicationException.read(iprot_);
924
        iprot_.readMessageEnd();
925
        throw x;
926
      }
927
      getWarehouse_result result = new getWarehouse_result();
928
      result.read(iprot_);
929
      iprot_.readMessageEnd();
930
      if (result.isSetSuccess()) {
931
        return result.success;
932
      }
933
      if (result.cex != null) {
934
        throw result.cex;
935
      }
936
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getWarehouse failed: unknown result");
937
    }
938
 
103 ashish 939
    public List<Warehouse> getAllWarehousesForItem(long item_id) throws CatalogServiceException, TException
100 ashish 940
    {
103 ashish 941
      send_getAllWarehousesForItem(item_id);
100 ashish 942
      return recv_getAllWarehousesForItem();
943
    }
944
 
103 ashish 945
    public void send_getAllWarehousesForItem(long item_id) throws TException
100 ashish 946
    {
947
      oprot_.writeMessageBegin(new TMessage("getAllWarehousesForItem", TMessageType.CALL, seqid_));
948
      getAllWarehousesForItem_args args = new getAllWarehousesForItem_args();
103 ashish 949
      args.item_id = item_id;
100 ashish 950
      args.write(oprot_);
951
      oprot_.writeMessageEnd();
952
      oprot_.getTransport().flush();
953
    }
954
 
955
    public List<Warehouse> recv_getAllWarehousesForItem() throws CatalogServiceException, TException
956
    {
957
      TMessage msg = iprot_.readMessageBegin();
958
      if (msg.type == TMessageType.EXCEPTION) {
959
        TApplicationException x = TApplicationException.read(iprot_);
960
        iprot_.readMessageEnd();
961
        throw x;
962
      }
963
      getAllWarehousesForItem_result result = new getAllWarehousesForItem_result();
964
      result.read(iprot_);
965
      iprot_.readMessageEnd();
966
      if (result.isSetSuccess()) {
967
        return result.success;
968
      }
969
      if (result.cex != null) {
970
        throw result.cex;
971
      }
972
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getAllWarehousesForItem failed: unknown result");
973
    }
974
 
103 ashish 975
    public List<Item> getAllItemsForWarehouse(long warehouse_id) throws CatalogServiceException, TException
100 ashish 976
    {
103 ashish 977
      send_getAllItemsForWarehouse(warehouse_id);
978
      return recv_getAllItemsForWarehouse();
100 ashish 979
    }
980
 
103 ashish 981
    public void send_getAllItemsForWarehouse(long warehouse_id) throws TException
100 ashish 982
    {
103 ashish 983
      oprot_.writeMessageBegin(new TMessage("getAllItemsForWarehouse", TMessageType.CALL, seqid_));
984
      getAllItemsForWarehouse_args args = new getAllItemsForWarehouse_args();
985
      args.warehouse_id = warehouse_id;
100 ashish 986
      args.write(oprot_);
987
      oprot_.writeMessageEnd();
988
      oprot_.getTransport().flush();
989
    }
990
 
103 ashish 991
    public List<Item> recv_getAllItemsForWarehouse() throws CatalogServiceException, TException
100 ashish 992
    {
993
      TMessage msg = iprot_.readMessageBegin();
994
      if (msg.type == TMessageType.EXCEPTION) {
995
        TApplicationException x = TApplicationException.read(iprot_);
996
        iprot_.readMessageEnd();
997
        throw x;
998
      }
103 ashish 999
      getAllItemsForWarehouse_result result = new getAllItemsForWarehouse_result();
100 ashish 1000
      result.read(iprot_);
1001
      iprot_.readMessageEnd();
1002
      if (result.isSetSuccess()) {
1003
        return result.success;
1004
      }
1005
      if (result.cex != null) {
1006
        throw result.cex;
1007
      }
103 ashish 1008
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getAllItemsForWarehouse failed: unknown result");
100 ashish 1009
    }
1010
 
103 ashish 1011
    public Vendor getVendor(long vendor_id) throws CatalogServiceException, TException
1012
    {
1013
      send_getVendor(vendor_id);
1014
      return recv_getVendor();
1015
    }
1016
 
1017
    public void send_getVendor(long vendor_id) throws TException
1018
    {
1019
      oprot_.writeMessageBegin(new TMessage("getVendor", TMessageType.CALL, seqid_));
1020
      getVendor_args args = new getVendor_args();
1021
      args.vendor_id = vendor_id;
1022
      args.write(oprot_);
1023
      oprot_.writeMessageEnd();
1024
      oprot_.getTransport().flush();
1025
    }
1026
 
1027
    public Vendor recv_getVendor() throws CatalogServiceException, TException
1028
    {
1029
      TMessage msg = iprot_.readMessageBegin();
1030
      if (msg.type == TMessageType.EXCEPTION) {
1031
        TApplicationException x = TApplicationException.read(iprot_);
1032
        iprot_.readMessageEnd();
1033
        throw x;
1034
      }
1035
      getVendor_result result = new getVendor_result();
1036
      result.read(iprot_);
1037
      iprot_.readMessageEnd();
1038
      if (result.isSetSuccess()) {
1039
        return result.success;
1040
      }
1041
      if (result.cex != null) {
1042
        throw result.cex;
1043
      }
1044
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getVendor failed: unknown result");
1045
    }
1046
 
1047
    public List<Vendor> getAllVendors(boolean isActive) throws CatalogServiceException, TException
1048
    {
1049
      send_getAllVendors(isActive);
1050
      return recv_getAllVendors();
1051
    }
1052
 
1053
    public void send_getAllVendors(boolean isActive) throws TException
1054
    {
1055
      oprot_.writeMessageBegin(new TMessage("getAllVendors", TMessageType.CALL, seqid_));
1056
      getAllVendors_args args = new getAllVendors_args();
1057
      args.isActive = isActive;
1058
      args.write(oprot_);
1059
      oprot_.writeMessageEnd();
1060
      oprot_.getTransport().flush();
1061
    }
1062
 
1063
    public List<Vendor> recv_getAllVendors() throws CatalogServiceException, TException
1064
    {
1065
      TMessage msg = iprot_.readMessageBegin();
1066
      if (msg.type == TMessageType.EXCEPTION) {
1067
        TApplicationException x = TApplicationException.read(iprot_);
1068
        iprot_.readMessageEnd();
1069
        throw x;
1070
      }
1071
      getAllVendors_result result = new getAllVendors_result();
1072
      result.read(iprot_);
1073
      iprot_.readMessageEnd();
1074
      if (result.isSetSuccess()) {
1075
        return result.success;
1076
      }
1077
      if (result.cex != null) {
1078
        throw result.cex;
1079
      }
1080
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getAllVendors failed: unknown result");
1081
    }
1082
 
100 ashish 1083
  }
1084
  public static class Processor implements TProcessor {
1085
    private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName());
1086
    public Processor(Iface iface)
1087
    {
1088
      iface_ = iface;
1089
      processMap_.put("addCategory", new addCategory());
103 ashish 1090
      processMap_.put("addItem", new addItem());
100 ashish 1091
      processMap_.put("addItemToCategory", new addItemToCategory());
1092
      processMap_.put("addWarehouse", new addWarehouse());
1093
      processMap_.put("addVendor", new addVendor());
1094
      processMap_.put("updateInventory", new updateInventory());
103 ashish 1095
      processMap_.put("retireCategory", new retireCategory());
1096
      processMap_.put("retireVendor", new retireVendor());
1097
      processMap_.put("retireWarehouse", new retireWarehouse());
1098
      processMap_.put("startItemOn", new startItemOn());
1099
      processMap_.put("retireItemOn", new retireItemOn());
1100
      processMap_.put("changeItemStatus", new changeItemStatus());
100 ashish 1101
      processMap_.put("getCategory", new getCategory());
1102
      processMap_.put("getAllCategories", new getAllCategories());
1103
      processMap_.put("getItem", new getItem());
1104
      processMap_.put("getAllItemsForCategory", new getAllItemsForCategory());
103 ashish 1105
      processMap_.put("getAllItems", new getAllItems());
1106
      processMap_.put("getAllItemsByStatus", new getAllItemsByStatus());
100 ashish 1107
      processMap_.put("getItemInventory", new getItemInventory());
103 ashish 1108
      processMap_.put("getItemAvailibilityAtWarehouse", new getItemAvailibilityAtWarehouse());
100 ashish 1109
      processMap_.put("getItemInventoryHistory", new getItemInventoryHistory());
103 ashish 1110
      processMap_.put("getAllWarehouses", new getAllWarehouses());
100 ashish 1111
      processMap_.put("getWarehouse", new getWarehouse());
1112
      processMap_.put("getAllWarehousesForItem", new getAllWarehousesForItem());
103 ashish 1113
      processMap_.put("getAllItemsForWarehouse", new getAllItemsForWarehouse());
1114
      processMap_.put("getVendor", new getVendor());
1115
      processMap_.put("getAllVendors", new getAllVendors());
100 ashish 1116
    }
1117
 
1118
    protected static interface ProcessFunction {
1119
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException;
1120
    }
1121
 
1122
    private Iface iface_;
1123
    protected final HashMap<String,ProcessFunction> processMap_ = new HashMap<String,ProcessFunction>();
1124
 
1125
    public boolean process(TProtocol iprot, TProtocol oprot) throws TException
1126
    {
1127
      TMessage msg = iprot.readMessageBegin();
1128
      ProcessFunction fn = processMap_.get(msg.name);
1129
      if (fn == null) {
1130
        TProtocolUtil.skip(iprot, TType.STRUCT);
1131
        iprot.readMessageEnd();
1132
        TApplicationException x = new TApplicationException(TApplicationException.UNKNOWN_METHOD, "Invalid method name: '"+msg.name+"'");
1133
        oprot.writeMessageBegin(new TMessage(msg.name, TMessageType.EXCEPTION, msg.seqid));
1134
        x.write(oprot);
1135
        oprot.writeMessageEnd();
1136
        oprot.getTransport().flush();
1137
        return true;
1138
      }
1139
      fn.process(msg.seqid, iprot, oprot);
1140
      return true;
1141
    }
1142
 
1143
    private class addCategory implements ProcessFunction {
1144
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
1145
      {
1146
        addCategory_args args = new addCategory_args();
1147
        args.read(iprot);
1148
        iprot.readMessageEnd();
1149
        addCategory_result result = new addCategory_result();
1150
        try {
103 ashish 1151
          result.success = iface_.addCategory(args.category);
1152
          result.setSuccessIsSet(true);
100 ashish 1153
        } catch (CatalogServiceException cex) {
1154
          result.cex = cex;
1155
        } catch (Throwable th) {
1156
          LOGGER.error("Internal error processing addCategory", th);
1157
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing addCategory");
1158
          oprot.writeMessageBegin(new TMessage("addCategory", TMessageType.EXCEPTION, seqid));
1159
          x.write(oprot);
1160
          oprot.writeMessageEnd();
1161
          oprot.getTransport().flush();
1162
          return;
1163
        }
1164
        oprot.writeMessageBegin(new TMessage("addCategory", TMessageType.REPLY, seqid));
1165
        result.write(oprot);
1166
        oprot.writeMessageEnd();
1167
        oprot.getTransport().flush();
1168
      }
1169
 
1170
    }
1171
 
103 ashish 1172
    private class addItem implements ProcessFunction {
1173
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
1174
      {
1175
        addItem_args args = new addItem_args();
1176
        args.read(iprot);
1177
        iprot.readMessageEnd();
1178
        addItem_result result = new addItem_result();
1179
        try {
1180
          result.success = iface_.addItem(args.item);
1181
          result.setSuccessIsSet(true);
1182
        } catch (CatalogServiceException cex) {
1183
          result.cex = cex;
1184
        } catch (Throwable th) {
1185
          LOGGER.error("Internal error processing addItem", th);
1186
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing addItem");
1187
          oprot.writeMessageBegin(new TMessage("addItem", TMessageType.EXCEPTION, seqid));
1188
          x.write(oprot);
1189
          oprot.writeMessageEnd();
1190
          oprot.getTransport().flush();
1191
          return;
1192
        }
1193
        oprot.writeMessageBegin(new TMessage("addItem", TMessageType.REPLY, seqid));
1194
        result.write(oprot);
1195
        oprot.writeMessageEnd();
1196
        oprot.getTransport().flush();
1197
      }
1198
 
1199
    }
1200
 
100 ashish 1201
    private class addItemToCategory implements ProcessFunction {
1202
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
1203
      {
1204
        addItemToCategory_args args = new addItemToCategory_args();
1205
        args.read(iprot);
1206
        iprot.readMessageEnd();
1207
        addItemToCategory_result result = new addItemToCategory_result();
1208
        try {
103 ashish 1209
          result.success = iface_.addItemToCategory(args.item_id, args.category_id);
1210
          result.setSuccessIsSet(true);
100 ashish 1211
        } catch (CatalogServiceException cex) {
1212
          result.cex = cex;
1213
        } catch (Throwable th) {
1214
          LOGGER.error("Internal error processing addItemToCategory", th);
1215
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing addItemToCategory");
1216
          oprot.writeMessageBegin(new TMessage("addItemToCategory", TMessageType.EXCEPTION, seqid));
1217
          x.write(oprot);
1218
          oprot.writeMessageEnd();
1219
          oprot.getTransport().flush();
1220
          return;
1221
        }
1222
        oprot.writeMessageBegin(new TMessage("addItemToCategory", TMessageType.REPLY, seqid));
1223
        result.write(oprot);
1224
        oprot.writeMessageEnd();
1225
        oprot.getTransport().flush();
1226
      }
1227
 
1228
    }
1229
 
103 ashish 1230
    private class addWarehouse implements ProcessFunction {
100 ashish 1231
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
1232
      {
103 ashish 1233
        addWarehouse_args args = new addWarehouse_args();
100 ashish 1234
        args.read(iprot);
1235
        iprot.readMessageEnd();
103 ashish 1236
        addWarehouse_result result = new addWarehouse_result();
100 ashish 1237
        try {
103 ashish 1238
          result.success = iface_.addWarehouse(args.warehouse);
1239
          result.setSuccessIsSet(true);
100 ashish 1240
        } catch (CatalogServiceException cex) {
1241
          result.cex = cex;
1242
        } catch (Throwable th) {
103 ashish 1243
          LOGGER.error("Internal error processing addWarehouse", th);
1244
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing addWarehouse");
1245
          oprot.writeMessageBegin(new TMessage("addWarehouse", TMessageType.EXCEPTION, seqid));
100 ashish 1246
          x.write(oprot);
1247
          oprot.writeMessageEnd();
1248
          oprot.getTransport().flush();
1249
          return;
1250
        }
103 ashish 1251
        oprot.writeMessageBegin(new TMessage("addWarehouse", TMessageType.REPLY, seqid));
100 ashish 1252
        result.write(oprot);
1253
        oprot.writeMessageEnd();
1254
        oprot.getTransport().flush();
1255
      }
1256
 
1257
    }
1258
 
103 ashish 1259
    private class addVendor implements ProcessFunction {
100 ashish 1260
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
1261
      {
103 ashish 1262
        addVendor_args args = new addVendor_args();
100 ashish 1263
        args.read(iprot);
1264
        iprot.readMessageEnd();
103 ashish 1265
        addVendor_result result = new addVendor_result();
100 ashish 1266
        try {
103 ashish 1267
          result.success = iface_.addVendor(args.vendor);
1268
          result.setSuccessIsSet(true);
100 ashish 1269
        } catch (CatalogServiceException cex) {
1270
          result.cex = cex;
1271
        } catch (Throwable th) {
103 ashish 1272
          LOGGER.error("Internal error processing addVendor", th);
1273
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing addVendor");
1274
          oprot.writeMessageBegin(new TMessage("addVendor", TMessageType.EXCEPTION, seqid));
100 ashish 1275
          x.write(oprot);
1276
          oprot.writeMessageEnd();
1277
          oprot.getTransport().flush();
1278
          return;
1279
        }
103 ashish 1280
        oprot.writeMessageBegin(new TMessage("addVendor", TMessageType.REPLY, seqid));
100 ashish 1281
        result.write(oprot);
1282
        oprot.writeMessageEnd();
1283
        oprot.getTransport().flush();
1284
      }
1285
 
1286
    }
1287
 
103 ashish 1288
    private class updateInventory implements ProcessFunction {
100 ashish 1289
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
1290
      {
103 ashish 1291
        updateInventory_args args = new updateInventory_args();
100 ashish 1292
        args.read(iprot);
1293
        iprot.readMessageEnd();
103 ashish 1294
        updateInventory_result result = new updateInventory_result();
100 ashish 1295
        try {
103 ashish 1296
          iface_.updateInventory(args.item_id, args.warehouse_id, args.quantity, args.timestamp);
100 ashish 1297
        } catch (CatalogServiceException cex) {
1298
          result.cex = cex;
1299
        } catch (Throwable th) {
103 ashish 1300
          LOGGER.error("Internal error processing updateInventory", th);
1301
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing updateInventory");
1302
          oprot.writeMessageBegin(new TMessage("updateInventory", TMessageType.EXCEPTION, seqid));
100 ashish 1303
          x.write(oprot);
1304
          oprot.writeMessageEnd();
1305
          oprot.getTransport().flush();
1306
          return;
1307
        }
103 ashish 1308
        oprot.writeMessageBegin(new TMessage("updateInventory", TMessageType.REPLY, seqid));
100 ashish 1309
        result.write(oprot);
1310
        oprot.writeMessageEnd();
1311
        oprot.getTransport().flush();
1312
      }
1313
 
1314
    }
1315
 
103 ashish 1316
    private class retireCategory implements ProcessFunction {
100 ashish 1317
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
1318
      {
103 ashish 1319
        retireCategory_args args = new retireCategory_args();
100 ashish 1320
        args.read(iprot);
1321
        iprot.readMessageEnd();
103 ashish 1322
        retireCategory_result result = new retireCategory_result();
100 ashish 1323
        try {
103 ashish 1324
          iface_.retireCategory(args.category_id);
100 ashish 1325
        } catch (CatalogServiceException cex) {
1326
          result.cex = cex;
1327
        } catch (Throwable th) {
103 ashish 1328
          LOGGER.error("Internal error processing retireCategory", th);
1329
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing retireCategory");
1330
          oprot.writeMessageBegin(new TMessage("retireCategory", TMessageType.EXCEPTION, seqid));
100 ashish 1331
          x.write(oprot);
1332
          oprot.writeMessageEnd();
1333
          oprot.getTransport().flush();
1334
          return;
1335
        }
103 ashish 1336
        oprot.writeMessageBegin(new TMessage("retireCategory", TMessageType.REPLY, seqid));
100 ashish 1337
        result.write(oprot);
1338
        oprot.writeMessageEnd();
1339
        oprot.getTransport().flush();
1340
      }
1341
 
1342
    }
1343
 
103 ashish 1344
    private class retireVendor implements ProcessFunction {
100 ashish 1345
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
1346
      {
103 ashish 1347
        retireVendor_args args = new retireVendor_args();
100 ashish 1348
        args.read(iprot);
1349
        iprot.readMessageEnd();
103 ashish 1350
        retireVendor_result result = new retireVendor_result();
100 ashish 1351
        try {
103 ashish 1352
          iface_.retireVendor(args.vendor_id);
100 ashish 1353
        } catch (CatalogServiceException cex) {
1354
          result.cex = cex;
1355
        } catch (Throwable th) {
103 ashish 1356
          LOGGER.error("Internal error processing retireVendor", th);
1357
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing retireVendor");
1358
          oprot.writeMessageBegin(new TMessage("retireVendor", TMessageType.EXCEPTION, seqid));
100 ashish 1359
          x.write(oprot);
1360
          oprot.writeMessageEnd();
1361
          oprot.getTransport().flush();
1362
          return;
1363
        }
103 ashish 1364
        oprot.writeMessageBegin(new TMessage("retireVendor", TMessageType.REPLY, seqid));
100 ashish 1365
        result.write(oprot);
1366
        oprot.writeMessageEnd();
1367
        oprot.getTransport().flush();
1368
      }
1369
 
1370
    }
1371
 
103 ashish 1372
    private class retireWarehouse implements ProcessFunction {
1373
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
1374
      {
1375
        retireWarehouse_args args = new retireWarehouse_args();
1376
        args.read(iprot);
1377
        iprot.readMessageEnd();
1378
        retireWarehouse_result result = new retireWarehouse_result();
1379
        try {
1380
          iface_.retireWarehouse(args.warehouse_id);
1381
        } catch (CatalogServiceException cex) {
1382
          result.cex = cex;
1383
        } catch (Throwable th) {
1384
          LOGGER.error("Internal error processing retireWarehouse", th);
1385
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing retireWarehouse");
1386
          oprot.writeMessageBegin(new TMessage("retireWarehouse", TMessageType.EXCEPTION, seqid));
1387
          x.write(oprot);
1388
          oprot.writeMessageEnd();
1389
          oprot.getTransport().flush();
1390
          return;
1391
        }
1392
        oprot.writeMessageBegin(new TMessage("retireWarehouse", TMessageType.REPLY, seqid));
1393
        result.write(oprot);
1394
        oprot.writeMessageEnd();
1395
        oprot.getTransport().flush();
1396
      }
1397
 
1398
    }
1399
 
1400
    private class startItemOn implements ProcessFunction {
1401
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
1402
      {
1403
        startItemOn_args args = new startItemOn_args();
1404
        args.read(iprot);
1405
        iprot.readMessageEnd();
1406
        startItemOn_result result = new startItemOn_result();
1407
        try {
1408
          iface_.startItemOn(args.item_id, args.timestamp);
1409
        } catch (CatalogServiceException cex) {
1410
          result.cex = cex;
1411
        } catch (Throwable th) {
1412
          LOGGER.error("Internal error processing startItemOn", th);
1413
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing startItemOn");
1414
          oprot.writeMessageBegin(new TMessage("startItemOn", TMessageType.EXCEPTION, seqid));
1415
          x.write(oprot);
1416
          oprot.writeMessageEnd();
1417
          oprot.getTransport().flush();
1418
          return;
1419
        }
1420
        oprot.writeMessageBegin(new TMessage("startItemOn", TMessageType.REPLY, seqid));
1421
        result.write(oprot);
1422
        oprot.writeMessageEnd();
1423
        oprot.getTransport().flush();
1424
      }
1425
 
1426
    }
1427
 
1428
    private class retireItemOn implements ProcessFunction {
1429
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
1430
      {
1431
        retireItemOn_args args = new retireItemOn_args();
1432
        args.read(iprot);
1433
        iprot.readMessageEnd();
1434
        retireItemOn_result result = new retireItemOn_result();
1435
        try {
1436
          iface_.retireItemOn(args.item_id, args.timestamp);
1437
        } catch (CatalogServiceException cex) {
1438
          result.cex = cex;
1439
        } catch (Throwable th) {
1440
          LOGGER.error("Internal error processing retireItemOn", th);
1441
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing retireItemOn");
1442
          oprot.writeMessageBegin(new TMessage("retireItemOn", TMessageType.EXCEPTION, seqid));
1443
          x.write(oprot);
1444
          oprot.writeMessageEnd();
1445
          oprot.getTransport().flush();
1446
          return;
1447
        }
1448
        oprot.writeMessageBegin(new TMessage("retireItemOn", TMessageType.REPLY, seqid));
1449
        result.write(oprot);
1450
        oprot.writeMessageEnd();
1451
        oprot.getTransport().flush();
1452
      }
1453
 
1454
    }
1455
 
1456
    private class changeItemStatus implements ProcessFunction {
1457
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
1458
      {
1459
        changeItemStatus_args args = new changeItemStatus_args();
1460
        args.read(iprot);
1461
        iprot.readMessageEnd();
1462
        changeItemStatus_result result = new changeItemStatus_result();
1463
        try {
1464
          iface_.changeItemStatus(args.item_id, args.timestamp, args.newstatus);
1465
        } catch (CatalogServiceException cex) {
1466
          result.cex = cex;
1467
        } catch (Throwable th) {
1468
          LOGGER.error("Internal error processing changeItemStatus", th);
1469
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing changeItemStatus");
1470
          oprot.writeMessageBegin(new TMessage("changeItemStatus", TMessageType.EXCEPTION, seqid));
1471
          x.write(oprot);
1472
          oprot.writeMessageEnd();
1473
          oprot.getTransport().flush();
1474
          return;
1475
        }
1476
        oprot.writeMessageBegin(new TMessage("changeItemStatus", TMessageType.REPLY, seqid));
1477
        result.write(oprot);
1478
        oprot.writeMessageEnd();
1479
        oprot.getTransport().flush();
1480
      }
1481
 
1482
    }
1483
 
100 ashish 1484
    private class getCategory implements ProcessFunction {
1485
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
1486
      {
1487
        getCategory_args args = new getCategory_args();
1488
        args.read(iprot);
1489
        iprot.readMessageEnd();
1490
        getCategory_result result = new getCategory_result();
1491
        try {
1492
          result.success = iface_.getCategory(args.id);
1493
        } catch (CatalogServiceException cex) {
1494
          result.cex = cex;
1495
        } catch (Throwable th) {
1496
          LOGGER.error("Internal error processing getCategory", th);
1497
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing getCategory");
1498
          oprot.writeMessageBegin(new TMessage("getCategory", TMessageType.EXCEPTION, seqid));
1499
          x.write(oprot);
1500
          oprot.writeMessageEnd();
1501
          oprot.getTransport().flush();
1502
          return;
1503
        }
1504
        oprot.writeMessageBegin(new TMessage("getCategory", TMessageType.REPLY, seqid));
1505
        result.write(oprot);
1506
        oprot.writeMessageEnd();
1507
        oprot.getTransport().flush();
1508
      }
1509
 
1510
    }
1511
 
1512
    private class getAllCategories implements ProcessFunction {
1513
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
1514
      {
1515
        getAllCategories_args args = new getAllCategories_args();
1516
        args.read(iprot);
1517
        iprot.readMessageEnd();
1518
        getAllCategories_result result = new getAllCategories_result();
1519
        try {
103 ashish 1520
          result.success = iface_.getAllCategories(args.isActive);
100 ashish 1521
        } catch (CatalogServiceException cex) {
1522
          result.cex = cex;
1523
        } catch (Throwable th) {
1524
          LOGGER.error("Internal error processing getAllCategories", th);
1525
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing getAllCategories");
1526
          oprot.writeMessageBegin(new TMessage("getAllCategories", TMessageType.EXCEPTION, seqid));
1527
          x.write(oprot);
1528
          oprot.writeMessageEnd();
1529
          oprot.getTransport().flush();
1530
          return;
1531
        }
1532
        oprot.writeMessageBegin(new TMessage("getAllCategories", TMessageType.REPLY, seqid));
1533
        result.write(oprot);
1534
        oprot.writeMessageEnd();
1535
        oprot.getTransport().flush();
1536
      }
1537
 
1538
    }
1539
 
1540
    private class getItem implements ProcessFunction {
1541
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
1542
      {
1543
        getItem_args args = new getItem_args();
1544
        args.read(iprot);
1545
        iprot.readMessageEnd();
1546
        getItem_result result = new getItem_result();
1547
        try {
1548
          result.success = iface_.getItem(args.item_id);
1549
        } catch (CatalogServiceException cex) {
1550
          result.cex = cex;
1551
        } catch (Throwable th) {
1552
          LOGGER.error("Internal error processing getItem", th);
1553
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing getItem");
1554
          oprot.writeMessageBegin(new TMessage("getItem", TMessageType.EXCEPTION, seqid));
1555
          x.write(oprot);
1556
          oprot.writeMessageEnd();
1557
          oprot.getTransport().flush();
1558
          return;
1559
        }
1560
        oprot.writeMessageBegin(new TMessage("getItem", TMessageType.REPLY, seqid));
1561
        result.write(oprot);
1562
        oprot.writeMessageEnd();
1563
        oprot.getTransport().flush();
1564
      }
1565
 
1566
    }
1567
 
1568
    private class getAllItemsForCategory implements ProcessFunction {
1569
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
1570
      {
1571
        getAllItemsForCategory_args args = new getAllItemsForCategory_args();
1572
        args.read(iprot);
1573
        iprot.readMessageEnd();
1574
        getAllItemsForCategory_result result = new getAllItemsForCategory_result();
1575
        try {
103 ashish 1576
          result.success = iface_.getAllItemsForCategory(args.category_id, args.isActive);
100 ashish 1577
        } catch (CatalogServiceException cex) {
1578
          result.cex = cex;
1579
        } catch (Throwable th) {
1580
          LOGGER.error("Internal error processing getAllItemsForCategory", th);
1581
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing getAllItemsForCategory");
1582
          oprot.writeMessageBegin(new TMessage("getAllItemsForCategory", TMessageType.EXCEPTION, seqid));
1583
          x.write(oprot);
1584
          oprot.writeMessageEnd();
1585
          oprot.getTransport().flush();
1586
          return;
1587
        }
1588
        oprot.writeMessageBegin(new TMessage("getAllItemsForCategory", TMessageType.REPLY, seqid));
1589
        result.write(oprot);
1590
        oprot.writeMessageEnd();
1591
        oprot.getTransport().flush();
1592
      }
1593
 
1594
    }
1595
 
103 ashish 1596
    private class getAllItems implements ProcessFunction {
100 ashish 1597
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
1598
      {
103 ashish 1599
        getAllItems_args args = new getAllItems_args();
100 ashish 1600
        args.read(iprot);
1601
        iprot.readMessageEnd();
103 ashish 1602
        getAllItems_result result = new getAllItems_result();
100 ashish 1603
        try {
103 ashish 1604
          result.success = iface_.getAllItems(args.isActive);
100 ashish 1605
        } catch (CatalogServiceException cex) {
1606
          result.cex = cex;
1607
        } catch (Throwable th) {
103 ashish 1608
          LOGGER.error("Internal error processing getAllItems", th);
1609
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing getAllItems");
1610
          oprot.writeMessageBegin(new TMessage("getAllItems", TMessageType.EXCEPTION, seqid));
100 ashish 1611
          x.write(oprot);
1612
          oprot.writeMessageEnd();
1613
          oprot.getTransport().flush();
1614
          return;
1615
        }
103 ashish 1616
        oprot.writeMessageBegin(new TMessage("getAllItems", TMessageType.REPLY, seqid));
100 ashish 1617
        result.write(oprot);
1618
        oprot.writeMessageEnd();
1619
        oprot.getTransport().flush();
1620
      }
1621
 
1622
    }
1623
 
103 ashish 1624
    private class getAllItemsByStatus implements ProcessFunction {
1625
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
1626
      {
1627
        getAllItemsByStatus_args args = new getAllItemsByStatus_args();
1628
        args.read(iprot);
1629
        iprot.readMessageEnd();
1630
        getAllItemsByStatus_result result = new getAllItemsByStatus_result();
1631
        try {
1632
          result.success = iface_.getAllItemsByStatus(args.itemStatus);
1633
        } catch (CatalogServiceException cex) {
1634
          result.cex = cex;
1635
        } catch (Throwable th) {
1636
          LOGGER.error("Internal error processing getAllItemsByStatus", th);
1637
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing getAllItemsByStatus");
1638
          oprot.writeMessageBegin(new TMessage("getAllItemsByStatus", TMessageType.EXCEPTION, seqid));
1639
          x.write(oprot);
1640
          oprot.writeMessageEnd();
1641
          oprot.getTransport().flush();
1642
          return;
1643
        }
1644
        oprot.writeMessageBegin(new TMessage("getAllItemsByStatus", TMessageType.REPLY, seqid));
1645
        result.write(oprot);
1646
        oprot.writeMessageEnd();
1647
        oprot.getTransport().flush();
1648
      }
1649
 
1650
    }
1651
 
100 ashish 1652
    private class getItemInventory implements ProcessFunction {
1653
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
1654
      {
1655
        getItemInventory_args args = new getItemInventory_args();
1656
        args.read(iprot);
1657
        iprot.readMessageEnd();
1658
        getItemInventory_result result = new getItemInventory_result();
1659
        try {
1660
          result.success = iface_.getItemInventory(args.item_id);
1661
        } catch (CatalogServiceException cex) {
1662
          result.cex = cex;
1663
        } catch (Throwable th) {
1664
          LOGGER.error("Internal error processing getItemInventory", th);
1665
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing getItemInventory");
1666
          oprot.writeMessageBegin(new TMessage("getItemInventory", TMessageType.EXCEPTION, seqid));
1667
          x.write(oprot);
1668
          oprot.writeMessageEnd();
1669
          oprot.getTransport().flush();
1670
          return;
1671
        }
1672
        oprot.writeMessageBegin(new TMessage("getItemInventory", TMessageType.REPLY, seqid));
1673
        result.write(oprot);
1674
        oprot.writeMessageEnd();
1675
        oprot.getTransport().flush();
1676
      }
1677
 
1678
    }
1679
 
103 ashish 1680
    private class getItemAvailibilityAtWarehouse implements ProcessFunction {
1681
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
1682
      {
1683
        getItemAvailibilityAtWarehouse_args args = new getItemAvailibilityAtWarehouse_args();
1684
        args.read(iprot);
1685
        iprot.readMessageEnd();
1686
        getItemAvailibilityAtWarehouse_result result = new getItemAvailibilityAtWarehouse_result();
1687
        try {
1688
          result.success = iface_.getItemAvailibilityAtWarehouse(args.warehouse_id, args.item_id);
1689
          result.setSuccessIsSet(true);
1690
        } catch (CatalogServiceException cex) {
1691
          result.cex = cex;
1692
        } catch (Throwable th) {
1693
          LOGGER.error("Internal error processing getItemAvailibilityAtWarehouse", th);
1694
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing getItemAvailibilityAtWarehouse");
1695
          oprot.writeMessageBegin(new TMessage("getItemAvailibilityAtWarehouse", TMessageType.EXCEPTION, seqid));
1696
          x.write(oprot);
1697
          oprot.writeMessageEnd();
1698
          oprot.getTransport().flush();
1699
          return;
1700
        }
1701
        oprot.writeMessageBegin(new TMessage("getItemAvailibilityAtWarehouse", TMessageType.REPLY, seqid));
1702
        result.write(oprot);
1703
        oprot.writeMessageEnd();
1704
        oprot.getTransport().flush();
1705
      }
1706
 
1707
    }
1708
 
100 ashish 1709
    private class getItemInventoryHistory implements ProcessFunction {
1710
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
1711
      {
1712
        getItemInventoryHistory_args args = new getItemInventoryHistory_args();
1713
        args.read(iprot);
1714
        iprot.readMessageEnd();
1715
        getItemInventoryHistory_result result = new getItemInventoryHistory_result();
1716
        try {
1717
          result.success = iface_.getItemInventoryHistory(args.id, args.item_id, args.warehouse_id, args.from_date, args.to_date);
1718
        } catch (CatalogServiceException cex) {
1719
          result.cex = cex;
1720
        } catch (Throwable th) {
1721
          LOGGER.error("Internal error processing getItemInventoryHistory", th);
1722
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing getItemInventoryHistory");
1723
          oprot.writeMessageBegin(new TMessage("getItemInventoryHistory", TMessageType.EXCEPTION, seqid));
1724
          x.write(oprot);
1725
          oprot.writeMessageEnd();
1726
          oprot.getTransport().flush();
1727
          return;
1728
        }
1729
        oprot.writeMessageBegin(new TMessage("getItemInventoryHistory", TMessageType.REPLY, seqid));
1730
        result.write(oprot);
1731
        oprot.writeMessageEnd();
1732
        oprot.getTransport().flush();
1733
      }
1734
 
1735
    }
1736
 
103 ashish 1737
    private class getAllWarehouses implements ProcessFunction {
1738
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
1739
      {
1740
        getAllWarehouses_args args = new getAllWarehouses_args();
1741
        args.read(iprot);
1742
        iprot.readMessageEnd();
1743
        getAllWarehouses_result result = new getAllWarehouses_result();
1744
        try {
1745
          result.success = iface_.getAllWarehouses(args.isActive);
1746
        } catch (CatalogServiceException cex) {
1747
          result.cex = cex;
1748
        } catch (Throwable th) {
1749
          LOGGER.error("Internal error processing getAllWarehouses", th);
1750
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing getAllWarehouses");
1751
          oprot.writeMessageBegin(new TMessage("getAllWarehouses", TMessageType.EXCEPTION, seqid));
1752
          x.write(oprot);
1753
          oprot.writeMessageEnd();
1754
          oprot.getTransport().flush();
1755
          return;
1756
        }
1757
        oprot.writeMessageBegin(new TMessage("getAllWarehouses", TMessageType.REPLY, seqid));
1758
        result.write(oprot);
1759
        oprot.writeMessageEnd();
1760
        oprot.getTransport().flush();
1761
      }
1762
 
1763
    }
1764
 
100 ashish 1765
    private class getWarehouse implements ProcessFunction {
1766
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
1767
      {
1768
        getWarehouse_args args = new getWarehouse_args();
1769
        args.read(iprot);
1770
        iprot.readMessageEnd();
1771
        getWarehouse_result result = new getWarehouse_result();
1772
        try {
1773
          result.success = iface_.getWarehouse(args.warehouse_id);
1774
        } catch (CatalogServiceException cex) {
1775
          result.cex = cex;
1776
        } catch (Throwable th) {
1777
          LOGGER.error("Internal error processing getWarehouse", th);
1778
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing getWarehouse");
1779
          oprot.writeMessageBegin(new TMessage("getWarehouse", TMessageType.EXCEPTION, seqid));
1780
          x.write(oprot);
1781
          oprot.writeMessageEnd();
1782
          oprot.getTransport().flush();
1783
          return;
1784
        }
1785
        oprot.writeMessageBegin(new TMessage("getWarehouse", TMessageType.REPLY, seqid));
1786
        result.write(oprot);
1787
        oprot.writeMessageEnd();
1788
        oprot.getTransport().flush();
1789
      }
1790
 
1791
    }
1792
 
1793
    private class getAllWarehousesForItem implements ProcessFunction {
1794
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
1795
      {
1796
        getAllWarehousesForItem_args args = new getAllWarehousesForItem_args();
1797
        args.read(iprot);
1798
        iprot.readMessageEnd();
1799
        getAllWarehousesForItem_result result = new getAllWarehousesForItem_result();
1800
        try {
103 ashish 1801
          result.success = iface_.getAllWarehousesForItem(args.item_id);
100 ashish 1802
        } catch (CatalogServiceException cex) {
1803
          result.cex = cex;
1804
        } catch (Throwable th) {
1805
          LOGGER.error("Internal error processing getAllWarehousesForItem", th);
1806
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing getAllWarehousesForItem");
1807
          oprot.writeMessageBegin(new TMessage("getAllWarehousesForItem", TMessageType.EXCEPTION, seqid));
1808
          x.write(oprot);
1809
          oprot.writeMessageEnd();
1810
          oprot.getTransport().flush();
1811
          return;
1812
        }
1813
        oprot.writeMessageBegin(new TMessage("getAllWarehousesForItem", TMessageType.REPLY, seqid));
1814
        result.write(oprot);
1815
        oprot.writeMessageEnd();
1816
        oprot.getTransport().flush();
1817
      }
1818
 
1819
    }
1820
 
103 ashish 1821
    private class getAllItemsForWarehouse implements ProcessFunction {
100 ashish 1822
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
1823
      {
103 ashish 1824
        getAllItemsForWarehouse_args args = new getAllItemsForWarehouse_args();
100 ashish 1825
        args.read(iprot);
1826
        iprot.readMessageEnd();
103 ashish 1827
        getAllItemsForWarehouse_result result = new getAllItemsForWarehouse_result();
100 ashish 1828
        try {
103 ashish 1829
          result.success = iface_.getAllItemsForWarehouse(args.warehouse_id);
100 ashish 1830
        } catch (CatalogServiceException cex) {
1831
          result.cex = cex;
1832
        } catch (Throwable th) {
103 ashish 1833
          LOGGER.error("Internal error processing getAllItemsForWarehouse", th);
1834
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing getAllItemsForWarehouse");
1835
          oprot.writeMessageBegin(new TMessage("getAllItemsForWarehouse", TMessageType.EXCEPTION, seqid));
100 ashish 1836
          x.write(oprot);
1837
          oprot.writeMessageEnd();
1838
          oprot.getTransport().flush();
1839
          return;
1840
        }
103 ashish 1841
        oprot.writeMessageBegin(new TMessage("getAllItemsForWarehouse", TMessageType.REPLY, seqid));
100 ashish 1842
        result.write(oprot);
1843
        oprot.writeMessageEnd();
1844
        oprot.getTransport().flush();
1845
      }
1846
 
1847
    }
1848
 
103 ashish 1849
    private class getVendor implements ProcessFunction {
1850
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
1851
      {
1852
        getVendor_args args = new getVendor_args();
1853
        args.read(iprot);
1854
        iprot.readMessageEnd();
1855
        getVendor_result result = new getVendor_result();
1856
        try {
1857
          result.success = iface_.getVendor(args.vendor_id);
1858
        } catch (CatalogServiceException cex) {
1859
          result.cex = cex;
1860
        } catch (Throwable th) {
1861
          LOGGER.error("Internal error processing getVendor", th);
1862
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing getVendor");
1863
          oprot.writeMessageBegin(new TMessage("getVendor", TMessageType.EXCEPTION, seqid));
1864
          x.write(oprot);
1865
          oprot.writeMessageEnd();
1866
          oprot.getTransport().flush();
1867
          return;
1868
        }
1869
        oprot.writeMessageBegin(new TMessage("getVendor", TMessageType.REPLY, seqid));
1870
        result.write(oprot);
1871
        oprot.writeMessageEnd();
1872
        oprot.getTransport().flush();
1873
      }
1874
 
1875
    }
1876
 
1877
    private class getAllVendors implements ProcessFunction {
1878
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
1879
      {
1880
        getAllVendors_args args = new getAllVendors_args();
1881
        args.read(iprot);
1882
        iprot.readMessageEnd();
1883
        getAllVendors_result result = new getAllVendors_result();
1884
        try {
1885
          result.success = iface_.getAllVendors(args.isActive);
1886
        } catch (CatalogServiceException cex) {
1887
          result.cex = cex;
1888
        } catch (Throwable th) {
1889
          LOGGER.error("Internal error processing getAllVendors", th);
1890
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing getAllVendors");
1891
          oprot.writeMessageBegin(new TMessage("getAllVendors", TMessageType.EXCEPTION, seqid));
1892
          x.write(oprot);
1893
          oprot.writeMessageEnd();
1894
          oprot.getTransport().flush();
1895
          return;
1896
        }
1897
        oprot.writeMessageBegin(new TMessage("getAllVendors", TMessageType.REPLY, seqid));
1898
        result.write(oprot);
1899
        oprot.writeMessageEnd();
1900
        oprot.getTransport().flush();
1901
      }
1902
 
1903
    }
1904
 
100 ashish 1905
  }
1906
 
1907
  public static class addCategory_args implements TBase<addCategory_args._Fields>, java.io.Serializable, Cloneable, Comparable<addCategory_args>   {
1908
    private static final TStruct STRUCT_DESC = new TStruct("addCategory_args");
1909
 
1910
    private static final TField CATEGORY_FIELD_DESC = new TField("category", TType.STRUCT, (short)1);
1911
 
1912
    private Category category;
1913
 
1914
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
1915
    public enum _Fields implements TFieldIdEnum {
1916
      CATEGORY((short)1, "category");
1917
 
1918
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
1919
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
1920
 
1921
      static {
1922
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
1923
          byId.put((int)field._thriftId, field);
1924
          byName.put(field.getFieldName(), field);
1925
        }
1926
      }
1927
 
1928
      /**
1929
       * Find the _Fields constant that matches fieldId, or null if its not found.
1930
       */
1931
      public static _Fields findByThriftId(int fieldId) {
1932
        return byId.get(fieldId);
1933
      }
1934
 
1935
      /**
1936
       * Find the _Fields constant that matches fieldId, throwing an exception
1937
       * if it is not found.
1938
       */
1939
      public static _Fields findByThriftIdOrThrow(int fieldId) {
1940
        _Fields fields = findByThriftId(fieldId);
1941
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
1942
        return fields;
1943
      }
1944
 
1945
      /**
1946
       * Find the _Fields constant that matches name, or null if its not found.
1947
       */
1948
      public static _Fields findByName(String name) {
1949
        return byName.get(name);
1950
      }
1951
 
1952
      private final short _thriftId;
1953
      private final String _fieldName;
1954
 
1955
      _Fields(short thriftId, String fieldName) {
1956
        _thriftId = thriftId;
1957
        _fieldName = fieldName;
1958
      }
1959
 
1960
      public short getThriftFieldId() {
1961
        return _thriftId;
1962
      }
1963
 
1964
      public String getFieldName() {
1965
        return _fieldName;
1966
      }
1967
    }
1968
 
1969
    // isset id assignments
1970
 
1971
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
1972
      put(_Fields.CATEGORY, new FieldMetaData("category", TFieldRequirementType.DEFAULT, 
1973
          new StructMetaData(TType.STRUCT, Category.class)));
1974
    }});
1975
 
1976
    static {
1977
      FieldMetaData.addStructMetaDataMap(addCategory_args.class, metaDataMap);
1978
    }
1979
 
1980
    public addCategory_args() {
1981
    }
1982
 
1983
    public addCategory_args(
1984
      Category category)
1985
    {
1986
      this();
1987
      this.category = category;
1988
    }
1989
 
1990
    /**
1991
     * Performs a deep copy on <i>other</i>.
1992
     */
1993
    public addCategory_args(addCategory_args other) {
1994
      if (other.isSetCategory()) {
1995
        this.category = new Category(other.category);
1996
      }
1997
    }
1998
 
1999
    public addCategory_args deepCopy() {
2000
      return new addCategory_args(this);
2001
    }
2002
 
2003
    @Deprecated
2004
    public addCategory_args clone() {
2005
      return new addCategory_args(this);
2006
    }
2007
 
2008
    public Category getCategory() {
2009
      return this.category;
2010
    }
2011
 
2012
    public addCategory_args setCategory(Category category) {
2013
      this.category = category;
2014
      return this;
2015
    }
2016
 
2017
    public void unsetCategory() {
2018
      this.category = null;
2019
    }
2020
 
2021
    /** Returns true if field category is set (has been asigned a value) and false otherwise */
2022
    public boolean isSetCategory() {
2023
      return this.category != null;
2024
    }
2025
 
2026
    public void setCategoryIsSet(boolean value) {
2027
      if (!value) {
2028
        this.category = null;
2029
      }
2030
    }
2031
 
2032
    public void setFieldValue(_Fields field, Object value) {
2033
      switch (field) {
2034
      case CATEGORY:
2035
        if (value == null) {
2036
          unsetCategory();
2037
        } else {
2038
          setCategory((Category)value);
2039
        }
2040
        break;
2041
 
2042
      }
2043
    }
2044
 
2045
    public void setFieldValue(int fieldID, Object value) {
2046
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
2047
    }
2048
 
2049
    public Object getFieldValue(_Fields field) {
2050
      switch (field) {
2051
      case CATEGORY:
2052
        return getCategory();
2053
 
2054
      }
2055
      throw new IllegalStateException();
2056
    }
2057
 
2058
    public Object getFieldValue(int fieldId) {
2059
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
2060
    }
2061
 
2062
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
2063
    public boolean isSet(_Fields field) {
2064
      switch (field) {
2065
      case CATEGORY:
2066
        return isSetCategory();
2067
      }
2068
      throw new IllegalStateException();
2069
    }
2070
 
2071
    public boolean isSet(int fieldID) {
2072
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
2073
    }
2074
 
2075
    @Override
2076
    public boolean equals(Object that) {
2077
      if (that == null)
2078
        return false;
2079
      if (that instanceof addCategory_args)
2080
        return this.equals((addCategory_args)that);
2081
      return false;
2082
    }
2083
 
2084
    public boolean equals(addCategory_args that) {
2085
      if (that == null)
2086
        return false;
2087
 
2088
      boolean this_present_category = true && this.isSetCategory();
2089
      boolean that_present_category = true && that.isSetCategory();
2090
      if (this_present_category || that_present_category) {
2091
        if (!(this_present_category && that_present_category))
2092
          return false;
2093
        if (!this.category.equals(that.category))
2094
          return false;
2095
      }
2096
 
2097
      return true;
2098
    }
2099
 
2100
    @Override
2101
    public int hashCode() {
2102
      return 0;
2103
    }
2104
 
2105
    public int compareTo(addCategory_args other) {
2106
      if (!getClass().equals(other.getClass())) {
2107
        return getClass().getName().compareTo(other.getClass().getName());
2108
      }
2109
 
2110
      int lastComparison = 0;
2111
      addCategory_args typedOther = (addCategory_args)other;
2112
 
2113
      lastComparison = Boolean.valueOf(isSetCategory()).compareTo(isSetCategory());
2114
      if (lastComparison != 0) {
2115
        return lastComparison;
2116
      }
2117
      lastComparison = TBaseHelper.compareTo(category, typedOther.category);
2118
      if (lastComparison != 0) {
2119
        return lastComparison;
2120
      }
2121
      return 0;
2122
    }
2123
 
2124
    public void read(TProtocol iprot) throws TException {
2125
      TField field;
2126
      iprot.readStructBegin();
2127
      while (true)
2128
      {
2129
        field = iprot.readFieldBegin();
2130
        if (field.type == TType.STOP) { 
2131
          break;
2132
        }
2133
        _Fields fieldId = _Fields.findByThriftId(field.id);
2134
        if (fieldId == null) {
2135
          TProtocolUtil.skip(iprot, field.type);
2136
        } else {
2137
          switch (fieldId) {
2138
            case CATEGORY:
2139
              if (field.type == TType.STRUCT) {
2140
                this.category = new Category();
2141
                this.category.read(iprot);
2142
              } else { 
2143
                TProtocolUtil.skip(iprot, field.type);
2144
              }
2145
              break;
2146
          }
2147
          iprot.readFieldEnd();
2148
        }
2149
      }
2150
      iprot.readStructEnd();
2151
      validate();
2152
    }
2153
 
2154
    public void write(TProtocol oprot) throws TException {
2155
      validate();
2156
 
2157
      oprot.writeStructBegin(STRUCT_DESC);
2158
      if (this.category != null) {
2159
        oprot.writeFieldBegin(CATEGORY_FIELD_DESC);
2160
        this.category.write(oprot);
2161
        oprot.writeFieldEnd();
2162
      }
2163
      oprot.writeFieldStop();
2164
      oprot.writeStructEnd();
2165
    }
2166
 
2167
    @Override
2168
    public String toString() {
2169
      StringBuilder sb = new StringBuilder("addCategory_args(");
2170
      boolean first = true;
2171
 
2172
      sb.append("category:");
2173
      if (this.category == null) {
2174
        sb.append("null");
2175
      } else {
2176
        sb.append(this.category);
2177
      }
2178
      first = false;
2179
      sb.append(")");
2180
      return sb.toString();
2181
    }
2182
 
2183
    public void validate() throws TException {
2184
      // check for required fields
2185
    }
2186
 
2187
  }
2188
 
2189
  public static class addCategory_result implements TBase<addCategory_result._Fields>, java.io.Serializable, Cloneable, Comparable<addCategory_result>   {
2190
    private static final TStruct STRUCT_DESC = new TStruct("addCategory_result");
2191
 
103 ashish 2192
    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.I64, (short)0);
100 ashish 2193
    private static final TField CEX_FIELD_DESC = new TField("cex", TType.STRUCT, (short)1);
2194
 
103 ashish 2195
    private long success;
100 ashish 2196
    private CatalogServiceException cex;
2197
 
2198
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
2199
    public enum _Fields implements TFieldIdEnum {
103 ashish 2200
      SUCCESS((short)0, "success"),
100 ashish 2201
      CEX((short)1, "cex");
2202
 
2203
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
2204
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
2205
 
2206
      static {
2207
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
2208
          byId.put((int)field._thriftId, field);
2209
          byName.put(field.getFieldName(), field);
2210
        }
2211
      }
2212
 
2213
      /**
2214
       * Find the _Fields constant that matches fieldId, or null if its not found.
2215
       */
2216
      public static _Fields findByThriftId(int fieldId) {
2217
        return byId.get(fieldId);
2218
      }
2219
 
2220
      /**
2221
       * Find the _Fields constant that matches fieldId, throwing an exception
2222
       * if it is not found.
2223
       */
2224
      public static _Fields findByThriftIdOrThrow(int fieldId) {
2225
        _Fields fields = findByThriftId(fieldId);
2226
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
2227
        return fields;
2228
      }
2229
 
2230
      /**
2231
       * Find the _Fields constant that matches name, or null if its not found.
2232
       */
2233
      public static _Fields findByName(String name) {
2234
        return byName.get(name);
2235
      }
2236
 
2237
      private final short _thriftId;
2238
      private final String _fieldName;
2239
 
2240
      _Fields(short thriftId, String fieldName) {
2241
        _thriftId = thriftId;
2242
        _fieldName = fieldName;
2243
      }
2244
 
2245
      public short getThriftFieldId() {
2246
        return _thriftId;
2247
      }
2248
 
2249
      public String getFieldName() {
2250
        return _fieldName;
2251
      }
2252
    }
2253
 
2254
    // isset id assignments
103 ashish 2255
    private static final int __SUCCESS_ISSET_ID = 0;
2256
    private BitSet __isset_bit_vector = new BitSet(1);
100 ashish 2257
 
2258
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
103 ashish 2259
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
2260
          new FieldValueMetaData(TType.I64)));
100 ashish 2261
      put(_Fields.CEX, new FieldMetaData("cex", TFieldRequirementType.DEFAULT, 
2262
          new FieldValueMetaData(TType.STRUCT)));
2263
    }});
2264
 
2265
    static {
2266
      FieldMetaData.addStructMetaDataMap(addCategory_result.class, metaDataMap);
2267
    }
2268
 
2269
    public addCategory_result() {
2270
    }
2271
 
2272
    public addCategory_result(
103 ashish 2273
      long success,
100 ashish 2274
      CatalogServiceException cex)
2275
    {
2276
      this();
103 ashish 2277
      this.success = success;
2278
      setSuccessIsSet(true);
100 ashish 2279
      this.cex = cex;
2280
    }
2281
 
2282
    /**
2283
     * Performs a deep copy on <i>other</i>.
2284
     */
2285
    public addCategory_result(addCategory_result other) {
103 ashish 2286
      __isset_bit_vector.clear();
2287
      __isset_bit_vector.or(other.__isset_bit_vector);
2288
      this.success = other.success;
100 ashish 2289
      if (other.isSetCex()) {
2290
        this.cex = new CatalogServiceException(other.cex);
2291
      }
2292
    }
2293
 
2294
    public addCategory_result deepCopy() {
2295
      return new addCategory_result(this);
2296
    }
2297
 
2298
    @Deprecated
2299
    public addCategory_result clone() {
2300
      return new addCategory_result(this);
2301
    }
2302
 
103 ashish 2303
    public long getSuccess() {
2304
      return this.success;
2305
    }
2306
 
2307
    public addCategory_result setSuccess(long success) {
2308
      this.success = success;
2309
      setSuccessIsSet(true);
2310
      return this;
2311
    }
2312
 
2313
    public void unsetSuccess() {
2314
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
2315
    }
2316
 
2317
    /** Returns true if field success is set (has been asigned a value) and false otherwise */
2318
    public boolean isSetSuccess() {
2319
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
2320
    }
2321
 
2322
    public void setSuccessIsSet(boolean value) {
2323
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
2324
    }
2325
 
100 ashish 2326
    public CatalogServiceException getCex() {
2327
      return this.cex;
2328
    }
2329
 
2330
    public addCategory_result setCex(CatalogServiceException cex) {
2331
      this.cex = cex;
2332
      return this;
2333
    }
2334
 
2335
    public void unsetCex() {
2336
      this.cex = null;
2337
    }
2338
 
2339
    /** Returns true if field cex is set (has been asigned a value) and false otherwise */
2340
    public boolean isSetCex() {
2341
      return this.cex != null;
2342
    }
2343
 
2344
    public void setCexIsSet(boolean value) {
2345
      if (!value) {
2346
        this.cex = null;
2347
      }
2348
    }
2349
 
2350
    public void setFieldValue(_Fields field, Object value) {
2351
      switch (field) {
103 ashish 2352
      case SUCCESS:
2353
        if (value == null) {
2354
          unsetSuccess();
2355
        } else {
2356
          setSuccess((Long)value);
2357
        }
2358
        break;
2359
 
100 ashish 2360
      case CEX:
2361
        if (value == null) {
2362
          unsetCex();
2363
        } else {
2364
          setCex((CatalogServiceException)value);
2365
        }
2366
        break;
2367
 
2368
      }
2369
    }
2370
 
2371
    public void setFieldValue(int fieldID, Object value) {
2372
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
2373
    }
2374
 
2375
    public Object getFieldValue(_Fields field) {
2376
      switch (field) {
103 ashish 2377
      case SUCCESS:
2378
        return new Long(getSuccess());
2379
 
100 ashish 2380
      case CEX:
2381
        return getCex();
2382
 
2383
      }
2384
      throw new IllegalStateException();
2385
    }
2386
 
2387
    public Object getFieldValue(int fieldId) {
2388
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
2389
    }
2390
 
2391
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
2392
    public boolean isSet(_Fields field) {
2393
      switch (field) {
103 ashish 2394
      case SUCCESS:
2395
        return isSetSuccess();
100 ashish 2396
      case CEX:
2397
        return isSetCex();
2398
      }
2399
      throw new IllegalStateException();
2400
    }
2401
 
2402
    public boolean isSet(int fieldID) {
2403
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
2404
    }
2405
 
2406
    @Override
2407
    public boolean equals(Object that) {
2408
      if (that == null)
2409
        return false;
2410
      if (that instanceof addCategory_result)
2411
        return this.equals((addCategory_result)that);
2412
      return false;
2413
    }
2414
 
2415
    public boolean equals(addCategory_result that) {
2416
      if (that == null)
2417
        return false;
2418
 
103 ashish 2419
      boolean this_present_success = true;
2420
      boolean that_present_success = true;
2421
      if (this_present_success || that_present_success) {
2422
        if (!(this_present_success && that_present_success))
2423
          return false;
2424
        if (this.success != that.success)
2425
          return false;
2426
      }
2427
 
100 ashish 2428
      boolean this_present_cex = true && this.isSetCex();
2429
      boolean that_present_cex = true && that.isSetCex();
2430
      if (this_present_cex || that_present_cex) {
2431
        if (!(this_present_cex && that_present_cex))
2432
          return false;
2433
        if (!this.cex.equals(that.cex))
2434
          return false;
2435
      }
2436
 
2437
      return true;
2438
    }
2439
 
2440
    @Override
2441
    public int hashCode() {
2442
      return 0;
2443
    }
2444
 
2445
    public int compareTo(addCategory_result other) {
2446
      if (!getClass().equals(other.getClass())) {
2447
        return getClass().getName().compareTo(other.getClass().getName());
2448
      }
2449
 
2450
      int lastComparison = 0;
2451
      addCategory_result typedOther = (addCategory_result)other;
2452
 
103 ashish 2453
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
2454
      if (lastComparison != 0) {
2455
        return lastComparison;
2456
      }
2457
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
2458
      if (lastComparison != 0) {
2459
        return lastComparison;
2460
      }
100 ashish 2461
      lastComparison = Boolean.valueOf(isSetCex()).compareTo(isSetCex());
2462
      if (lastComparison != 0) {
2463
        return lastComparison;
2464
      }
2465
      lastComparison = TBaseHelper.compareTo(cex, typedOther.cex);
2466
      if (lastComparison != 0) {
2467
        return lastComparison;
2468
      }
2469
      return 0;
2470
    }
2471
 
2472
    public void read(TProtocol iprot) throws TException {
2473
      TField field;
2474
      iprot.readStructBegin();
2475
      while (true)
2476
      {
2477
        field = iprot.readFieldBegin();
2478
        if (field.type == TType.STOP) { 
2479
          break;
2480
        }
2481
        _Fields fieldId = _Fields.findByThriftId(field.id);
2482
        if (fieldId == null) {
2483
          TProtocolUtil.skip(iprot, field.type);
2484
        } else {
2485
          switch (fieldId) {
103 ashish 2486
            case SUCCESS:
2487
              if (field.type == TType.I64) {
2488
                this.success = iprot.readI64();
2489
                setSuccessIsSet(true);
2490
              } else { 
2491
                TProtocolUtil.skip(iprot, field.type);
2492
              }
2493
              break;
100 ashish 2494
            case CEX:
2495
              if (field.type == TType.STRUCT) {
2496
                this.cex = new CatalogServiceException();
2497
                this.cex.read(iprot);
2498
              } else { 
2499
                TProtocolUtil.skip(iprot, field.type);
2500
              }
2501
              break;
2502
          }
2503
          iprot.readFieldEnd();
2504
        }
2505
      }
2506
      iprot.readStructEnd();
2507
      validate();
2508
    }
2509
 
2510
    public void write(TProtocol oprot) throws TException {
2511
      oprot.writeStructBegin(STRUCT_DESC);
2512
 
103 ashish 2513
      if (this.isSetSuccess()) {
2514
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
2515
        oprot.writeI64(this.success);
2516
        oprot.writeFieldEnd();
2517
      } else if (this.isSetCex()) {
100 ashish 2518
        oprot.writeFieldBegin(CEX_FIELD_DESC);
2519
        this.cex.write(oprot);
2520
        oprot.writeFieldEnd();
2521
      }
2522
      oprot.writeFieldStop();
2523
      oprot.writeStructEnd();
2524
    }
2525
 
2526
    @Override
2527
    public String toString() {
2528
      StringBuilder sb = new StringBuilder("addCategory_result(");
2529
      boolean first = true;
2530
 
103 ashish 2531
      sb.append("success:");
2532
      sb.append(this.success);
2533
      first = false;
2534
      if (!first) sb.append(", ");
100 ashish 2535
      sb.append("cex:");
2536
      if (this.cex == null) {
2537
        sb.append("null");
2538
      } else {
2539
        sb.append(this.cex);
2540
      }
2541
      first = false;
2542
      sb.append(")");
2543
      return sb.toString();
2544
    }
2545
 
2546
    public void validate() throws TException {
2547
      // check for required fields
2548
    }
2549
 
2550
  }
2551
 
103 ashish 2552
  public static class addItem_args implements TBase<addItem_args._Fields>, java.io.Serializable, Cloneable   {
2553
    private static final TStruct STRUCT_DESC = new TStruct("addItem_args");
100 ashish 2554
 
2555
    private static final TField ITEM_FIELD_DESC = new TField("item", TType.STRUCT, (short)1);
2556
 
2557
    private Item item;
2558
 
2559
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
2560
    public enum _Fields implements TFieldIdEnum {
103 ashish 2561
      ITEM((short)1, "item");
100 ashish 2562
 
2563
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
2564
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
2565
 
2566
      static {
2567
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
2568
          byId.put((int)field._thriftId, field);
2569
          byName.put(field.getFieldName(), field);
2570
        }
2571
      }
2572
 
2573
      /**
2574
       * Find the _Fields constant that matches fieldId, or null if its not found.
2575
       */
2576
      public static _Fields findByThriftId(int fieldId) {
2577
        return byId.get(fieldId);
2578
      }
2579
 
2580
      /**
2581
       * Find the _Fields constant that matches fieldId, throwing an exception
2582
       * if it is not found.
2583
       */
2584
      public static _Fields findByThriftIdOrThrow(int fieldId) {
2585
        _Fields fields = findByThriftId(fieldId);
2586
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
2587
        return fields;
2588
      }
2589
 
2590
      /**
2591
       * Find the _Fields constant that matches name, or null if its not found.
2592
       */
2593
      public static _Fields findByName(String name) {
2594
        return byName.get(name);
2595
      }
2596
 
2597
      private final short _thriftId;
2598
      private final String _fieldName;
2599
 
2600
      _Fields(short thriftId, String fieldName) {
2601
        _thriftId = thriftId;
2602
        _fieldName = fieldName;
2603
      }
2604
 
2605
      public short getThriftFieldId() {
2606
        return _thriftId;
2607
      }
2608
 
2609
      public String getFieldName() {
2610
        return _fieldName;
2611
      }
2612
    }
2613
 
2614
    // isset id assignments
2615
 
2616
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
2617
      put(_Fields.ITEM, new FieldMetaData("item", TFieldRequirementType.DEFAULT, 
2618
          new StructMetaData(TType.STRUCT, Item.class)));
2619
    }});
2620
 
2621
    static {
103 ashish 2622
      FieldMetaData.addStructMetaDataMap(addItem_args.class, metaDataMap);
100 ashish 2623
    }
2624
 
103 ashish 2625
    public addItem_args() {
100 ashish 2626
    }
2627
 
103 ashish 2628
    public addItem_args(
2629
      Item item)
100 ashish 2630
    {
2631
      this();
2632
      this.item = item;
2633
    }
2634
 
2635
    /**
2636
     * Performs a deep copy on <i>other</i>.
2637
     */
103 ashish 2638
    public addItem_args(addItem_args other) {
100 ashish 2639
      if (other.isSetItem()) {
2640
        this.item = new Item(other.item);
2641
      }
2642
    }
2643
 
103 ashish 2644
    public addItem_args deepCopy() {
2645
      return new addItem_args(this);
100 ashish 2646
    }
2647
 
2648
    @Deprecated
103 ashish 2649
    public addItem_args clone() {
2650
      return new addItem_args(this);
100 ashish 2651
    }
2652
 
2653
    public Item getItem() {
2654
      return this.item;
2655
    }
2656
 
103 ashish 2657
    public addItem_args setItem(Item item) {
100 ashish 2658
      this.item = item;
2659
      return this;
2660
    }
2661
 
2662
    public void unsetItem() {
2663
      this.item = null;
2664
    }
2665
 
2666
    /** Returns true if field item is set (has been asigned a value) and false otherwise */
2667
    public boolean isSetItem() {
2668
      return this.item != null;
2669
    }
2670
 
2671
    public void setItemIsSet(boolean value) {
2672
      if (!value) {
2673
        this.item = null;
2674
      }
2675
    }
2676
 
103 ashish 2677
    public void setFieldValue(_Fields field, Object value) {
2678
      switch (field) {
2679
      case ITEM:
2680
        if (value == null) {
2681
          unsetItem();
2682
        } else {
2683
          setItem((Item)value);
2684
        }
2685
        break;
2686
 
2687
      }
2688
    }
2689
 
2690
    public void setFieldValue(int fieldID, Object value) {
2691
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
2692
    }
2693
 
2694
    public Object getFieldValue(_Fields field) {
2695
      switch (field) {
2696
      case ITEM:
2697
        return getItem();
2698
 
2699
      }
2700
      throw new IllegalStateException();
2701
    }
2702
 
2703
    public Object getFieldValue(int fieldId) {
2704
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
2705
    }
2706
 
2707
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
2708
    public boolean isSet(_Fields field) {
2709
      switch (field) {
2710
      case ITEM:
2711
        return isSetItem();
2712
      }
2713
      throw new IllegalStateException();
2714
    }
2715
 
2716
    public boolean isSet(int fieldID) {
2717
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
2718
    }
2719
 
2720
    @Override
2721
    public boolean equals(Object that) {
2722
      if (that == null)
2723
        return false;
2724
      if (that instanceof addItem_args)
2725
        return this.equals((addItem_args)that);
2726
      return false;
2727
    }
2728
 
2729
    public boolean equals(addItem_args that) {
2730
      if (that == null)
2731
        return false;
2732
 
2733
      boolean this_present_item = true && this.isSetItem();
2734
      boolean that_present_item = true && that.isSetItem();
2735
      if (this_present_item || that_present_item) {
2736
        if (!(this_present_item && that_present_item))
2737
          return false;
2738
        if (!this.item.equals(that.item))
2739
          return false;
2740
      }
2741
 
2742
      return true;
2743
    }
2744
 
2745
    @Override
2746
    public int hashCode() {
2747
      return 0;
2748
    }
2749
 
2750
    public void read(TProtocol iprot) throws TException {
2751
      TField field;
2752
      iprot.readStructBegin();
2753
      while (true)
2754
      {
2755
        field = iprot.readFieldBegin();
2756
        if (field.type == TType.STOP) { 
2757
          break;
2758
        }
2759
        _Fields fieldId = _Fields.findByThriftId(field.id);
2760
        if (fieldId == null) {
2761
          TProtocolUtil.skip(iprot, field.type);
2762
        } else {
2763
          switch (fieldId) {
2764
            case ITEM:
2765
              if (field.type == TType.STRUCT) {
2766
                this.item = new Item();
2767
                this.item.read(iprot);
2768
              } else { 
2769
                TProtocolUtil.skip(iprot, field.type);
2770
              }
2771
              break;
2772
          }
2773
          iprot.readFieldEnd();
2774
        }
2775
      }
2776
      iprot.readStructEnd();
2777
      validate();
2778
    }
2779
 
2780
    public void write(TProtocol oprot) throws TException {
2781
      validate();
2782
 
2783
      oprot.writeStructBegin(STRUCT_DESC);
2784
      if (this.item != null) {
2785
        oprot.writeFieldBegin(ITEM_FIELD_DESC);
2786
        this.item.write(oprot);
2787
        oprot.writeFieldEnd();
2788
      }
2789
      oprot.writeFieldStop();
2790
      oprot.writeStructEnd();
2791
    }
2792
 
2793
    @Override
2794
    public String toString() {
2795
      StringBuilder sb = new StringBuilder("addItem_args(");
2796
      boolean first = true;
2797
 
2798
      sb.append("item:");
2799
      if (this.item == null) {
2800
        sb.append("null");
2801
      } else {
2802
        sb.append(this.item);
2803
      }
2804
      first = false;
2805
      sb.append(")");
2806
      return sb.toString();
2807
    }
2808
 
2809
    public void validate() throws TException {
2810
      // check for required fields
2811
    }
2812
 
2813
  }
2814
 
2815
  public static class addItem_result implements TBase<addItem_result._Fields>, java.io.Serializable, Cloneable, Comparable<addItem_result>   {
2816
    private static final TStruct STRUCT_DESC = new TStruct("addItem_result");
2817
 
2818
    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.I64, (short)0);
2819
    private static final TField CEX_FIELD_DESC = new TField("cex", TType.STRUCT, (short)1);
2820
 
2821
    private long success;
2822
    private CatalogServiceException cex;
2823
 
2824
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
2825
    public enum _Fields implements TFieldIdEnum {
2826
      SUCCESS((short)0, "success"),
2827
      CEX((short)1, "cex");
2828
 
2829
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
2830
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
2831
 
2832
      static {
2833
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
2834
          byId.put((int)field._thriftId, field);
2835
          byName.put(field.getFieldName(), field);
2836
        }
2837
      }
2838
 
2839
      /**
2840
       * Find the _Fields constant that matches fieldId, or null if its not found.
2841
       */
2842
      public static _Fields findByThriftId(int fieldId) {
2843
        return byId.get(fieldId);
2844
      }
2845
 
2846
      /**
2847
       * Find the _Fields constant that matches fieldId, throwing an exception
2848
       * if it is not found.
2849
       */
2850
      public static _Fields findByThriftIdOrThrow(int fieldId) {
2851
        _Fields fields = findByThriftId(fieldId);
2852
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
2853
        return fields;
2854
      }
2855
 
2856
      /**
2857
       * Find the _Fields constant that matches name, or null if its not found.
2858
       */
2859
      public static _Fields findByName(String name) {
2860
        return byName.get(name);
2861
      }
2862
 
2863
      private final short _thriftId;
2864
      private final String _fieldName;
2865
 
2866
      _Fields(short thriftId, String fieldName) {
2867
        _thriftId = thriftId;
2868
        _fieldName = fieldName;
2869
      }
2870
 
2871
      public short getThriftFieldId() {
2872
        return _thriftId;
2873
      }
2874
 
2875
      public String getFieldName() {
2876
        return _fieldName;
2877
      }
2878
    }
2879
 
2880
    // isset id assignments
2881
    private static final int __SUCCESS_ISSET_ID = 0;
2882
    private BitSet __isset_bit_vector = new BitSet(1);
2883
 
2884
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
2885
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
2886
          new FieldValueMetaData(TType.I64)));
2887
      put(_Fields.CEX, new FieldMetaData("cex", TFieldRequirementType.DEFAULT, 
2888
          new FieldValueMetaData(TType.STRUCT)));
2889
    }});
2890
 
2891
    static {
2892
      FieldMetaData.addStructMetaDataMap(addItem_result.class, metaDataMap);
2893
    }
2894
 
2895
    public addItem_result() {
2896
    }
2897
 
2898
    public addItem_result(
2899
      long success,
2900
      CatalogServiceException cex)
2901
    {
2902
      this();
2903
      this.success = success;
2904
      setSuccessIsSet(true);
2905
      this.cex = cex;
2906
    }
2907
 
2908
    /**
2909
     * Performs a deep copy on <i>other</i>.
2910
     */
2911
    public addItem_result(addItem_result other) {
2912
      __isset_bit_vector.clear();
2913
      __isset_bit_vector.or(other.__isset_bit_vector);
2914
      this.success = other.success;
2915
      if (other.isSetCex()) {
2916
        this.cex = new CatalogServiceException(other.cex);
2917
      }
2918
    }
2919
 
2920
    public addItem_result deepCopy() {
2921
      return new addItem_result(this);
2922
    }
2923
 
2924
    @Deprecated
2925
    public addItem_result clone() {
2926
      return new addItem_result(this);
2927
    }
2928
 
2929
    public long getSuccess() {
2930
      return this.success;
2931
    }
2932
 
2933
    public addItem_result setSuccess(long success) {
2934
      this.success = success;
2935
      setSuccessIsSet(true);
2936
      return this;
2937
    }
2938
 
2939
    public void unsetSuccess() {
2940
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
2941
    }
2942
 
2943
    /** Returns true if field success is set (has been asigned a value) and false otherwise */
2944
    public boolean isSetSuccess() {
2945
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
2946
    }
2947
 
2948
    public void setSuccessIsSet(boolean value) {
2949
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
2950
    }
2951
 
2952
    public CatalogServiceException getCex() {
2953
      return this.cex;
2954
    }
2955
 
2956
    public addItem_result setCex(CatalogServiceException cex) {
2957
      this.cex = cex;
2958
      return this;
2959
    }
2960
 
2961
    public void unsetCex() {
2962
      this.cex = null;
2963
    }
2964
 
2965
    /** Returns true if field cex is set (has been asigned a value) and false otherwise */
2966
    public boolean isSetCex() {
2967
      return this.cex != null;
2968
    }
2969
 
2970
    public void setCexIsSet(boolean value) {
2971
      if (!value) {
2972
        this.cex = null;
2973
      }
2974
    }
2975
 
2976
    public void setFieldValue(_Fields field, Object value) {
2977
      switch (field) {
2978
      case SUCCESS:
2979
        if (value == null) {
2980
          unsetSuccess();
2981
        } else {
2982
          setSuccess((Long)value);
2983
        }
2984
        break;
2985
 
2986
      case CEX:
2987
        if (value == null) {
2988
          unsetCex();
2989
        } else {
2990
          setCex((CatalogServiceException)value);
2991
        }
2992
        break;
2993
 
2994
      }
2995
    }
2996
 
2997
    public void setFieldValue(int fieldID, Object value) {
2998
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
2999
    }
3000
 
3001
    public Object getFieldValue(_Fields field) {
3002
      switch (field) {
3003
      case SUCCESS:
3004
        return new Long(getSuccess());
3005
 
3006
      case CEX:
3007
        return getCex();
3008
 
3009
      }
3010
      throw new IllegalStateException();
3011
    }
3012
 
3013
    public Object getFieldValue(int fieldId) {
3014
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
3015
    }
3016
 
3017
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
3018
    public boolean isSet(_Fields field) {
3019
      switch (field) {
3020
      case SUCCESS:
3021
        return isSetSuccess();
3022
      case CEX:
3023
        return isSetCex();
3024
      }
3025
      throw new IllegalStateException();
3026
    }
3027
 
3028
    public boolean isSet(int fieldID) {
3029
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
3030
    }
3031
 
3032
    @Override
3033
    public boolean equals(Object that) {
3034
      if (that == null)
3035
        return false;
3036
      if (that instanceof addItem_result)
3037
        return this.equals((addItem_result)that);
3038
      return false;
3039
    }
3040
 
3041
    public boolean equals(addItem_result that) {
3042
      if (that == null)
3043
        return false;
3044
 
3045
      boolean this_present_success = true;
3046
      boolean that_present_success = true;
3047
      if (this_present_success || that_present_success) {
3048
        if (!(this_present_success && that_present_success))
3049
          return false;
3050
        if (this.success != that.success)
3051
          return false;
3052
      }
3053
 
3054
      boolean this_present_cex = true && this.isSetCex();
3055
      boolean that_present_cex = true && that.isSetCex();
3056
      if (this_present_cex || that_present_cex) {
3057
        if (!(this_present_cex && that_present_cex))
3058
          return false;
3059
        if (!this.cex.equals(that.cex))
3060
          return false;
3061
      }
3062
 
3063
      return true;
3064
    }
3065
 
3066
    @Override
3067
    public int hashCode() {
3068
      return 0;
3069
    }
3070
 
3071
    public int compareTo(addItem_result other) {
3072
      if (!getClass().equals(other.getClass())) {
3073
        return getClass().getName().compareTo(other.getClass().getName());
3074
      }
3075
 
3076
      int lastComparison = 0;
3077
      addItem_result typedOther = (addItem_result)other;
3078
 
3079
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
3080
      if (lastComparison != 0) {
3081
        return lastComparison;
3082
      }
3083
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
3084
      if (lastComparison != 0) {
3085
        return lastComparison;
3086
      }
3087
      lastComparison = Boolean.valueOf(isSetCex()).compareTo(isSetCex());
3088
      if (lastComparison != 0) {
3089
        return lastComparison;
3090
      }
3091
      lastComparison = TBaseHelper.compareTo(cex, typedOther.cex);
3092
      if (lastComparison != 0) {
3093
        return lastComparison;
3094
      }
3095
      return 0;
3096
    }
3097
 
3098
    public void read(TProtocol iprot) throws TException {
3099
      TField field;
3100
      iprot.readStructBegin();
3101
      while (true)
3102
      {
3103
        field = iprot.readFieldBegin();
3104
        if (field.type == TType.STOP) { 
3105
          break;
3106
        }
3107
        _Fields fieldId = _Fields.findByThriftId(field.id);
3108
        if (fieldId == null) {
3109
          TProtocolUtil.skip(iprot, field.type);
3110
        } else {
3111
          switch (fieldId) {
3112
            case SUCCESS:
3113
              if (field.type == TType.I64) {
3114
                this.success = iprot.readI64();
3115
                setSuccessIsSet(true);
3116
              } else { 
3117
                TProtocolUtil.skip(iprot, field.type);
3118
              }
3119
              break;
3120
            case CEX:
3121
              if (field.type == TType.STRUCT) {
3122
                this.cex = new CatalogServiceException();
3123
                this.cex.read(iprot);
3124
              } else { 
3125
                TProtocolUtil.skip(iprot, field.type);
3126
              }
3127
              break;
3128
          }
3129
          iprot.readFieldEnd();
3130
        }
3131
      }
3132
      iprot.readStructEnd();
3133
      validate();
3134
    }
3135
 
3136
    public void write(TProtocol oprot) throws TException {
3137
      oprot.writeStructBegin(STRUCT_DESC);
3138
 
3139
      if (this.isSetSuccess()) {
3140
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
3141
        oprot.writeI64(this.success);
3142
        oprot.writeFieldEnd();
3143
      } else if (this.isSetCex()) {
3144
        oprot.writeFieldBegin(CEX_FIELD_DESC);
3145
        this.cex.write(oprot);
3146
        oprot.writeFieldEnd();
3147
      }
3148
      oprot.writeFieldStop();
3149
      oprot.writeStructEnd();
3150
    }
3151
 
3152
    @Override
3153
    public String toString() {
3154
      StringBuilder sb = new StringBuilder("addItem_result(");
3155
      boolean first = true;
3156
 
3157
      sb.append("success:");
3158
      sb.append(this.success);
3159
      first = false;
3160
      if (!first) sb.append(", ");
3161
      sb.append("cex:");
3162
      if (this.cex == null) {
3163
        sb.append("null");
3164
      } else {
3165
        sb.append(this.cex);
3166
      }
3167
      first = false;
3168
      sb.append(")");
3169
      return sb.toString();
3170
    }
3171
 
3172
    public void validate() throws TException {
3173
      // check for required fields
3174
    }
3175
 
3176
  }
3177
 
3178
  public static class addItemToCategory_args implements TBase<addItemToCategory_args._Fields>, java.io.Serializable, Cloneable, Comparable<addItemToCategory_args>   {
3179
    private static final TStruct STRUCT_DESC = new TStruct("addItemToCategory_args");
3180
 
3181
    private static final TField ITEM_ID_FIELD_DESC = new TField("item_id", TType.I64, (short)1);
3182
    private static final TField CATEGORY_ID_FIELD_DESC = new TField("category_id", TType.I64, (short)2);
3183
 
3184
    private long item_id;
3185
    private long category_id;
3186
 
3187
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3188
    public enum _Fields implements TFieldIdEnum {
3189
      ITEM_ID((short)1, "item_id"),
3190
      CATEGORY_ID((short)2, "category_id");
3191
 
3192
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
3193
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
3194
 
3195
      static {
3196
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
3197
          byId.put((int)field._thriftId, field);
3198
          byName.put(field.getFieldName(), field);
3199
        }
3200
      }
3201
 
3202
      /**
3203
       * Find the _Fields constant that matches fieldId, or null if its not found.
3204
       */
3205
      public static _Fields findByThriftId(int fieldId) {
3206
        return byId.get(fieldId);
3207
      }
3208
 
3209
      /**
3210
       * Find the _Fields constant that matches fieldId, throwing an exception
3211
       * if it is not found.
3212
       */
3213
      public static _Fields findByThriftIdOrThrow(int fieldId) {
3214
        _Fields fields = findByThriftId(fieldId);
3215
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
3216
        return fields;
3217
      }
3218
 
3219
      /**
3220
       * Find the _Fields constant that matches name, or null if its not found.
3221
       */
3222
      public static _Fields findByName(String name) {
3223
        return byName.get(name);
3224
      }
3225
 
3226
      private final short _thriftId;
3227
      private final String _fieldName;
3228
 
3229
      _Fields(short thriftId, String fieldName) {
3230
        _thriftId = thriftId;
3231
        _fieldName = fieldName;
3232
      }
3233
 
3234
      public short getThriftFieldId() {
3235
        return _thriftId;
3236
      }
3237
 
3238
      public String getFieldName() {
3239
        return _fieldName;
3240
      }
3241
    }
3242
 
3243
    // isset id assignments
3244
    private static final int __ITEM_ID_ISSET_ID = 0;
3245
    private static final int __CATEGORY_ID_ISSET_ID = 1;
3246
    private BitSet __isset_bit_vector = new BitSet(2);
3247
 
3248
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
3249
      put(_Fields.ITEM_ID, new FieldMetaData("item_id", TFieldRequirementType.DEFAULT, 
3250
          new FieldValueMetaData(TType.I64)));
3251
      put(_Fields.CATEGORY_ID, new FieldMetaData("category_id", TFieldRequirementType.DEFAULT, 
3252
          new FieldValueMetaData(TType.I64)));
3253
    }});
3254
 
3255
    static {
3256
      FieldMetaData.addStructMetaDataMap(addItemToCategory_args.class, metaDataMap);
3257
    }
3258
 
3259
    public addItemToCategory_args() {
3260
    }
3261
 
3262
    public addItemToCategory_args(
3263
      long item_id,
3264
      long category_id)
3265
    {
3266
      this();
3267
      this.item_id = item_id;
3268
      setItem_idIsSet(true);
3269
      this.category_id = category_id;
3270
      setCategory_idIsSet(true);
3271
    }
3272
 
3273
    /**
3274
     * Performs a deep copy on <i>other</i>.
3275
     */
3276
    public addItemToCategory_args(addItemToCategory_args other) {
3277
      __isset_bit_vector.clear();
3278
      __isset_bit_vector.or(other.__isset_bit_vector);
3279
      this.item_id = other.item_id;
3280
      this.category_id = other.category_id;
3281
    }
3282
 
3283
    public addItemToCategory_args deepCopy() {
3284
      return new addItemToCategory_args(this);
3285
    }
3286
 
3287
    @Deprecated
3288
    public addItemToCategory_args clone() {
3289
      return new addItemToCategory_args(this);
3290
    }
3291
 
3292
    public long getItem_id() {
3293
      return this.item_id;
3294
    }
3295
 
3296
    public addItemToCategory_args setItem_id(long item_id) {
3297
      this.item_id = item_id;
3298
      setItem_idIsSet(true);
3299
      return this;
3300
    }
3301
 
3302
    public void unsetItem_id() {
3303
      __isset_bit_vector.clear(__ITEM_ID_ISSET_ID);
3304
    }
3305
 
3306
    /** Returns true if field item_id is set (has been asigned a value) and false otherwise */
3307
    public boolean isSetItem_id() {
3308
      return __isset_bit_vector.get(__ITEM_ID_ISSET_ID);
3309
    }
3310
 
3311
    public void setItem_idIsSet(boolean value) {
3312
      __isset_bit_vector.set(__ITEM_ID_ISSET_ID, value);
3313
    }
3314
 
100 ashish 3315
    public long getCategory_id() {
3316
      return this.category_id;
3317
    }
3318
 
3319
    public addItemToCategory_args setCategory_id(long category_id) {
3320
      this.category_id = category_id;
3321
      setCategory_idIsSet(true);
3322
      return this;
3323
    }
3324
 
3325
    public void unsetCategory_id() {
3326
      __isset_bit_vector.clear(__CATEGORY_ID_ISSET_ID);
3327
    }
3328
 
3329
    /** Returns true if field category_id is set (has been asigned a value) and false otherwise */
3330
    public boolean isSetCategory_id() {
3331
      return __isset_bit_vector.get(__CATEGORY_ID_ISSET_ID);
3332
    }
3333
 
3334
    public void setCategory_idIsSet(boolean value) {
3335
      __isset_bit_vector.set(__CATEGORY_ID_ISSET_ID, value);
3336
    }
3337
 
3338
    public void setFieldValue(_Fields field, Object value) {
3339
      switch (field) {
103 ashish 3340
      case ITEM_ID:
100 ashish 3341
        if (value == null) {
103 ashish 3342
          unsetItem_id();
100 ashish 3343
        } else {
103 ashish 3344
          setItem_id((Long)value);
100 ashish 3345
        }
3346
        break;
3347
 
3348
      case CATEGORY_ID:
3349
        if (value == null) {
3350
          unsetCategory_id();
3351
        } else {
3352
          setCategory_id((Long)value);
3353
        }
3354
        break;
3355
 
3356
      }
3357
    }
3358
 
3359
    public void setFieldValue(int fieldID, Object value) {
3360
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
3361
    }
3362
 
3363
    public Object getFieldValue(_Fields field) {
3364
      switch (field) {
103 ashish 3365
      case ITEM_ID:
3366
        return new Long(getItem_id());
100 ashish 3367
 
3368
      case CATEGORY_ID:
3369
        return new Long(getCategory_id());
3370
 
3371
      }
3372
      throw new IllegalStateException();
3373
    }
3374
 
3375
    public Object getFieldValue(int fieldId) {
3376
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
3377
    }
3378
 
3379
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
3380
    public boolean isSet(_Fields field) {
3381
      switch (field) {
103 ashish 3382
      case ITEM_ID:
3383
        return isSetItem_id();
100 ashish 3384
      case CATEGORY_ID:
3385
        return isSetCategory_id();
3386
      }
3387
      throw new IllegalStateException();
3388
    }
3389
 
3390
    public boolean isSet(int fieldID) {
3391
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
3392
    }
3393
 
3394
    @Override
3395
    public boolean equals(Object that) {
3396
      if (that == null)
3397
        return false;
3398
      if (that instanceof addItemToCategory_args)
3399
        return this.equals((addItemToCategory_args)that);
3400
      return false;
3401
    }
3402
 
3403
    public boolean equals(addItemToCategory_args that) {
3404
      if (that == null)
3405
        return false;
3406
 
103 ashish 3407
      boolean this_present_item_id = true;
3408
      boolean that_present_item_id = true;
3409
      if (this_present_item_id || that_present_item_id) {
3410
        if (!(this_present_item_id && that_present_item_id))
100 ashish 3411
          return false;
103 ashish 3412
        if (this.item_id != that.item_id)
100 ashish 3413
          return false;
3414
      }
3415
 
3416
      boolean this_present_category_id = true;
3417
      boolean that_present_category_id = true;
3418
      if (this_present_category_id || that_present_category_id) {
3419
        if (!(this_present_category_id && that_present_category_id))
3420
          return false;
3421
        if (this.category_id != that.category_id)
3422
          return false;
3423
      }
3424
 
3425
      return true;
3426
    }
3427
 
3428
    @Override
3429
    public int hashCode() {
3430
      return 0;
3431
    }
3432
 
103 ashish 3433
    public int compareTo(addItemToCategory_args other) {
3434
      if (!getClass().equals(other.getClass())) {
3435
        return getClass().getName().compareTo(other.getClass().getName());
3436
      }
3437
 
3438
      int lastComparison = 0;
3439
      addItemToCategory_args typedOther = (addItemToCategory_args)other;
3440
 
3441
      lastComparison = Boolean.valueOf(isSetItem_id()).compareTo(isSetItem_id());
3442
      if (lastComparison != 0) {
3443
        return lastComparison;
3444
      }
3445
      lastComparison = TBaseHelper.compareTo(item_id, typedOther.item_id);
3446
      if (lastComparison != 0) {
3447
        return lastComparison;
3448
      }
3449
      lastComparison = Boolean.valueOf(isSetCategory_id()).compareTo(isSetCategory_id());
3450
      if (lastComparison != 0) {
3451
        return lastComparison;
3452
      }
3453
      lastComparison = TBaseHelper.compareTo(category_id, typedOther.category_id);
3454
      if (lastComparison != 0) {
3455
        return lastComparison;
3456
      }
3457
      return 0;
3458
    }
3459
 
100 ashish 3460
    public void read(TProtocol iprot) throws TException {
3461
      TField field;
3462
      iprot.readStructBegin();
3463
      while (true)
3464
      {
3465
        field = iprot.readFieldBegin();
3466
        if (field.type == TType.STOP) { 
3467
          break;
3468
        }
3469
        _Fields fieldId = _Fields.findByThriftId(field.id);
3470
        if (fieldId == null) {
3471
          TProtocolUtil.skip(iprot, field.type);
3472
        } else {
3473
          switch (fieldId) {
103 ashish 3474
            case ITEM_ID:
3475
              if (field.type == TType.I64) {
3476
                this.item_id = iprot.readI64();
3477
                setItem_idIsSet(true);
100 ashish 3478
              } else { 
3479
                TProtocolUtil.skip(iprot, field.type);
3480
              }
3481
              break;
3482
            case CATEGORY_ID:
3483
              if (field.type == TType.I64) {
3484
                this.category_id = iprot.readI64();
3485
                setCategory_idIsSet(true);
3486
              } else { 
3487
                TProtocolUtil.skip(iprot, field.type);
3488
              }
3489
              break;
3490
          }
3491
          iprot.readFieldEnd();
3492
        }
3493
      }
3494
      iprot.readStructEnd();
3495
      validate();
3496
    }
3497
 
3498
    public void write(TProtocol oprot) throws TException {
3499
      validate();
3500
 
3501
      oprot.writeStructBegin(STRUCT_DESC);
103 ashish 3502
      oprot.writeFieldBegin(ITEM_ID_FIELD_DESC);
3503
      oprot.writeI64(this.item_id);
3504
      oprot.writeFieldEnd();
100 ashish 3505
      oprot.writeFieldBegin(CATEGORY_ID_FIELD_DESC);
3506
      oprot.writeI64(this.category_id);
3507
      oprot.writeFieldEnd();
3508
      oprot.writeFieldStop();
3509
      oprot.writeStructEnd();
3510
    }
3511
 
3512
    @Override
3513
    public String toString() {
3514
      StringBuilder sb = new StringBuilder("addItemToCategory_args(");
3515
      boolean first = true;
3516
 
103 ashish 3517
      sb.append("item_id:");
3518
      sb.append(this.item_id);
100 ashish 3519
      first = false;
3520
      if (!first) sb.append(", ");
3521
      sb.append("category_id:");
3522
      sb.append(this.category_id);
3523
      first = false;
3524
      sb.append(")");
3525
      return sb.toString();
3526
    }
3527
 
3528
    public void validate() throws TException {
3529
      // check for required fields
3530
    }
3531
 
3532
  }
3533
 
3534
  public static class addItemToCategory_result implements TBase<addItemToCategory_result._Fields>, java.io.Serializable, Cloneable, Comparable<addItemToCategory_result>   {
3535
    private static final TStruct STRUCT_DESC = new TStruct("addItemToCategory_result");
3536
 
103 ashish 3537
    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.I64, (short)0);
100 ashish 3538
    private static final TField CEX_FIELD_DESC = new TField("cex", TType.STRUCT, (short)1);
3539
 
103 ashish 3540
    private long success;
100 ashish 3541
    private CatalogServiceException cex;
3542
 
3543
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3544
    public enum _Fields implements TFieldIdEnum {
103 ashish 3545
      SUCCESS((short)0, "success"),
100 ashish 3546
      CEX((short)1, "cex");
3547
 
3548
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
3549
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
3550
 
3551
      static {
3552
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
3553
          byId.put((int)field._thriftId, field);
3554
          byName.put(field.getFieldName(), field);
3555
        }
3556
      }
3557
 
3558
      /**
3559
       * Find the _Fields constant that matches fieldId, or null if its not found.
3560
       */
3561
      public static _Fields findByThriftId(int fieldId) {
3562
        return byId.get(fieldId);
3563
      }
3564
 
3565
      /**
3566
       * Find the _Fields constant that matches fieldId, throwing an exception
3567
       * if it is not found.
3568
       */
3569
      public static _Fields findByThriftIdOrThrow(int fieldId) {
3570
        _Fields fields = findByThriftId(fieldId);
3571
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
3572
        return fields;
3573
      }
3574
 
3575
      /**
3576
       * Find the _Fields constant that matches name, or null if its not found.
3577
       */
3578
      public static _Fields findByName(String name) {
3579
        return byName.get(name);
3580
      }
3581
 
3582
      private final short _thriftId;
3583
      private final String _fieldName;
3584
 
3585
      _Fields(short thriftId, String fieldName) {
3586
        _thriftId = thriftId;
3587
        _fieldName = fieldName;
3588
      }
3589
 
3590
      public short getThriftFieldId() {
3591
        return _thriftId;
3592
      }
3593
 
3594
      public String getFieldName() {
3595
        return _fieldName;
3596
      }
3597
    }
3598
 
3599
    // isset id assignments
103 ashish 3600
    private static final int __SUCCESS_ISSET_ID = 0;
3601
    private BitSet __isset_bit_vector = new BitSet(1);
100 ashish 3602
 
3603
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
103 ashish 3604
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
3605
          new FieldValueMetaData(TType.I64)));
100 ashish 3606
      put(_Fields.CEX, new FieldMetaData("cex", TFieldRequirementType.DEFAULT, 
3607
          new FieldValueMetaData(TType.STRUCT)));
3608
    }});
3609
 
3610
    static {
3611
      FieldMetaData.addStructMetaDataMap(addItemToCategory_result.class, metaDataMap);
3612
    }
3613
 
3614
    public addItemToCategory_result() {
3615
    }
3616
 
3617
    public addItemToCategory_result(
103 ashish 3618
      long success,
100 ashish 3619
      CatalogServiceException cex)
3620
    {
3621
      this();
103 ashish 3622
      this.success = success;
3623
      setSuccessIsSet(true);
100 ashish 3624
      this.cex = cex;
3625
    }
3626
 
3627
    /**
3628
     * Performs a deep copy on <i>other</i>.
3629
     */
3630
    public addItemToCategory_result(addItemToCategory_result other) {
103 ashish 3631
      __isset_bit_vector.clear();
3632
      __isset_bit_vector.or(other.__isset_bit_vector);
3633
      this.success = other.success;
100 ashish 3634
      if (other.isSetCex()) {
3635
        this.cex = new CatalogServiceException(other.cex);
3636
      }
3637
    }
3638
 
3639
    public addItemToCategory_result deepCopy() {
3640
      return new addItemToCategory_result(this);
3641
    }
3642
 
3643
    @Deprecated
3644
    public addItemToCategory_result clone() {
3645
      return new addItemToCategory_result(this);
3646
    }
3647
 
103 ashish 3648
    public long getSuccess() {
3649
      return this.success;
3650
    }
3651
 
3652
    public addItemToCategory_result setSuccess(long success) {
3653
      this.success = success;
3654
      setSuccessIsSet(true);
3655
      return this;
3656
    }
3657
 
3658
    public void unsetSuccess() {
3659
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
3660
    }
3661
 
3662
    /** Returns true if field success is set (has been asigned a value) and false otherwise */
3663
    public boolean isSetSuccess() {
3664
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
3665
    }
3666
 
3667
    public void setSuccessIsSet(boolean value) {
3668
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
3669
    }
3670
 
100 ashish 3671
    public CatalogServiceException getCex() {
3672
      return this.cex;
3673
    }
3674
 
3675
    public addItemToCategory_result setCex(CatalogServiceException cex) {
3676
      this.cex = cex;
3677
      return this;
3678
    }
3679
 
3680
    public void unsetCex() {
3681
      this.cex = null;
3682
    }
3683
 
3684
    /** Returns true if field cex is set (has been asigned a value) and false otherwise */
3685
    public boolean isSetCex() {
3686
      return this.cex != null;
3687
    }
3688
 
3689
    public void setCexIsSet(boolean value) {
3690
      if (!value) {
3691
        this.cex = null;
3692
      }
3693
    }
3694
 
3695
    public void setFieldValue(_Fields field, Object value) {
3696
      switch (field) {
103 ashish 3697
      case SUCCESS:
3698
        if (value == null) {
3699
          unsetSuccess();
3700
        } else {
3701
          setSuccess((Long)value);
3702
        }
3703
        break;
3704
 
100 ashish 3705
      case CEX:
3706
        if (value == null) {
3707
          unsetCex();
3708
        } else {
3709
          setCex((CatalogServiceException)value);
3710
        }
3711
        break;
3712
 
3713
      }
3714
    }
3715
 
3716
    public void setFieldValue(int fieldID, Object value) {
3717
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
3718
    }
3719
 
3720
    public Object getFieldValue(_Fields field) {
3721
      switch (field) {
103 ashish 3722
      case SUCCESS:
3723
        return new Long(getSuccess());
3724
 
100 ashish 3725
      case CEX:
3726
        return getCex();
3727
 
3728
      }
3729
      throw new IllegalStateException();
3730
    }
3731
 
3732
    public Object getFieldValue(int fieldId) {
3733
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
3734
    }
3735
 
3736
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
3737
    public boolean isSet(_Fields field) {
3738
      switch (field) {
103 ashish 3739
      case SUCCESS:
3740
        return isSetSuccess();
100 ashish 3741
      case CEX:
3742
        return isSetCex();
3743
      }
3744
      throw new IllegalStateException();
3745
    }
3746
 
3747
    public boolean isSet(int fieldID) {
3748
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
3749
    }
3750
 
3751
    @Override
3752
    public boolean equals(Object that) {
3753
      if (that == null)
3754
        return false;
3755
      if (that instanceof addItemToCategory_result)
3756
        return this.equals((addItemToCategory_result)that);
3757
      return false;
3758
    }
3759
 
3760
    public boolean equals(addItemToCategory_result that) {
3761
      if (that == null)
3762
        return false;
3763
 
103 ashish 3764
      boolean this_present_success = true;
3765
      boolean that_present_success = true;
3766
      if (this_present_success || that_present_success) {
3767
        if (!(this_present_success && that_present_success))
3768
          return false;
3769
        if (this.success != that.success)
3770
          return false;
3771
      }
3772
 
100 ashish 3773
      boolean this_present_cex = true && this.isSetCex();
3774
      boolean that_present_cex = true && that.isSetCex();
3775
      if (this_present_cex || that_present_cex) {
3776
        if (!(this_present_cex && that_present_cex))
3777
          return false;
3778
        if (!this.cex.equals(that.cex))
3779
          return false;
3780
      }
3781
 
3782
      return true;
3783
    }
3784
 
3785
    @Override
3786
    public int hashCode() {
3787
      return 0;
3788
    }
3789
 
3790
    public int compareTo(addItemToCategory_result other) {
3791
      if (!getClass().equals(other.getClass())) {
3792
        return getClass().getName().compareTo(other.getClass().getName());
3793
      }
3794
 
3795
      int lastComparison = 0;
3796
      addItemToCategory_result typedOther = (addItemToCategory_result)other;
3797
 
103 ashish 3798
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
3799
      if (lastComparison != 0) {
3800
        return lastComparison;
3801
      }
3802
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
3803
      if (lastComparison != 0) {
3804
        return lastComparison;
3805
      }
100 ashish 3806
      lastComparison = Boolean.valueOf(isSetCex()).compareTo(isSetCex());
3807
      if (lastComparison != 0) {
3808
        return lastComparison;
3809
      }
3810
      lastComparison = TBaseHelper.compareTo(cex, typedOther.cex);
3811
      if (lastComparison != 0) {
3812
        return lastComparison;
3813
      }
3814
      return 0;
3815
    }
3816
 
3817
    public void read(TProtocol iprot) throws TException {
3818
      TField field;
3819
      iprot.readStructBegin();
3820
      while (true)
3821
      {
3822
        field = iprot.readFieldBegin();
3823
        if (field.type == TType.STOP) { 
3824
          break;
3825
        }
3826
        _Fields fieldId = _Fields.findByThriftId(field.id);
3827
        if (fieldId == null) {
3828
          TProtocolUtil.skip(iprot, field.type);
3829
        } else {
3830
          switch (fieldId) {
103 ashish 3831
            case SUCCESS:
3832
              if (field.type == TType.I64) {
3833
                this.success = iprot.readI64();
3834
                setSuccessIsSet(true);
3835
              } else { 
3836
                TProtocolUtil.skip(iprot, field.type);
3837
              }
3838
              break;
100 ashish 3839
            case CEX:
3840
              if (field.type == TType.STRUCT) {
3841
                this.cex = new CatalogServiceException();
3842
                this.cex.read(iprot);
3843
              } else { 
3844
                TProtocolUtil.skip(iprot, field.type);
3845
              }
3846
              break;
3847
          }
3848
          iprot.readFieldEnd();
3849
        }
3850
      }
3851
      iprot.readStructEnd();
3852
      validate();
3853
    }
3854
 
3855
    public void write(TProtocol oprot) throws TException {
3856
      oprot.writeStructBegin(STRUCT_DESC);
3857
 
103 ashish 3858
      if (this.isSetSuccess()) {
3859
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
3860
        oprot.writeI64(this.success);
3861
        oprot.writeFieldEnd();
3862
      } else if (this.isSetCex()) {
100 ashish 3863
        oprot.writeFieldBegin(CEX_FIELD_DESC);
3864
        this.cex.write(oprot);
3865
        oprot.writeFieldEnd();
3866
      }
3867
      oprot.writeFieldStop();
3868
      oprot.writeStructEnd();
3869
    }
3870
 
3871
    @Override
3872
    public String toString() {
3873
      StringBuilder sb = new StringBuilder("addItemToCategory_result(");
3874
      boolean first = true;
3875
 
103 ashish 3876
      sb.append("success:");
3877
      sb.append(this.success);
3878
      first = false;
3879
      if (!first) sb.append(", ");
100 ashish 3880
      sb.append("cex:");
3881
      if (this.cex == null) {
3882
        sb.append("null");
3883
      } else {
3884
        sb.append(this.cex);
3885
      }
3886
      first = false;
3887
      sb.append(")");
3888
      return sb.toString();
3889
    }
3890
 
3891
    public void validate() throws TException {
3892
      // check for required fields
3893
    }
3894
 
3895
  }
3896
 
103 ashish 3897
  public static class addWarehouse_args implements TBase<addWarehouse_args._Fields>, java.io.Serializable, Cloneable, Comparable<addWarehouse_args>   {
3898
    private static final TStruct STRUCT_DESC = new TStruct("addWarehouse_args");
100 ashish 3899
 
103 ashish 3900
    private static final TField WAREHOUSE_FIELD_DESC = new TField("warehouse", TType.STRUCT, (short)1);
100 ashish 3901
 
103 ashish 3902
    private Warehouse warehouse;
100 ashish 3903
 
3904
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3905
    public enum _Fields implements TFieldIdEnum {
103 ashish 3906
      WAREHOUSE((short)1, "warehouse");
100 ashish 3907
 
3908
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
3909
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
3910
 
3911
      static {
3912
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
3913
          byId.put((int)field._thriftId, field);
3914
          byName.put(field.getFieldName(), field);
3915
        }
3916
      }
3917
 
3918
      /**
3919
       * Find the _Fields constant that matches fieldId, or null if its not found.
3920
       */
3921
      public static _Fields findByThriftId(int fieldId) {
3922
        return byId.get(fieldId);
3923
      }
3924
 
3925
      /**
3926
       * Find the _Fields constant that matches fieldId, throwing an exception
3927
       * if it is not found.
3928
       */
3929
      public static _Fields findByThriftIdOrThrow(int fieldId) {
3930
        _Fields fields = findByThriftId(fieldId);
3931
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
3932
        return fields;
3933
      }
3934
 
3935
      /**
3936
       * Find the _Fields constant that matches name, or null if its not found.
3937
       */
3938
      public static _Fields findByName(String name) {
3939
        return byName.get(name);
3940
      }
3941
 
3942
      private final short _thriftId;
3943
      private final String _fieldName;
3944
 
3945
      _Fields(short thriftId, String fieldName) {
3946
        _thriftId = thriftId;
3947
        _fieldName = fieldName;
3948
      }
3949
 
3950
      public short getThriftFieldId() {
3951
        return _thriftId;
3952
      }
3953
 
3954
      public String getFieldName() {
3955
        return _fieldName;
3956
      }
3957
    }
3958
 
3959
    // isset id assignments
103 ashish 3960
 
3961
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
3962
      put(_Fields.WAREHOUSE, new FieldMetaData("warehouse", TFieldRequirementType.DEFAULT, 
3963
          new StructMetaData(TType.STRUCT, Warehouse.class)));
3964
    }});
3965
 
3966
    static {
3967
      FieldMetaData.addStructMetaDataMap(addWarehouse_args.class, metaDataMap);
3968
    }
3969
 
3970
    public addWarehouse_args() {
3971
    }
3972
 
3973
    public addWarehouse_args(
3974
      Warehouse warehouse)
3975
    {
3976
      this();
3977
      this.warehouse = warehouse;
3978
    }
3979
 
3980
    /**
3981
     * Performs a deep copy on <i>other</i>.
3982
     */
3983
    public addWarehouse_args(addWarehouse_args other) {
3984
      if (other.isSetWarehouse()) {
3985
        this.warehouse = new Warehouse(other.warehouse);
3986
      }
3987
    }
3988
 
3989
    public addWarehouse_args deepCopy() {
3990
      return new addWarehouse_args(this);
3991
    }
3992
 
3993
    @Deprecated
3994
    public addWarehouse_args clone() {
3995
      return new addWarehouse_args(this);
3996
    }
3997
 
3998
    public Warehouse getWarehouse() {
3999
      return this.warehouse;
4000
    }
4001
 
4002
    public addWarehouse_args setWarehouse(Warehouse warehouse) {
4003
      this.warehouse = warehouse;
4004
      return this;
4005
    }
4006
 
4007
    public void unsetWarehouse() {
4008
      this.warehouse = null;
4009
    }
4010
 
4011
    /** Returns true if field warehouse is set (has been asigned a value) and false otherwise */
4012
    public boolean isSetWarehouse() {
4013
      return this.warehouse != null;
4014
    }
4015
 
4016
    public void setWarehouseIsSet(boolean value) {
4017
      if (!value) {
4018
        this.warehouse = null;
4019
      }
4020
    }
4021
 
4022
    public void setFieldValue(_Fields field, Object value) {
4023
      switch (field) {
4024
      case WAREHOUSE:
4025
        if (value == null) {
4026
          unsetWarehouse();
4027
        } else {
4028
          setWarehouse((Warehouse)value);
4029
        }
4030
        break;
4031
 
4032
      }
4033
    }
4034
 
4035
    public void setFieldValue(int fieldID, Object value) {
4036
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
4037
    }
4038
 
4039
    public Object getFieldValue(_Fields field) {
4040
      switch (field) {
4041
      case WAREHOUSE:
4042
        return getWarehouse();
4043
 
4044
      }
4045
      throw new IllegalStateException();
4046
    }
4047
 
4048
    public Object getFieldValue(int fieldId) {
4049
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
4050
    }
4051
 
4052
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
4053
    public boolean isSet(_Fields field) {
4054
      switch (field) {
4055
      case WAREHOUSE:
4056
        return isSetWarehouse();
4057
      }
4058
      throw new IllegalStateException();
4059
    }
4060
 
4061
    public boolean isSet(int fieldID) {
4062
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
4063
    }
4064
 
4065
    @Override
4066
    public boolean equals(Object that) {
4067
      if (that == null)
4068
        return false;
4069
      if (that instanceof addWarehouse_args)
4070
        return this.equals((addWarehouse_args)that);
4071
      return false;
4072
    }
4073
 
4074
    public boolean equals(addWarehouse_args that) {
4075
      if (that == null)
4076
        return false;
4077
 
4078
      boolean this_present_warehouse = true && this.isSetWarehouse();
4079
      boolean that_present_warehouse = true && that.isSetWarehouse();
4080
      if (this_present_warehouse || that_present_warehouse) {
4081
        if (!(this_present_warehouse && that_present_warehouse))
4082
          return false;
4083
        if (!this.warehouse.equals(that.warehouse))
4084
          return false;
4085
      }
4086
 
4087
      return true;
4088
    }
4089
 
4090
    @Override
4091
    public int hashCode() {
4092
      return 0;
4093
    }
4094
 
4095
    public int compareTo(addWarehouse_args other) {
4096
      if (!getClass().equals(other.getClass())) {
4097
        return getClass().getName().compareTo(other.getClass().getName());
4098
      }
4099
 
4100
      int lastComparison = 0;
4101
      addWarehouse_args typedOther = (addWarehouse_args)other;
4102
 
4103
      lastComparison = Boolean.valueOf(isSetWarehouse()).compareTo(isSetWarehouse());
4104
      if (lastComparison != 0) {
4105
        return lastComparison;
4106
      }
4107
      lastComparison = TBaseHelper.compareTo(warehouse, typedOther.warehouse);
4108
      if (lastComparison != 0) {
4109
        return lastComparison;
4110
      }
4111
      return 0;
4112
    }
4113
 
4114
    public void read(TProtocol iprot) throws TException {
4115
      TField field;
4116
      iprot.readStructBegin();
4117
      while (true)
4118
      {
4119
        field = iprot.readFieldBegin();
4120
        if (field.type == TType.STOP) { 
4121
          break;
4122
        }
4123
        _Fields fieldId = _Fields.findByThriftId(field.id);
4124
        if (fieldId == null) {
4125
          TProtocolUtil.skip(iprot, field.type);
4126
        } else {
4127
          switch (fieldId) {
4128
            case WAREHOUSE:
4129
              if (field.type == TType.STRUCT) {
4130
                this.warehouse = new Warehouse();
4131
                this.warehouse.read(iprot);
4132
              } else { 
4133
                TProtocolUtil.skip(iprot, field.type);
4134
              }
4135
              break;
4136
          }
4137
          iprot.readFieldEnd();
4138
        }
4139
      }
4140
      iprot.readStructEnd();
4141
      validate();
4142
    }
4143
 
4144
    public void write(TProtocol oprot) throws TException {
4145
      validate();
4146
 
4147
      oprot.writeStructBegin(STRUCT_DESC);
4148
      if (this.warehouse != null) {
4149
        oprot.writeFieldBegin(WAREHOUSE_FIELD_DESC);
4150
        this.warehouse.write(oprot);
4151
        oprot.writeFieldEnd();
4152
      }
4153
      oprot.writeFieldStop();
4154
      oprot.writeStructEnd();
4155
    }
4156
 
4157
    @Override
4158
    public String toString() {
4159
      StringBuilder sb = new StringBuilder("addWarehouse_args(");
4160
      boolean first = true;
4161
 
4162
      sb.append("warehouse:");
4163
      if (this.warehouse == null) {
4164
        sb.append("null");
4165
      } else {
4166
        sb.append(this.warehouse);
4167
      }
4168
      first = false;
4169
      sb.append(")");
4170
      return sb.toString();
4171
    }
4172
 
4173
    public void validate() throws TException {
4174
      // check for required fields
4175
    }
4176
 
4177
  }
4178
 
4179
  public static class addWarehouse_result implements TBase<addWarehouse_result._Fields>, java.io.Serializable, Cloneable, Comparable<addWarehouse_result>   {
4180
    private static final TStruct STRUCT_DESC = new TStruct("addWarehouse_result");
4181
 
4182
    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.I64, (short)0);
4183
    private static final TField CEX_FIELD_DESC = new TField("cex", TType.STRUCT, (short)1);
4184
 
4185
    private long success;
4186
    private CatalogServiceException cex;
4187
 
4188
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
4189
    public enum _Fields implements TFieldIdEnum {
4190
      SUCCESS((short)0, "success"),
4191
      CEX((short)1, "cex");
4192
 
4193
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
4194
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
4195
 
4196
      static {
4197
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
4198
          byId.put((int)field._thriftId, field);
4199
          byName.put(field.getFieldName(), field);
4200
        }
4201
      }
4202
 
4203
      /**
4204
       * Find the _Fields constant that matches fieldId, or null if its not found.
4205
       */
4206
      public static _Fields findByThriftId(int fieldId) {
4207
        return byId.get(fieldId);
4208
      }
4209
 
4210
      /**
4211
       * Find the _Fields constant that matches fieldId, throwing an exception
4212
       * if it is not found.
4213
       */
4214
      public static _Fields findByThriftIdOrThrow(int fieldId) {
4215
        _Fields fields = findByThriftId(fieldId);
4216
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
4217
        return fields;
4218
      }
4219
 
4220
      /**
4221
       * Find the _Fields constant that matches name, or null if its not found.
4222
       */
4223
      public static _Fields findByName(String name) {
4224
        return byName.get(name);
4225
      }
4226
 
4227
      private final short _thriftId;
4228
      private final String _fieldName;
4229
 
4230
      _Fields(short thriftId, String fieldName) {
4231
        _thriftId = thriftId;
4232
        _fieldName = fieldName;
4233
      }
4234
 
4235
      public short getThriftFieldId() {
4236
        return _thriftId;
4237
      }
4238
 
4239
      public String getFieldName() {
4240
        return _fieldName;
4241
      }
4242
    }
4243
 
4244
    // isset id assignments
4245
    private static final int __SUCCESS_ISSET_ID = 0;
100 ashish 4246
    private BitSet __isset_bit_vector = new BitSet(1);
4247
 
4248
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
103 ashish 4249
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
100 ashish 4250
          new FieldValueMetaData(TType.I64)));
103 ashish 4251
      put(_Fields.CEX, new FieldMetaData("cex", TFieldRequirementType.DEFAULT, 
4252
          new FieldValueMetaData(TType.STRUCT)));
100 ashish 4253
    }});
4254
 
4255
    static {
103 ashish 4256
      FieldMetaData.addStructMetaDataMap(addWarehouse_result.class, metaDataMap);
100 ashish 4257
    }
4258
 
103 ashish 4259
    public addWarehouse_result() {
100 ashish 4260
    }
4261
 
103 ashish 4262
    public addWarehouse_result(
4263
      long success,
4264
      CatalogServiceException cex)
100 ashish 4265
    {
4266
      this();
103 ashish 4267
      this.success = success;
4268
      setSuccessIsSet(true);
4269
      this.cex = cex;
100 ashish 4270
    }
4271
 
4272
    /**
4273
     * Performs a deep copy on <i>other</i>.
4274
     */
103 ashish 4275
    public addWarehouse_result(addWarehouse_result other) {
100 ashish 4276
      __isset_bit_vector.clear();
4277
      __isset_bit_vector.or(other.__isset_bit_vector);
103 ashish 4278
      this.success = other.success;
4279
      if (other.isSetCex()) {
4280
        this.cex = new CatalogServiceException(other.cex);
100 ashish 4281
      }
4282
    }
4283
 
103 ashish 4284
    public addWarehouse_result deepCopy() {
4285
      return new addWarehouse_result(this);
100 ashish 4286
    }
4287
 
4288
    @Deprecated
103 ashish 4289
    public addWarehouse_result clone() {
4290
      return new addWarehouse_result(this);
100 ashish 4291
    }
4292
 
103 ashish 4293
    public long getSuccess() {
4294
      return this.success;
100 ashish 4295
    }
4296
 
103 ashish 4297
    public addWarehouse_result setSuccess(long success) {
4298
      this.success = success;
4299
      setSuccessIsSet(true);
100 ashish 4300
      return this;
4301
    }
4302
 
103 ashish 4303
    public void unsetSuccess() {
4304
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
100 ashish 4305
    }
4306
 
103 ashish 4307
    /** Returns true if field success is set (has been asigned a value) and false otherwise */
4308
    public boolean isSetSuccess() {
4309
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
100 ashish 4310
    }
4311
 
103 ashish 4312
    public void setSuccessIsSet(boolean value) {
4313
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
100 ashish 4314
    }
4315
 
103 ashish 4316
    public CatalogServiceException getCex() {
4317
      return this.cex;
100 ashish 4318
    }
4319
 
103 ashish 4320
    public addWarehouse_result setCex(CatalogServiceException cex) {
4321
      this.cex = cex;
100 ashish 4322
      return this;
4323
    }
4324
 
103 ashish 4325
    public void unsetCex() {
4326
      this.cex = null;
100 ashish 4327
    }
4328
 
103 ashish 4329
    /** Returns true if field cex is set (has been asigned a value) and false otherwise */
4330
    public boolean isSetCex() {
4331
      return this.cex != null;
100 ashish 4332
    }
4333
 
103 ashish 4334
    public void setCexIsSet(boolean value) {
4335
      if (!value) {
4336
        this.cex = null;
4337
      }
100 ashish 4338
    }
4339
 
4340
    public void setFieldValue(_Fields field, Object value) {
4341
      switch (field) {
103 ashish 4342
      case SUCCESS:
100 ashish 4343
        if (value == null) {
103 ashish 4344
          unsetSuccess();
100 ashish 4345
        } else {
103 ashish 4346
          setSuccess((Long)value);
100 ashish 4347
        }
4348
        break;
4349
 
103 ashish 4350
      case CEX:
100 ashish 4351
        if (value == null) {
103 ashish 4352
          unsetCex();
100 ashish 4353
        } else {
103 ashish 4354
          setCex((CatalogServiceException)value);
100 ashish 4355
        }
4356
        break;
4357
 
4358
      }
4359
    }
4360
 
4361
    public void setFieldValue(int fieldID, Object value) {
4362
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
4363
    }
4364
 
4365
    public Object getFieldValue(_Fields field) {
4366
      switch (field) {
103 ashish 4367
      case SUCCESS:
4368
        return new Long(getSuccess());
100 ashish 4369
 
103 ashish 4370
      case CEX:
4371
        return getCex();
100 ashish 4372
 
4373
      }
4374
      throw new IllegalStateException();
4375
    }
4376
 
4377
    public Object getFieldValue(int fieldId) {
4378
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
4379
    }
4380
 
4381
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
4382
    public boolean isSet(_Fields field) {
4383
      switch (field) {
103 ashish 4384
      case SUCCESS:
4385
        return isSetSuccess();
4386
      case CEX:
4387
        return isSetCex();
100 ashish 4388
      }
4389
      throw new IllegalStateException();
4390
    }
4391
 
4392
    public boolean isSet(int fieldID) {
4393
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
4394
    }
4395
 
4396
    @Override
4397
    public boolean equals(Object that) {
4398
      if (that == null)
4399
        return false;
103 ashish 4400
      if (that instanceof addWarehouse_result)
4401
        return this.equals((addWarehouse_result)that);
100 ashish 4402
      return false;
4403
    }
4404
 
103 ashish 4405
    public boolean equals(addWarehouse_result that) {
100 ashish 4406
      if (that == null)
4407
        return false;
4408
 
103 ashish 4409
      boolean this_present_success = true;
4410
      boolean that_present_success = true;
4411
      if (this_present_success || that_present_success) {
4412
        if (!(this_present_success && that_present_success))
100 ashish 4413
          return false;
103 ashish 4414
        if (this.success != that.success)
100 ashish 4415
          return false;
4416
      }
4417
 
103 ashish 4418
      boolean this_present_cex = true && this.isSetCex();
4419
      boolean that_present_cex = true && that.isSetCex();
4420
      if (this_present_cex || that_present_cex) {
4421
        if (!(this_present_cex && that_present_cex))
100 ashish 4422
          return false;
103 ashish 4423
        if (!this.cex.equals(that.cex))
100 ashish 4424
          return false;
4425
      }
4426
 
4427
      return true;
4428
    }
4429
 
4430
    @Override
4431
    public int hashCode() {
4432
      return 0;
4433
    }
4434
 
103 ashish 4435
    public int compareTo(addWarehouse_result other) {
100 ashish 4436
      if (!getClass().equals(other.getClass())) {
4437
        return getClass().getName().compareTo(other.getClass().getName());
4438
      }
4439
 
4440
      int lastComparison = 0;
103 ashish 4441
      addWarehouse_result typedOther = (addWarehouse_result)other;
100 ashish 4442
 
103 ashish 4443
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
100 ashish 4444
      if (lastComparison != 0) {
4445
        return lastComparison;
4446
      }
103 ashish 4447
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
100 ashish 4448
      if (lastComparison != 0) {
4449
        return lastComparison;
4450
      }
103 ashish 4451
      lastComparison = Boolean.valueOf(isSetCex()).compareTo(isSetCex());
100 ashish 4452
      if (lastComparison != 0) {
4453
        return lastComparison;
4454
      }
103 ashish 4455
      lastComparison = TBaseHelper.compareTo(cex, typedOther.cex);
100 ashish 4456
      if (lastComparison != 0) {
4457
        return lastComparison;
4458
      }
4459
      return 0;
4460
    }
4461
 
4462
    public void read(TProtocol iprot) throws TException {
4463
      TField field;
4464
      iprot.readStructBegin();
4465
      while (true)
4466
      {
4467
        field = iprot.readFieldBegin();
4468
        if (field.type == TType.STOP) { 
4469
          break;
4470
        }
4471
        _Fields fieldId = _Fields.findByThriftId(field.id);
4472
        if (fieldId == null) {
4473
          TProtocolUtil.skip(iprot, field.type);
4474
        } else {
4475
          switch (fieldId) {
103 ashish 4476
            case SUCCESS:
4477
              if (field.type == TType.I64) {
4478
                this.success = iprot.readI64();
4479
                setSuccessIsSet(true);
4480
              } else { 
4481
                TProtocolUtil.skip(iprot, field.type);
4482
              }
4483
              break;
4484
            case CEX:
100 ashish 4485
              if (field.type == TType.STRUCT) {
103 ashish 4486
                this.cex = new CatalogServiceException();
4487
                this.cex.read(iprot);
100 ashish 4488
              } else { 
4489
                TProtocolUtil.skip(iprot, field.type);
4490
              }
4491
              break;
103 ashish 4492
          }
4493
          iprot.readFieldEnd();
4494
        }
4495
      }
4496
      iprot.readStructEnd();
4497
      validate();
4498
    }
4499
 
4500
    public void write(TProtocol oprot) throws TException {
4501
      oprot.writeStructBegin(STRUCT_DESC);
4502
 
4503
      if (this.isSetSuccess()) {
4504
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
4505
        oprot.writeI64(this.success);
4506
        oprot.writeFieldEnd();
4507
      } else if (this.isSetCex()) {
4508
        oprot.writeFieldBegin(CEX_FIELD_DESC);
4509
        this.cex.write(oprot);
4510
        oprot.writeFieldEnd();
4511
      }
4512
      oprot.writeFieldStop();
4513
      oprot.writeStructEnd();
4514
    }
4515
 
4516
    @Override
4517
    public String toString() {
4518
      StringBuilder sb = new StringBuilder("addWarehouse_result(");
4519
      boolean first = true;
4520
 
4521
      sb.append("success:");
4522
      sb.append(this.success);
4523
      first = false;
4524
      if (!first) sb.append(", ");
4525
      sb.append("cex:");
4526
      if (this.cex == null) {
4527
        sb.append("null");
4528
      } else {
4529
        sb.append(this.cex);
4530
      }
4531
      first = false;
4532
      sb.append(")");
4533
      return sb.toString();
4534
    }
4535
 
4536
    public void validate() throws TException {
4537
      // check for required fields
4538
    }
4539
 
4540
  }
4541
 
4542
  public static class addVendor_args implements TBase<addVendor_args._Fields>, java.io.Serializable, Cloneable, Comparable<addVendor_args>   {
4543
    private static final TStruct STRUCT_DESC = new TStruct("addVendor_args");
4544
 
4545
    private static final TField VENDOR_FIELD_DESC = new TField("vendor", TType.STRUCT, (short)1);
4546
 
4547
    private Vendor vendor;
4548
 
4549
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
4550
    public enum _Fields implements TFieldIdEnum {
4551
      VENDOR((short)1, "vendor");
4552
 
4553
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
4554
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
4555
 
4556
      static {
4557
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
4558
          byId.put((int)field._thriftId, field);
4559
          byName.put(field.getFieldName(), field);
4560
        }
4561
      }
4562
 
4563
      /**
4564
       * Find the _Fields constant that matches fieldId, or null if its not found.
4565
       */
4566
      public static _Fields findByThriftId(int fieldId) {
4567
        return byId.get(fieldId);
4568
      }
4569
 
4570
      /**
4571
       * Find the _Fields constant that matches fieldId, throwing an exception
4572
       * if it is not found.
4573
       */
4574
      public static _Fields findByThriftIdOrThrow(int fieldId) {
4575
        _Fields fields = findByThriftId(fieldId);
4576
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
4577
        return fields;
4578
      }
4579
 
4580
      /**
4581
       * Find the _Fields constant that matches name, or null if its not found.
4582
       */
4583
      public static _Fields findByName(String name) {
4584
        return byName.get(name);
4585
      }
4586
 
4587
      private final short _thriftId;
4588
      private final String _fieldName;
4589
 
4590
      _Fields(short thriftId, String fieldName) {
4591
        _thriftId = thriftId;
4592
        _fieldName = fieldName;
4593
      }
4594
 
4595
      public short getThriftFieldId() {
4596
        return _thriftId;
4597
      }
4598
 
4599
      public String getFieldName() {
4600
        return _fieldName;
4601
      }
4602
    }
4603
 
4604
    // isset id assignments
4605
 
4606
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
4607
      put(_Fields.VENDOR, new FieldMetaData("vendor", TFieldRequirementType.DEFAULT, 
4608
          new StructMetaData(TType.STRUCT, Vendor.class)));
4609
    }});
4610
 
4611
    static {
4612
      FieldMetaData.addStructMetaDataMap(addVendor_args.class, metaDataMap);
4613
    }
4614
 
4615
    public addVendor_args() {
4616
    }
4617
 
4618
    public addVendor_args(
4619
      Vendor vendor)
4620
    {
4621
      this();
4622
      this.vendor = vendor;
4623
    }
4624
 
4625
    /**
4626
     * Performs a deep copy on <i>other</i>.
4627
     */
4628
    public addVendor_args(addVendor_args other) {
4629
      if (other.isSetVendor()) {
4630
        this.vendor = new Vendor(other.vendor);
4631
      }
4632
    }
4633
 
4634
    public addVendor_args deepCopy() {
4635
      return new addVendor_args(this);
4636
    }
4637
 
4638
    @Deprecated
4639
    public addVendor_args clone() {
4640
      return new addVendor_args(this);
4641
    }
4642
 
4643
    public Vendor getVendor() {
4644
      return this.vendor;
4645
    }
4646
 
4647
    public addVendor_args setVendor(Vendor vendor) {
4648
      this.vendor = vendor;
4649
      return this;
4650
    }
4651
 
4652
    public void unsetVendor() {
4653
      this.vendor = null;
4654
    }
4655
 
4656
    /** Returns true if field vendor is set (has been asigned a value) and false otherwise */
4657
    public boolean isSetVendor() {
4658
      return this.vendor != null;
4659
    }
4660
 
4661
    public void setVendorIsSet(boolean value) {
4662
      if (!value) {
4663
        this.vendor = null;
4664
      }
4665
    }
4666
 
4667
    public void setFieldValue(_Fields field, Object value) {
4668
      switch (field) {
4669
      case VENDOR:
4670
        if (value == null) {
4671
          unsetVendor();
4672
        } else {
4673
          setVendor((Vendor)value);
4674
        }
4675
        break;
4676
 
4677
      }
4678
    }
4679
 
4680
    public void setFieldValue(int fieldID, Object value) {
4681
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
4682
    }
4683
 
4684
    public Object getFieldValue(_Fields field) {
4685
      switch (field) {
4686
      case VENDOR:
4687
        return getVendor();
4688
 
4689
      }
4690
      throw new IllegalStateException();
4691
    }
4692
 
4693
    public Object getFieldValue(int fieldId) {
4694
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
4695
    }
4696
 
4697
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
4698
    public boolean isSet(_Fields field) {
4699
      switch (field) {
4700
      case VENDOR:
4701
        return isSetVendor();
4702
      }
4703
      throw new IllegalStateException();
4704
    }
4705
 
4706
    public boolean isSet(int fieldID) {
4707
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
4708
    }
4709
 
4710
    @Override
4711
    public boolean equals(Object that) {
4712
      if (that == null)
4713
        return false;
4714
      if (that instanceof addVendor_args)
4715
        return this.equals((addVendor_args)that);
4716
      return false;
4717
    }
4718
 
4719
    public boolean equals(addVendor_args that) {
4720
      if (that == null)
4721
        return false;
4722
 
4723
      boolean this_present_vendor = true && this.isSetVendor();
4724
      boolean that_present_vendor = true && that.isSetVendor();
4725
      if (this_present_vendor || that_present_vendor) {
4726
        if (!(this_present_vendor && that_present_vendor))
4727
          return false;
4728
        if (!this.vendor.equals(that.vendor))
4729
          return false;
4730
      }
4731
 
4732
      return true;
4733
    }
4734
 
4735
    @Override
4736
    public int hashCode() {
4737
      return 0;
4738
    }
4739
 
4740
    public int compareTo(addVendor_args other) {
4741
      if (!getClass().equals(other.getClass())) {
4742
        return getClass().getName().compareTo(other.getClass().getName());
4743
      }
4744
 
4745
      int lastComparison = 0;
4746
      addVendor_args typedOther = (addVendor_args)other;
4747
 
4748
      lastComparison = Boolean.valueOf(isSetVendor()).compareTo(isSetVendor());
4749
      if (lastComparison != 0) {
4750
        return lastComparison;
4751
      }
4752
      lastComparison = TBaseHelper.compareTo(vendor, typedOther.vendor);
4753
      if (lastComparison != 0) {
4754
        return lastComparison;
4755
      }
4756
      return 0;
4757
    }
4758
 
4759
    public void read(TProtocol iprot) throws TException {
4760
      TField field;
4761
      iprot.readStructBegin();
4762
      while (true)
4763
      {
4764
        field = iprot.readFieldBegin();
4765
        if (field.type == TType.STOP) { 
4766
          break;
4767
        }
4768
        _Fields fieldId = _Fields.findByThriftId(field.id);
4769
        if (fieldId == null) {
4770
          TProtocolUtil.skip(iprot, field.type);
4771
        } else {
4772
          switch (fieldId) {
4773
            case VENDOR:
4774
              if (field.type == TType.STRUCT) {
4775
                this.vendor = new Vendor();
4776
                this.vendor.read(iprot);
100 ashish 4777
              } else { 
4778
                TProtocolUtil.skip(iprot, field.type);
4779
              }
4780
              break;
4781
          }
4782
          iprot.readFieldEnd();
4783
        }
4784
      }
4785
      iprot.readStructEnd();
4786
      validate();
4787
    }
4788
 
4789
    public void write(TProtocol oprot) throws TException {
4790
      validate();
4791
 
4792
      oprot.writeStructBegin(STRUCT_DESC);
103 ashish 4793
      if (this.vendor != null) {
4794
        oprot.writeFieldBegin(VENDOR_FIELD_DESC);
4795
        this.vendor.write(oprot);
100 ashish 4796
        oprot.writeFieldEnd();
4797
      }
4798
      oprot.writeFieldStop();
4799
      oprot.writeStructEnd();
4800
    }
4801
 
4802
    @Override
4803
    public String toString() {
103 ashish 4804
      StringBuilder sb = new StringBuilder("addVendor_args(");
100 ashish 4805
      boolean first = true;
4806
 
103 ashish 4807
      sb.append("vendor:");
4808
      if (this.vendor == null) {
100 ashish 4809
        sb.append("null");
4810
      } else {
103 ashish 4811
        sb.append(this.vendor);
100 ashish 4812
      }
4813
      first = false;
4814
      sb.append(")");
4815
      return sb.toString();
4816
    }
4817
 
4818
    public void validate() throws TException {
4819
      // check for required fields
4820
    }
4821
 
4822
  }
4823
 
103 ashish 4824
  public static class addVendor_result implements TBase<addVendor_result._Fields>, java.io.Serializable, Cloneable, Comparable<addVendor_result>   {
4825
    private static final TStruct STRUCT_DESC = new TStruct("addVendor_result");
100 ashish 4826
 
103 ashish 4827
    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.I64, (short)0);
100 ashish 4828
    private static final TField CEX_FIELD_DESC = new TField("cex", TType.STRUCT, (short)1);
4829
 
103 ashish 4830
    private long success;
100 ashish 4831
    private CatalogServiceException cex;
4832
 
4833
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
4834
    public enum _Fields implements TFieldIdEnum {
103 ashish 4835
      SUCCESS((short)0, "success"),
100 ashish 4836
      CEX((short)1, "cex");
4837
 
4838
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
4839
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
4840
 
4841
      static {
4842
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
4843
          byId.put((int)field._thriftId, field);
4844
          byName.put(field.getFieldName(), field);
4845
        }
4846
      }
4847
 
4848
      /**
4849
       * Find the _Fields constant that matches fieldId, or null if its not found.
4850
       */
4851
      public static _Fields findByThriftId(int fieldId) {
4852
        return byId.get(fieldId);
4853
      }
4854
 
4855
      /**
4856
       * Find the _Fields constant that matches fieldId, throwing an exception
4857
       * if it is not found.
4858
       */
4859
      public static _Fields findByThriftIdOrThrow(int fieldId) {
4860
        _Fields fields = findByThriftId(fieldId);
4861
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
4862
        return fields;
4863
      }
4864
 
4865
      /**
4866
       * Find the _Fields constant that matches name, or null if its not found.
4867
       */
4868
      public static _Fields findByName(String name) {
4869
        return byName.get(name);
4870
      }
4871
 
4872
      private final short _thriftId;
4873
      private final String _fieldName;
4874
 
4875
      _Fields(short thriftId, String fieldName) {
4876
        _thriftId = thriftId;
4877
        _fieldName = fieldName;
4878
      }
4879
 
4880
      public short getThriftFieldId() {
4881
        return _thriftId;
4882
      }
4883
 
4884
      public String getFieldName() {
4885
        return _fieldName;
4886
      }
4887
    }
4888
 
4889
    // isset id assignments
103 ashish 4890
    private static final int __SUCCESS_ISSET_ID = 0;
4891
    private BitSet __isset_bit_vector = new BitSet(1);
100 ashish 4892
 
4893
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
103 ashish 4894
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
4895
          new FieldValueMetaData(TType.I64)));
100 ashish 4896
      put(_Fields.CEX, new FieldMetaData("cex", TFieldRequirementType.DEFAULT, 
4897
          new FieldValueMetaData(TType.STRUCT)));
4898
    }});
4899
 
4900
    static {
103 ashish 4901
      FieldMetaData.addStructMetaDataMap(addVendor_result.class, metaDataMap);
100 ashish 4902
    }
4903
 
103 ashish 4904
    public addVendor_result() {
100 ashish 4905
    }
4906
 
103 ashish 4907
    public addVendor_result(
4908
      long success,
100 ashish 4909
      CatalogServiceException cex)
4910
    {
4911
      this();
103 ashish 4912
      this.success = success;
4913
      setSuccessIsSet(true);
100 ashish 4914
      this.cex = cex;
4915
    }
4916
 
4917
    /**
4918
     * Performs a deep copy on <i>other</i>.
4919
     */
103 ashish 4920
    public addVendor_result(addVendor_result other) {
4921
      __isset_bit_vector.clear();
4922
      __isset_bit_vector.or(other.__isset_bit_vector);
4923
      this.success = other.success;
100 ashish 4924
      if (other.isSetCex()) {
4925
        this.cex = new CatalogServiceException(other.cex);
4926
      }
4927
    }
4928
 
103 ashish 4929
    public addVendor_result deepCopy() {
4930
      return new addVendor_result(this);
100 ashish 4931
    }
4932
 
4933
    @Deprecated
103 ashish 4934
    public addVendor_result clone() {
4935
      return new addVendor_result(this);
100 ashish 4936
    }
4937
 
103 ashish 4938
    public long getSuccess() {
4939
      return this.success;
4940
    }
4941
 
4942
    public addVendor_result setSuccess(long success) {
4943
      this.success = success;
4944
      setSuccessIsSet(true);
4945
      return this;
4946
    }
4947
 
4948
    public void unsetSuccess() {
4949
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
4950
    }
4951
 
4952
    /** Returns true if field success is set (has been asigned a value) and false otherwise */
4953
    public boolean isSetSuccess() {
4954
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
4955
    }
4956
 
4957
    public void setSuccessIsSet(boolean value) {
4958
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
4959
    }
4960
 
100 ashish 4961
    public CatalogServiceException getCex() {
4962
      return this.cex;
4963
    }
4964
 
103 ashish 4965
    public addVendor_result setCex(CatalogServiceException cex) {
100 ashish 4966
      this.cex = cex;
4967
      return this;
4968
    }
4969
 
4970
    public void unsetCex() {
4971
      this.cex = null;
4972
    }
4973
 
4974
    /** Returns true if field cex is set (has been asigned a value) and false otherwise */
4975
    public boolean isSetCex() {
4976
      return this.cex != null;
4977
    }
4978
 
4979
    public void setCexIsSet(boolean value) {
4980
      if (!value) {
4981
        this.cex = null;
4982
      }
4983
    }
4984
 
4985
    public void setFieldValue(_Fields field, Object value) {
4986
      switch (field) {
103 ashish 4987
      case SUCCESS:
4988
        if (value == null) {
4989
          unsetSuccess();
4990
        } else {
4991
          setSuccess((Long)value);
4992
        }
4993
        break;
4994
 
100 ashish 4995
      case CEX:
4996
        if (value == null) {
4997
          unsetCex();
4998
        } else {
4999
          setCex((CatalogServiceException)value);
5000
        }
5001
        break;
5002
 
5003
      }
5004
    }
5005
 
5006
    public void setFieldValue(int fieldID, Object value) {
5007
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
5008
    }
5009
 
5010
    public Object getFieldValue(_Fields field) {
5011
      switch (field) {
103 ashish 5012
      case SUCCESS:
5013
        return new Long(getSuccess());
5014
 
100 ashish 5015
      case CEX:
5016
        return getCex();
5017
 
5018
      }
5019
      throw new IllegalStateException();
5020
    }
5021
 
5022
    public Object getFieldValue(int fieldId) {
5023
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
5024
    }
5025
 
5026
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
5027
    public boolean isSet(_Fields field) {
5028
      switch (field) {
103 ashish 5029
      case SUCCESS:
5030
        return isSetSuccess();
100 ashish 5031
      case CEX:
5032
        return isSetCex();
5033
      }
5034
      throw new IllegalStateException();
5035
    }
5036
 
5037
    public boolean isSet(int fieldID) {
5038
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
5039
    }
5040
 
5041
    @Override
5042
    public boolean equals(Object that) {
5043
      if (that == null)
5044
        return false;
103 ashish 5045
      if (that instanceof addVendor_result)
5046
        return this.equals((addVendor_result)that);
100 ashish 5047
      return false;
5048
    }
5049
 
103 ashish 5050
    public boolean equals(addVendor_result that) {
100 ashish 5051
      if (that == null)
5052
        return false;
5053
 
103 ashish 5054
      boolean this_present_success = true;
5055
      boolean that_present_success = true;
5056
      if (this_present_success || that_present_success) {
5057
        if (!(this_present_success && that_present_success))
5058
          return false;
5059
        if (this.success != that.success)
5060
          return false;
5061
      }
5062
 
100 ashish 5063
      boolean this_present_cex = true && this.isSetCex();
5064
      boolean that_present_cex = true && that.isSetCex();
5065
      if (this_present_cex || that_present_cex) {
5066
        if (!(this_present_cex && that_present_cex))
5067
          return false;
5068
        if (!this.cex.equals(that.cex))
5069
          return false;
5070
      }
5071
 
5072
      return true;
5073
    }
5074
 
5075
    @Override
5076
    public int hashCode() {
5077
      return 0;
5078
    }
5079
 
103 ashish 5080
    public int compareTo(addVendor_result other) {
100 ashish 5081
      if (!getClass().equals(other.getClass())) {
5082
        return getClass().getName().compareTo(other.getClass().getName());
5083
      }
5084
 
5085
      int lastComparison = 0;
103 ashish 5086
      addVendor_result typedOther = (addVendor_result)other;
100 ashish 5087
 
103 ashish 5088
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
5089
      if (lastComparison != 0) {
5090
        return lastComparison;
5091
      }
5092
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
5093
      if (lastComparison != 0) {
5094
        return lastComparison;
5095
      }
100 ashish 5096
      lastComparison = Boolean.valueOf(isSetCex()).compareTo(isSetCex());
5097
      if (lastComparison != 0) {
5098
        return lastComparison;
5099
      }
5100
      lastComparison = TBaseHelper.compareTo(cex, typedOther.cex);
5101
      if (lastComparison != 0) {
5102
        return lastComparison;
5103
      }
5104
      return 0;
5105
    }
5106
 
5107
    public void read(TProtocol iprot) throws TException {
5108
      TField field;
5109
      iprot.readStructBegin();
5110
      while (true)
5111
      {
5112
        field = iprot.readFieldBegin();
5113
        if (field.type == TType.STOP) { 
5114
          break;
5115
        }
5116
        _Fields fieldId = _Fields.findByThriftId(field.id);
5117
        if (fieldId == null) {
5118
          TProtocolUtil.skip(iprot, field.type);
5119
        } else {
5120
          switch (fieldId) {
103 ashish 5121
            case SUCCESS:
5122
              if (field.type == TType.I64) {
5123
                this.success = iprot.readI64();
5124
                setSuccessIsSet(true);
5125
              } else { 
5126
                TProtocolUtil.skip(iprot, field.type);
5127
              }
5128
              break;
100 ashish 5129
            case CEX:
5130
              if (field.type == TType.STRUCT) {
5131
                this.cex = new CatalogServiceException();
5132
                this.cex.read(iprot);
5133
              } else { 
5134
                TProtocolUtil.skip(iprot, field.type);
5135
              }
5136
              break;
5137
          }
5138
          iprot.readFieldEnd();
5139
        }
5140
      }
5141
      iprot.readStructEnd();
5142
      validate();
5143
    }
5144
 
5145
    public void write(TProtocol oprot) throws TException {
5146
      oprot.writeStructBegin(STRUCT_DESC);
5147
 
103 ashish 5148
      if (this.isSetSuccess()) {
5149
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
5150
        oprot.writeI64(this.success);
5151
        oprot.writeFieldEnd();
5152
      } else if (this.isSetCex()) {
100 ashish 5153
        oprot.writeFieldBegin(CEX_FIELD_DESC);
5154
        this.cex.write(oprot);
5155
        oprot.writeFieldEnd();
5156
      }
5157
      oprot.writeFieldStop();
5158
      oprot.writeStructEnd();
5159
    }
5160
 
5161
    @Override
5162
    public String toString() {
103 ashish 5163
      StringBuilder sb = new StringBuilder("addVendor_result(");
100 ashish 5164
      boolean first = true;
5165
 
103 ashish 5166
      sb.append("success:");
5167
      sb.append(this.success);
5168
      first = false;
5169
      if (!first) sb.append(", ");
100 ashish 5170
      sb.append("cex:");
5171
      if (this.cex == null) {
5172
        sb.append("null");
5173
      } else {
5174
        sb.append(this.cex);
5175
      }
5176
      first = false;
5177
      sb.append(")");
5178
      return sb.toString();
5179
    }
5180
 
5181
    public void validate() throws TException {
5182
      // check for required fields
5183
    }
5184
 
5185
  }
5186
 
103 ashish 5187
  public static class updateInventory_args implements TBase<updateInventory_args._Fields>, java.io.Serializable, Cloneable, Comparable<updateInventory_args>   {
5188
    private static final TStruct STRUCT_DESC = new TStruct("updateInventory_args");
100 ashish 5189
 
103 ashish 5190
    private static final TField ITEM_ID_FIELD_DESC = new TField("item_id", TType.I64, (short)1);
5191
    private static final TField WAREHOUSE_ID_FIELD_DESC = new TField("warehouse_id", TType.I64, (short)2);
5192
    private static final TField QUANTITY_FIELD_DESC = new TField("quantity", TType.I64, (short)3);
5193
    private static final TField TIMESTAMP_FIELD_DESC = new TField("timestamp", TType.I64, (short)4);
100 ashish 5194
 
5195
    private long item_id;
103 ashish 5196
    private long warehouse_id;
5197
    private long quantity;
5198
    private long timestamp;
100 ashish 5199
 
5200
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
5201
    public enum _Fields implements TFieldIdEnum {
103 ashish 5202
      ITEM_ID((short)1, "item_id"),
5203
      WAREHOUSE_ID((short)2, "warehouse_id"),
5204
      QUANTITY((short)3, "quantity"),
5205
      TIMESTAMP((short)4, "timestamp");
100 ashish 5206
 
5207
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
5208
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
5209
 
5210
      static {
5211
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
5212
          byId.put((int)field._thriftId, field);
5213
          byName.put(field.getFieldName(), field);
5214
        }
5215
      }
5216
 
5217
      /**
5218
       * Find the _Fields constant that matches fieldId, or null if its not found.
5219
       */
5220
      public static _Fields findByThriftId(int fieldId) {
5221
        return byId.get(fieldId);
5222
      }
5223
 
5224
      /**
5225
       * Find the _Fields constant that matches fieldId, throwing an exception
5226
       * if it is not found.
5227
       */
5228
      public static _Fields findByThriftIdOrThrow(int fieldId) {
5229
        _Fields fields = findByThriftId(fieldId);
5230
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
5231
        return fields;
5232
      }
5233
 
5234
      /**
5235
       * Find the _Fields constant that matches name, or null if its not found.
5236
       */
5237
      public static _Fields findByName(String name) {
5238
        return byName.get(name);
5239
      }
5240
 
5241
      private final short _thriftId;
5242
      private final String _fieldName;
5243
 
5244
      _Fields(short thriftId, String fieldName) {
5245
        _thriftId = thriftId;
5246
        _fieldName = fieldName;
5247
      }
5248
 
5249
      public short getThriftFieldId() {
5250
        return _thriftId;
5251
      }
5252
 
5253
      public String getFieldName() {
5254
        return _fieldName;
5255
      }
5256
    }
5257
 
5258
    // isset id assignments
5259
    private static final int __ITEM_ID_ISSET_ID = 0;
103 ashish 5260
    private static final int __WAREHOUSE_ID_ISSET_ID = 1;
5261
    private static final int __QUANTITY_ISSET_ID = 2;
5262
    private static final int __TIMESTAMP_ISSET_ID = 3;
5263
    private BitSet __isset_bit_vector = new BitSet(4);
100 ashish 5264
 
5265
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
5266
      put(_Fields.ITEM_ID, new FieldMetaData("item_id", TFieldRequirementType.DEFAULT, 
5267
          new FieldValueMetaData(TType.I64)));
103 ashish 5268
      put(_Fields.WAREHOUSE_ID, new FieldMetaData("warehouse_id", TFieldRequirementType.DEFAULT, 
5269
          new FieldValueMetaData(TType.I64)));
5270
      put(_Fields.QUANTITY, new FieldMetaData("quantity", TFieldRequirementType.DEFAULT, 
5271
          new FieldValueMetaData(TType.I64)));
5272
      put(_Fields.TIMESTAMP, new FieldMetaData("timestamp", TFieldRequirementType.DEFAULT, 
5273
          new FieldValueMetaData(TType.I64)));
100 ashish 5274
    }});
5275
 
5276
    static {
103 ashish 5277
      FieldMetaData.addStructMetaDataMap(updateInventory_args.class, metaDataMap);
100 ashish 5278
    }
5279
 
103 ashish 5280
    public updateInventory_args() {
100 ashish 5281
    }
5282
 
103 ashish 5283
    public updateInventory_args(
5284
      long item_id,
5285
      long warehouse_id,
5286
      long quantity,
5287
      long timestamp)
100 ashish 5288
    {
5289
      this();
5290
      this.item_id = item_id;
5291
      setItem_idIsSet(true);
103 ashish 5292
      this.warehouse_id = warehouse_id;
5293
      setWarehouse_idIsSet(true);
5294
      this.quantity = quantity;
5295
      setQuantityIsSet(true);
5296
      this.timestamp = timestamp;
5297
      setTimestampIsSet(true);
100 ashish 5298
    }
5299
 
5300
    /**
5301
     * Performs a deep copy on <i>other</i>.
5302
     */
103 ashish 5303
    public updateInventory_args(updateInventory_args other) {
100 ashish 5304
      __isset_bit_vector.clear();
5305
      __isset_bit_vector.or(other.__isset_bit_vector);
5306
      this.item_id = other.item_id;
103 ashish 5307
      this.warehouse_id = other.warehouse_id;
5308
      this.quantity = other.quantity;
5309
      this.timestamp = other.timestamp;
100 ashish 5310
    }
5311
 
103 ashish 5312
    public updateInventory_args deepCopy() {
5313
      return new updateInventory_args(this);
100 ashish 5314
    }
5315
 
5316
    @Deprecated
103 ashish 5317
    public updateInventory_args clone() {
5318
      return new updateInventory_args(this);
100 ashish 5319
    }
5320
 
5321
    public long getItem_id() {
5322
      return this.item_id;
5323
    }
5324
 
103 ashish 5325
    public updateInventory_args setItem_id(long item_id) {
100 ashish 5326
      this.item_id = item_id;
5327
      setItem_idIsSet(true);
5328
      return this;
5329
    }
5330
 
5331
    public void unsetItem_id() {
5332
      __isset_bit_vector.clear(__ITEM_ID_ISSET_ID);
5333
    }
5334
 
5335
    /** Returns true if field item_id is set (has been asigned a value) and false otherwise */
5336
    public boolean isSetItem_id() {
5337
      return __isset_bit_vector.get(__ITEM_ID_ISSET_ID);
5338
    }
5339
 
5340
    public void setItem_idIsSet(boolean value) {
5341
      __isset_bit_vector.set(__ITEM_ID_ISSET_ID, value);
5342
    }
5343
 
103 ashish 5344
    public long getWarehouse_id() {
5345
      return this.warehouse_id;
5346
    }
5347
 
5348
    public updateInventory_args setWarehouse_id(long warehouse_id) {
5349
      this.warehouse_id = warehouse_id;
5350
      setWarehouse_idIsSet(true);
5351
      return this;
5352
    }
5353
 
5354
    public void unsetWarehouse_id() {
5355
      __isset_bit_vector.clear(__WAREHOUSE_ID_ISSET_ID);
5356
    }
5357
 
5358
    /** Returns true if field warehouse_id is set (has been asigned a value) and false otherwise */
5359
    public boolean isSetWarehouse_id() {
5360
      return __isset_bit_vector.get(__WAREHOUSE_ID_ISSET_ID);
5361
    }
5362
 
5363
    public void setWarehouse_idIsSet(boolean value) {
5364
      __isset_bit_vector.set(__WAREHOUSE_ID_ISSET_ID, value);
5365
    }
5366
 
5367
    public long getQuantity() {
5368
      return this.quantity;
5369
    }
5370
 
5371
    public updateInventory_args setQuantity(long quantity) {
5372
      this.quantity = quantity;
5373
      setQuantityIsSet(true);
5374
      return this;
5375
    }
5376
 
5377
    public void unsetQuantity() {
5378
      __isset_bit_vector.clear(__QUANTITY_ISSET_ID);
5379
    }
5380
 
5381
    /** Returns true if field quantity is set (has been asigned a value) and false otherwise */
5382
    public boolean isSetQuantity() {
5383
      return __isset_bit_vector.get(__QUANTITY_ISSET_ID);
5384
    }
5385
 
5386
    public void setQuantityIsSet(boolean value) {
5387
      __isset_bit_vector.set(__QUANTITY_ISSET_ID, value);
5388
    }
5389
 
5390
    public long getTimestamp() {
5391
      return this.timestamp;
5392
    }
5393
 
5394
    public updateInventory_args setTimestamp(long timestamp) {
5395
      this.timestamp = timestamp;
5396
      setTimestampIsSet(true);
5397
      return this;
5398
    }
5399
 
5400
    public void unsetTimestamp() {
5401
      __isset_bit_vector.clear(__TIMESTAMP_ISSET_ID);
5402
    }
5403
 
5404
    /** Returns true if field timestamp is set (has been asigned a value) and false otherwise */
5405
    public boolean isSetTimestamp() {
5406
      return __isset_bit_vector.get(__TIMESTAMP_ISSET_ID);
5407
    }
5408
 
5409
    public void setTimestampIsSet(boolean value) {
5410
      __isset_bit_vector.set(__TIMESTAMP_ISSET_ID, value);
5411
    }
5412
 
100 ashish 5413
    public void setFieldValue(_Fields field, Object value) {
5414
      switch (field) {
103 ashish 5415
      case ITEM_ID:
100 ashish 5416
        if (value == null) {
103 ashish 5417
          unsetItem_id();
100 ashish 5418
        } else {
103 ashish 5419
          setItem_id((Long)value);
100 ashish 5420
        }
5421
        break;
5422
 
103 ashish 5423
      case WAREHOUSE_ID:
100 ashish 5424
        if (value == null) {
103 ashish 5425
          unsetWarehouse_id();
100 ashish 5426
        } else {
103 ashish 5427
          setWarehouse_id((Long)value);
100 ashish 5428
        }
5429
        break;
5430
 
103 ashish 5431
      case QUANTITY:
5432
        if (value == null) {
5433
          unsetQuantity();
5434
        } else {
5435
          setQuantity((Long)value);
5436
        }
5437
        break;
5438
 
5439
      case TIMESTAMP:
5440
        if (value == null) {
5441
          unsetTimestamp();
5442
        } else {
5443
          setTimestamp((Long)value);
5444
        }
5445
        break;
5446
 
100 ashish 5447
      }
5448
    }
5449
 
5450
    public void setFieldValue(int fieldID, Object value) {
5451
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
5452
    }
5453
 
5454
    public Object getFieldValue(_Fields field) {
5455
      switch (field) {
5456
      case ITEM_ID:
5457
        return new Long(getItem_id());
5458
 
103 ashish 5459
      case WAREHOUSE_ID:
5460
        return new Long(getWarehouse_id());
5461
 
5462
      case QUANTITY:
5463
        return new Long(getQuantity());
5464
 
5465
      case TIMESTAMP:
5466
        return new Long(getTimestamp());
5467
 
100 ashish 5468
      }
5469
      throw new IllegalStateException();
5470
    }
5471
 
5472
    public Object getFieldValue(int fieldId) {
5473
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
5474
    }
5475
 
5476
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
5477
    public boolean isSet(_Fields field) {
5478
      switch (field) {
5479
      case ITEM_ID:
5480
        return isSetItem_id();
103 ashish 5481
      case WAREHOUSE_ID:
5482
        return isSetWarehouse_id();
5483
      case QUANTITY:
5484
        return isSetQuantity();
5485
      case TIMESTAMP:
5486
        return isSetTimestamp();
100 ashish 5487
      }
5488
      throw new IllegalStateException();
5489
    }
5490
 
5491
    public boolean isSet(int fieldID) {
5492
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
5493
    }
5494
 
5495
    @Override
5496
    public boolean equals(Object that) {
5497
      if (that == null)
5498
        return false;
103 ashish 5499
      if (that instanceof updateInventory_args)
5500
        return this.equals((updateInventory_args)that);
100 ashish 5501
      return false;
5502
    }
5503
 
103 ashish 5504
    public boolean equals(updateInventory_args that) {
100 ashish 5505
      if (that == null)
5506
        return false;
5507
 
5508
      boolean this_present_item_id = true;
5509
      boolean that_present_item_id = true;
5510
      if (this_present_item_id || that_present_item_id) {
5511
        if (!(this_present_item_id && that_present_item_id))
5512
          return false;
5513
        if (this.item_id != that.item_id)
5514
          return false;
5515
      }
5516
 
103 ashish 5517
      boolean this_present_warehouse_id = true;
5518
      boolean that_present_warehouse_id = true;
5519
      if (this_present_warehouse_id || that_present_warehouse_id) {
5520
        if (!(this_present_warehouse_id && that_present_warehouse_id))
5521
          return false;
5522
        if (this.warehouse_id != that.warehouse_id)
5523
          return false;
5524
      }
5525
 
5526
      boolean this_present_quantity = true;
5527
      boolean that_present_quantity = true;
5528
      if (this_present_quantity || that_present_quantity) {
5529
        if (!(this_present_quantity && that_present_quantity))
5530
          return false;
5531
        if (this.quantity != that.quantity)
5532
          return false;
5533
      }
5534
 
5535
      boolean this_present_timestamp = true;
5536
      boolean that_present_timestamp = true;
5537
      if (this_present_timestamp || that_present_timestamp) {
5538
        if (!(this_present_timestamp && that_present_timestamp))
5539
          return false;
5540
        if (this.timestamp != that.timestamp)
5541
          return false;
5542
      }
5543
 
100 ashish 5544
      return true;
5545
    }
5546
 
5547
    @Override
5548
    public int hashCode() {
5549
      return 0;
5550
    }
5551
 
103 ashish 5552
    public int compareTo(updateInventory_args other) {
5553
      if (!getClass().equals(other.getClass())) {
5554
        return getClass().getName().compareTo(other.getClass().getName());
5555
      }
5556
 
5557
      int lastComparison = 0;
5558
      updateInventory_args typedOther = (updateInventory_args)other;
5559
 
5560
      lastComparison = Boolean.valueOf(isSetItem_id()).compareTo(isSetItem_id());
5561
      if (lastComparison != 0) {
5562
        return lastComparison;
5563
      }
5564
      lastComparison = TBaseHelper.compareTo(item_id, typedOther.item_id);
5565
      if (lastComparison != 0) {
5566
        return lastComparison;
5567
      }
5568
      lastComparison = Boolean.valueOf(isSetWarehouse_id()).compareTo(isSetWarehouse_id());
5569
      if (lastComparison != 0) {
5570
        return lastComparison;
5571
      }
5572
      lastComparison = TBaseHelper.compareTo(warehouse_id, typedOther.warehouse_id);
5573
      if (lastComparison != 0) {
5574
        return lastComparison;
5575
      }
5576
      lastComparison = Boolean.valueOf(isSetQuantity()).compareTo(isSetQuantity());
5577
      if (lastComparison != 0) {
5578
        return lastComparison;
5579
      }
5580
      lastComparison = TBaseHelper.compareTo(quantity, typedOther.quantity);
5581
      if (lastComparison != 0) {
5582
        return lastComparison;
5583
      }
5584
      lastComparison = Boolean.valueOf(isSetTimestamp()).compareTo(isSetTimestamp());
5585
      if (lastComparison != 0) {
5586
        return lastComparison;
5587
      }
5588
      lastComparison = TBaseHelper.compareTo(timestamp, typedOther.timestamp);
5589
      if (lastComparison != 0) {
5590
        return lastComparison;
5591
      }
5592
      return 0;
5593
    }
5594
 
100 ashish 5595
    public void read(TProtocol iprot) throws TException {
5596
      TField field;
5597
      iprot.readStructBegin();
5598
      while (true)
5599
      {
5600
        field = iprot.readFieldBegin();
5601
        if (field.type == TType.STOP) { 
5602
          break;
5603
        }
5604
        _Fields fieldId = _Fields.findByThriftId(field.id);
5605
        if (fieldId == null) {
5606
          TProtocolUtil.skip(iprot, field.type);
5607
        } else {
5608
          switch (fieldId) {
103 ashish 5609
            case ITEM_ID:
5610
              if (field.type == TType.I64) {
5611
                this.item_id = iprot.readI64();
5612
                setItem_idIsSet(true);
100 ashish 5613
              } else { 
5614
                TProtocolUtil.skip(iprot, field.type);
5615
              }
5616
              break;
103 ashish 5617
            case WAREHOUSE_ID:
100 ashish 5618
              if (field.type == TType.I64) {
103 ashish 5619
                this.warehouse_id = iprot.readI64();
5620
                setWarehouse_idIsSet(true);
100 ashish 5621
              } else { 
5622
                TProtocolUtil.skip(iprot, field.type);
5623
              }
5624
              break;
103 ashish 5625
            case QUANTITY:
5626
              if (field.type == TType.I64) {
5627
                this.quantity = iprot.readI64();
5628
                setQuantityIsSet(true);
5629
              } else { 
5630
                TProtocolUtil.skip(iprot, field.type);
5631
              }
5632
              break;
5633
            case TIMESTAMP:
5634
              if (field.type == TType.I64) {
5635
                this.timestamp = iprot.readI64();
5636
                setTimestampIsSet(true);
5637
              } else { 
5638
                TProtocolUtil.skip(iprot, field.type);
5639
              }
5640
              break;
100 ashish 5641
          }
5642
          iprot.readFieldEnd();
5643
        }
5644
      }
5645
      iprot.readStructEnd();
5646
      validate();
5647
    }
5648
 
5649
    public void write(TProtocol oprot) throws TException {
5650
      validate();
5651
 
5652
      oprot.writeStructBegin(STRUCT_DESC);
5653
      oprot.writeFieldBegin(ITEM_ID_FIELD_DESC);
5654
      oprot.writeI64(this.item_id);
5655
      oprot.writeFieldEnd();
103 ashish 5656
      oprot.writeFieldBegin(WAREHOUSE_ID_FIELD_DESC);
5657
      oprot.writeI64(this.warehouse_id);
5658
      oprot.writeFieldEnd();
5659
      oprot.writeFieldBegin(QUANTITY_FIELD_DESC);
5660
      oprot.writeI64(this.quantity);
5661
      oprot.writeFieldEnd();
5662
      oprot.writeFieldBegin(TIMESTAMP_FIELD_DESC);
5663
      oprot.writeI64(this.timestamp);
5664
      oprot.writeFieldEnd();
100 ashish 5665
      oprot.writeFieldStop();
5666
      oprot.writeStructEnd();
5667
    }
5668
 
5669
    @Override
5670
    public String toString() {
103 ashish 5671
      StringBuilder sb = new StringBuilder("updateInventory_args(");
100 ashish 5672
      boolean first = true;
5673
 
5674
      sb.append("item_id:");
5675
      sb.append(this.item_id);
5676
      first = false;
103 ashish 5677
      if (!first) sb.append(", ");
5678
      sb.append("warehouse_id:");
5679
      sb.append(this.warehouse_id);
5680
      first = false;
5681
      if (!first) sb.append(", ");
5682
      sb.append("quantity:");
5683
      sb.append(this.quantity);
5684
      first = false;
5685
      if (!first) sb.append(", ");
5686
      sb.append("timestamp:");
5687
      sb.append(this.timestamp);
5688
      first = false;
100 ashish 5689
      sb.append(")");
5690
      return sb.toString();
5691
    }
5692
 
5693
    public void validate() throws TException {
5694
      // check for required fields
5695
    }
5696
 
5697
  }
5698
 
103 ashish 5699
  public static class updateInventory_result implements TBase<updateInventory_result._Fields>, java.io.Serializable, Cloneable, Comparable<updateInventory_result>   {
5700
    private static final TStruct STRUCT_DESC = new TStruct("updateInventory_result");
100 ashish 5701
 
5702
    private static final TField CEX_FIELD_DESC = new TField("cex", TType.STRUCT, (short)1);
5703
 
5704
    private CatalogServiceException cex;
5705
 
5706
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
5707
    public enum _Fields implements TFieldIdEnum {
5708
      CEX((short)1, "cex");
5709
 
5710
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
5711
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
5712
 
5713
      static {
5714
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
5715
          byId.put((int)field._thriftId, field);
5716
          byName.put(field.getFieldName(), field);
5717
        }
5718
      }
5719
 
5720
      /**
5721
       * Find the _Fields constant that matches fieldId, or null if its not found.
5722
       */
5723
      public static _Fields findByThriftId(int fieldId) {
5724
        return byId.get(fieldId);
5725
      }
5726
 
5727
      /**
5728
       * Find the _Fields constant that matches fieldId, throwing an exception
5729
       * if it is not found.
5730
       */
5731
      public static _Fields findByThriftIdOrThrow(int fieldId) {
5732
        _Fields fields = findByThriftId(fieldId);
5733
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
5734
        return fields;
5735
      }
5736
 
5737
      /**
5738
       * Find the _Fields constant that matches name, or null if its not found.
5739
       */
5740
      public static _Fields findByName(String name) {
5741
        return byName.get(name);
5742
      }
5743
 
5744
      private final short _thriftId;
5745
      private final String _fieldName;
5746
 
5747
      _Fields(short thriftId, String fieldName) {
5748
        _thriftId = thriftId;
5749
        _fieldName = fieldName;
5750
      }
5751
 
5752
      public short getThriftFieldId() {
5753
        return _thriftId;
5754
      }
5755
 
5756
      public String getFieldName() {
5757
        return _fieldName;
5758
      }
5759
    }
5760
 
5761
    // isset id assignments
5762
 
5763
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
5764
      put(_Fields.CEX, new FieldMetaData("cex", TFieldRequirementType.DEFAULT, 
5765
          new FieldValueMetaData(TType.STRUCT)));
5766
    }});
5767
 
5768
    static {
103 ashish 5769
      FieldMetaData.addStructMetaDataMap(updateInventory_result.class, metaDataMap);
100 ashish 5770
    }
5771
 
103 ashish 5772
    public updateInventory_result() {
100 ashish 5773
    }
5774
 
103 ashish 5775
    public updateInventory_result(
100 ashish 5776
      CatalogServiceException cex)
5777
    {
5778
      this();
5779
      this.cex = cex;
5780
    }
5781
 
5782
    /**
5783
     * Performs a deep copy on <i>other</i>.
5784
     */
103 ashish 5785
    public updateInventory_result(updateInventory_result other) {
100 ashish 5786
      if (other.isSetCex()) {
5787
        this.cex = new CatalogServiceException(other.cex);
5788
      }
5789
    }
5790
 
103 ashish 5791
    public updateInventory_result deepCopy() {
5792
      return new updateInventory_result(this);
100 ashish 5793
    }
5794
 
5795
    @Deprecated
103 ashish 5796
    public updateInventory_result clone() {
5797
      return new updateInventory_result(this);
100 ashish 5798
    }
5799
 
5800
    public CatalogServiceException getCex() {
5801
      return this.cex;
5802
    }
5803
 
103 ashish 5804
    public updateInventory_result setCex(CatalogServiceException cex) {
100 ashish 5805
      this.cex = cex;
5806
      return this;
5807
    }
5808
 
5809
    public void unsetCex() {
5810
      this.cex = null;
5811
    }
5812
 
5813
    /** Returns true if field cex is set (has been asigned a value) and false otherwise */
5814
    public boolean isSetCex() {
5815
      return this.cex != null;
5816
    }
5817
 
5818
    public void setCexIsSet(boolean value) {
5819
      if (!value) {
5820
        this.cex = null;
5821
      }
5822
    }
5823
 
5824
    public void setFieldValue(_Fields field, Object value) {
5825
      switch (field) {
5826
      case CEX:
5827
        if (value == null) {
5828
          unsetCex();
5829
        } else {
5830
          setCex((CatalogServiceException)value);
5831
        }
5832
        break;
5833
 
5834
      }
5835
    }
5836
 
5837
    public void setFieldValue(int fieldID, Object value) {
5838
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
5839
    }
5840
 
5841
    public Object getFieldValue(_Fields field) {
5842
      switch (field) {
5843
      case CEX:
5844
        return getCex();
5845
 
5846
      }
5847
      throw new IllegalStateException();
5848
    }
5849
 
5850
    public Object getFieldValue(int fieldId) {
5851
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
5852
    }
5853
 
5854
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
5855
    public boolean isSet(_Fields field) {
5856
      switch (field) {
5857
      case CEX:
5858
        return isSetCex();
5859
      }
5860
      throw new IllegalStateException();
5861
    }
5862
 
5863
    public boolean isSet(int fieldID) {
5864
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
5865
    }
5866
 
5867
    @Override
5868
    public boolean equals(Object that) {
5869
      if (that == null)
5870
        return false;
103 ashish 5871
      if (that instanceof updateInventory_result)
5872
        return this.equals((updateInventory_result)that);
100 ashish 5873
      return false;
5874
    }
5875
 
103 ashish 5876
    public boolean equals(updateInventory_result that) {
100 ashish 5877
      if (that == null)
5878
        return false;
5879
 
5880
      boolean this_present_cex = true && this.isSetCex();
5881
      boolean that_present_cex = true && that.isSetCex();
5882
      if (this_present_cex || that_present_cex) {
5883
        if (!(this_present_cex && that_present_cex))
5884
          return false;
5885
        if (!this.cex.equals(that.cex))
5886
          return false;
5887
      }
5888
 
5889
      return true;
5890
    }
5891
 
5892
    @Override
5893
    public int hashCode() {
5894
      return 0;
5895
    }
5896
 
103 ashish 5897
    public int compareTo(updateInventory_result other) {
100 ashish 5898
      if (!getClass().equals(other.getClass())) {
5899
        return getClass().getName().compareTo(other.getClass().getName());
5900
      }
5901
 
5902
      int lastComparison = 0;
103 ashish 5903
      updateInventory_result typedOther = (updateInventory_result)other;
100 ashish 5904
 
5905
      lastComparison = Boolean.valueOf(isSetCex()).compareTo(isSetCex());
5906
      if (lastComparison != 0) {
5907
        return lastComparison;
5908
      }
5909
      lastComparison = TBaseHelper.compareTo(cex, typedOther.cex);
5910
      if (lastComparison != 0) {
5911
        return lastComparison;
5912
      }
5913
      return 0;
5914
    }
5915
 
5916
    public void read(TProtocol iprot) throws TException {
5917
      TField field;
5918
      iprot.readStructBegin();
5919
      while (true)
5920
      {
5921
        field = iprot.readFieldBegin();
5922
        if (field.type == TType.STOP) { 
5923
          break;
5924
        }
5925
        _Fields fieldId = _Fields.findByThriftId(field.id);
5926
        if (fieldId == null) {
5927
          TProtocolUtil.skip(iprot, field.type);
5928
        } else {
5929
          switch (fieldId) {
5930
            case CEX:
5931
              if (field.type == TType.STRUCT) {
5932
                this.cex = new CatalogServiceException();
5933
                this.cex.read(iprot);
5934
              } else { 
5935
                TProtocolUtil.skip(iprot, field.type);
5936
              }
5937
              break;
5938
          }
5939
          iprot.readFieldEnd();
5940
        }
5941
      }
5942
      iprot.readStructEnd();
5943
      validate();
5944
    }
5945
 
5946
    public void write(TProtocol oprot) throws TException {
5947
      oprot.writeStructBegin(STRUCT_DESC);
5948
 
5949
      if (this.isSetCex()) {
5950
        oprot.writeFieldBegin(CEX_FIELD_DESC);
5951
        this.cex.write(oprot);
5952
        oprot.writeFieldEnd();
5953
      }
5954
      oprot.writeFieldStop();
5955
      oprot.writeStructEnd();
5956
    }
5957
 
5958
    @Override
5959
    public String toString() {
103 ashish 5960
      StringBuilder sb = new StringBuilder("updateInventory_result(");
100 ashish 5961
      boolean first = true;
5962
 
5963
      sb.append("cex:");
5964
      if (this.cex == null) {
5965
        sb.append("null");
5966
      } else {
5967
        sb.append(this.cex);
5968
      }
5969
      first = false;
5970
      sb.append(")");
5971
      return sb.toString();
5972
    }
5973
 
5974
    public void validate() throws TException {
5975
      // check for required fields
5976
    }
5977
 
5978
  }
5979
 
103 ashish 5980
  public static class retireCategory_args implements TBase<retireCategory_args._Fields>, java.io.Serializable, Cloneable, Comparable<retireCategory_args>   {
5981
    private static final TStruct STRUCT_DESC = new TStruct("retireCategory_args");
100 ashish 5982
 
103 ashish 5983
    private static final TField CATEGORY_ID_FIELD_DESC = new TField("category_id", TType.I64, (short)1);
100 ashish 5984
 
103 ashish 5985
    private long category_id;
100 ashish 5986
 
5987
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
5988
    public enum _Fields implements TFieldIdEnum {
103 ashish 5989
      CATEGORY_ID((short)1, "category_id");
100 ashish 5990
 
5991
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
5992
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
5993
 
5994
      static {
5995
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
5996
          byId.put((int)field._thriftId, field);
5997
          byName.put(field.getFieldName(), field);
5998
        }
5999
      }
6000
 
6001
      /**
6002
       * Find the _Fields constant that matches fieldId, or null if its not found.
6003
       */
6004
      public static _Fields findByThriftId(int fieldId) {
6005
        return byId.get(fieldId);
6006
      }
6007
 
6008
      /**
6009
       * Find the _Fields constant that matches fieldId, throwing an exception
6010
       * if it is not found.
6011
       */
6012
      public static _Fields findByThriftIdOrThrow(int fieldId) {
6013
        _Fields fields = findByThriftId(fieldId);
6014
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
6015
        return fields;
6016
      }
6017
 
6018
      /**
6019
       * Find the _Fields constant that matches name, or null if its not found.
6020
       */
6021
      public static _Fields findByName(String name) {
6022
        return byName.get(name);
6023
      }
6024
 
6025
      private final short _thriftId;
6026
      private final String _fieldName;
6027
 
6028
      _Fields(short thriftId, String fieldName) {
6029
        _thriftId = thriftId;
6030
        _fieldName = fieldName;
6031
      }
6032
 
6033
      public short getThriftFieldId() {
6034
        return _thriftId;
6035
      }
6036
 
6037
      public String getFieldName() {
6038
        return _fieldName;
6039
      }
6040
    }
6041
 
6042
    // isset id assignments
103 ashish 6043
    private static final int __CATEGORY_ID_ISSET_ID = 0;
6044
    private BitSet __isset_bit_vector = new BitSet(1);
100 ashish 6045
 
6046
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
103 ashish 6047
      put(_Fields.CATEGORY_ID, new FieldMetaData("category_id", TFieldRequirementType.DEFAULT, 
6048
          new FieldValueMetaData(TType.I64)));
100 ashish 6049
    }});
6050
 
6051
    static {
103 ashish 6052
      FieldMetaData.addStructMetaDataMap(retireCategory_args.class, metaDataMap);
100 ashish 6053
    }
6054
 
103 ashish 6055
    public retireCategory_args() {
100 ashish 6056
    }
6057
 
103 ashish 6058
    public retireCategory_args(
6059
      long category_id)
100 ashish 6060
    {
6061
      this();
103 ashish 6062
      this.category_id = category_id;
6063
      setCategory_idIsSet(true);
100 ashish 6064
    }
6065
 
6066
    /**
6067
     * Performs a deep copy on <i>other</i>.
6068
     */
103 ashish 6069
    public retireCategory_args(retireCategory_args other) {
6070
      __isset_bit_vector.clear();
6071
      __isset_bit_vector.or(other.__isset_bit_vector);
6072
      this.category_id = other.category_id;
100 ashish 6073
    }
6074
 
103 ashish 6075
    public retireCategory_args deepCopy() {
6076
      return new retireCategory_args(this);
100 ashish 6077
    }
6078
 
6079
    @Deprecated
103 ashish 6080
    public retireCategory_args clone() {
6081
      return new retireCategory_args(this);
100 ashish 6082
    }
6083
 
103 ashish 6084
    public long getCategory_id() {
6085
      return this.category_id;
100 ashish 6086
    }
6087
 
103 ashish 6088
    public retireCategory_args setCategory_id(long category_id) {
6089
      this.category_id = category_id;
6090
      setCategory_idIsSet(true);
100 ashish 6091
      return this;
6092
    }
6093
 
103 ashish 6094
    public void unsetCategory_id() {
6095
      __isset_bit_vector.clear(__CATEGORY_ID_ISSET_ID);
100 ashish 6096
    }
6097
 
103 ashish 6098
    /** Returns true if field category_id is set (has been asigned a value) and false otherwise */
6099
    public boolean isSetCategory_id() {
6100
      return __isset_bit_vector.get(__CATEGORY_ID_ISSET_ID);
100 ashish 6101
    }
6102
 
103 ashish 6103
    public void setCategory_idIsSet(boolean value) {
6104
      __isset_bit_vector.set(__CATEGORY_ID_ISSET_ID, value);
100 ashish 6105
    }
6106
 
6107
    public void setFieldValue(_Fields field, Object value) {
6108
      switch (field) {
103 ashish 6109
      case CATEGORY_ID:
100 ashish 6110
        if (value == null) {
103 ashish 6111
          unsetCategory_id();
100 ashish 6112
        } else {
103 ashish 6113
          setCategory_id((Long)value);
100 ashish 6114
        }
6115
        break;
6116
 
6117
      }
6118
    }
6119
 
6120
    public void setFieldValue(int fieldID, Object value) {
6121
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
6122
    }
6123
 
6124
    public Object getFieldValue(_Fields field) {
6125
      switch (field) {
103 ashish 6126
      case CATEGORY_ID:
6127
        return new Long(getCategory_id());
100 ashish 6128
 
6129
      }
6130
      throw new IllegalStateException();
6131
    }
6132
 
6133
    public Object getFieldValue(int fieldId) {
6134
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
6135
    }
6136
 
6137
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
6138
    public boolean isSet(_Fields field) {
6139
      switch (field) {
103 ashish 6140
      case CATEGORY_ID:
6141
        return isSetCategory_id();
100 ashish 6142
      }
6143
      throw new IllegalStateException();
6144
    }
6145
 
6146
    public boolean isSet(int fieldID) {
6147
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
6148
    }
6149
 
6150
    @Override
6151
    public boolean equals(Object that) {
6152
      if (that == null)
6153
        return false;
103 ashish 6154
      if (that instanceof retireCategory_args)
6155
        return this.equals((retireCategory_args)that);
100 ashish 6156
      return false;
6157
    }
6158
 
103 ashish 6159
    public boolean equals(retireCategory_args that) {
100 ashish 6160
      if (that == null)
6161
        return false;
6162
 
103 ashish 6163
      boolean this_present_category_id = true;
6164
      boolean that_present_category_id = true;
6165
      if (this_present_category_id || that_present_category_id) {
6166
        if (!(this_present_category_id && that_present_category_id))
100 ashish 6167
          return false;
103 ashish 6168
        if (this.category_id != that.category_id)
100 ashish 6169
          return false;
6170
      }
6171
 
6172
      return true;
6173
    }
6174
 
6175
    @Override
6176
    public int hashCode() {
6177
      return 0;
6178
    }
6179
 
103 ashish 6180
    public int compareTo(retireCategory_args other) {
100 ashish 6181
      if (!getClass().equals(other.getClass())) {
6182
        return getClass().getName().compareTo(other.getClass().getName());
6183
      }
6184
 
6185
      int lastComparison = 0;
103 ashish 6186
      retireCategory_args typedOther = (retireCategory_args)other;
100 ashish 6187
 
103 ashish 6188
      lastComparison = Boolean.valueOf(isSetCategory_id()).compareTo(isSetCategory_id());
100 ashish 6189
      if (lastComparison != 0) {
6190
        return lastComparison;
6191
      }
103 ashish 6192
      lastComparison = TBaseHelper.compareTo(category_id, typedOther.category_id);
100 ashish 6193
      if (lastComparison != 0) {
6194
        return lastComparison;
6195
      }
6196
      return 0;
6197
    }
6198
 
6199
    public void read(TProtocol iprot) throws TException {
6200
      TField field;
6201
      iprot.readStructBegin();
6202
      while (true)
6203
      {
6204
        field = iprot.readFieldBegin();
6205
        if (field.type == TType.STOP) { 
6206
          break;
6207
        }
6208
        _Fields fieldId = _Fields.findByThriftId(field.id);
6209
        if (fieldId == null) {
6210
          TProtocolUtil.skip(iprot, field.type);
6211
        } else {
6212
          switch (fieldId) {
103 ashish 6213
            case CATEGORY_ID:
6214
              if (field.type == TType.I64) {
6215
                this.category_id = iprot.readI64();
6216
                setCategory_idIsSet(true);
100 ashish 6217
              } else { 
6218
                TProtocolUtil.skip(iprot, field.type);
6219
              }
6220
              break;
6221
          }
6222
          iprot.readFieldEnd();
6223
        }
6224
      }
6225
      iprot.readStructEnd();
6226
      validate();
6227
    }
6228
 
6229
    public void write(TProtocol oprot) throws TException {
6230
      validate();
6231
 
6232
      oprot.writeStructBegin(STRUCT_DESC);
103 ashish 6233
      oprot.writeFieldBegin(CATEGORY_ID_FIELD_DESC);
6234
      oprot.writeI64(this.category_id);
6235
      oprot.writeFieldEnd();
100 ashish 6236
      oprot.writeFieldStop();
6237
      oprot.writeStructEnd();
6238
    }
6239
 
6240
    @Override
6241
    public String toString() {
103 ashish 6242
      StringBuilder sb = new StringBuilder("retireCategory_args(");
100 ashish 6243
      boolean first = true;
6244
 
103 ashish 6245
      sb.append("category_id:");
6246
      sb.append(this.category_id);
100 ashish 6247
      first = false;
6248
      sb.append(")");
6249
      return sb.toString();
6250
    }
6251
 
6252
    public void validate() throws TException {
6253
      // check for required fields
6254
    }
6255
 
6256
  }
6257
 
103 ashish 6258
  public static class retireCategory_result implements TBase<retireCategory_result._Fields>, java.io.Serializable, Cloneable, Comparable<retireCategory_result>   {
6259
    private static final TStruct STRUCT_DESC = new TStruct("retireCategory_result");
100 ashish 6260
 
6261
    private static final TField CEX_FIELD_DESC = new TField("cex", TType.STRUCT, (short)1);
6262
 
6263
    private CatalogServiceException cex;
6264
 
6265
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
6266
    public enum _Fields implements TFieldIdEnum {
6267
      CEX((short)1, "cex");
6268
 
6269
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
6270
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
6271
 
6272
      static {
6273
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
6274
          byId.put((int)field._thriftId, field);
6275
          byName.put(field.getFieldName(), field);
6276
        }
6277
      }
6278
 
6279
      /**
6280
       * Find the _Fields constant that matches fieldId, or null if its not found.
6281
       */
6282
      public static _Fields findByThriftId(int fieldId) {
6283
        return byId.get(fieldId);
6284
      }
6285
 
6286
      /**
6287
       * Find the _Fields constant that matches fieldId, throwing an exception
6288
       * if it is not found.
6289
       */
6290
      public static _Fields findByThriftIdOrThrow(int fieldId) {
6291
        _Fields fields = findByThriftId(fieldId);
6292
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
6293
        return fields;
6294
      }
6295
 
6296
      /**
6297
       * Find the _Fields constant that matches name, or null if its not found.
6298
       */
6299
      public static _Fields findByName(String name) {
6300
        return byName.get(name);
6301
      }
6302
 
6303
      private final short _thriftId;
6304
      private final String _fieldName;
6305
 
6306
      _Fields(short thriftId, String fieldName) {
6307
        _thriftId = thriftId;
6308
        _fieldName = fieldName;
6309
      }
6310
 
6311
      public short getThriftFieldId() {
6312
        return _thriftId;
6313
      }
6314
 
6315
      public String getFieldName() {
6316
        return _fieldName;
6317
      }
6318
    }
6319
 
6320
    // isset id assignments
6321
 
6322
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
6323
      put(_Fields.CEX, new FieldMetaData("cex", TFieldRequirementType.DEFAULT, 
6324
          new FieldValueMetaData(TType.STRUCT)));
6325
    }});
6326
 
6327
    static {
103 ashish 6328
      FieldMetaData.addStructMetaDataMap(retireCategory_result.class, metaDataMap);
100 ashish 6329
    }
6330
 
103 ashish 6331
    public retireCategory_result() {
100 ashish 6332
    }
6333
 
103 ashish 6334
    public retireCategory_result(
100 ashish 6335
      CatalogServiceException cex)
6336
    {
6337
      this();
6338
      this.cex = cex;
6339
    }
6340
 
6341
    /**
6342
     * Performs a deep copy on <i>other</i>.
6343
     */
103 ashish 6344
    public retireCategory_result(retireCategory_result other) {
100 ashish 6345
      if (other.isSetCex()) {
6346
        this.cex = new CatalogServiceException(other.cex);
6347
      }
6348
    }
6349
 
103 ashish 6350
    public retireCategory_result deepCopy() {
6351
      return new retireCategory_result(this);
100 ashish 6352
    }
6353
 
6354
    @Deprecated
103 ashish 6355
    public retireCategory_result clone() {
6356
      return new retireCategory_result(this);
100 ashish 6357
    }
6358
 
6359
    public CatalogServiceException getCex() {
6360
      return this.cex;
6361
    }
6362
 
103 ashish 6363
    public retireCategory_result setCex(CatalogServiceException cex) {
100 ashish 6364
      this.cex = cex;
6365
      return this;
6366
    }
6367
 
6368
    public void unsetCex() {
6369
      this.cex = null;
6370
    }
6371
 
6372
    /** Returns true if field cex is set (has been asigned a value) and false otherwise */
6373
    public boolean isSetCex() {
6374
      return this.cex != null;
6375
    }
6376
 
6377
    public void setCexIsSet(boolean value) {
6378
      if (!value) {
6379
        this.cex = null;
6380
      }
6381
    }
6382
 
6383
    public void setFieldValue(_Fields field, Object value) {
6384
      switch (field) {
6385
      case CEX:
6386
        if (value == null) {
6387
          unsetCex();
6388
        } else {
6389
          setCex((CatalogServiceException)value);
6390
        }
6391
        break;
6392
 
6393
      }
6394
    }
6395
 
6396
    public void setFieldValue(int fieldID, Object value) {
6397
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
6398
    }
6399
 
6400
    public Object getFieldValue(_Fields field) {
6401
      switch (field) {
6402
      case CEX:
6403
        return getCex();
6404
 
6405
      }
6406
      throw new IllegalStateException();
6407
    }
6408
 
6409
    public Object getFieldValue(int fieldId) {
6410
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
6411
    }
6412
 
6413
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
6414
    public boolean isSet(_Fields field) {
6415
      switch (field) {
6416
      case CEX:
6417
        return isSetCex();
6418
      }
6419
      throw new IllegalStateException();
6420
    }
6421
 
6422
    public boolean isSet(int fieldID) {
6423
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
6424
    }
6425
 
6426
    @Override
6427
    public boolean equals(Object that) {
6428
      if (that == null)
6429
        return false;
103 ashish 6430
      if (that instanceof retireCategory_result)
6431
        return this.equals((retireCategory_result)that);
100 ashish 6432
      return false;
6433
    }
6434
 
103 ashish 6435
    public boolean equals(retireCategory_result that) {
100 ashish 6436
      if (that == null)
6437
        return false;
6438
 
6439
      boolean this_present_cex = true && this.isSetCex();
6440
      boolean that_present_cex = true && that.isSetCex();
6441
      if (this_present_cex || that_present_cex) {
6442
        if (!(this_present_cex && that_present_cex))
6443
          return false;
6444
        if (!this.cex.equals(that.cex))
6445
          return false;
6446
      }
6447
 
6448
      return true;
6449
    }
6450
 
6451
    @Override
6452
    public int hashCode() {
6453
      return 0;
6454
    }
6455
 
103 ashish 6456
    public int compareTo(retireCategory_result other) {
100 ashish 6457
      if (!getClass().equals(other.getClass())) {
6458
        return getClass().getName().compareTo(other.getClass().getName());
6459
      }
6460
 
6461
      int lastComparison = 0;
103 ashish 6462
      retireCategory_result typedOther = (retireCategory_result)other;
100 ashish 6463
 
6464
      lastComparison = Boolean.valueOf(isSetCex()).compareTo(isSetCex());
6465
      if (lastComparison != 0) {
6466
        return lastComparison;
6467
      }
6468
      lastComparison = TBaseHelper.compareTo(cex, typedOther.cex);
6469
      if (lastComparison != 0) {
6470
        return lastComparison;
6471
      }
6472
      return 0;
6473
    }
6474
 
6475
    public void read(TProtocol iprot) throws TException {
6476
      TField field;
6477
      iprot.readStructBegin();
6478
      while (true)
6479
      {
6480
        field = iprot.readFieldBegin();
6481
        if (field.type == TType.STOP) { 
6482
          break;
6483
        }
6484
        _Fields fieldId = _Fields.findByThriftId(field.id);
6485
        if (fieldId == null) {
6486
          TProtocolUtil.skip(iprot, field.type);
6487
        } else {
6488
          switch (fieldId) {
6489
            case CEX:
6490
              if (field.type == TType.STRUCT) {
6491
                this.cex = new CatalogServiceException();
6492
                this.cex.read(iprot);
6493
              } else { 
6494
                TProtocolUtil.skip(iprot, field.type);
6495
              }
6496
              break;
6497
          }
6498
          iprot.readFieldEnd();
6499
        }
6500
      }
6501
      iprot.readStructEnd();
6502
      validate();
6503
    }
6504
 
6505
    public void write(TProtocol oprot) throws TException {
6506
      oprot.writeStructBegin(STRUCT_DESC);
6507
 
6508
      if (this.isSetCex()) {
6509
        oprot.writeFieldBegin(CEX_FIELD_DESC);
6510
        this.cex.write(oprot);
6511
        oprot.writeFieldEnd();
6512
      }
6513
      oprot.writeFieldStop();
6514
      oprot.writeStructEnd();
6515
    }
6516
 
6517
    @Override
6518
    public String toString() {
103 ashish 6519
      StringBuilder sb = new StringBuilder("retireCategory_result(");
100 ashish 6520
      boolean first = true;
6521
 
6522
      sb.append("cex:");
6523
      if (this.cex == null) {
6524
        sb.append("null");
6525
      } else {
6526
        sb.append(this.cex);
6527
      }
6528
      first = false;
6529
      sb.append(")");
6530
      return sb.toString();
6531
    }
6532
 
6533
    public void validate() throws TException {
6534
      // check for required fields
6535
    }
6536
 
6537
  }
6538
 
103 ashish 6539
  public static class retireVendor_args implements TBase<retireVendor_args._Fields>, java.io.Serializable, Cloneable, Comparable<retireVendor_args>   {
6540
    private static final TStruct STRUCT_DESC = new TStruct("retireVendor_args");
100 ashish 6541
 
103 ashish 6542
    private static final TField VENDOR_ID_FIELD_DESC = new TField("vendor_id", TType.I64, (short)1);
100 ashish 6543
 
103 ashish 6544
    private long vendor_id;
100 ashish 6545
 
6546
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
6547
    public enum _Fields implements TFieldIdEnum {
103 ashish 6548
      VENDOR_ID((short)1, "vendor_id");
100 ashish 6549
 
6550
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
6551
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
6552
 
6553
      static {
6554
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
6555
          byId.put((int)field._thriftId, field);
6556
          byName.put(field.getFieldName(), field);
6557
        }
6558
      }
6559
 
6560
      /**
6561
       * Find the _Fields constant that matches fieldId, or null if its not found.
6562
       */
6563
      public static _Fields findByThriftId(int fieldId) {
6564
        return byId.get(fieldId);
6565
      }
6566
 
6567
      /**
6568
       * Find the _Fields constant that matches fieldId, throwing an exception
6569
       * if it is not found.
6570
       */
6571
      public static _Fields findByThriftIdOrThrow(int fieldId) {
6572
        _Fields fields = findByThriftId(fieldId);
6573
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
6574
        return fields;
6575
      }
6576
 
6577
      /**
6578
       * Find the _Fields constant that matches name, or null if its not found.
6579
       */
6580
      public static _Fields findByName(String name) {
6581
        return byName.get(name);
6582
      }
6583
 
6584
      private final short _thriftId;
6585
      private final String _fieldName;
6586
 
6587
      _Fields(short thriftId, String fieldName) {
6588
        _thriftId = thriftId;
6589
        _fieldName = fieldName;
6590
      }
6591
 
6592
      public short getThriftFieldId() {
6593
        return _thriftId;
6594
      }
6595
 
6596
      public String getFieldName() {
6597
        return _fieldName;
6598
      }
6599
    }
6600
 
6601
    // isset id assignments
103 ashish 6602
    private static final int __VENDOR_ID_ISSET_ID = 0;
6603
    private BitSet __isset_bit_vector = new BitSet(1);
100 ashish 6604
 
6605
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
103 ashish 6606
      put(_Fields.VENDOR_ID, new FieldMetaData("vendor_id", TFieldRequirementType.DEFAULT, 
6607
          new FieldValueMetaData(TType.I64)));
100 ashish 6608
    }});
6609
 
6610
    static {
103 ashish 6611
      FieldMetaData.addStructMetaDataMap(retireVendor_args.class, metaDataMap);
100 ashish 6612
    }
6613
 
103 ashish 6614
    public retireVendor_args() {
100 ashish 6615
    }
6616
 
103 ashish 6617
    public retireVendor_args(
6618
      long vendor_id)
100 ashish 6619
    {
6620
      this();
103 ashish 6621
      this.vendor_id = vendor_id;
6622
      setVendor_idIsSet(true);
100 ashish 6623
    }
6624
 
6625
    /**
6626
     * Performs a deep copy on <i>other</i>.
6627
     */
103 ashish 6628
    public retireVendor_args(retireVendor_args other) {
6629
      __isset_bit_vector.clear();
6630
      __isset_bit_vector.or(other.__isset_bit_vector);
6631
      this.vendor_id = other.vendor_id;
6632
    }
6633
 
6634
    public retireVendor_args deepCopy() {
6635
      return new retireVendor_args(this);
6636
    }
6637
 
6638
    @Deprecated
6639
    public retireVendor_args clone() {
6640
      return new retireVendor_args(this);
6641
    }
6642
 
6643
    public long getVendor_id() {
6644
      return this.vendor_id;
6645
    }
6646
 
6647
    public retireVendor_args setVendor_id(long vendor_id) {
6648
      this.vendor_id = vendor_id;
6649
      setVendor_idIsSet(true);
6650
      return this;
6651
    }
6652
 
6653
    public void unsetVendor_id() {
6654
      __isset_bit_vector.clear(__VENDOR_ID_ISSET_ID);
6655
    }
6656
 
6657
    /** Returns true if field vendor_id is set (has been asigned a value) and false otherwise */
6658
    public boolean isSetVendor_id() {
6659
      return __isset_bit_vector.get(__VENDOR_ID_ISSET_ID);
6660
    }
6661
 
6662
    public void setVendor_idIsSet(boolean value) {
6663
      __isset_bit_vector.set(__VENDOR_ID_ISSET_ID, value);
6664
    }
6665
 
6666
    public void setFieldValue(_Fields field, Object value) {
6667
      switch (field) {
6668
      case VENDOR_ID:
6669
        if (value == null) {
6670
          unsetVendor_id();
6671
        } else {
6672
          setVendor_id((Long)value);
6673
        }
6674
        break;
6675
 
100 ashish 6676
      }
6677
    }
6678
 
103 ashish 6679
    public void setFieldValue(int fieldID, Object value) {
6680
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
100 ashish 6681
    }
6682
 
103 ashish 6683
    public Object getFieldValue(_Fields field) {
6684
      switch (field) {
6685
      case VENDOR_ID:
6686
        return new Long(getVendor_id());
6687
 
6688
      }
6689
      throw new IllegalStateException();
6690
    }
6691
 
6692
    public Object getFieldValue(int fieldId) {
6693
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
6694
    }
6695
 
6696
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
6697
    public boolean isSet(_Fields field) {
6698
      switch (field) {
6699
      case VENDOR_ID:
6700
        return isSetVendor_id();
6701
      }
6702
      throw new IllegalStateException();
6703
    }
6704
 
6705
    public boolean isSet(int fieldID) {
6706
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
6707
    }
6708
 
6709
    @Override
6710
    public boolean equals(Object that) {
6711
      if (that == null)
6712
        return false;
6713
      if (that instanceof retireVendor_args)
6714
        return this.equals((retireVendor_args)that);
6715
      return false;
6716
    }
6717
 
6718
    public boolean equals(retireVendor_args that) {
6719
      if (that == null)
6720
        return false;
6721
 
6722
      boolean this_present_vendor_id = true;
6723
      boolean that_present_vendor_id = true;
6724
      if (this_present_vendor_id || that_present_vendor_id) {
6725
        if (!(this_present_vendor_id && that_present_vendor_id))
6726
          return false;
6727
        if (this.vendor_id != that.vendor_id)
6728
          return false;
6729
      }
6730
 
6731
      return true;
6732
    }
6733
 
6734
    @Override
6735
    public int hashCode() {
6736
      return 0;
6737
    }
6738
 
6739
    public int compareTo(retireVendor_args other) {
6740
      if (!getClass().equals(other.getClass())) {
6741
        return getClass().getName().compareTo(other.getClass().getName());
6742
      }
6743
 
6744
      int lastComparison = 0;
6745
      retireVendor_args typedOther = (retireVendor_args)other;
6746
 
6747
      lastComparison = Boolean.valueOf(isSetVendor_id()).compareTo(isSetVendor_id());
6748
      if (lastComparison != 0) {
6749
        return lastComparison;
6750
      }
6751
      lastComparison = TBaseHelper.compareTo(vendor_id, typedOther.vendor_id);
6752
      if (lastComparison != 0) {
6753
        return lastComparison;
6754
      }
6755
      return 0;
6756
    }
6757
 
6758
    public void read(TProtocol iprot) throws TException {
6759
      TField field;
6760
      iprot.readStructBegin();
6761
      while (true)
6762
      {
6763
        field = iprot.readFieldBegin();
6764
        if (field.type == TType.STOP) { 
6765
          break;
6766
        }
6767
        _Fields fieldId = _Fields.findByThriftId(field.id);
6768
        if (fieldId == null) {
6769
          TProtocolUtil.skip(iprot, field.type);
6770
        } else {
6771
          switch (fieldId) {
6772
            case VENDOR_ID:
6773
              if (field.type == TType.I64) {
6774
                this.vendor_id = iprot.readI64();
6775
                setVendor_idIsSet(true);
6776
              } else { 
6777
                TProtocolUtil.skip(iprot, field.type);
6778
              }
6779
              break;
6780
          }
6781
          iprot.readFieldEnd();
6782
        }
6783
      }
6784
      iprot.readStructEnd();
6785
      validate();
6786
    }
6787
 
6788
    public void write(TProtocol oprot) throws TException {
6789
      validate();
6790
 
6791
      oprot.writeStructBegin(STRUCT_DESC);
6792
      oprot.writeFieldBegin(VENDOR_ID_FIELD_DESC);
6793
      oprot.writeI64(this.vendor_id);
6794
      oprot.writeFieldEnd();
6795
      oprot.writeFieldStop();
6796
      oprot.writeStructEnd();
6797
    }
6798
 
6799
    @Override
6800
    public String toString() {
6801
      StringBuilder sb = new StringBuilder("retireVendor_args(");
6802
      boolean first = true;
6803
 
6804
      sb.append("vendor_id:");
6805
      sb.append(this.vendor_id);
6806
      first = false;
6807
      sb.append(")");
6808
      return sb.toString();
6809
    }
6810
 
6811
    public void validate() throws TException {
6812
      // check for required fields
6813
    }
6814
 
6815
  }
6816
 
6817
  public static class retireVendor_result implements TBase<retireVendor_result._Fields>, java.io.Serializable, Cloneable, Comparable<retireVendor_result>   {
6818
    private static final TStruct STRUCT_DESC = new TStruct("retireVendor_result");
6819
 
6820
    private static final TField CEX_FIELD_DESC = new TField("cex", TType.STRUCT, (short)1);
6821
 
6822
    private CatalogServiceException cex;
6823
 
6824
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
6825
    public enum _Fields implements TFieldIdEnum {
6826
      CEX((short)1, "cex");
6827
 
6828
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
6829
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
6830
 
6831
      static {
6832
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
6833
          byId.put((int)field._thriftId, field);
6834
          byName.put(field.getFieldName(), field);
6835
        }
6836
      }
6837
 
6838
      /**
6839
       * Find the _Fields constant that matches fieldId, or null if its not found.
6840
       */
6841
      public static _Fields findByThriftId(int fieldId) {
6842
        return byId.get(fieldId);
6843
      }
6844
 
6845
      /**
6846
       * Find the _Fields constant that matches fieldId, throwing an exception
6847
       * if it is not found.
6848
       */
6849
      public static _Fields findByThriftIdOrThrow(int fieldId) {
6850
        _Fields fields = findByThriftId(fieldId);
6851
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
6852
        return fields;
6853
      }
6854
 
6855
      /**
6856
       * Find the _Fields constant that matches name, or null if its not found.
6857
       */
6858
      public static _Fields findByName(String name) {
6859
        return byName.get(name);
6860
      }
6861
 
6862
      private final short _thriftId;
6863
      private final String _fieldName;
6864
 
6865
      _Fields(short thriftId, String fieldName) {
6866
        _thriftId = thriftId;
6867
        _fieldName = fieldName;
6868
      }
6869
 
6870
      public short getThriftFieldId() {
6871
        return _thriftId;
6872
      }
6873
 
6874
      public String getFieldName() {
6875
        return _fieldName;
6876
      }
6877
    }
6878
 
6879
    // isset id assignments
6880
 
6881
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
6882
      put(_Fields.CEX, new FieldMetaData("cex", TFieldRequirementType.DEFAULT, 
6883
          new FieldValueMetaData(TType.STRUCT)));
6884
    }});
6885
 
6886
    static {
6887
      FieldMetaData.addStructMetaDataMap(retireVendor_result.class, metaDataMap);
6888
    }
6889
 
6890
    public retireVendor_result() {
6891
    }
6892
 
6893
    public retireVendor_result(
6894
      CatalogServiceException cex)
6895
    {
6896
      this();
6897
      this.cex = cex;
6898
    }
6899
 
6900
    /**
6901
     * Performs a deep copy on <i>other</i>.
6902
     */
6903
    public retireVendor_result(retireVendor_result other) {
6904
      if (other.isSetCex()) {
6905
        this.cex = new CatalogServiceException(other.cex);
6906
      }
6907
    }
6908
 
6909
    public retireVendor_result deepCopy() {
6910
      return new retireVendor_result(this);
6911
    }
6912
 
100 ashish 6913
    @Deprecated
103 ashish 6914
    public retireVendor_result clone() {
6915
      return new retireVendor_result(this);
100 ashish 6916
    }
6917
 
103 ashish 6918
    public CatalogServiceException getCex() {
6919
      return this.cex;
100 ashish 6920
    }
6921
 
103 ashish 6922
    public retireVendor_result setCex(CatalogServiceException cex) {
6923
      this.cex = cex;
100 ashish 6924
      return this;
6925
    }
6926
 
103 ashish 6927
    public void unsetCex() {
6928
      this.cex = null;
100 ashish 6929
    }
6930
 
103 ashish 6931
    /** Returns true if field cex is set (has been asigned a value) and false otherwise */
6932
    public boolean isSetCex() {
6933
      return this.cex != null;
100 ashish 6934
    }
6935
 
103 ashish 6936
    public void setCexIsSet(boolean value) {
100 ashish 6937
      if (!value) {
103 ashish 6938
        this.cex = null;
100 ashish 6939
      }
6940
    }
6941
 
6942
    public void setFieldValue(_Fields field, Object value) {
6943
      switch (field) {
103 ashish 6944
      case CEX:
100 ashish 6945
        if (value == null) {
103 ashish 6946
          unsetCex();
100 ashish 6947
        } else {
103 ashish 6948
          setCex((CatalogServiceException)value);
100 ashish 6949
        }
6950
        break;
6951
 
6952
      }
6953
    }
6954
 
6955
    public void setFieldValue(int fieldID, Object value) {
6956
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
6957
    }
6958
 
6959
    public Object getFieldValue(_Fields field) {
6960
      switch (field) {
103 ashish 6961
      case CEX:
6962
        return getCex();
100 ashish 6963
 
6964
      }
6965
      throw new IllegalStateException();
6966
    }
6967
 
6968
    public Object getFieldValue(int fieldId) {
6969
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
6970
    }
6971
 
6972
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
6973
    public boolean isSet(_Fields field) {
6974
      switch (field) {
103 ashish 6975
      case CEX:
6976
        return isSetCex();
100 ashish 6977
      }
6978
      throw new IllegalStateException();
6979
    }
6980
 
6981
    public boolean isSet(int fieldID) {
6982
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
6983
    }
6984
 
6985
    @Override
6986
    public boolean equals(Object that) {
6987
      if (that == null)
6988
        return false;
103 ashish 6989
      if (that instanceof retireVendor_result)
6990
        return this.equals((retireVendor_result)that);
100 ashish 6991
      return false;
6992
    }
6993
 
103 ashish 6994
    public boolean equals(retireVendor_result that) {
100 ashish 6995
      if (that == null)
6996
        return false;
6997
 
103 ashish 6998
      boolean this_present_cex = true && this.isSetCex();
6999
      boolean that_present_cex = true && that.isSetCex();
7000
      if (this_present_cex || that_present_cex) {
7001
        if (!(this_present_cex && that_present_cex))
100 ashish 7002
          return false;
103 ashish 7003
        if (!this.cex.equals(that.cex))
100 ashish 7004
          return false;
7005
      }
7006
 
7007
      return true;
7008
    }
7009
 
7010
    @Override
7011
    public int hashCode() {
7012
      return 0;
7013
    }
7014
 
103 ashish 7015
    public int compareTo(retireVendor_result other) {
100 ashish 7016
      if (!getClass().equals(other.getClass())) {
7017
        return getClass().getName().compareTo(other.getClass().getName());
7018
      }
7019
 
7020
      int lastComparison = 0;
103 ashish 7021
      retireVendor_result typedOther = (retireVendor_result)other;
100 ashish 7022
 
103 ashish 7023
      lastComparison = Boolean.valueOf(isSetCex()).compareTo(isSetCex());
100 ashish 7024
      if (lastComparison != 0) {
7025
        return lastComparison;
7026
      }
103 ashish 7027
      lastComparison = TBaseHelper.compareTo(cex, typedOther.cex);
100 ashish 7028
      if (lastComparison != 0) {
7029
        return lastComparison;
7030
      }
7031
      return 0;
7032
    }
7033
 
7034
    public void read(TProtocol iprot) throws TException {
7035
      TField field;
7036
      iprot.readStructBegin();
7037
      while (true)
7038
      {
7039
        field = iprot.readFieldBegin();
7040
        if (field.type == TType.STOP) { 
7041
          break;
7042
        }
7043
        _Fields fieldId = _Fields.findByThriftId(field.id);
7044
        if (fieldId == null) {
7045
          TProtocolUtil.skip(iprot, field.type);
7046
        } else {
7047
          switch (fieldId) {
103 ashish 7048
            case CEX:
100 ashish 7049
              if (field.type == TType.STRUCT) {
103 ashish 7050
                this.cex = new CatalogServiceException();
7051
                this.cex.read(iprot);
100 ashish 7052
              } else { 
7053
                TProtocolUtil.skip(iprot, field.type);
7054
              }
7055
              break;
7056
          }
7057
          iprot.readFieldEnd();
7058
        }
7059
      }
7060
      iprot.readStructEnd();
7061
      validate();
7062
    }
7063
 
7064
    public void write(TProtocol oprot) throws TException {
103 ashish 7065
      oprot.writeStructBegin(STRUCT_DESC);
100 ashish 7066
 
103 ashish 7067
      if (this.isSetCex()) {
7068
        oprot.writeFieldBegin(CEX_FIELD_DESC);
7069
        this.cex.write(oprot);
100 ashish 7070
        oprot.writeFieldEnd();
7071
      }
7072
      oprot.writeFieldStop();
7073
      oprot.writeStructEnd();
7074
    }
7075
 
7076
    @Override
7077
    public String toString() {
103 ashish 7078
      StringBuilder sb = new StringBuilder("retireVendor_result(");
100 ashish 7079
      boolean first = true;
7080
 
103 ashish 7081
      sb.append("cex:");
7082
      if (this.cex == null) {
100 ashish 7083
        sb.append("null");
7084
      } else {
103 ashish 7085
        sb.append(this.cex);
100 ashish 7086
      }
7087
      first = false;
7088
      sb.append(")");
7089
      return sb.toString();
7090
    }
7091
 
7092
    public void validate() throws TException {
7093
      // check for required fields
7094
    }
7095
 
7096
  }
7097
 
103 ashish 7098
  public static class retireWarehouse_args implements TBase<retireWarehouse_args._Fields>, java.io.Serializable, Cloneable, Comparable<retireWarehouse_args>   {
7099
    private static final TStruct STRUCT_DESC = new TStruct("retireWarehouse_args");
100 ashish 7100
 
103 ashish 7101
    private static final TField WAREHOUSE_ID_FIELD_DESC = new TField("warehouse_id", TType.I64, (short)1);
7102
 
7103
    private long warehouse_id;
7104
 
7105
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
7106
    public enum _Fields implements TFieldIdEnum {
7107
      WAREHOUSE_ID((short)1, "warehouse_id");
7108
 
7109
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
7110
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
7111
 
7112
      static {
7113
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
7114
          byId.put((int)field._thriftId, field);
7115
          byName.put(field.getFieldName(), field);
7116
        }
7117
      }
7118
 
7119
      /**
7120
       * Find the _Fields constant that matches fieldId, or null if its not found.
7121
       */
7122
      public static _Fields findByThriftId(int fieldId) {
7123
        return byId.get(fieldId);
7124
      }
7125
 
7126
      /**
7127
       * Find the _Fields constant that matches fieldId, throwing an exception
7128
       * if it is not found.
7129
       */
7130
      public static _Fields findByThriftIdOrThrow(int fieldId) {
7131
        _Fields fields = findByThriftId(fieldId);
7132
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
7133
        return fields;
7134
      }
7135
 
7136
      /**
7137
       * Find the _Fields constant that matches name, or null if its not found.
7138
       */
7139
      public static _Fields findByName(String name) {
7140
        return byName.get(name);
7141
      }
7142
 
7143
      private final short _thriftId;
7144
      private final String _fieldName;
7145
 
7146
      _Fields(short thriftId, String fieldName) {
7147
        _thriftId = thriftId;
7148
        _fieldName = fieldName;
7149
      }
7150
 
7151
      public short getThriftFieldId() {
7152
        return _thriftId;
7153
      }
7154
 
7155
      public String getFieldName() {
7156
        return _fieldName;
7157
      }
7158
    }
7159
 
7160
    // isset id assignments
7161
    private static final int __WAREHOUSE_ID_ISSET_ID = 0;
7162
    private BitSet __isset_bit_vector = new BitSet(1);
7163
 
7164
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
7165
      put(_Fields.WAREHOUSE_ID, new FieldMetaData("warehouse_id", TFieldRequirementType.DEFAULT, 
7166
          new FieldValueMetaData(TType.I64)));
7167
    }});
7168
 
7169
    static {
7170
      FieldMetaData.addStructMetaDataMap(retireWarehouse_args.class, metaDataMap);
7171
    }
7172
 
7173
    public retireWarehouse_args() {
7174
    }
7175
 
7176
    public retireWarehouse_args(
7177
      long warehouse_id)
7178
    {
7179
      this();
7180
      this.warehouse_id = warehouse_id;
7181
      setWarehouse_idIsSet(true);
7182
    }
7183
 
7184
    /**
7185
     * Performs a deep copy on <i>other</i>.
7186
     */
7187
    public retireWarehouse_args(retireWarehouse_args other) {
7188
      __isset_bit_vector.clear();
7189
      __isset_bit_vector.or(other.__isset_bit_vector);
7190
      this.warehouse_id = other.warehouse_id;
7191
    }
7192
 
7193
    public retireWarehouse_args deepCopy() {
7194
      return new retireWarehouse_args(this);
7195
    }
7196
 
7197
    @Deprecated
7198
    public retireWarehouse_args clone() {
7199
      return new retireWarehouse_args(this);
7200
    }
7201
 
7202
    public long getWarehouse_id() {
7203
      return this.warehouse_id;
7204
    }
7205
 
7206
    public retireWarehouse_args setWarehouse_id(long warehouse_id) {
7207
      this.warehouse_id = warehouse_id;
7208
      setWarehouse_idIsSet(true);
7209
      return this;
7210
    }
7211
 
7212
    public void unsetWarehouse_id() {
7213
      __isset_bit_vector.clear(__WAREHOUSE_ID_ISSET_ID);
7214
    }
7215
 
7216
    /** Returns true if field warehouse_id is set (has been asigned a value) and false otherwise */
7217
    public boolean isSetWarehouse_id() {
7218
      return __isset_bit_vector.get(__WAREHOUSE_ID_ISSET_ID);
7219
    }
7220
 
7221
    public void setWarehouse_idIsSet(boolean value) {
7222
      __isset_bit_vector.set(__WAREHOUSE_ID_ISSET_ID, value);
7223
    }
7224
 
7225
    public void setFieldValue(_Fields field, Object value) {
7226
      switch (field) {
7227
      case WAREHOUSE_ID:
7228
        if (value == null) {
7229
          unsetWarehouse_id();
7230
        } else {
7231
          setWarehouse_id((Long)value);
7232
        }
7233
        break;
7234
 
7235
      }
7236
    }
7237
 
7238
    public void setFieldValue(int fieldID, Object value) {
7239
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
7240
    }
7241
 
7242
    public Object getFieldValue(_Fields field) {
7243
      switch (field) {
7244
      case WAREHOUSE_ID:
7245
        return new Long(getWarehouse_id());
7246
 
7247
      }
7248
      throw new IllegalStateException();
7249
    }
7250
 
7251
    public Object getFieldValue(int fieldId) {
7252
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
7253
    }
7254
 
7255
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
7256
    public boolean isSet(_Fields field) {
7257
      switch (field) {
7258
      case WAREHOUSE_ID:
7259
        return isSetWarehouse_id();
7260
      }
7261
      throw new IllegalStateException();
7262
    }
7263
 
7264
    public boolean isSet(int fieldID) {
7265
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
7266
    }
7267
 
7268
    @Override
7269
    public boolean equals(Object that) {
7270
      if (that == null)
7271
        return false;
7272
      if (that instanceof retireWarehouse_args)
7273
        return this.equals((retireWarehouse_args)that);
7274
      return false;
7275
    }
7276
 
7277
    public boolean equals(retireWarehouse_args that) {
7278
      if (that == null)
7279
        return false;
7280
 
7281
      boolean this_present_warehouse_id = true;
7282
      boolean that_present_warehouse_id = true;
7283
      if (this_present_warehouse_id || that_present_warehouse_id) {
7284
        if (!(this_present_warehouse_id && that_present_warehouse_id))
7285
          return false;
7286
        if (this.warehouse_id != that.warehouse_id)
7287
          return false;
7288
      }
7289
 
7290
      return true;
7291
    }
7292
 
7293
    @Override
7294
    public int hashCode() {
7295
      return 0;
7296
    }
7297
 
7298
    public int compareTo(retireWarehouse_args other) {
7299
      if (!getClass().equals(other.getClass())) {
7300
        return getClass().getName().compareTo(other.getClass().getName());
7301
      }
7302
 
7303
      int lastComparison = 0;
7304
      retireWarehouse_args typedOther = (retireWarehouse_args)other;
7305
 
7306
      lastComparison = Boolean.valueOf(isSetWarehouse_id()).compareTo(isSetWarehouse_id());
7307
      if (lastComparison != 0) {
7308
        return lastComparison;
7309
      }
7310
      lastComparison = TBaseHelper.compareTo(warehouse_id, typedOther.warehouse_id);
7311
      if (lastComparison != 0) {
7312
        return lastComparison;
7313
      }
7314
      return 0;
7315
    }
7316
 
7317
    public void read(TProtocol iprot) throws TException {
7318
      TField field;
7319
      iprot.readStructBegin();
7320
      while (true)
7321
      {
7322
        field = iprot.readFieldBegin();
7323
        if (field.type == TType.STOP) { 
7324
          break;
7325
        }
7326
        _Fields fieldId = _Fields.findByThriftId(field.id);
7327
        if (fieldId == null) {
7328
          TProtocolUtil.skip(iprot, field.type);
7329
        } else {
7330
          switch (fieldId) {
7331
            case WAREHOUSE_ID:
7332
              if (field.type == TType.I64) {
7333
                this.warehouse_id = iprot.readI64();
7334
                setWarehouse_idIsSet(true);
7335
              } else { 
7336
                TProtocolUtil.skip(iprot, field.type);
7337
              }
7338
              break;
7339
          }
7340
          iprot.readFieldEnd();
7341
        }
7342
      }
7343
      iprot.readStructEnd();
7344
      validate();
7345
    }
7346
 
7347
    public void write(TProtocol oprot) throws TException {
7348
      validate();
7349
 
7350
      oprot.writeStructBegin(STRUCT_DESC);
7351
      oprot.writeFieldBegin(WAREHOUSE_ID_FIELD_DESC);
7352
      oprot.writeI64(this.warehouse_id);
7353
      oprot.writeFieldEnd();
7354
      oprot.writeFieldStop();
7355
      oprot.writeStructEnd();
7356
    }
7357
 
7358
    @Override
7359
    public String toString() {
7360
      StringBuilder sb = new StringBuilder("retireWarehouse_args(");
7361
      boolean first = true;
7362
 
7363
      sb.append("warehouse_id:");
7364
      sb.append(this.warehouse_id);
7365
      first = false;
7366
      sb.append(")");
7367
      return sb.toString();
7368
    }
7369
 
7370
    public void validate() throws TException {
7371
      // check for required fields
7372
    }
7373
 
7374
  }
7375
 
7376
  public static class retireWarehouse_result implements TBase<retireWarehouse_result._Fields>, java.io.Serializable, Cloneable, Comparable<retireWarehouse_result>   {
7377
    private static final TStruct STRUCT_DESC = new TStruct("retireWarehouse_result");
7378
 
100 ashish 7379
    private static final TField CEX_FIELD_DESC = new TField("cex", TType.STRUCT, (short)1);
7380
 
7381
    private CatalogServiceException cex;
7382
 
7383
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
7384
    public enum _Fields implements TFieldIdEnum {
7385
      CEX((short)1, "cex");
7386
 
7387
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
7388
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
7389
 
7390
      static {
7391
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
7392
          byId.put((int)field._thriftId, field);
7393
          byName.put(field.getFieldName(), field);
7394
        }
7395
      }
7396
 
7397
      /**
7398
       * Find the _Fields constant that matches fieldId, or null if its not found.
7399
       */
7400
      public static _Fields findByThriftId(int fieldId) {
7401
        return byId.get(fieldId);
7402
      }
7403
 
7404
      /**
7405
       * Find the _Fields constant that matches fieldId, throwing an exception
7406
       * if it is not found.
7407
       */
7408
      public static _Fields findByThriftIdOrThrow(int fieldId) {
7409
        _Fields fields = findByThriftId(fieldId);
7410
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
7411
        return fields;
7412
      }
7413
 
7414
      /**
7415
       * Find the _Fields constant that matches name, or null if its not found.
7416
       */
7417
      public static _Fields findByName(String name) {
7418
        return byName.get(name);
7419
      }
7420
 
7421
      private final short _thriftId;
7422
      private final String _fieldName;
7423
 
7424
      _Fields(short thriftId, String fieldName) {
7425
        _thriftId = thriftId;
7426
        _fieldName = fieldName;
7427
      }
7428
 
7429
      public short getThriftFieldId() {
7430
        return _thriftId;
7431
      }
7432
 
7433
      public String getFieldName() {
7434
        return _fieldName;
7435
      }
7436
    }
7437
 
7438
    // isset id assignments
7439
 
7440
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
7441
      put(_Fields.CEX, new FieldMetaData("cex", TFieldRequirementType.DEFAULT, 
7442
          new FieldValueMetaData(TType.STRUCT)));
7443
    }});
7444
 
7445
    static {
103 ashish 7446
      FieldMetaData.addStructMetaDataMap(retireWarehouse_result.class, metaDataMap);
100 ashish 7447
    }
7448
 
103 ashish 7449
    public retireWarehouse_result() {
100 ashish 7450
    }
7451
 
103 ashish 7452
    public retireWarehouse_result(
100 ashish 7453
      CatalogServiceException cex)
7454
    {
7455
      this();
7456
      this.cex = cex;
7457
    }
7458
 
7459
    /**
7460
     * Performs a deep copy on <i>other</i>.
7461
     */
103 ashish 7462
    public retireWarehouse_result(retireWarehouse_result other) {
100 ashish 7463
      if (other.isSetCex()) {
7464
        this.cex = new CatalogServiceException(other.cex);
7465
      }
7466
    }
7467
 
103 ashish 7468
    public retireWarehouse_result deepCopy() {
7469
      return new retireWarehouse_result(this);
100 ashish 7470
    }
7471
 
7472
    @Deprecated
103 ashish 7473
    public retireWarehouse_result clone() {
7474
      return new retireWarehouse_result(this);
100 ashish 7475
    }
7476
 
7477
    public CatalogServiceException getCex() {
7478
      return this.cex;
7479
    }
7480
 
103 ashish 7481
    public retireWarehouse_result setCex(CatalogServiceException cex) {
100 ashish 7482
      this.cex = cex;
7483
      return this;
7484
    }
7485
 
7486
    public void unsetCex() {
7487
      this.cex = null;
7488
    }
7489
 
7490
    /** Returns true if field cex is set (has been asigned a value) and false otherwise */
7491
    public boolean isSetCex() {
7492
      return this.cex != null;
7493
    }
7494
 
7495
    public void setCexIsSet(boolean value) {
7496
      if (!value) {
7497
        this.cex = null;
7498
      }
7499
    }
7500
 
7501
    public void setFieldValue(_Fields field, Object value) {
7502
      switch (field) {
7503
      case CEX:
7504
        if (value == null) {
7505
          unsetCex();
7506
        } else {
7507
          setCex((CatalogServiceException)value);
7508
        }
7509
        break;
7510
 
7511
      }
7512
    }
7513
 
7514
    public void setFieldValue(int fieldID, Object value) {
7515
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
7516
    }
7517
 
7518
    public Object getFieldValue(_Fields field) {
7519
      switch (field) {
7520
      case CEX:
7521
        return getCex();
7522
 
7523
      }
7524
      throw new IllegalStateException();
7525
    }
7526
 
7527
    public Object getFieldValue(int fieldId) {
7528
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
7529
    }
7530
 
7531
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
7532
    public boolean isSet(_Fields field) {
7533
      switch (field) {
7534
      case CEX:
7535
        return isSetCex();
7536
      }
7537
      throw new IllegalStateException();
7538
    }
7539
 
7540
    public boolean isSet(int fieldID) {
7541
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
7542
    }
7543
 
7544
    @Override
7545
    public boolean equals(Object that) {
7546
      if (that == null)
7547
        return false;
103 ashish 7548
      if (that instanceof retireWarehouse_result)
7549
        return this.equals((retireWarehouse_result)that);
100 ashish 7550
      return false;
7551
    }
7552
 
103 ashish 7553
    public boolean equals(retireWarehouse_result that) {
100 ashish 7554
      if (that == null)
7555
        return false;
7556
 
7557
      boolean this_present_cex = true && this.isSetCex();
7558
      boolean that_present_cex = true && that.isSetCex();
7559
      if (this_present_cex || that_present_cex) {
7560
        if (!(this_present_cex && that_present_cex))
7561
          return false;
7562
        if (!this.cex.equals(that.cex))
7563
          return false;
7564
      }
7565
 
7566
      return true;
7567
    }
7568
 
7569
    @Override
7570
    public int hashCode() {
7571
      return 0;
7572
    }
7573
 
103 ashish 7574
    public int compareTo(retireWarehouse_result other) {
100 ashish 7575
      if (!getClass().equals(other.getClass())) {
7576
        return getClass().getName().compareTo(other.getClass().getName());
7577
      }
7578
 
7579
      int lastComparison = 0;
103 ashish 7580
      retireWarehouse_result typedOther = (retireWarehouse_result)other;
100 ashish 7581
 
7582
      lastComparison = Boolean.valueOf(isSetCex()).compareTo(isSetCex());
7583
      if (lastComparison != 0) {
7584
        return lastComparison;
7585
      }
7586
      lastComparison = TBaseHelper.compareTo(cex, typedOther.cex);
7587
      if (lastComparison != 0) {
7588
        return lastComparison;
7589
      }
7590
      return 0;
7591
    }
7592
 
7593
    public void read(TProtocol iprot) throws TException {
7594
      TField field;
7595
      iprot.readStructBegin();
7596
      while (true)
7597
      {
7598
        field = iprot.readFieldBegin();
7599
        if (field.type == TType.STOP) { 
7600
          break;
7601
        }
7602
        _Fields fieldId = _Fields.findByThriftId(field.id);
7603
        if (fieldId == null) {
7604
          TProtocolUtil.skip(iprot, field.type);
7605
        } else {
7606
          switch (fieldId) {
7607
            case CEX:
7608
              if (field.type == TType.STRUCT) {
7609
                this.cex = new CatalogServiceException();
7610
                this.cex.read(iprot);
7611
              } else { 
7612
                TProtocolUtil.skip(iprot, field.type);
7613
              }
7614
              break;
7615
          }
7616
          iprot.readFieldEnd();
7617
        }
7618
      }
7619
      iprot.readStructEnd();
7620
      validate();
7621
    }
7622
 
7623
    public void write(TProtocol oprot) throws TException {
7624
      oprot.writeStructBegin(STRUCT_DESC);
7625
 
7626
      if (this.isSetCex()) {
7627
        oprot.writeFieldBegin(CEX_FIELD_DESC);
7628
        this.cex.write(oprot);
7629
        oprot.writeFieldEnd();
7630
      }
7631
      oprot.writeFieldStop();
7632
      oprot.writeStructEnd();
7633
    }
7634
 
7635
    @Override
7636
    public String toString() {
103 ashish 7637
      StringBuilder sb = new StringBuilder("retireWarehouse_result(");
100 ashish 7638
      boolean first = true;
7639
 
7640
      sb.append("cex:");
7641
      if (this.cex == null) {
7642
        sb.append("null");
7643
      } else {
7644
        sb.append(this.cex);
7645
      }
7646
      first = false;
7647
      sb.append(")");
7648
      return sb.toString();
7649
    }
7650
 
7651
    public void validate() throws TException {
7652
      // check for required fields
7653
    }
7654
 
7655
  }
7656
 
103 ashish 7657
  public static class startItemOn_args implements TBase<startItemOn_args._Fields>, java.io.Serializable, Cloneable, Comparable<startItemOn_args>   {
7658
    private static final TStruct STRUCT_DESC = new TStruct("startItemOn_args");
100 ashish 7659
 
7660
    private static final TField ITEM_ID_FIELD_DESC = new TField("item_id", TType.I64, (short)1);
103 ashish 7661
    private static final TField TIMESTAMP_FIELD_DESC = new TField("timestamp", TType.I64, (short)2);
100 ashish 7662
 
7663
    private long item_id;
7664
    private long timestamp;
7665
 
7666
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
7667
    public enum _Fields implements TFieldIdEnum {
7668
      ITEM_ID((short)1, "item_id"),
103 ashish 7669
      TIMESTAMP((short)2, "timestamp");
100 ashish 7670
 
7671
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
7672
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
7673
 
7674
      static {
7675
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
7676
          byId.put((int)field._thriftId, field);
7677
          byName.put(field.getFieldName(), field);
7678
        }
7679
      }
7680
 
7681
      /**
7682
       * Find the _Fields constant that matches fieldId, or null if its not found.
7683
       */
7684
      public static _Fields findByThriftId(int fieldId) {
7685
        return byId.get(fieldId);
7686
      }
7687
 
7688
      /**
7689
       * Find the _Fields constant that matches fieldId, throwing an exception
7690
       * if it is not found.
7691
       */
7692
      public static _Fields findByThriftIdOrThrow(int fieldId) {
7693
        _Fields fields = findByThriftId(fieldId);
7694
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
7695
        return fields;
7696
      }
7697
 
7698
      /**
7699
       * Find the _Fields constant that matches name, or null if its not found.
7700
       */
7701
      public static _Fields findByName(String name) {
7702
        return byName.get(name);
7703
      }
7704
 
7705
      private final short _thriftId;
7706
      private final String _fieldName;
7707
 
7708
      _Fields(short thriftId, String fieldName) {
7709
        _thriftId = thriftId;
7710
        _fieldName = fieldName;
7711
      }
7712
 
7713
      public short getThriftFieldId() {
7714
        return _thriftId;
7715
      }
7716
 
7717
      public String getFieldName() {
7718
        return _fieldName;
7719
      }
7720
    }
7721
 
7722
    // isset id assignments
7723
    private static final int __ITEM_ID_ISSET_ID = 0;
103 ashish 7724
    private static final int __TIMESTAMP_ISSET_ID = 1;
7725
    private BitSet __isset_bit_vector = new BitSet(2);
100 ashish 7726
 
7727
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
7728
      put(_Fields.ITEM_ID, new FieldMetaData("item_id", TFieldRequirementType.DEFAULT, 
7729
          new FieldValueMetaData(TType.I64)));
7730
      put(_Fields.TIMESTAMP, new FieldMetaData("timestamp", TFieldRequirementType.DEFAULT, 
7731
          new FieldValueMetaData(TType.I64)));
7732
    }});
7733
 
7734
    static {
103 ashish 7735
      FieldMetaData.addStructMetaDataMap(startItemOn_args.class, metaDataMap);
100 ashish 7736
    }
7737
 
103 ashish 7738
    public startItemOn_args() {
100 ashish 7739
    }
7740
 
103 ashish 7741
    public startItemOn_args(
100 ashish 7742
      long item_id,
7743
      long timestamp)
7744
    {
7745
      this();
7746
      this.item_id = item_id;
7747
      setItem_idIsSet(true);
7748
      this.timestamp = timestamp;
7749
      setTimestampIsSet(true);
7750
    }
7751
 
7752
    /**
7753
     * Performs a deep copy on <i>other</i>.
7754
     */
103 ashish 7755
    public startItemOn_args(startItemOn_args other) {
100 ashish 7756
      __isset_bit_vector.clear();
7757
      __isset_bit_vector.or(other.__isset_bit_vector);
7758
      this.item_id = other.item_id;
7759
      this.timestamp = other.timestamp;
7760
    }
7761
 
103 ashish 7762
    public startItemOn_args deepCopy() {
7763
      return new startItemOn_args(this);
100 ashish 7764
    }
7765
 
7766
    @Deprecated
103 ashish 7767
    public startItemOn_args clone() {
7768
      return new startItemOn_args(this);
100 ashish 7769
    }
7770
 
7771
    public long getItem_id() {
7772
      return this.item_id;
7773
    }
7774
 
103 ashish 7775
    public startItemOn_args setItem_id(long item_id) {
100 ashish 7776
      this.item_id = item_id;
7777
      setItem_idIsSet(true);
7778
      return this;
7779
    }
7780
 
7781
    public void unsetItem_id() {
7782
      __isset_bit_vector.clear(__ITEM_ID_ISSET_ID);
7783
    }
7784
 
7785
    /** Returns true if field item_id is set (has been asigned a value) and false otherwise */
7786
    public boolean isSetItem_id() {
7787
      return __isset_bit_vector.get(__ITEM_ID_ISSET_ID);
7788
    }
7789
 
7790
    public void setItem_idIsSet(boolean value) {
7791
      __isset_bit_vector.set(__ITEM_ID_ISSET_ID, value);
7792
    }
7793
 
103 ashish 7794
    public long getTimestamp() {
7795
      return this.timestamp;
100 ashish 7796
    }
7797
 
103 ashish 7798
    public startItemOn_args setTimestamp(long timestamp) {
7799
      this.timestamp = timestamp;
7800
      setTimestampIsSet(true);
100 ashish 7801
      return this;
7802
    }
7803
 
103 ashish 7804
    public void unsetTimestamp() {
7805
      __isset_bit_vector.clear(__TIMESTAMP_ISSET_ID);
100 ashish 7806
    }
7807
 
103 ashish 7808
    /** Returns true if field timestamp is set (has been asigned a value) and false otherwise */
7809
    public boolean isSetTimestamp() {
7810
      return __isset_bit_vector.get(__TIMESTAMP_ISSET_ID);
100 ashish 7811
    }
7812
 
103 ashish 7813
    public void setTimestampIsSet(boolean value) {
7814
      __isset_bit_vector.set(__TIMESTAMP_ISSET_ID, value);
100 ashish 7815
    }
7816
 
103 ashish 7817
    public void setFieldValue(_Fields field, Object value) {
7818
      switch (field) {
7819
      case ITEM_ID:
7820
        if (value == null) {
7821
          unsetItem_id();
7822
        } else {
7823
          setItem_id((Long)value);
7824
        }
7825
        break;
7826
 
7827
      case TIMESTAMP:
7828
        if (value == null) {
7829
          unsetTimestamp();
7830
        } else {
7831
          setTimestamp((Long)value);
7832
        }
7833
        break;
7834
 
7835
      }
100 ashish 7836
    }
7837
 
103 ashish 7838
    public void setFieldValue(int fieldID, Object value) {
7839
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
7840
    }
7841
 
7842
    public Object getFieldValue(_Fields field) {
7843
      switch (field) {
7844
      case ITEM_ID:
7845
        return new Long(getItem_id());
7846
 
7847
      case TIMESTAMP:
7848
        return new Long(getTimestamp());
7849
 
7850
      }
7851
      throw new IllegalStateException();
7852
    }
7853
 
7854
    public Object getFieldValue(int fieldId) {
7855
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
7856
    }
7857
 
7858
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
7859
    public boolean isSet(_Fields field) {
7860
      switch (field) {
7861
      case ITEM_ID:
7862
        return isSetItem_id();
7863
      case TIMESTAMP:
7864
        return isSetTimestamp();
7865
      }
7866
      throw new IllegalStateException();
7867
    }
7868
 
7869
    public boolean isSet(int fieldID) {
7870
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
7871
    }
7872
 
7873
    @Override
7874
    public boolean equals(Object that) {
7875
      if (that == null)
7876
        return false;
7877
      if (that instanceof startItemOn_args)
7878
        return this.equals((startItemOn_args)that);
7879
      return false;
7880
    }
7881
 
7882
    public boolean equals(startItemOn_args that) {
7883
      if (that == null)
7884
        return false;
7885
 
7886
      boolean this_present_item_id = true;
7887
      boolean that_present_item_id = true;
7888
      if (this_present_item_id || that_present_item_id) {
7889
        if (!(this_present_item_id && that_present_item_id))
7890
          return false;
7891
        if (this.item_id != that.item_id)
7892
          return false;
7893
      }
7894
 
7895
      boolean this_present_timestamp = true;
7896
      boolean that_present_timestamp = true;
7897
      if (this_present_timestamp || that_present_timestamp) {
7898
        if (!(this_present_timestamp && that_present_timestamp))
7899
          return false;
7900
        if (this.timestamp != that.timestamp)
7901
          return false;
7902
      }
7903
 
7904
      return true;
7905
    }
7906
 
7907
    @Override
7908
    public int hashCode() {
7909
      return 0;
7910
    }
7911
 
7912
    public int compareTo(startItemOn_args other) {
7913
      if (!getClass().equals(other.getClass())) {
7914
        return getClass().getName().compareTo(other.getClass().getName());
7915
      }
7916
 
7917
      int lastComparison = 0;
7918
      startItemOn_args typedOther = (startItemOn_args)other;
7919
 
7920
      lastComparison = Boolean.valueOf(isSetItem_id()).compareTo(isSetItem_id());
7921
      if (lastComparison != 0) {
7922
        return lastComparison;
7923
      }
7924
      lastComparison = TBaseHelper.compareTo(item_id, typedOther.item_id);
7925
      if (lastComparison != 0) {
7926
        return lastComparison;
7927
      }
7928
      lastComparison = Boolean.valueOf(isSetTimestamp()).compareTo(isSetTimestamp());
7929
      if (lastComparison != 0) {
7930
        return lastComparison;
7931
      }
7932
      lastComparison = TBaseHelper.compareTo(timestamp, typedOther.timestamp);
7933
      if (lastComparison != 0) {
7934
        return lastComparison;
7935
      }
7936
      return 0;
7937
    }
7938
 
7939
    public void read(TProtocol iprot) throws TException {
7940
      TField field;
7941
      iprot.readStructBegin();
7942
      while (true)
7943
      {
7944
        field = iprot.readFieldBegin();
7945
        if (field.type == TType.STOP) { 
7946
          break;
7947
        }
7948
        _Fields fieldId = _Fields.findByThriftId(field.id);
7949
        if (fieldId == null) {
7950
          TProtocolUtil.skip(iprot, field.type);
7951
        } else {
7952
          switch (fieldId) {
7953
            case ITEM_ID:
7954
              if (field.type == TType.I64) {
7955
                this.item_id = iprot.readI64();
7956
                setItem_idIsSet(true);
7957
              } else { 
7958
                TProtocolUtil.skip(iprot, field.type);
7959
              }
7960
              break;
7961
            case TIMESTAMP:
7962
              if (field.type == TType.I64) {
7963
                this.timestamp = iprot.readI64();
7964
                setTimestampIsSet(true);
7965
              } else { 
7966
                TProtocolUtil.skip(iprot, field.type);
7967
              }
7968
              break;
7969
          }
7970
          iprot.readFieldEnd();
7971
        }
7972
      }
7973
      iprot.readStructEnd();
7974
      validate();
7975
    }
7976
 
7977
    public void write(TProtocol oprot) throws TException {
7978
      validate();
7979
 
7980
      oprot.writeStructBegin(STRUCT_DESC);
7981
      oprot.writeFieldBegin(ITEM_ID_FIELD_DESC);
7982
      oprot.writeI64(this.item_id);
7983
      oprot.writeFieldEnd();
7984
      oprot.writeFieldBegin(TIMESTAMP_FIELD_DESC);
7985
      oprot.writeI64(this.timestamp);
7986
      oprot.writeFieldEnd();
7987
      oprot.writeFieldStop();
7988
      oprot.writeStructEnd();
7989
    }
7990
 
7991
    @Override
7992
    public String toString() {
7993
      StringBuilder sb = new StringBuilder("startItemOn_args(");
7994
      boolean first = true;
7995
 
7996
      sb.append("item_id:");
7997
      sb.append(this.item_id);
7998
      first = false;
7999
      if (!first) sb.append(", ");
8000
      sb.append("timestamp:");
8001
      sb.append(this.timestamp);
8002
      first = false;
8003
      sb.append(")");
8004
      return sb.toString();
8005
    }
8006
 
8007
    public void validate() throws TException {
8008
      // check for required fields
8009
    }
8010
 
8011
  }
8012
 
8013
  public static class startItemOn_result implements TBase<startItemOn_result._Fields>, java.io.Serializable, Cloneable, Comparable<startItemOn_result>   {
8014
    private static final TStruct STRUCT_DESC = new TStruct("startItemOn_result");
8015
 
8016
    private static final TField CEX_FIELD_DESC = new TField("cex", TType.STRUCT, (short)1);
8017
 
8018
    private CatalogServiceException cex;
8019
 
8020
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
8021
    public enum _Fields implements TFieldIdEnum {
8022
      CEX((short)1, "cex");
8023
 
8024
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
8025
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
8026
 
8027
      static {
8028
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
8029
          byId.put((int)field._thriftId, field);
8030
          byName.put(field.getFieldName(), field);
8031
        }
8032
      }
8033
 
8034
      /**
8035
       * Find the _Fields constant that matches fieldId, or null if its not found.
8036
       */
8037
      public static _Fields findByThriftId(int fieldId) {
8038
        return byId.get(fieldId);
8039
      }
8040
 
8041
      /**
8042
       * Find the _Fields constant that matches fieldId, throwing an exception
8043
       * if it is not found.
8044
       */
8045
      public static _Fields findByThriftIdOrThrow(int fieldId) {
8046
        _Fields fields = findByThriftId(fieldId);
8047
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
8048
        return fields;
8049
      }
8050
 
8051
      /**
8052
       * Find the _Fields constant that matches name, or null if its not found.
8053
       */
8054
      public static _Fields findByName(String name) {
8055
        return byName.get(name);
8056
      }
8057
 
8058
      private final short _thriftId;
8059
      private final String _fieldName;
8060
 
8061
      _Fields(short thriftId, String fieldName) {
8062
        _thriftId = thriftId;
8063
        _fieldName = fieldName;
8064
      }
8065
 
8066
      public short getThriftFieldId() {
8067
        return _thriftId;
8068
      }
8069
 
8070
      public String getFieldName() {
8071
        return _fieldName;
8072
      }
8073
    }
8074
 
8075
    // isset id assignments
8076
 
8077
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
8078
      put(_Fields.CEX, new FieldMetaData("cex", TFieldRequirementType.DEFAULT, 
8079
          new FieldValueMetaData(TType.STRUCT)));
8080
    }});
8081
 
8082
    static {
8083
      FieldMetaData.addStructMetaDataMap(startItemOn_result.class, metaDataMap);
8084
    }
8085
 
8086
    public startItemOn_result() {
8087
    }
8088
 
8089
    public startItemOn_result(
8090
      CatalogServiceException cex)
8091
    {
8092
      this();
8093
      this.cex = cex;
8094
    }
8095
 
8096
    /**
8097
     * Performs a deep copy on <i>other</i>.
8098
     */
8099
    public startItemOn_result(startItemOn_result other) {
8100
      if (other.isSetCex()) {
8101
        this.cex = new CatalogServiceException(other.cex);
8102
      }
8103
    }
8104
 
8105
    public startItemOn_result deepCopy() {
8106
      return new startItemOn_result(this);
8107
    }
8108
 
8109
    @Deprecated
8110
    public startItemOn_result clone() {
8111
      return new startItemOn_result(this);
8112
    }
8113
 
8114
    public CatalogServiceException getCex() {
8115
      return this.cex;
8116
    }
8117
 
8118
    public startItemOn_result setCex(CatalogServiceException cex) {
8119
      this.cex = cex;
100 ashish 8120
      return this;
8121
    }
8122
 
103 ashish 8123
    public void unsetCex() {
8124
      this.cex = null;
100 ashish 8125
    }
8126
 
103 ashish 8127
    /** Returns true if field cex is set (has been asigned a value) and false otherwise */
8128
    public boolean isSetCex() {
8129
      return this.cex != null;
100 ashish 8130
    }
8131
 
103 ashish 8132
    public void setCexIsSet(boolean value) {
8133
      if (!value) {
8134
        this.cex = null;
8135
      }
100 ashish 8136
    }
8137
 
103 ashish 8138
    public void setFieldValue(_Fields field, Object value) {
8139
      switch (field) {
8140
      case CEX:
8141
        if (value == null) {
8142
          unsetCex();
8143
        } else {
8144
          setCex((CatalogServiceException)value);
8145
        }
8146
        break;
8147
 
8148
      }
8149
    }
8150
 
8151
    public void setFieldValue(int fieldID, Object value) {
8152
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
8153
    }
8154
 
8155
    public Object getFieldValue(_Fields field) {
8156
      switch (field) {
8157
      case CEX:
8158
        return getCex();
8159
 
8160
      }
8161
      throw new IllegalStateException();
8162
    }
8163
 
8164
    public Object getFieldValue(int fieldId) {
8165
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
8166
    }
8167
 
8168
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
8169
    public boolean isSet(_Fields field) {
8170
      switch (field) {
8171
      case CEX:
8172
        return isSetCex();
8173
      }
8174
      throw new IllegalStateException();
8175
    }
8176
 
8177
    public boolean isSet(int fieldID) {
8178
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
8179
    }
8180
 
8181
    @Override
8182
    public boolean equals(Object that) {
8183
      if (that == null)
8184
        return false;
8185
      if (that instanceof startItemOn_result)
8186
        return this.equals((startItemOn_result)that);
8187
      return false;
8188
    }
8189
 
8190
    public boolean equals(startItemOn_result that) {
8191
      if (that == null)
8192
        return false;
8193
 
8194
      boolean this_present_cex = true && this.isSetCex();
8195
      boolean that_present_cex = true && that.isSetCex();
8196
      if (this_present_cex || that_present_cex) {
8197
        if (!(this_present_cex && that_present_cex))
8198
          return false;
8199
        if (!this.cex.equals(that.cex))
8200
          return false;
8201
      }
8202
 
8203
      return true;
8204
    }
8205
 
8206
    @Override
8207
    public int hashCode() {
8208
      return 0;
8209
    }
8210
 
8211
    public int compareTo(startItemOn_result other) {
8212
      if (!getClass().equals(other.getClass())) {
8213
        return getClass().getName().compareTo(other.getClass().getName());
8214
      }
8215
 
8216
      int lastComparison = 0;
8217
      startItemOn_result typedOther = (startItemOn_result)other;
8218
 
8219
      lastComparison = Boolean.valueOf(isSetCex()).compareTo(isSetCex());
8220
      if (lastComparison != 0) {
8221
        return lastComparison;
8222
      }
8223
      lastComparison = TBaseHelper.compareTo(cex, typedOther.cex);
8224
      if (lastComparison != 0) {
8225
        return lastComparison;
8226
      }
8227
      return 0;
8228
    }
8229
 
8230
    public void read(TProtocol iprot) throws TException {
8231
      TField field;
8232
      iprot.readStructBegin();
8233
      while (true)
8234
      {
8235
        field = iprot.readFieldBegin();
8236
        if (field.type == TType.STOP) { 
8237
          break;
8238
        }
8239
        _Fields fieldId = _Fields.findByThriftId(field.id);
8240
        if (fieldId == null) {
8241
          TProtocolUtil.skip(iprot, field.type);
8242
        } else {
8243
          switch (fieldId) {
8244
            case CEX:
8245
              if (field.type == TType.STRUCT) {
8246
                this.cex = new CatalogServiceException();
8247
                this.cex.read(iprot);
8248
              } else { 
8249
                TProtocolUtil.skip(iprot, field.type);
8250
              }
8251
              break;
8252
          }
8253
          iprot.readFieldEnd();
8254
        }
8255
      }
8256
      iprot.readStructEnd();
8257
      validate();
8258
    }
8259
 
8260
    public void write(TProtocol oprot) throws TException {
8261
      oprot.writeStructBegin(STRUCT_DESC);
8262
 
8263
      if (this.isSetCex()) {
8264
        oprot.writeFieldBegin(CEX_FIELD_DESC);
8265
        this.cex.write(oprot);
8266
        oprot.writeFieldEnd();
8267
      }
8268
      oprot.writeFieldStop();
8269
      oprot.writeStructEnd();
8270
    }
8271
 
8272
    @Override
8273
    public String toString() {
8274
      StringBuilder sb = new StringBuilder("startItemOn_result(");
8275
      boolean first = true;
8276
 
8277
      sb.append("cex:");
8278
      if (this.cex == null) {
8279
        sb.append("null");
8280
      } else {
8281
        sb.append(this.cex);
8282
      }
8283
      first = false;
8284
      sb.append(")");
8285
      return sb.toString();
8286
    }
8287
 
8288
    public void validate() throws TException {
8289
      // check for required fields
8290
    }
8291
 
8292
  }
8293
 
8294
  public static class retireItemOn_args implements TBase<retireItemOn_args._Fields>, java.io.Serializable, Cloneable, Comparable<retireItemOn_args>   {
8295
    private static final TStruct STRUCT_DESC = new TStruct("retireItemOn_args");
8296
 
8297
    private static final TField ITEM_ID_FIELD_DESC = new TField("item_id", TType.I64, (short)1);
8298
    private static final TField TIMESTAMP_FIELD_DESC = new TField("timestamp", TType.I64, (short)2);
8299
 
8300
    private long item_id;
8301
    private long timestamp;
8302
 
8303
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
8304
    public enum _Fields implements TFieldIdEnum {
8305
      ITEM_ID((short)1, "item_id"),
8306
      TIMESTAMP((short)2, "timestamp");
8307
 
8308
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
8309
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
8310
 
8311
      static {
8312
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
8313
          byId.put((int)field._thriftId, field);
8314
          byName.put(field.getFieldName(), field);
8315
        }
8316
      }
8317
 
8318
      /**
8319
       * Find the _Fields constant that matches fieldId, or null if its not found.
8320
       */
8321
      public static _Fields findByThriftId(int fieldId) {
8322
        return byId.get(fieldId);
8323
      }
8324
 
8325
      /**
8326
       * Find the _Fields constant that matches fieldId, throwing an exception
8327
       * if it is not found.
8328
       */
8329
      public static _Fields findByThriftIdOrThrow(int fieldId) {
8330
        _Fields fields = findByThriftId(fieldId);
8331
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
8332
        return fields;
8333
      }
8334
 
8335
      /**
8336
       * Find the _Fields constant that matches name, or null if its not found.
8337
       */
8338
      public static _Fields findByName(String name) {
8339
        return byName.get(name);
8340
      }
8341
 
8342
      private final short _thriftId;
8343
      private final String _fieldName;
8344
 
8345
      _Fields(short thriftId, String fieldName) {
8346
        _thriftId = thriftId;
8347
        _fieldName = fieldName;
8348
      }
8349
 
8350
      public short getThriftFieldId() {
8351
        return _thriftId;
8352
      }
8353
 
8354
      public String getFieldName() {
8355
        return _fieldName;
8356
      }
8357
    }
8358
 
8359
    // isset id assignments
8360
    private static final int __ITEM_ID_ISSET_ID = 0;
8361
    private static final int __TIMESTAMP_ISSET_ID = 1;
8362
    private BitSet __isset_bit_vector = new BitSet(2);
8363
 
8364
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
8365
      put(_Fields.ITEM_ID, new FieldMetaData("item_id", TFieldRequirementType.DEFAULT, 
8366
          new FieldValueMetaData(TType.I64)));
8367
      put(_Fields.TIMESTAMP, new FieldMetaData("timestamp", TFieldRequirementType.DEFAULT, 
8368
          new FieldValueMetaData(TType.I64)));
8369
    }});
8370
 
8371
    static {
8372
      FieldMetaData.addStructMetaDataMap(retireItemOn_args.class, metaDataMap);
8373
    }
8374
 
8375
    public retireItemOn_args() {
8376
    }
8377
 
8378
    public retireItemOn_args(
8379
      long item_id,
8380
      long timestamp)
8381
    {
8382
      this();
8383
      this.item_id = item_id;
8384
      setItem_idIsSet(true);
8385
      this.timestamp = timestamp;
8386
      setTimestampIsSet(true);
8387
    }
8388
 
8389
    /**
8390
     * Performs a deep copy on <i>other</i>.
8391
     */
8392
    public retireItemOn_args(retireItemOn_args other) {
8393
      __isset_bit_vector.clear();
8394
      __isset_bit_vector.or(other.__isset_bit_vector);
8395
      this.item_id = other.item_id;
8396
      this.timestamp = other.timestamp;
8397
    }
8398
 
8399
    public retireItemOn_args deepCopy() {
8400
      return new retireItemOn_args(this);
8401
    }
8402
 
8403
    @Deprecated
8404
    public retireItemOn_args clone() {
8405
      return new retireItemOn_args(this);
8406
    }
8407
 
8408
    public long getItem_id() {
8409
      return this.item_id;
8410
    }
8411
 
8412
    public retireItemOn_args setItem_id(long item_id) {
8413
      this.item_id = item_id;
8414
      setItem_idIsSet(true);
8415
      return this;
8416
    }
8417
 
8418
    public void unsetItem_id() {
8419
      __isset_bit_vector.clear(__ITEM_ID_ISSET_ID);
8420
    }
8421
 
8422
    /** Returns true if field item_id is set (has been asigned a value) and false otherwise */
8423
    public boolean isSetItem_id() {
8424
      return __isset_bit_vector.get(__ITEM_ID_ISSET_ID);
8425
    }
8426
 
8427
    public void setItem_idIsSet(boolean value) {
8428
      __isset_bit_vector.set(__ITEM_ID_ISSET_ID, value);
8429
    }
8430
 
100 ashish 8431
    public long getTimestamp() {
8432
      return this.timestamp;
8433
    }
8434
 
103 ashish 8435
    public retireItemOn_args setTimestamp(long timestamp) {
100 ashish 8436
      this.timestamp = timestamp;
8437
      setTimestampIsSet(true);
8438
      return this;
8439
    }
8440
 
8441
    public void unsetTimestamp() {
8442
      __isset_bit_vector.clear(__TIMESTAMP_ISSET_ID);
8443
    }
8444
 
8445
    /** Returns true if field timestamp is set (has been asigned a value) and false otherwise */
8446
    public boolean isSetTimestamp() {
8447
      return __isset_bit_vector.get(__TIMESTAMP_ISSET_ID);
8448
    }
8449
 
8450
    public void setTimestampIsSet(boolean value) {
8451
      __isset_bit_vector.set(__TIMESTAMP_ISSET_ID, value);
8452
    }
8453
 
8454
    public void setFieldValue(_Fields field, Object value) {
8455
      switch (field) {
8456
      case ITEM_ID:
8457
        if (value == null) {
8458
          unsetItem_id();
8459
        } else {
8460
          setItem_id((Long)value);
8461
        }
8462
        break;
8463
 
103 ashish 8464
      case TIMESTAMP:
100 ashish 8465
        if (value == null) {
103 ashish 8466
          unsetTimestamp();
100 ashish 8467
        } else {
103 ashish 8468
          setTimestamp((Long)value);
100 ashish 8469
        }
8470
        break;
8471
 
103 ashish 8472
      }
8473
    }
8474
 
8475
    public void setFieldValue(int fieldID, Object value) {
8476
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
8477
    }
8478
 
8479
    public Object getFieldValue(_Fields field) {
8480
      switch (field) {
8481
      case ITEM_ID:
8482
        return new Long(getItem_id());
8483
 
8484
      case TIMESTAMP:
8485
        return new Long(getTimestamp());
8486
 
8487
      }
8488
      throw new IllegalStateException();
8489
    }
8490
 
8491
    public Object getFieldValue(int fieldId) {
8492
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
8493
    }
8494
 
8495
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
8496
    public boolean isSet(_Fields field) {
8497
      switch (field) {
8498
      case ITEM_ID:
8499
        return isSetItem_id();
8500
      case TIMESTAMP:
8501
        return isSetTimestamp();
8502
      }
8503
      throw new IllegalStateException();
8504
    }
8505
 
8506
    public boolean isSet(int fieldID) {
8507
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
8508
    }
8509
 
8510
    @Override
8511
    public boolean equals(Object that) {
8512
      if (that == null)
8513
        return false;
8514
      if (that instanceof retireItemOn_args)
8515
        return this.equals((retireItemOn_args)that);
8516
      return false;
8517
    }
8518
 
8519
    public boolean equals(retireItemOn_args that) {
8520
      if (that == null)
8521
        return false;
8522
 
8523
      boolean this_present_item_id = true;
8524
      boolean that_present_item_id = true;
8525
      if (this_present_item_id || that_present_item_id) {
8526
        if (!(this_present_item_id && that_present_item_id))
8527
          return false;
8528
        if (this.item_id != that.item_id)
8529
          return false;
8530
      }
8531
 
8532
      boolean this_present_timestamp = true;
8533
      boolean that_present_timestamp = true;
8534
      if (this_present_timestamp || that_present_timestamp) {
8535
        if (!(this_present_timestamp && that_present_timestamp))
8536
          return false;
8537
        if (this.timestamp != that.timestamp)
8538
          return false;
8539
      }
8540
 
8541
      return true;
8542
    }
8543
 
8544
    @Override
8545
    public int hashCode() {
8546
      return 0;
8547
    }
8548
 
8549
    public int compareTo(retireItemOn_args other) {
8550
      if (!getClass().equals(other.getClass())) {
8551
        return getClass().getName().compareTo(other.getClass().getName());
8552
      }
8553
 
8554
      int lastComparison = 0;
8555
      retireItemOn_args typedOther = (retireItemOn_args)other;
8556
 
8557
      lastComparison = Boolean.valueOf(isSetItem_id()).compareTo(isSetItem_id());
8558
      if (lastComparison != 0) {
8559
        return lastComparison;
8560
      }
8561
      lastComparison = TBaseHelper.compareTo(item_id, typedOther.item_id);
8562
      if (lastComparison != 0) {
8563
        return lastComparison;
8564
      }
8565
      lastComparison = Boolean.valueOf(isSetTimestamp()).compareTo(isSetTimestamp());
8566
      if (lastComparison != 0) {
8567
        return lastComparison;
8568
      }
8569
      lastComparison = TBaseHelper.compareTo(timestamp, typedOther.timestamp);
8570
      if (lastComparison != 0) {
8571
        return lastComparison;
8572
      }
8573
      return 0;
8574
    }
8575
 
8576
    public void read(TProtocol iprot) throws TException {
8577
      TField field;
8578
      iprot.readStructBegin();
8579
      while (true)
8580
      {
8581
        field = iprot.readFieldBegin();
8582
        if (field.type == TType.STOP) { 
8583
          break;
8584
        }
8585
        _Fields fieldId = _Fields.findByThriftId(field.id);
8586
        if (fieldId == null) {
8587
          TProtocolUtil.skip(iprot, field.type);
8588
        } else {
8589
          switch (fieldId) {
8590
            case ITEM_ID:
8591
              if (field.type == TType.I64) {
8592
                this.item_id = iprot.readI64();
8593
                setItem_idIsSet(true);
8594
              } else { 
8595
                TProtocolUtil.skip(iprot, field.type);
8596
              }
8597
              break;
8598
            case TIMESTAMP:
8599
              if (field.type == TType.I64) {
8600
                this.timestamp = iprot.readI64();
8601
                setTimestampIsSet(true);
8602
              } else { 
8603
                TProtocolUtil.skip(iprot, field.type);
8604
              }
8605
              break;
8606
          }
8607
          iprot.readFieldEnd();
8608
        }
8609
      }
8610
      iprot.readStructEnd();
8611
      validate();
8612
    }
8613
 
8614
    public void write(TProtocol oprot) throws TException {
8615
      validate();
8616
 
8617
      oprot.writeStructBegin(STRUCT_DESC);
8618
      oprot.writeFieldBegin(ITEM_ID_FIELD_DESC);
8619
      oprot.writeI64(this.item_id);
8620
      oprot.writeFieldEnd();
8621
      oprot.writeFieldBegin(TIMESTAMP_FIELD_DESC);
8622
      oprot.writeI64(this.timestamp);
8623
      oprot.writeFieldEnd();
8624
      oprot.writeFieldStop();
8625
      oprot.writeStructEnd();
8626
    }
8627
 
8628
    @Override
8629
    public String toString() {
8630
      StringBuilder sb = new StringBuilder("retireItemOn_args(");
8631
      boolean first = true;
8632
 
8633
      sb.append("item_id:");
8634
      sb.append(this.item_id);
8635
      first = false;
8636
      if (!first) sb.append(", ");
8637
      sb.append("timestamp:");
8638
      sb.append(this.timestamp);
8639
      first = false;
8640
      sb.append(")");
8641
      return sb.toString();
8642
    }
8643
 
8644
    public void validate() throws TException {
8645
      // check for required fields
8646
    }
8647
 
8648
  }
8649
 
8650
  public static class retireItemOn_result implements TBase<retireItemOn_result._Fields>, java.io.Serializable, Cloneable, Comparable<retireItemOn_result>   {
8651
    private static final TStruct STRUCT_DESC = new TStruct("retireItemOn_result");
8652
 
8653
    private static final TField CEX_FIELD_DESC = new TField("cex", TType.STRUCT, (short)1);
8654
 
8655
    private CatalogServiceException cex;
8656
 
8657
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
8658
    public enum _Fields implements TFieldIdEnum {
8659
      CEX((short)1, "cex");
8660
 
8661
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
8662
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
8663
 
8664
      static {
8665
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
8666
          byId.put((int)field._thriftId, field);
8667
          byName.put(field.getFieldName(), field);
8668
        }
8669
      }
8670
 
8671
      /**
8672
       * Find the _Fields constant that matches fieldId, or null if its not found.
8673
       */
8674
      public static _Fields findByThriftId(int fieldId) {
8675
        return byId.get(fieldId);
8676
      }
8677
 
8678
      /**
8679
       * Find the _Fields constant that matches fieldId, throwing an exception
8680
       * if it is not found.
8681
       */
8682
      public static _Fields findByThriftIdOrThrow(int fieldId) {
8683
        _Fields fields = findByThriftId(fieldId);
8684
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
8685
        return fields;
8686
      }
8687
 
8688
      /**
8689
       * Find the _Fields constant that matches name, or null if its not found.
8690
       */
8691
      public static _Fields findByName(String name) {
8692
        return byName.get(name);
8693
      }
8694
 
8695
      private final short _thriftId;
8696
      private final String _fieldName;
8697
 
8698
      _Fields(short thriftId, String fieldName) {
8699
        _thriftId = thriftId;
8700
        _fieldName = fieldName;
8701
      }
8702
 
8703
      public short getThriftFieldId() {
8704
        return _thriftId;
8705
      }
8706
 
8707
      public String getFieldName() {
8708
        return _fieldName;
8709
      }
8710
    }
8711
 
8712
    // isset id assignments
8713
 
8714
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
8715
      put(_Fields.CEX, new FieldMetaData("cex", TFieldRequirementType.DEFAULT, 
8716
          new FieldValueMetaData(TType.STRUCT)));
8717
    }});
8718
 
8719
    static {
8720
      FieldMetaData.addStructMetaDataMap(retireItemOn_result.class, metaDataMap);
8721
    }
8722
 
8723
    public retireItemOn_result() {
8724
    }
8725
 
8726
    public retireItemOn_result(
8727
      CatalogServiceException cex)
8728
    {
8729
      this();
8730
      this.cex = cex;
8731
    }
8732
 
8733
    /**
8734
     * Performs a deep copy on <i>other</i>.
8735
     */
8736
    public retireItemOn_result(retireItemOn_result other) {
8737
      if (other.isSetCex()) {
8738
        this.cex = new CatalogServiceException(other.cex);
8739
      }
8740
    }
8741
 
8742
    public retireItemOn_result deepCopy() {
8743
      return new retireItemOn_result(this);
8744
    }
8745
 
8746
    @Deprecated
8747
    public retireItemOn_result clone() {
8748
      return new retireItemOn_result(this);
8749
    }
8750
 
8751
    public CatalogServiceException getCex() {
8752
      return this.cex;
8753
    }
8754
 
8755
    public retireItemOn_result setCex(CatalogServiceException cex) {
8756
      this.cex = cex;
8757
      return this;
8758
    }
8759
 
8760
    public void unsetCex() {
8761
      this.cex = null;
8762
    }
8763
 
8764
    /** Returns true if field cex is set (has been asigned a value) and false otherwise */
8765
    public boolean isSetCex() {
8766
      return this.cex != null;
8767
    }
8768
 
8769
    public void setCexIsSet(boolean value) {
8770
      if (!value) {
8771
        this.cex = null;
8772
      }
8773
    }
8774
 
8775
    public void setFieldValue(_Fields field, Object value) {
8776
      switch (field) {
8777
      case CEX:
100 ashish 8778
        if (value == null) {
103 ashish 8779
          unsetCex();
100 ashish 8780
        } else {
103 ashish 8781
          setCex((CatalogServiceException)value);
100 ashish 8782
        }
8783
        break;
8784
 
103 ashish 8785
      }
8786
    }
8787
 
8788
    public void setFieldValue(int fieldID, Object value) {
8789
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
8790
    }
8791
 
8792
    public Object getFieldValue(_Fields field) {
8793
      switch (field) {
8794
      case CEX:
8795
        return getCex();
8796
 
8797
      }
8798
      throw new IllegalStateException();
8799
    }
8800
 
8801
    public Object getFieldValue(int fieldId) {
8802
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
8803
    }
8804
 
8805
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
8806
    public boolean isSet(_Fields field) {
8807
      switch (field) {
8808
      case CEX:
8809
        return isSetCex();
8810
      }
8811
      throw new IllegalStateException();
8812
    }
8813
 
8814
    public boolean isSet(int fieldID) {
8815
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
8816
    }
8817
 
8818
    @Override
8819
    public boolean equals(Object that) {
8820
      if (that == null)
8821
        return false;
8822
      if (that instanceof retireItemOn_result)
8823
        return this.equals((retireItemOn_result)that);
8824
      return false;
8825
    }
8826
 
8827
    public boolean equals(retireItemOn_result that) {
8828
      if (that == null)
8829
        return false;
8830
 
8831
      boolean this_present_cex = true && this.isSetCex();
8832
      boolean that_present_cex = true && that.isSetCex();
8833
      if (this_present_cex || that_present_cex) {
8834
        if (!(this_present_cex && that_present_cex))
8835
          return false;
8836
        if (!this.cex.equals(that.cex))
8837
          return false;
8838
      }
8839
 
8840
      return true;
8841
    }
8842
 
8843
    @Override
8844
    public int hashCode() {
8845
      return 0;
8846
    }
8847
 
8848
    public int compareTo(retireItemOn_result other) {
8849
      if (!getClass().equals(other.getClass())) {
8850
        return getClass().getName().compareTo(other.getClass().getName());
8851
      }
8852
 
8853
      int lastComparison = 0;
8854
      retireItemOn_result typedOther = (retireItemOn_result)other;
8855
 
8856
      lastComparison = Boolean.valueOf(isSetCex()).compareTo(isSetCex());
8857
      if (lastComparison != 0) {
8858
        return lastComparison;
8859
      }
8860
      lastComparison = TBaseHelper.compareTo(cex, typedOther.cex);
8861
      if (lastComparison != 0) {
8862
        return lastComparison;
8863
      }
8864
      return 0;
8865
    }
8866
 
8867
    public void read(TProtocol iprot) throws TException {
8868
      TField field;
8869
      iprot.readStructBegin();
8870
      while (true)
8871
      {
8872
        field = iprot.readFieldBegin();
8873
        if (field.type == TType.STOP) { 
8874
          break;
8875
        }
8876
        _Fields fieldId = _Fields.findByThriftId(field.id);
8877
        if (fieldId == null) {
8878
          TProtocolUtil.skip(iprot, field.type);
8879
        } else {
8880
          switch (fieldId) {
8881
            case CEX:
8882
              if (field.type == TType.STRUCT) {
8883
                this.cex = new CatalogServiceException();
8884
                this.cex.read(iprot);
8885
              } else { 
8886
                TProtocolUtil.skip(iprot, field.type);
8887
              }
8888
              break;
8889
          }
8890
          iprot.readFieldEnd();
8891
        }
8892
      }
8893
      iprot.readStructEnd();
8894
      validate();
8895
    }
8896
 
8897
    public void write(TProtocol oprot) throws TException {
8898
      oprot.writeStructBegin(STRUCT_DESC);
8899
 
8900
      if (this.isSetCex()) {
8901
        oprot.writeFieldBegin(CEX_FIELD_DESC);
8902
        this.cex.write(oprot);
8903
        oprot.writeFieldEnd();
8904
      }
8905
      oprot.writeFieldStop();
8906
      oprot.writeStructEnd();
8907
    }
8908
 
8909
    @Override
8910
    public String toString() {
8911
      StringBuilder sb = new StringBuilder("retireItemOn_result(");
8912
      boolean first = true;
8913
 
8914
      sb.append("cex:");
8915
      if (this.cex == null) {
8916
        sb.append("null");
8917
      } else {
8918
        sb.append(this.cex);
8919
      }
8920
      first = false;
8921
      sb.append(")");
8922
      return sb.toString();
8923
    }
8924
 
8925
    public void validate() throws TException {
8926
      // check for required fields
8927
    }
8928
 
8929
  }
8930
 
8931
  public static class changeItemStatus_args implements TBase<changeItemStatus_args._Fields>, java.io.Serializable, Cloneable, Comparable<changeItemStatus_args>   {
8932
    private static final TStruct STRUCT_DESC = new TStruct("changeItemStatus_args");
8933
 
8934
    private static final TField ITEM_ID_FIELD_DESC = new TField("item_id", TType.I64, (short)1);
8935
    private static final TField TIMESTAMP_FIELD_DESC = new TField("timestamp", TType.I64, (short)2);
8936
    private static final TField NEWSTATUS_FIELD_DESC = new TField("newstatus", TType.I32, (short)3);
8937
 
8938
    private long item_id;
8939
    private long timestamp;
8940
    private status newstatus;
8941
 
8942
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
8943
    public enum _Fields implements TFieldIdEnum {
8944
      ITEM_ID((short)1, "item_id"),
8945
      TIMESTAMP((short)2, "timestamp"),
8946
      /**
8947
       * 
8948
       * @see status
8949
       */
8950
      NEWSTATUS((short)3, "newstatus");
8951
 
8952
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
8953
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
8954
 
8955
      static {
8956
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
8957
          byId.put((int)field._thriftId, field);
8958
          byName.put(field.getFieldName(), field);
8959
        }
8960
      }
8961
 
8962
      /**
8963
       * Find the _Fields constant that matches fieldId, or null if its not found.
8964
       */
8965
      public static _Fields findByThriftId(int fieldId) {
8966
        return byId.get(fieldId);
8967
      }
8968
 
8969
      /**
8970
       * Find the _Fields constant that matches fieldId, throwing an exception
8971
       * if it is not found.
8972
       */
8973
      public static _Fields findByThriftIdOrThrow(int fieldId) {
8974
        _Fields fields = findByThriftId(fieldId);
8975
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
8976
        return fields;
8977
      }
8978
 
8979
      /**
8980
       * Find the _Fields constant that matches name, or null if its not found.
8981
       */
8982
      public static _Fields findByName(String name) {
8983
        return byName.get(name);
8984
      }
8985
 
8986
      private final short _thriftId;
8987
      private final String _fieldName;
8988
 
8989
      _Fields(short thriftId, String fieldName) {
8990
        _thriftId = thriftId;
8991
        _fieldName = fieldName;
8992
      }
8993
 
8994
      public short getThriftFieldId() {
8995
        return _thriftId;
8996
      }
8997
 
8998
      public String getFieldName() {
8999
        return _fieldName;
9000
      }
9001
    }
9002
 
9003
    // isset id assignments
9004
    private static final int __ITEM_ID_ISSET_ID = 0;
9005
    private static final int __TIMESTAMP_ISSET_ID = 1;
9006
    private BitSet __isset_bit_vector = new BitSet(2);
9007
 
9008
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
9009
      put(_Fields.ITEM_ID, new FieldMetaData("item_id", TFieldRequirementType.DEFAULT, 
9010
          new FieldValueMetaData(TType.I64)));
9011
      put(_Fields.TIMESTAMP, new FieldMetaData("timestamp", TFieldRequirementType.DEFAULT, 
9012
          new FieldValueMetaData(TType.I64)));
9013
      put(_Fields.NEWSTATUS, new FieldMetaData("newstatus", TFieldRequirementType.DEFAULT, 
9014
          new EnumMetaData(TType.ENUM, status.class)));
9015
    }});
9016
 
9017
    static {
9018
      FieldMetaData.addStructMetaDataMap(changeItemStatus_args.class, metaDataMap);
9019
    }
9020
 
9021
    public changeItemStatus_args() {
9022
    }
9023
 
9024
    public changeItemStatus_args(
9025
      long item_id,
9026
      long timestamp,
9027
      status newstatus)
9028
    {
9029
      this();
9030
      this.item_id = item_id;
9031
      setItem_idIsSet(true);
9032
      this.timestamp = timestamp;
9033
      setTimestampIsSet(true);
9034
      this.newstatus = newstatus;
9035
    }
9036
 
9037
    /**
9038
     * Performs a deep copy on <i>other</i>.
9039
     */
9040
    public changeItemStatus_args(changeItemStatus_args other) {
9041
      __isset_bit_vector.clear();
9042
      __isset_bit_vector.or(other.__isset_bit_vector);
9043
      this.item_id = other.item_id;
9044
      this.timestamp = other.timestamp;
9045
      if (other.isSetNewstatus()) {
9046
        this.newstatus = other.newstatus;
9047
      }
9048
    }
9049
 
9050
    public changeItemStatus_args deepCopy() {
9051
      return new changeItemStatus_args(this);
9052
    }
9053
 
9054
    @Deprecated
9055
    public changeItemStatus_args clone() {
9056
      return new changeItemStatus_args(this);
9057
    }
9058
 
9059
    public long getItem_id() {
9060
      return this.item_id;
9061
    }
9062
 
9063
    public changeItemStatus_args setItem_id(long item_id) {
9064
      this.item_id = item_id;
9065
      setItem_idIsSet(true);
9066
      return this;
9067
    }
9068
 
9069
    public void unsetItem_id() {
9070
      __isset_bit_vector.clear(__ITEM_ID_ISSET_ID);
9071
    }
9072
 
9073
    /** Returns true if field item_id is set (has been asigned a value) and false otherwise */
9074
    public boolean isSetItem_id() {
9075
      return __isset_bit_vector.get(__ITEM_ID_ISSET_ID);
9076
    }
9077
 
9078
    public void setItem_idIsSet(boolean value) {
9079
      __isset_bit_vector.set(__ITEM_ID_ISSET_ID, value);
9080
    }
9081
 
9082
    public long getTimestamp() {
9083
      return this.timestamp;
9084
    }
9085
 
9086
    public changeItemStatus_args setTimestamp(long timestamp) {
9087
      this.timestamp = timestamp;
9088
      setTimestampIsSet(true);
9089
      return this;
9090
    }
9091
 
9092
    public void unsetTimestamp() {
9093
      __isset_bit_vector.clear(__TIMESTAMP_ISSET_ID);
9094
    }
9095
 
9096
    /** Returns true if field timestamp is set (has been asigned a value) and false otherwise */
9097
    public boolean isSetTimestamp() {
9098
      return __isset_bit_vector.get(__TIMESTAMP_ISSET_ID);
9099
    }
9100
 
9101
    public void setTimestampIsSet(boolean value) {
9102
      __isset_bit_vector.set(__TIMESTAMP_ISSET_ID, value);
9103
    }
9104
 
9105
    /**
9106
     * 
9107
     * @see status
9108
     */
9109
    public status getNewstatus() {
9110
      return this.newstatus;
9111
    }
9112
 
9113
    /**
9114
     * 
9115
     * @see status
9116
     */
9117
    public changeItemStatus_args setNewstatus(status newstatus) {
9118
      this.newstatus = newstatus;
9119
      return this;
9120
    }
9121
 
9122
    public void unsetNewstatus() {
9123
      this.newstatus = null;
9124
    }
9125
 
9126
    /** Returns true if field newstatus is set (has been asigned a value) and false otherwise */
9127
    public boolean isSetNewstatus() {
9128
      return this.newstatus != null;
9129
    }
9130
 
9131
    public void setNewstatusIsSet(boolean value) {
9132
      if (!value) {
9133
        this.newstatus = null;
9134
      }
9135
    }
9136
 
9137
    public void setFieldValue(_Fields field, Object value) {
9138
      switch (field) {
9139
      case ITEM_ID:
9140
        if (value == null) {
9141
          unsetItem_id();
9142
        } else {
9143
          setItem_id((Long)value);
9144
        }
9145
        break;
9146
 
100 ashish 9147
      case TIMESTAMP:
9148
        if (value == null) {
9149
          unsetTimestamp();
9150
        } else {
9151
          setTimestamp((Long)value);
9152
        }
9153
        break;
9154
 
103 ashish 9155
      case NEWSTATUS:
9156
        if (value == null) {
9157
          unsetNewstatus();
9158
        } else {
9159
          setNewstatus((status)value);
9160
        }
9161
        break;
9162
 
100 ashish 9163
      }
9164
    }
9165
 
9166
    public void setFieldValue(int fieldID, Object value) {
9167
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
9168
    }
9169
 
9170
    public Object getFieldValue(_Fields field) {
9171
      switch (field) {
9172
      case ITEM_ID:
9173
        return new Long(getItem_id());
9174
 
9175
      case TIMESTAMP:
9176
        return new Long(getTimestamp());
9177
 
103 ashish 9178
      case NEWSTATUS:
9179
        return getNewstatus();
9180
 
100 ashish 9181
      }
9182
      throw new IllegalStateException();
9183
    }
9184
 
9185
    public Object getFieldValue(int fieldId) {
9186
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
9187
    }
9188
 
9189
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
9190
    public boolean isSet(_Fields field) {
9191
      switch (field) {
9192
      case ITEM_ID:
9193
        return isSetItem_id();
9194
      case TIMESTAMP:
9195
        return isSetTimestamp();
103 ashish 9196
      case NEWSTATUS:
9197
        return isSetNewstatus();
100 ashish 9198
      }
9199
      throw new IllegalStateException();
9200
    }
9201
 
9202
    public boolean isSet(int fieldID) {
9203
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
9204
    }
9205
 
9206
    @Override
9207
    public boolean equals(Object that) {
9208
      if (that == null)
9209
        return false;
103 ashish 9210
      if (that instanceof changeItemStatus_args)
9211
        return this.equals((changeItemStatus_args)that);
100 ashish 9212
      return false;
9213
    }
9214
 
103 ashish 9215
    public boolean equals(changeItemStatus_args that) {
100 ashish 9216
      if (that == null)
9217
        return false;
9218
 
9219
      boolean this_present_item_id = true;
9220
      boolean that_present_item_id = true;
9221
      if (this_present_item_id || that_present_item_id) {
9222
        if (!(this_present_item_id && that_present_item_id))
9223
          return false;
9224
        if (this.item_id != that.item_id)
9225
          return false;
9226
      }
9227
 
9228
      boolean this_present_timestamp = true;
9229
      boolean that_present_timestamp = true;
9230
      if (this_present_timestamp || that_present_timestamp) {
9231
        if (!(this_present_timestamp && that_present_timestamp))
9232
          return false;
9233
        if (this.timestamp != that.timestamp)
9234
          return false;
9235
      }
9236
 
103 ashish 9237
      boolean this_present_newstatus = true && this.isSetNewstatus();
9238
      boolean that_present_newstatus = true && that.isSetNewstatus();
9239
      if (this_present_newstatus || that_present_newstatus) {
9240
        if (!(this_present_newstatus && that_present_newstatus))
9241
          return false;
9242
        if (!this.newstatus.equals(that.newstatus))
9243
          return false;
9244
      }
9245
 
100 ashish 9246
      return true;
9247
    }
9248
 
9249
    @Override
9250
    public int hashCode() {
9251
      return 0;
9252
    }
9253
 
103 ashish 9254
    public int compareTo(changeItemStatus_args other) {
100 ashish 9255
      if (!getClass().equals(other.getClass())) {
9256
        return getClass().getName().compareTo(other.getClass().getName());
9257
      }
9258
 
9259
      int lastComparison = 0;
103 ashish 9260
      changeItemStatus_args typedOther = (changeItemStatus_args)other;
100 ashish 9261
 
9262
      lastComparison = Boolean.valueOf(isSetItem_id()).compareTo(isSetItem_id());
9263
      if (lastComparison != 0) {
9264
        return lastComparison;
9265
      }
9266
      lastComparison = TBaseHelper.compareTo(item_id, typedOther.item_id);
9267
      if (lastComparison != 0) {
9268
        return lastComparison;
9269
      }
103 ashish 9270
      lastComparison = Boolean.valueOf(isSetTimestamp()).compareTo(isSetTimestamp());
100 ashish 9271
      if (lastComparison != 0) {
9272
        return lastComparison;
9273
      }
103 ashish 9274
      lastComparison = TBaseHelper.compareTo(timestamp, typedOther.timestamp);
100 ashish 9275
      if (lastComparison != 0) {
9276
        return lastComparison;
9277
      }
103 ashish 9278
      lastComparison = Boolean.valueOf(isSetNewstatus()).compareTo(isSetNewstatus());
100 ashish 9279
      if (lastComparison != 0) {
9280
        return lastComparison;
9281
      }
103 ashish 9282
      lastComparison = TBaseHelper.compareTo(newstatus, typedOther.newstatus);
100 ashish 9283
      if (lastComparison != 0) {
9284
        return lastComparison;
9285
      }
9286
      return 0;
9287
    }
9288
 
9289
    public void read(TProtocol iprot) throws TException {
9290
      TField field;
9291
      iprot.readStructBegin();
9292
      while (true)
9293
      {
9294
        field = iprot.readFieldBegin();
9295
        if (field.type == TType.STOP) { 
9296
          break;
9297
        }
9298
        _Fields fieldId = _Fields.findByThriftId(field.id);
9299
        if (fieldId == null) {
9300
          TProtocolUtil.skip(iprot, field.type);
9301
        } else {
9302
          switch (fieldId) {
9303
            case ITEM_ID:
9304
              if (field.type == TType.I64) {
9305
                this.item_id = iprot.readI64();
9306
                setItem_idIsSet(true);
9307
              } else { 
9308
                TProtocolUtil.skip(iprot, field.type);
9309
              }
9310
              break;
103 ashish 9311
            case TIMESTAMP:
100 ashish 9312
              if (field.type == TType.I64) {
103 ashish 9313
                this.timestamp = iprot.readI64();
9314
                setTimestampIsSet(true);
100 ashish 9315
              } else { 
9316
                TProtocolUtil.skip(iprot, field.type);
9317
              }
9318
              break;
103 ashish 9319
            case NEWSTATUS:
9320
              if (field.type == TType.I32) {
9321
                this.newstatus = status.findByValue(iprot.readI32());
100 ashish 9322
              } else { 
9323
                TProtocolUtil.skip(iprot, field.type);
9324
              }
9325
              break;
9326
          }
9327
          iprot.readFieldEnd();
9328
        }
9329
      }
9330
      iprot.readStructEnd();
9331
      validate();
9332
    }
9333
 
9334
    public void write(TProtocol oprot) throws TException {
9335
      validate();
9336
 
9337
      oprot.writeStructBegin(STRUCT_DESC);
9338
      oprot.writeFieldBegin(ITEM_ID_FIELD_DESC);
9339
      oprot.writeI64(this.item_id);
9340
      oprot.writeFieldEnd();
9341
      oprot.writeFieldBegin(TIMESTAMP_FIELD_DESC);
9342
      oprot.writeI64(this.timestamp);
9343
      oprot.writeFieldEnd();
103 ashish 9344
      if (this.newstatus != null) {
9345
        oprot.writeFieldBegin(NEWSTATUS_FIELD_DESC);
9346
        oprot.writeI32(this.newstatus.getValue());
9347
        oprot.writeFieldEnd();
9348
      }
100 ashish 9349
      oprot.writeFieldStop();
9350
      oprot.writeStructEnd();
9351
    }
9352
 
9353
    @Override
9354
    public String toString() {
103 ashish 9355
      StringBuilder sb = new StringBuilder("changeItemStatus_args(");
100 ashish 9356
      boolean first = true;
9357
 
9358
      sb.append("item_id:");
9359
      sb.append(this.item_id);
9360
      first = false;
9361
      if (!first) sb.append(", ");
103 ashish 9362
      sb.append("timestamp:");
9363
      sb.append(this.timestamp);
100 ashish 9364
      first = false;
9365
      if (!first) sb.append(", ");
103 ashish 9366
      sb.append("newstatus:");
9367
      if (this.newstatus == null) {
9368
        sb.append("null");
9369
      } else {
9370
        String newstatus_name = newstatus.name();
9371
        if (newstatus_name != null) {
9372
          sb.append(newstatus_name);
9373
          sb.append(" (");
9374
        }
9375
        sb.append(this.newstatus);
9376
        if (newstatus_name != null) {
9377
          sb.append(")");
9378
        }
9379
      }
100 ashish 9380
      first = false;
9381
      sb.append(")");
9382
      return sb.toString();
9383
    }
9384
 
9385
    public void validate() throws TException {
9386
      // check for required fields
9387
    }
9388
 
9389
  }
9390
 
103 ashish 9391
  public static class changeItemStatus_result implements TBase<changeItemStatus_result._Fields>, java.io.Serializable, Cloneable, Comparable<changeItemStatus_result>   {
9392
    private static final TStruct STRUCT_DESC = new TStruct("changeItemStatus_result");
100 ashish 9393
 
9394
    private static final TField CEX_FIELD_DESC = new TField("cex", TType.STRUCT, (short)1);
9395
 
9396
    private CatalogServiceException cex;
9397
 
9398
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
9399
    public enum _Fields implements TFieldIdEnum {
9400
      CEX((short)1, "cex");
9401
 
9402
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
9403
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
9404
 
9405
      static {
9406
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
9407
          byId.put((int)field._thriftId, field);
9408
          byName.put(field.getFieldName(), field);
9409
        }
9410
      }
9411
 
9412
      /**
9413
       * Find the _Fields constant that matches fieldId, or null if its not found.
9414
       */
9415
      public static _Fields findByThriftId(int fieldId) {
9416
        return byId.get(fieldId);
9417
      }
9418
 
9419
      /**
9420
       * Find the _Fields constant that matches fieldId, throwing an exception
9421
       * if it is not found.
9422
       */
9423
      public static _Fields findByThriftIdOrThrow(int fieldId) {
9424
        _Fields fields = findByThriftId(fieldId);
9425
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
9426
        return fields;
9427
      }
9428
 
9429
      /**
9430
       * Find the _Fields constant that matches name, or null if its not found.
9431
       */
9432
      public static _Fields findByName(String name) {
9433
        return byName.get(name);
9434
      }
9435
 
9436
      private final short _thriftId;
9437
      private final String _fieldName;
9438
 
9439
      _Fields(short thriftId, String fieldName) {
9440
        _thriftId = thriftId;
9441
        _fieldName = fieldName;
9442
      }
9443
 
9444
      public short getThriftFieldId() {
9445
        return _thriftId;
9446
      }
9447
 
9448
      public String getFieldName() {
9449
        return _fieldName;
9450
      }
9451
    }
9452
 
9453
    // isset id assignments
9454
 
9455
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
9456
      put(_Fields.CEX, new FieldMetaData("cex", TFieldRequirementType.DEFAULT, 
9457
          new FieldValueMetaData(TType.STRUCT)));
9458
    }});
9459
 
9460
    static {
103 ashish 9461
      FieldMetaData.addStructMetaDataMap(changeItemStatus_result.class, metaDataMap);
100 ashish 9462
    }
9463
 
103 ashish 9464
    public changeItemStatus_result() {
100 ashish 9465
    }
9466
 
103 ashish 9467
    public changeItemStatus_result(
100 ashish 9468
      CatalogServiceException cex)
9469
    {
9470
      this();
9471
      this.cex = cex;
9472
    }
9473
 
9474
    /**
9475
     * Performs a deep copy on <i>other</i>.
9476
     */
103 ashish 9477
    public changeItemStatus_result(changeItemStatus_result other) {
100 ashish 9478
      if (other.isSetCex()) {
9479
        this.cex = new CatalogServiceException(other.cex);
9480
      }
9481
    }
9482
 
103 ashish 9483
    public changeItemStatus_result deepCopy() {
9484
      return new changeItemStatus_result(this);
100 ashish 9485
    }
9486
 
9487
    @Deprecated
103 ashish 9488
    public changeItemStatus_result clone() {
9489
      return new changeItemStatus_result(this);
100 ashish 9490
    }
9491
 
9492
    public CatalogServiceException getCex() {
9493
      return this.cex;
9494
    }
9495
 
103 ashish 9496
    public changeItemStatus_result setCex(CatalogServiceException cex) {
100 ashish 9497
      this.cex = cex;
9498
      return this;
9499
    }
9500
 
9501
    public void unsetCex() {
9502
      this.cex = null;
9503
    }
9504
 
9505
    /** Returns true if field cex is set (has been asigned a value) and false otherwise */
9506
    public boolean isSetCex() {
9507
      return this.cex != null;
9508
    }
9509
 
9510
    public void setCexIsSet(boolean value) {
9511
      if (!value) {
9512
        this.cex = null;
9513
      }
9514
    }
9515
 
9516
    public void setFieldValue(_Fields field, Object value) {
9517
      switch (field) {
9518
      case CEX:
9519
        if (value == null) {
9520
          unsetCex();
9521
        } else {
9522
          setCex((CatalogServiceException)value);
9523
        }
9524
        break;
9525
 
9526
      }
9527
    }
9528
 
9529
    public void setFieldValue(int fieldID, Object value) {
9530
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
9531
    }
9532
 
9533
    public Object getFieldValue(_Fields field) {
9534
      switch (field) {
9535
      case CEX:
9536
        return getCex();
9537
 
9538
      }
9539
      throw new IllegalStateException();
9540
    }
9541
 
9542
    public Object getFieldValue(int fieldId) {
9543
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
9544
    }
9545
 
9546
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
9547
    public boolean isSet(_Fields field) {
9548
      switch (field) {
9549
      case CEX:
9550
        return isSetCex();
9551
      }
9552
      throw new IllegalStateException();
9553
    }
9554
 
9555
    public boolean isSet(int fieldID) {
9556
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
9557
    }
9558
 
9559
    @Override
9560
    public boolean equals(Object that) {
9561
      if (that == null)
9562
        return false;
103 ashish 9563
      if (that instanceof changeItemStatus_result)
9564
        return this.equals((changeItemStatus_result)that);
100 ashish 9565
      return false;
9566
    }
9567
 
103 ashish 9568
    public boolean equals(changeItemStatus_result that) {
100 ashish 9569
      if (that == null)
9570
        return false;
9571
 
9572
      boolean this_present_cex = true && this.isSetCex();
9573
      boolean that_present_cex = true && that.isSetCex();
9574
      if (this_present_cex || that_present_cex) {
9575
        if (!(this_present_cex && that_present_cex))
9576
          return false;
9577
        if (!this.cex.equals(that.cex))
9578
          return false;
9579
      }
9580
 
9581
      return true;
9582
    }
9583
 
9584
    @Override
9585
    public int hashCode() {
9586
      return 0;
9587
    }
9588
 
103 ashish 9589
    public int compareTo(changeItemStatus_result other) {
100 ashish 9590
      if (!getClass().equals(other.getClass())) {
9591
        return getClass().getName().compareTo(other.getClass().getName());
9592
      }
9593
 
9594
      int lastComparison = 0;
103 ashish 9595
      changeItemStatus_result typedOther = (changeItemStatus_result)other;
100 ashish 9596
 
9597
      lastComparison = Boolean.valueOf(isSetCex()).compareTo(isSetCex());
9598
      if (lastComparison != 0) {
9599
        return lastComparison;
9600
      }
9601
      lastComparison = TBaseHelper.compareTo(cex, typedOther.cex);
9602
      if (lastComparison != 0) {
9603
        return lastComparison;
9604
      }
9605
      return 0;
9606
    }
9607
 
9608
    public void read(TProtocol iprot) throws TException {
9609
      TField field;
9610
      iprot.readStructBegin();
9611
      while (true)
9612
      {
9613
        field = iprot.readFieldBegin();
9614
        if (field.type == TType.STOP) { 
9615
          break;
9616
        }
9617
        _Fields fieldId = _Fields.findByThriftId(field.id);
9618
        if (fieldId == null) {
9619
          TProtocolUtil.skip(iprot, field.type);
9620
        } else {
9621
          switch (fieldId) {
9622
            case CEX:
9623
              if (field.type == TType.STRUCT) {
9624
                this.cex = new CatalogServiceException();
9625
                this.cex.read(iprot);
9626
              } else { 
9627
                TProtocolUtil.skip(iprot, field.type);
9628
              }
9629
              break;
9630
          }
9631
          iprot.readFieldEnd();
9632
        }
9633
      }
9634
      iprot.readStructEnd();
9635
      validate();
9636
    }
9637
 
9638
    public void write(TProtocol oprot) throws TException {
9639
      oprot.writeStructBegin(STRUCT_DESC);
9640
 
9641
      if (this.isSetCex()) {
9642
        oprot.writeFieldBegin(CEX_FIELD_DESC);
9643
        this.cex.write(oprot);
9644
        oprot.writeFieldEnd();
9645
      }
9646
      oprot.writeFieldStop();
9647
      oprot.writeStructEnd();
9648
    }
9649
 
9650
    @Override
9651
    public String toString() {
103 ashish 9652
      StringBuilder sb = new StringBuilder("changeItemStatus_result(");
100 ashish 9653
      boolean first = true;
9654
 
9655
      sb.append("cex:");
9656
      if (this.cex == null) {
9657
        sb.append("null");
9658
      } else {
9659
        sb.append(this.cex);
9660
      }
9661
      first = false;
9662
      sb.append(")");
9663
      return sb.toString();
9664
    }
9665
 
9666
    public void validate() throws TException {
9667
      // check for required fields
9668
    }
9669
 
9670
  }
9671
 
9672
  public static class getCategory_args implements TBase<getCategory_args._Fields>, java.io.Serializable, Cloneable, Comparable<getCategory_args>   {
9673
    private static final TStruct STRUCT_DESC = new TStruct("getCategory_args");
9674
 
9675
    private static final TField ID_FIELD_DESC = new TField("id", TType.I64, (short)1);
9676
 
9677
    private long id;
9678
 
9679
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
9680
    public enum _Fields implements TFieldIdEnum {
9681
      ID((short)1, "id");
9682
 
9683
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
9684
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
9685
 
9686
      static {
9687
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
9688
          byId.put((int)field._thriftId, field);
9689
          byName.put(field.getFieldName(), field);
9690
        }
9691
      }
9692
 
9693
      /**
9694
       * Find the _Fields constant that matches fieldId, or null if its not found.
9695
       */
9696
      public static _Fields findByThriftId(int fieldId) {
9697
        return byId.get(fieldId);
9698
      }
9699
 
9700
      /**
9701
       * Find the _Fields constant that matches fieldId, throwing an exception
9702
       * if it is not found.
9703
       */
9704
      public static _Fields findByThriftIdOrThrow(int fieldId) {
9705
        _Fields fields = findByThriftId(fieldId);
9706
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
9707
        return fields;
9708
      }
9709
 
9710
      /**
9711
       * Find the _Fields constant that matches name, or null if its not found.
9712
       */
9713
      public static _Fields findByName(String name) {
9714
        return byName.get(name);
9715
      }
9716
 
9717
      private final short _thriftId;
9718
      private final String _fieldName;
9719
 
9720
      _Fields(short thriftId, String fieldName) {
9721
        _thriftId = thriftId;
9722
        _fieldName = fieldName;
9723
      }
9724
 
9725
      public short getThriftFieldId() {
9726
        return _thriftId;
9727
      }
9728
 
9729
      public String getFieldName() {
9730
        return _fieldName;
9731
      }
9732
    }
9733
 
9734
    // isset id assignments
9735
    private static final int __ID_ISSET_ID = 0;
9736
    private BitSet __isset_bit_vector = new BitSet(1);
9737
 
9738
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
9739
      put(_Fields.ID, new FieldMetaData("id", TFieldRequirementType.DEFAULT, 
9740
          new FieldValueMetaData(TType.I64)));
9741
    }});
9742
 
9743
    static {
9744
      FieldMetaData.addStructMetaDataMap(getCategory_args.class, metaDataMap);
9745
    }
9746
 
9747
    public getCategory_args() {
9748
    }
9749
 
9750
    public getCategory_args(
9751
      long id)
9752
    {
9753
      this();
9754
      this.id = id;
9755
      setIdIsSet(true);
9756
    }
9757
 
9758
    /**
9759
     * Performs a deep copy on <i>other</i>.
9760
     */
9761
    public getCategory_args(getCategory_args other) {
9762
      __isset_bit_vector.clear();
9763
      __isset_bit_vector.or(other.__isset_bit_vector);
9764
      this.id = other.id;
9765
    }
9766
 
9767
    public getCategory_args deepCopy() {
9768
      return new getCategory_args(this);
9769
    }
9770
 
9771
    @Deprecated
9772
    public getCategory_args clone() {
9773
      return new getCategory_args(this);
9774
    }
9775
 
9776
    public long getId() {
9777
      return this.id;
9778
    }
9779
 
9780
    public getCategory_args setId(long id) {
9781
      this.id = id;
9782
      setIdIsSet(true);
9783
      return this;
9784
    }
9785
 
9786
    public void unsetId() {
9787
      __isset_bit_vector.clear(__ID_ISSET_ID);
9788
    }
9789
 
9790
    /** Returns true if field id is set (has been asigned a value) and false otherwise */
9791
    public boolean isSetId() {
9792
      return __isset_bit_vector.get(__ID_ISSET_ID);
9793
    }
9794
 
9795
    public void setIdIsSet(boolean value) {
9796
      __isset_bit_vector.set(__ID_ISSET_ID, value);
9797
    }
9798
 
9799
    public void setFieldValue(_Fields field, Object value) {
9800
      switch (field) {
9801
      case ID:
9802
        if (value == null) {
9803
          unsetId();
9804
        } else {
9805
          setId((Long)value);
9806
        }
9807
        break;
9808
 
9809
      }
9810
    }
9811
 
9812
    public void setFieldValue(int fieldID, Object value) {
9813
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
9814
    }
9815
 
9816
    public Object getFieldValue(_Fields field) {
9817
      switch (field) {
9818
      case ID:
9819
        return new Long(getId());
9820
 
9821
      }
9822
      throw new IllegalStateException();
9823
    }
9824
 
9825
    public Object getFieldValue(int fieldId) {
9826
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
9827
    }
9828
 
9829
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
9830
    public boolean isSet(_Fields field) {
9831
      switch (field) {
9832
      case ID:
9833
        return isSetId();
9834
      }
9835
      throw new IllegalStateException();
9836
    }
9837
 
9838
    public boolean isSet(int fieldID) {
9839
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
9840
    }
9841
 
9842
    @Override
9843
    public boolean equals(Object that) {
9844
      if (that == null)
9845
        return false;
9846
      if (that instanceof getCategory_args)
9847
        return this.equals((getCategory_args)that);
9848
      return false;
9849
    }
9850
 
9851
    public boolean equals(getCategory_args that) {
9852
      if (that == null)
9853
        return false;
9854
 
9855
      boolean this_present_id = true;
9856
      boolean that_present_id = true;
9857
      if (this_present_id || that_present_id) {
9858
        if (!(this_present_id && that_present_id))
9859
          return false;
9860
        if (this.id != that.id)
9861
          return false;
9862
      }
9863
 
9864
      return true;
9865
    }
9866
 
9867
    @Override
9868
    public int hashCode() {
9869
      return 0;
9870
    }
9871
 
9872
    public int compareTo(getCategory_args other) {
9873
      if (!getClass().equals(other.getClass())) {
9874
        return getClass().getName().compareTo(other.getClass().getName());
9875
      }
9876
 
9877
      int lastComparison = 0;
9878
      getCategory_args typedOther = (getCategory_args)other;
9879
 
9880
      lastComparison = Boolean.valueOf(isSetId()).compareTo(isSetId());
9881
      if (lastComparison != 0) {
9882
        return lastComparison;
9883
      }
9884
      lastComparison = TBaseHelper.compareTo(id, typedOther.id);
9885
      if (lastComparison != 0) {
9886
        return lastComparison;
9887
      }
9888
      return 0;
9889
    }
9890
 
9891
    public void read(TProtocol iprot) throws TException {
9892
      TField field;
9893
      iprot.readStructBegin();
9894
      while (true)
9895
      {
9896
        field = iprot.readFieldBegin();
9897
        if (field.type == TType.STOP) { 
9898
          break;
9899
        }
9900
        _Fields fieldId = _Fields.findByThriftId(field.id);
9901
        if (fieldId == null) {
9902
          TProtocolUtil.skip(iprot, field.type);
9903
        } else {
9904
          switch (fieldId) {
9905
            case ID:
9906
              if (field.type == TType.I64) {
9907
                this.id = iprot.readI64();
9908
                setIdIsSet(true);
9909
              } else { 
9910
                TProtocolUtil.skip(iprot, field.type);
9911
              }
9912
              break;
9913
          }
9914
          iprot.readFieldEnd();
9915
        }
9916
      }
9917
      iprot.readStructEnd();
9918
      validate();
9919
    }
9920
 
9921
    public void write(TProtocol oprot) throws TException {
9922
      validate();
9923
 
9924
      oprot.writeStructBegin(STRUCT_DESC);
9925
      oprot.writeFieldBegin(ID_FIELD_DESC);
9926
      oprot.writeI64(this.id);
9927
      oprot.writeFieldEnd();
9928
      oprot.writeFieldStop();
9929
      oprot.writeStructEnd();
9930
    }
9931
 
9932
    @Override
9933
    public String toString() {
9934
      StringBuilder sb = new StringBuilder("getCategory_args(");
9935
      boolean first = true;
9936
 
9937
      sb.append("id:");
9938
      sb.append(this.id);
9939
      first = false;
9940
      sb.append(")");
9941
      return sb.toString();
9942
    }
9943
 
9944
    public void validate() throws TException {
9945
      // check for required fields
9946
    }
9947
 
9948
  }
9949
 
9950
  public static class getCategory_result implements TBase<getCategory_result._Fields>, java.io.Serializable, Cloneable, Comparable<getCategory_result>   {
9951
    private static final TStruct STRUCT_DESC = new TStruct("getCategory_result");
9952
 
9953
    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRUCT, (short)0);
9954
    private static final TField CEX_FIELD_DESC = new TField("cex", TType.STRUCT, (short)1);
9955
 
9956
    private Category success;
9957
    private CatalogServiceException cex;
9958
 
9959
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
9960
    public enum _Fields implements TFieldIdEnum {
9961
      SUCCESS((short)0, "success"),
9962
      CEX((short)1, "cex");
9963
 
9964
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
9965
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
9966
 
9967
      static {
9968
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
9969
          byId.put((int)field._thriftId, field);
9970
          byName.put(field.getFieldName(), field);
9971
        }
9972
      }
9973
 
9974
      /**
9975
       * Find the _Fields constant that matches fieldId, or null if its not found.
9976
       */
9977
      public static _Fields findByThriftId(int fieldId) {
9978
        return byId.get(fieldId);
9979
      }
9980
 
9981
      /**
9982
       * Find the _Fields constant that matches fieldId, throwing an exception
9983
       * if it is not found.
9984
       */
9985
      public static _Fields findByThriftIdOrThrow(int fieldId) {
9986
        _Fields fields = findByThriftId(fieldId);
9987
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
9988
        return fields;
9989
      }
9990
 
9991
      /**
9992
       * Find the _Fields constant that matches name, or null if its not found.
9993
       */
9994
      public static _Fields findByName(String name) {
9995
        return byName.get(name);
9996
      }
9997
 
9998
      private final short _thriftId;
9999
      private final String _fieldName;
10000
 
10001
      _Fields(short thriftId, String fieldName) {
10002
        _thriftId = thriftId;
10003
        _fieldName = fieldName;
10004
      }
10005
 
10006
      public short getThriftFieldId() {
10007
        return _thriftId;
10008
      }
10009
 
10010
      public String getFieldName() {
10011
        return _fieldName;
10012
      }
10013
    }
10014
 
10015
    // isset id assignments
10016
 
10017
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
10018
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
10019
          new StructMetaData(TType.STRUCT, Category.class)));
10020
      put(_Fields.CEX, new FieldMetaData("cex", TFieldRequirementType.DEFAULT, 
10021
          new FieldValueMetaData(TType.STRUCT)));
10022
    }});
10023
 
10024
    static {
10025
      FieldMetaData.addStructMetaDataMap(getCategory_result.class, metaDataMap);
10026
    }
10027
 
10028
    public getCategory_result() {
10029
    }
10030
 
10031
    public getCategory_result(
10032
      Category success,
10033
      CatalogServiceException cex)
10034
    {
10035
      this();
10036
      this.success = success;
10037
      this.cex = cex;
10038
    }
10039
 
10040
    /**
10041
     * Performs a deep copy on <i>other</i>.
10042
     */
10043
    public getCategory_result(getCategory_result other) {
10044
      if (other.isSetSuccess()) {
10045
        this.success = new Category(other.success);
10046
      }
10047
      if (other.isSetCex()) {
10048
        this.cex = new CatalogServiceException(other.cex);
10049
      }
10050
    }
10051
 
10052
    public getCategory_result deepCopy() {
10053
      return new getCategory_result(this);
10054
    }
10055
 
10056
    @Deprecated
10057
    public getCategory_result clone() {
10058
      return new getCategory_result(this);
10059
    }
10060
 
10061
    public Category getSuccess() {
10062
      return this.success;
10063
    }
10064
 
10065
    public getCategory_result setSuccess(Category success) {
10066
      this.success = success;
10067
      return this;
10068
    }
10069
 
10070
    public void unsetSuccess() {
10071
      this.success = null;
10072
    }
10073
 
10074
    /** Returns true if field success is set (has been asigned a value) and false otherwise */
10075
    public boolean isSetSuccess() {
10076
      return this.success != null;
10077
    }
10078
 
10079
    public void setSuccessIsSet(boolean value) {
10080
      if (!value) {
10081
        this.success = null;
10082
      }
10083
    }
10084
 
10085
    public CatalogServiceException getCex() {
10086
      return this.cex;
10087
    }
10088
 
10089
    public getCategory_result setCex(CatalogServiceException cex) {
10090
      this.cex = cex;
10091
      return this;
10092
    }
10093
 
10094
    public void unsetCex() {
10095
      this.cex = null;
10096
    }
10097
 
10098
    /** Returns true if field cex is set (has been asigned a value) and false otherwise */
10099
    public boolean isSetCex() {
10100
      return this.cex != null;
10101
    }
10102
 
10103
    public void setCexIsSet(boolean value) {
10104
      if (!value) {
10105
        this.cex = null;
10106
      }
10107
    }
10108
 
10109
    public void setFieldValue(_Fields field, Object value) {
10110
      switch (field) {
10111
      case SUCCESS:
10112
        if (value == null) {
10113
          unsetSuccess();
10114
        } else {
10115
          setSuccess((Category)value);
10116
        }
10117
        break;
10118
 
10119
      case CEX:
10120
        if (value == null) {
10121
          unsetCex();
10122
        } else {
10123
          setCex((CatalogServiceException)value);
10124
        }
10125
        break;
10126
 
10127
      }
10128
    }
10129
 
10130
    public void setFieldValue(int fieldID, Object value) {
10131
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
10132
    }
10133
 
10134
    public Object getFieldValue(_Fields field) {
10135
      switch (field) {
10136
      case SUCCESS:
10137
        return getSuccess();
10138
 
10139
      case CEX:
10140
        return getCex();
10141
 
10142
      }
10143
      throw new IllegalStateException();
10144
    }
10145
 
10146
    public Object getFieldValue(int fieldId) {
10147
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
10148
    }
10149
 
10150
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
10151
    public boolean isSet(_Fields field) {
10152
      switch (field) {
10153
      case SUCCESS:
10154
        return isSetSuccess();
10155
      case CEX:
10156
        return isSetCex();
10157
      }
10158
      throw new IllegalStateException();
10159
    }
10160
 
10161
    public boolean isSet(int fieldID) {
10162
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
10163
    }
10164
 
10165
    @Override
10166
    public boolean equals(Object that) {
10167
      if (that == null)
10168
        return false;
10169
      if (that instanceof getCategory_result)
10170
        return this.equals((getCategory_result)that);
10171
      return false;
10172
    }
10173
 
10174
    public boolean equals(getCategory_result that) {
10175
      if (that == null)
10176
        return false;
10177
 
10178
      boolean this_present_success = true && this.isSetSuccess();
10179
      boolean that_present_success = true && that.isSetSuccess();
10180
      if (this_present_success || that_present_success) {
10181
        if (!(this_present_success && that_present_success))
10182
          return false;
10183
        if (!this.success.equals(that.success))
10184
          return false;
10185
      }
10186
 
10187
      boolean this_present_cex = true && this.isSetCex();
10188
      boolean that_present_cex = true && that.isSetCex();
10189
      if (this_present_cex || that_present_cex) {
10190
        if (!(this_present_cex && that_present_cex))
10191
          return false;
10192
        if (!this.cex.equals(that.cex))
10193
          return false;
10194
      }
10195
 
10196
      return true;
10197
    }
10198
 
10199
    @Override
10200
    public int hashCode() {
10201
      return 0;
10202
    }
10203
 
10204
    public int compareTo(getCategory_result other) {
10205
      if (!getClass().equals(other.getClass())) {
10206
        return getClass().getName().compareTo(other.getClass().getName());
10207
      }
10208
 
10209
      int lastComparison = 0;
10210
      getCategory_result typedOther = (getCategory_result)other;
10211
 
10212
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
10213
      if (lastComparison != 0) {
10214
        return lastComparison;
10215
      }
10216
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
10217
      if (lastComparison != 0) {
10218
        return lastComparison;
10219
      }
10220
      lastComparison = Boolean.valueOf(isSetCex()).compareTo(isSetCex());
10221
      if (lastComparison != 0) {
10222
        return lastComparison;
10223
      }
10224
      lastComparison = TBaseHelper.compareTo(cex, typedOther.cex);
10225
      if (lastComparison != 0) {
10226
        return lastComparison;
10227
      }
10228
      return 0;
10229
    }
10230
 
10231
    public void read(TProtocol iprot) throws TException {
10232
      TField field;
10233
      iprot.readStructBegin();
10234
      while (true)
10235
      {
10236
        field = iprot.readFieldBegin();
10237
        if (field.type == TType.STOP) { 
10238
          break;
10239
        }
10240
        _Fields fieldId = _Fields.findByThriftId(field.id);
10241
        if (fieldId == null) {
10242
          TProtocolUtil.skip(iprot, field.type);
10243
        } else {
10244
          switch (fieldId) {
10245
            case SUCCESS:
10246
              if (field.type == TType.STRUCT) {
10247
                this.success = new Category();
10248
                this.success.read(iprot);
10249
              } else { 
10250
                TProtocolUtil.skip(iprot, field.type);
10251
              }
10252
              break;
10253
            case CEX:
10254
              if (field.type == TType.STRUCT) {
10255
                this.cex = new CatalogServiceException();
10256
                this.cex.read(iprot);
10257
              } else { 
10258
                TProtocolUtil.skip(iprot, field.type);
10259
              }
10260
              break;
10261
          }
10262
          iprot.readFieldEnd();
10263
        }
10264
      }
10265
      iprot.readStructEnd();
10266
      validate();
10267
    }
10268
 
10269
    public void write(TProtocol oprot) throws TException {
10270
      oprot.writeStructBegin(STRUCT_DESC);
10271
 
10272
      if (this.isSetSuccess()) {
10273
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
10274
        this.success.write(oprot);
10275
        oprot.writeFieldEnd();
10276
      } else if (this.isSetCex()) {
10277
        oprot.writeFieldBegin(CEX_FIELD_DESC);
10278
        this.cex.write(oprot);
10279
        oprot.writeFieldEnd();
10280
      }
10281
      oprot.writeFieldStop();
10282
      oprot.writeStructEnd();
10283
    }
10284
 
10285
    @Override
10286
    public String toString() {
10287
      StringBuilder sb = new StringBuilder("getCategory_result(");
10288
      boolean first = true;
10289
 
10290
      sb.append("success:");
10291
      if (this.success == null) {
10292
        sb.append("null");
10293
      } else {
10294
        sb.append(this.success);
10295
      }
10296
      first = false;
10297
      if (!first) sb.append(", ");
10298
      sb.append("cex:");
10299
      if (this.cex == null) {
10300
        sb.append("null");
10301
      } else {
10302
        sb.append(this.cex);
10303
      }
10304
      first = false;
10305
      sb.append(")");
10306
      return sb.toString();
10307
    }
10308
 
10309
    public void validate() throws TException {
10310
      // check for required fields
10311
    }
10312
 
10313
  }
10314
 
10315
  public static class getAllCategories_args implements TBase<getAllCategories_args._Fields>, java.io.Serializable, Cloneable, Comparable<getAllCategories_args>   {
10316
    private static final TStruct STRUCT_DESC = new TStruct("getAllCategories_args");
10317
 
103 ashish 10318
    private static final TField IS_ACTIVE_FIELD_DESC = new TField("isActive", TType.BOOL, (short)1);
100 ashish 10319
 
103 ashish 10320
    private boolean isActive;
100 ashish 10321
 
10322
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
10323
    public enum _Fields implements TFieldIdEnum {
103 ashish 10324
      IS_ACTIVE((short)1, "isActive");
100 ashish 10325
 
10326
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
10327
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
10328
 
10329
      static {
10330
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
10331
          byId.put((int)field._thriftId, field);
10332
          byName.put(field.getFieldName(), field);
10333
        }
10334
      }
10335
 
10336
      /**
10337
       * Find the _Fields constant that matches fieldId, or null if its not found.
10338
       */
10339
      public static _Fields findByThriftId(int fieldId) {
10340
        return byId.get(fieldId);
10341
      }
10342
 
10343
      /**
10344
       * Find the _Fields constant that matches fieldId, throwing an exception
10345
       * if it is not found.
10346
       */
10347
      public static _Fields findByThriftIdOrThrow(int fieldId) {
10348
        _Fields fields = findByThriftId(fieldId);
10349
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
10350
        return fields;
10351
      }
10352
 
10353
      /**
10354
       * Find the _Fields constant that matches name, or null if its not found.
10355
       */
10356
      public static _Fields findByName(String name) {
10357
        return byName.get(name);
10358
      }
10359
 
10360
      private final short _thriftId;
10361
      private final String _fieldName;
10362
 
10363
      _Fields(short thriftId, String fieldName) {
10364
        _thriftId = thriftId;
10365
        _fieldName = fieldName;
10366
      }
10367
 
10368
      public short getThriftFieldId() {
10369
        return _thriftId;
10370
      }
10371
 
10372
      public String getFieldName() {
10373
        return _fieldName;
10374
      }
10375
    }
103 ashish 10376
 
10377
    // isset id assignments
10378
    private static final int __ISACTIVE_ISSET_ID = 0;
10379
    private BitSet __isset_bit_vector = new BitSet(1);
10380
 
100 ashish 10381
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
103 ashish 10382
      put(_Fields.IS_ACTIVE, new FieldMetaData("isActive", TFieldRequirementType.DEFAULT, 
10383
          new FieldValueMetaData(TType.BOOL)));
100 ashish 10384
    }});
10385
 
10386
    static {
10387
      FieldMetaData.addStructMetaDataMap(getAllCategories_args.class, metaDataMap);
10388
    }
10389
 
10390
    public getAllCategories_args() {
10391
    }
10392
 
103 ashish 10393
    public getAllCategories_args(
10394
      boolean isActive)
10395
    {
10396
      this();
10397
      this.isActive = isActive;
10398
      setIsActiveIsSet(true);
10399
    }
10400
 
100 ashish 10401
    /**
10402
     * Performs a deep copy on <i>other</i>.
10403
     */
10404
    public getAllCategories_args(getAllCategories_args other) {
103 ashish 10405
      __isset_bit_vector.clear();
10406
      __isset_bit_vector.or(other.__isset_bit_vector);
10407
      this.isActive = other.isActive;
100 ashish 10408
    }
10409
 
10410
    public getAllCategories_args deepCopy() {
10411
      return new getAllCategories_args(this);
10412
    }
10413
 
10414
    @Deprecated
10415
    public getAllCategories_args clone() {
10416
      return new getAllCategories_args(this);
10417
    }
10418
 
103 ashish 10419
    public boolean isIsActive() {
10420
      return this.isActive;
10421
    }
10422
 
10423
    public getAllCategories_args setIsActive(boolean isActive) {
10424
      this.isActive = isActive;
10425
      setIsActiveIsSet(true);
10426
      return this;
10427
    }
10428
 
10429
    public void unsetIsActive() {
10430
      __isset_bit_vector.clear(__ISACTIVE_ISSET_ID);
10431
    }
10432
 
10433
    /** Returns true if field isActive is set (has been asigned a value) and false otherwise */
10434
    public boolean isSetIsActive() {
10435
      return __isset_bit_vector.get(__ISACTIVE_ISSET_ID);
10436
    }
10437
 
10438
    public void setIsActiveIsSet(boolean value) {
10439
      __isset_bit_vector.set(__ISACTIVE_ISSET_ID, value);
10440
    }
10441
 
100 ashish 10442
    public void setFieldValue(_Fields field, Object value) {
10443
      switch (field) {
103 ashish 10444
      case IS_ACTIVE:
10445
        if (value == null) {
10446
          unsetIsActive();
10447
        } else {
10448
          setIsActive((Boolean)value);
10449
        }
10450
        break;
10451
 
100 ashish 10452
      }
10453
    }
10454
 
10455
    public void setFieldValue(int fieldID, Object value) {
10456
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
10457
    }
10458
 
10459
    public Object getFieldValue(_Fields field) {
10460
      switch (field) {
103 ashish 10461
      case IS_ACTIVE:
10462
        return new Boolean(isIsActive());
10463
 
100 ashish 10464
      }
10465
      throw new IllegalStateException();
10466
    }
10467
 
10468
    public Object getFieldValue(int fieldId) {
10469
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
10470
    }
10471
 
10472
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
10473
    public boolean isSet(_Fields field) {
10474
      switch (field) {
103 ashish 10475
      case IS_ACTIVE:
10476
        return isSetIsActive();
100 ashish 10477
      }
10478
      throw new IllegalStateException();
10479
    }
10480
 
10481
    public boolean isSet(int fieldID) {
10482
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
10483
    }
10484
 
10485
    @Override
10486
    public boolean equals(Object that) {
10487
      if (that == null)
10488
        return false;
10489
      if (that instanceof getAllCategories_args)
10490
        return this.equals((getAllCategories_args)that);
10491
      return false;
10492
    }
10493
 
10494
    public boolean equals(getAllCategories_args that) {
10495
      if (that == null)
10496
        return false;
10497
 
103 ashish 10498
      boolean this_present_isActive = true;
10499
      boolean that_present_isActive = true;
10500
      if (this_present_isActive || that_present_isActive) {
10501
        if (!(this_present_isActive && that_present_isActive))
10502
          return false;
10503
        if (this.isActive != that.isActive)
10504
          return false;
10505
      }
10506
 
100 ashish 10507
      return true;
10508
    }
10509
 
10510
    @Override
10511
    public int hashCode() {
10512
      return 0;
10513
    }
10514
 
10515
    public int compareTo(getAllCategories_args other) {
10516
      if (!getClass().equals(other.getClass())) {
10517
        return getClass().getName().compareTo(other.getClass().getName());
10518
      }
10519
 
10520
      int lastComparison = 0;
10521
      getAllCategories_args typedOther = (getAllCategories_args)other;
10522
 
103 ashish 10523
      lastComparison = Boolean.valueOf(isSetIsActive()).compareTo(isSetIsActive());
10524
      if (lastComparison != 0) {
10525
        return lastComparison;
10526
      }
10527
      lastComparison = TBaseHelper.compareTo(isActive, typedOther.isActive);
10528
      if (lastComparison != 0) {
10529
        return lastComparison;
10530
      }
100 ashish 10531
      return 0;
10532
    }
10533
 
10534
    public void read(TProtocol iprot) throws TException {
10535
      TField field;
10536
      iprot.readStructBegin();
10537
      while (true)
10538
      {
10539
        field = iprot.readFieldBegin();
10540
        if (field.type == TType.STOP) { 
10541
          break;
10542
        }
10543
        _Fields fieldId = _Fields.findByThriftId(field.id);
10544
        if (fieldId == null) {
10545
          TProtocolUtil.skip(iprot, field.type);
10546
        } else {
10547
          switch (fieldId) {
103 ashish 10548
            case IS_ACTIVE:
10549
              if (field.type == TType.BOOL) {
10550
                this.isActive = iprot.readBool();
10551
                setIsActiveIsSet(true);
10552
              } else { 
10553
                TProtocolUtil.skip(iprot, field.type);
10554
              }
10555
              break;
100 ashish 10556
          }
10557
          iprot.readFieldEnd();
10558
        }
10559
      }
10560
      iprot.readStructEnd();
10561
      validate();
10562
    }
10563
 
10564
    public void write(TProtocol oprot) throws TException {
10565
      validate();
10566
 
10567
      oprot.writeStructBegin(STRUCT_DESC);
103 ashish 10568
      oprot.writeFieldBegin(IS_ACTIVE_FIELD_DESC);
10569
      oprot.writeBool(this.isActive);
10570
      oprot.writeFieldEnd();
100 ashish 10571
      oprot.writeFieldStop();
10572
      oprot.writeStructEnd();
10573
    }
10574
 
10575
    @Override
10576
    public String toString() {
10577
      StringBuilder sb = new StringBuilder("getAllCategories_args(");
10578
      boolean first = true;
10579
 
103 ashish 10580
      sb.append("isActive:");
10581
      sb.append(this.isActive);
10582
      first = false;
100 ashish 10583
      sb.append(")");
10584
      return sb.toString();
10585
    }
10586
 
10587
    public void validate() throws TException {
10588
      // check for required fields
10589
    }
10590
 
10591
  }
10592
 
10593
  public static class getAllCategories_result implements TBase<getAllCategories_result._Fields>, java.io.Serializable, Cloneable, Comparable<getAllCategories_result>   {
10594
    private static final TStruct STRUCT_DESC = new TStruct("getAllCategories_result");
10595
 
10596
    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0);
10597
    private static final TField CEX_FIELD_DESC = new TField("cex", TType.STRUCT, (short)1);
10598
 
10599
    private List<Category> success;
10600
    private CatalogServiceException cex;
10601
 
10602
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
10603
    public enum _Fields implements TFieldIdEnum {
10604
      SUCCESS((short)0, "success"),
10605
      CEX((short)1, "cex");
10606
 
10607
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
10608
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
10609
 
10610
      static {
10611
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
10612
          byId.put((int)field._thriftId, field);
10613
          byName.put(field.getFieldName(), field);
10614
        }
10615
      }
10616
 
10617
      /**
10618
       * Find the _Fields constant that matches fieldId, or null if its not found.
10619
       */
10620
      public static _Fields findByThriftId(int fieldId) {
10621
        return byId.get(fieldId);
10622
      }
10623
 
10624
      /**
10625
       * Find the _Fields constant that matches fieldId, throwing an exception
10626
       * if it is not found.
10627
       */
10628
      public static _Fields findByThriftIdOrThrow(int fieldId) {
10629
        _Fields fields = findByThriftId(fieldId);
10630
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
10631
        return fields;
10632
      }
10633
 
10634
      /**
10635
       * Find the _Fields constant that matches name, or null if its not found.
10636
       */
10637
      public static _Fields findByName(String name) {
10638
        return byName.get(name);
10639
      }
10640
 
10641
      private final short _thriftId;
10642
      private final String _fieldName;
10643
 
10644
      _Fields(short thriftId, String fieldName) {
10645
        _thriftId = thriftId;
10646
        _fieldName = fieldName;
10647
      }
10648
 
10649
      public short getThriftFieldId() {
10650
        return _thriftId;
10651
      }
10652
 
10653
      public String getFieldName() {
10654
        return _fieldName;
10655
      }
10656
    }
10657
 
10658
    // isset id assignments
10659
 
10660
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
10661
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
10662
          new ListMetaData(TType.LIST, 
10663
              new StructMetaData(TType.STRUCT, Category.class))));
10664
      put(_Fields.CEX, new FieldMetaData("cex", TFieldRequirementType.DEFAULT, 
10665
          new FieldValueMetaData(TType.STRUCT)));
10666
    }});
10667
 
10668
    static {
10669
      FieldMetaData.addStructMetaDataMap(getAllCategories_result.class, metaDataMap);
10670
    }
10671
 
10672
    public getAllCategories_result() {
10673
    }
10674
 
10675
    public getAllCategories_result(
10676
      List<Category> success,
10677
      CatalogServiceException cex)
10678
    {
10679
      this();
10680
      this.success = success;
10681
      this.cex = cex;
10682
    }
10683
 
10684
    /**
10685
     * Performs a deep copy on <i>other</i>.
10686
     */
10687
    public getAllCategories_result(getAllCategories_result other) {
10688
      if (other.isSetSuccess()) {
10689
        List<Category> __this__success = new ArrayList<Category>();
10690
        for (Category other_element : other.success) {
10691
          __this__success.add(new Category(other_element));
10692
        }
10693
        this.success = __this__success;
10694
      }
10695
      if (other.isSetCex()) {
10696
        this.cex = new CatalogServiceException(other.cex);
10697
      }
10698
    }
10699
 
10700
    public getAllCategories_result deepCopy() {
10701
      return new getAllCategories_result(this);
10702
    }
10703
 
10704
    @Deprecated
10705
    public getAllCategories_result clone() {
10706
      return new getAllCategories_result(this);
10707
    }
10708
 
10709
    public int getSuccessSize() {
10710
      return (this.success == null) ? 0 : this.success.size();
10711
    }
10712
 
10713
    public java.util.Iterator<Category> getSuccessIterator() {
10714
      return (this.success == null) ? null : this.success.iterator();
10715
    }
10716
 
10717
    public void addToSuccess(Category elem) {
10718
      if (this.success == null) {
10719
        this.success = new ArrayList<Category>();
10720
      }
10721
      this.success.add(elem);
10722
    }
10723
 
10724
    public List<Category> getSuccess() {
10725
      return this.success;
10726
    }
10727
 
10728
    public getAllCategories_result setSuccess(List<Category> success) {
10729
      this.success = success;
10730
      return this;
10731
    }
10732
 
10733
    public void unsetSuccess() {
10734
      this.success = null;
10735
    }
10736
 
10737
    /** Returns true if field success is set (has been asigned a value) and false otherwise */
10738
    public boolean isSetSuccess() {
10739
      return this.success != null;
10740
    }
10741
 
10742
    public void setSuccessIsSet(boolean value) {
10743
      if (!value) {
10744
        this.success = null;
10745
      }
10746
    }
10747
 
10748
    public CatalogServiceException getCex() {
10749
      return this.cex;
10750
    }
10751
 
10752
    public getAllCategories_result setCex(CatalogServiceException cex) {
10753
      this.cex = cex;
10754
      return this;
10755
    }
10756
 
10757
    public void unsetCex() {
10758
      this.cex = null;
10759
    }
10760
 
10761
    /** Returns true if field cex is set (has been asigned a value) and false otherwise */
10762
    public boolean isSetCex() {
10763
      return this.cex != null;
10764
    }
10765
 
10766
    public void setCexIsSet(boolean value) {
10767
      if (!value) {
10768
        this.cex = null;
10769
      }
10770
    }
10771
 
10772
    public void setFieldValue(_Fields field, Object value) {
10773
      switch (field) {
10774
      case SUCCESS:
10775
        if (value == null) {
10776
          unsetSuccess();
10777
        } else {
10778
          setSuccess((List<Category>)value);
10779
        }
10780
        break;
10781
 
10782
      case CEX:
10783
        if (value == null) {
10784
          unsetCex();
10785
        } else {
10786
          setCex((CatalogServiceException)value);
10787
        }
10788
        break;
10789
 
10790
      }
10791
    }
10792
 
10793
    public void setFieldValue(int fieldID, Object value) {
10794
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
10795
    }
10796
 
10797
    public Object getFieldValue(_Fields field) {
10798
      switch (field) {
10799
      case SUCCESS:
10800
        return getSuccess();
10801
 
10802
      case CEX:
10803
        return getCex();
10804
 
10805
      }
10806
      throw new IllegalStateException();
10807
    }
10808
 
10809
    public Object getFieldValue(int fieldId) {
10810
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
10811
    }
10812
 
10813
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
10814
    public boolean isSet(_Fields field) {
10815
      switch (field) {
10816
      case SUCCESS:
10817
        return isSetSuccess();
10818
      case CEX:
10819
        return isSetCex();
10820
      }
10821
      throw new IllegalStateException();
10822
    }
10823
 
10824
    public boolean isSet(int fieldID) {
10825
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
10826
    }
10827
 
10828
    @Override
10829
    public boolean equals(Object that) {
10830
      if (that == null)
10831
        return false;
10832
      if (that instanceof getAllCategories_result)
10833
        return this.equals((getAllCategories_result)that);
10834
      return false;
10835
    }
10836
 
10837
    public boolean equals(getAllCategories_result that) {
10838
      if (that == null)
10839
        return false;
10840
 
10841
      boolean this_present_success = true && this.isSetSuccess();
10842
      boolean that_present_success = true && that.isSetSuccess();
10843
      if (this_present_success || that_present_success) {
10844
        if (!(this_present_success && that_present_success))
10845
          return false;
10846
        if (!this.success.equals(that.success))
10847
          return false;
10848
      }
10849
 
10850
      boolean this_present_cex = true && this.isSetCex();
10851
      boolean that_present_cex = true && that.isSetCex();
10852
      if (this_present_cex || that_present_cex) {
10853
        if (!(this_present_cex && that_present_cex))
10854
          return false;
10855
        if (!this.cex.equals(that.cex))
10856
          return false;
10857
      }
10858
 
10859
      return true;
10860
    }
10861
 
10862
    @Override
10863
    public int hashCode() {
10864
      return 0;
10865
    }
10866
 
10867
    public int compareTo(getAllCategories_result other) {
10868
      if (!getClass().equals(other.getClass())) {
10869
        return getClass().getName().compareTo(other.getClass().getName());
10870
      }
10871
 
10872
      int lastComparison = 0;
10873
      getAllCategories_result typedOther = (getAllCategories_result)other;
10874
 
10875
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
10876
      if (lastComparison != 0) {
10877
        return lastComparison;
10878
      }
10879
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
10880
      if (lastComparison != 0) {
10881
        return lastComparison;
10882
      }
10883
      lastComparison = Boolean.valueOf(isSetCex()).compareTo(isSetCex());
10884
      if (lastComparison != 0) {
10885
        return lastComparison;
10886
      }
10887
      lastComparison = TBaseHelper.compareTo(cex, typedOther.cex);
10888
      if (lastComparison != 0) {
10889
        return lastComparison;
10890
      }
10891
      return 0;
10892
    }
10893
 
10894
    public void read(TProtocol iprot) throws TException {
10895
      TField field;
10896
      iprot.readStructBegin();
10897
      while (true)
10898
      {
10899
        field = iprot.readFieldBegin();
10900
        if (field.type == TType.STOP) { 
10901
          break;
10902
        }
10903
        _Fields fieldId = _Fields.findByThriftId(field.id);
10904
        if (fieldId == null) {
10905
          TProtocolUtil.skip(iprot, field.type);
10906
        } else {
10907
          switch (fieldId) {
10908
            case SUCCESS:
10909
              if (field.type == TType.LIST) {
10910
                {
103 ashish 10911
                  TList _list18 = iprot.readListBegin();
10912
                  this.success = new ArrayList<Category>(_list18.size);
10913
                  for (int _i19 = 0; _i19 < _list18.size; ++_i19)
100 ashish 10914
                  {
103 ashish 10915
                    Category _elem20;
10916
                    _elem20 = new Category();
10917
                    _elem20.read(iprot);
10918
                    this.success.add(_elem20);
100 ashish 10919
                  }
10920
                  iprot.readListEnd();
10921
                }
10922
              } else { 
10923
                TProtocolUtil.skip(iprot, field.type);
10924
              }
10925
              break;
10926
            case CEX:
10927
              if (field.type == TType.STRUCT) {
10928
                this.cex = new CatalogServiceException();
10929
                this.cex.read(iprot);
10930
              } else { 
10931
                TProtocolUtil.skip(iprot, field.type);
10932
              }
10933
              break;
10934
          }
10935
          iprot.readFieldEnd();
10936
        }
10937
      }
10938
      iprot.readStructEnd();
10939
      validate();
10940
    }
10941
 
10942
    public void write(TProtocol oprot) throws TException {
10943
      oprot.writeStructBegin(STRUCT_DESC);
10944
 
10945
      if (this.isSetSuccess()) {
10946
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
10947
        {
10948
          oprot.writeListBegin(new TList(TType.STRUCT, this.success.size()));
103 ashish 10949
          for (Category _iter21 : this.success)
100 ashish 10950
          {
103 ashish 10951
            _iter21.write(oprot);
100 ashish 10952
          }
10953
          oprot.writeListEnd();
10954
        }
10955
        oprot.writeFieldEnd();
10956
      } else if (this.isSetCex()) {
10957
        oprot.writeFieldBegin(CEX_FIELD_DESC);
10958
        this.cex.write(oprot);
10959
        oprot.writeFieldEnd();
10960
      }
10961
      oprot.writeFieldStop();
10962
      oprot.writeStructEnd();
10963
    }
10964
 
10965
    @Override
10966
    public String toString() {
10967
      StringBuilder sb = new StringBuilder("getAllCategories_result(");
10968
      boolean first = true;
10969
 
10970
      sb.append("success:");
10971
      if (this.success == null) {
10972
        sb.append("null");
10973
      } else {
10974
        sb.append(this.success);
10975
      }
10976
      first = false;
10977
      if (!first) sb.append(", ");
10978
      sb.append("cex:");
10979
      if (this.cex == null) {
10980
        sb.append("null");
10981
      } else {
10982
        sb.append(this.cex);
10983
      }
10984
      first = false;
10985
      sb.append(")");
10986
      return sb.toString();
10987
    }
10988
 
10989
    public void validate() throws TException {
10990
      // check for required fields
10991
    }
10992
 
10993
  }
10994
 
10995
  public static class getItem_args implements TBase<getItem_args._Fields>, java.io.Serializable, Cloneable, Comparable<getItem_args>   {
10996
    private static final TStruct STRUCT_DESC = new TStruct("getItem_args");
10997
 
10998
    private static final TField ITEM_ID_FIELD_DESC = new TField("item_id", TType.I64, (short)1);
10999
 
11000
    private long item_id;
11001
 
11002
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
11003
    public enum _Fields implements TFieldIdEnum {
11004
      ITEM_ID((short)1, "item_id");
11005
 
11006
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
11007
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
11008
 
11009
      static {
11010
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
11011
          byId.put((int)field._thriftId, field);
11012
          byName.put(field.getFieldName(), field);
11013
        }
11014
      }
11015
 
11016
      /**
11017
       * Find the _Fields constant that matches fieldId, or null if its not found.
11018
       */
11019
      public static _Fields findByThriftId(int fieldId) {
11020
        return byId.get(fieldId);
11021
      }
11022
 
11023
      /**
11024
       * Find the _Fields constant that matches fieldId, throwing an exception
11025
       * if it is not found.
11026
       */
11027
      public static _Fields findByThriftIdOrThrow(int fieldId) {
11028
        _Fields fields = findByThriftId(fieldId);
11029
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
11030
        return fields;
11031
      }
11032
 
11033
      /**
11034
       * Find the _Fields constant that matches name, or null if its not found.
11035
       */
11036
      public static _Fields findByName(String name) {
11037
        return byName.get(name);
11038
      }
11039
 
11040
      private final short _thriftId;
11041
      private final String _fieldName;
11042
 
11043
      _Fields(short thriftId, String fieldName) {
11044
        _thriftId = thriftId;
11045
        _fieldName = fieldName;
11046
      }
11047
 
11048
      public short getThriftFieldId() {
11049
        return _thriftId;
11050
      }
11051
 
11052
      public String getFieldName() {
11053
        return _fieldName;
11054
      }
11055
    }
11056
 
11057
    // isset id assignments
11058
    private static final int __ITEM_ID_ISSET_ID = 0;
11059
    private BitSet __isset_bit_vector = new BitSet(1);
11060
 
11061
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
11062
      put(_Fields.ITEM_ID, new FieldMetaData("item_id", TFieldRequirementType.DEFAULT, 
11063
          new FieldValueMetaData(TType.I64)));
11064
    }});
11065
 
11066
    static {
11067
      FieldMetaData.addStructMetaDataMap(getItem_args.class, metaDataMap);
11068
    }
11069
 
11070
    public getItem_args() {
11071
    }
11072
 
11073
    public getItem_args(
11074
      long item_id)
11075
    {
11076
      this();
11077
      this.item_id = item_id;
11078
      setItem_idIsSet(true);
11079
    }
11080
 
11081
    /**
11082
     * Performs a deep copy on <i>other</i>.
11083
     */
11084
    public getItem_args(getItem_args other) {
11085
      __isset_bit_vector.clear();
11086
      __isset_bit_vector.or(other.__isset_bit_vector);
11087
      this.item_id = other.item_id;
11088
    }
11089
 
11090
    public getItem_args deepCopy() {
11091
      return new getItem_args(this);
11092
    }
11093
 
11094
    @Deprecated
11095
    public getItem_args clone() {
11096
      return new getItem_args(this);
11097
    }
11098
 
11099
    public long getItem_id() {
11100
      return this.item_id;
11101
    }
11102
 
11103
    public getItem_args setItem_id(long item_id) {
11104
      this.item_id = item_id;
11105
      setItem_idIsSet(true);
11106
      return this;
11107
    }
11108
 
11109
    public void unsetItem_id() {
11110
      __isset_bit_vector.clear(__ITEM_ID_ISSET_ID);
11111
    }
11112
 
11113
    /** Returns true if field item_id is set (has been asigned a value) and false otherwise */
11114
    public boolean isSetItem_id() {
11115
      return __isset_bit_vector.get(__ITEM_ID_ISSET_ID);
11116
    }
11117
 
11118
    public void setItem_idIsSet(boolean value) {
11119
      __isset_bit_vector.set(__ITEM_ID_ISSET_ID, value);
11120
    }
11121
 
11122
    public void setFieldValue(_Fields field, Object value) {
11123
      switch (field) {
11124
      case ITEM_ID:
11125
        if (value == null) {
11126
          unsetItem_id();
11127
        } else {
11128
          setItem_id((Long)value);
11129
        }
11130
        break;
11131
 
11132
      }
11133
    }
11134
 
11135
    public void setFieldValue(int fieldID, Object value) {
11136
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
11137
    }
11138
 
11139
    public Object getFieldValue(_Fields field) {
11140
      switch (field) {
11141
      case ITEM_ID:
11142
        return new Long(getItem_id());
11143
 
11144
      }
11145
      throw new IllegalStateException();
11146
    }
11147
 
11148
    public Object getFieldValue(int fieldId) {
11149
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
11150
    }
11151
 
11152
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
11153
    public boolean isSet(_Fields field) {
11154
      switch (field) {
11155
      case ITEM_ID:
11156
        return isSetItem_id();
11157
      }
11158
      throw new IllegalStateException();
11159
    }
11160
 
11161
    public boolean isSet(int fieldID) {
11162
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
11163
    }
11164
 
11165
    @Override
11166
    public boolean equals(Object that) {
11167
      if (that == null)
11168
        return false;
11169
      if (that instanceof getItem_args)
11170
        return this.equals((getItem_args)that);
11171
      return false;
11172
    }
11173
 
11174
    public boolean equals(getItem_args that) {
11175
      if (that == null)
11176
        return false;
11177
 
11178
      boolean this_present_item_id = true;
11179
      boolean that_present_item_id = true;
11180
      if (this_present_item_id || that_present_item_id) {
11181
        if (!(this_present_item_id && that_present_item_id))
11182
          return false;
11183
        if (this.item_id != that.item_id)
11184
          return false;
11185
      }
11186
 
11187
      return true;
11188
    }
11189
 
11190
    @Override
11191
    public int hashCode() {
11192
      return 0;
11193
    }
11194
 
11195
    public int compareTo(getItem_args other) {
11196
      if (!getClass().equals(other.getClass())) {
11197
        return getClass().getName().compareTo(other.getClass().getName());
11198
      }
11199
 
11200
      int lastComparison = 0;
11201
      getItem_args typedOther = (getItem_args)other;
11202
 
11203
      lastComparison = Boolean.valueOf(isSetItem_id()).compareTo(isSetItem_id());
11204
      if (lastComparison != 0) {
11205
        return lastComparison;
11206
      }
11207
      lastComparison = TBaseHelper.compareTo(item_id, typedOther.item_id);
11208
      if (lastComparison != 0) {
11209
        return lastComparison;
11210
      }
11211
      return 0;
11212
    }
11213
 
11214
    public void read(TProtocol iprot) throws TException {
11215
      TField field;
11216
      iprot.readStructBegin();
11217
      while (true)
11218
      {
11219
        field = iprot.readFieldBegin();
11220
        if (field.type == TType.STOP) { 
11221
          break;
11222
        }
11223
        _Fields fieldId = _Fields.findByThriftId(field.id);
11224
        if (fieldId == null) {
11225
          TProtocolUtil.skip(iprot, field.type);
11226
        } else {
11227
          switch (fieldId) {
11228
            case ITEM_ID:
11229
              if (field.type == TType.I64) {
11230
                this.item_id = iprot.readI64();
11231
                setItem_idIsSet(true);
11232
              } else { 
11233
                TProtocolUtil.skip(iprot, field.type);
11234
              }
11235
              break;
11236
          }
11237
          iprot.readFieldEnd();
11238
        }
11239
      }
11240
      iprot.readStructEnd();
11241
      validate();
11242
    }
11243
 
11244
    public void write(TProtocol oprot) throws TException {
11245
      validate();
11246
 
11247
      oprot.writeStructBegin(STRUCT_DESC);
11248
      oprot.writeFieldBegin(ITEM_ID_FIELD_DESC);
11249
      oprot.writeI64(this.item_id);
11250
      oprot.writeFieldEnd();
11251
      oprot.writeFieldStop();
11252
      oprot.writeStructEnd();
11253
    }
11254
 
11255
    @Override
11256
    public String toString() {
11257
      StringBuilder sb = new StringBuilder("getItem_args(");
11258
      boolean first = true;
11259
 
11260
      sb.append("item_id:");
11261
      sb.append(this.item_id);
11262
      first = false;
11263
      sb.append(")");
11264
      return sb.toString();
11265
    }
11266
 
11267
    public void validate() throws TException {
11268
      // check for required fields
11269
    }
11270
 
11271
  }
11272
 
11273
  public static class getItem_result implements TBase<getItem_result._Fields>, java.io.Serializable, Cloneable   {
11274
    private static final TStruct STRUCT_DESC = new TStruct("getItem_result");
11275
 
11276
    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRUCT, (short)0);
11277
    private static final TField CEX_FIELD_DESC = new TField("cex", TType.STRUCT, (short)1);
11278
 
11279
    private Item success;
11280
    private CatalogServiceException cex;
11281
 
11282
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
11283
    public enum _Fields implements TFieldIdEnum {
11284
      SUCCESS((short)0, "success"),
11285
      CEX((short)1, "cex");
11286
 
11287
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
11288
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
11289
 
11290
      static {
11291
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
11292
          byId.put((int)field._thriftId, field);
11293
          byName.put(field.getFieldName(), field);
11294
        }
11295
      }
11296
 
11297
      /**
11298
       * Find the _Fields constant that matches fieldId, or null if its not found.
11299
       */
11300
      public static _Fields findByThriftId(int fieldId) {
11301
        return byId.get(fieldId);
11302
      }
11303
 
11304
      /**
11305
       * Find the _Fields constant that matches fieldId, throwing an exception
11306
       * if it is not found.
11307
       */
11308
      public static _Fields findByThriftIdOrThrow(int fieldId) {
11309
        _Fields fields = findByThriftId(fieldId);
11310
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
11311
        return fields;
11312
      }
11313
 
11314
      /**
11315
       * Find the _Fields constant that matches name, or null if its not found.
11316
       */
11317
      public static _Fields findByName(String name) {
11318
        return byName.get(name);
11319
      }
11320
 
11321
      private final short _thriftId;
11322
      private final String _fieldName;
11323
 
11324
      _Fields(short thriftId, String fieldName) {
11325
        _thriftId = thriftId;
11326
        _fieldName = fieldName;
11327
      }
11328
 
11329
      public short getThriftFieldId() {
11330
        return _thriftId;
11331
      }
11332
 
11333
      public String getFieldName() {
11334
        return _fieldName;
11335
      }
11336
    }
11337
 
11338
    // isset id assignments
11339
 
11340
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
11341
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
11342
          new StructMetaData(TType.STRUCT, Item.class)));
11343
      put(_Fields.CEX, new FieldMetaData("cex", TFieldRequirementType.DEFAULT, 
11344
          new FieldValueMetaData(TType.STRUCT)));
11345
    }});
11346
 
11347
    static {
11348
      FieldMetaData.addStructMetaDataMap(getItem_result.class, metaDataMap);
11349
    }
11350
 
11351
    public getItem_result() {
11352
    }
11353
 
11354
    public getItem_result(
11355
      Item success,
11356
      CatalogServiceException cex)
11357
    {
11358
      this();
11359
      this.success = success;
11360
      this.cex = cex;
11361
    }
11362
 
11363
    /**
11364
     * Performs a deep copy on <i>other</i>.
11365
     */
11366
    public getItem_result(getItem_result other) {
11367
      if (other.isSetSuccess()) {
11368
        this.success = new Item(other.success);
11369
      }
11370
      if (other.isSetCex()) {
11371
        this.cex = new CatalogServiceException(other.cex);
11372
      }
11373
    }
11374
 
11375
    public getItem_result deepCopy() {
11376
      return new getItem_result(this);
11377
    }
11378
 
11379
    @Deprecated
11380
    public getItem_result clone() {
11381
      return new getItem_result(this);
11382
    }
11383
 
11384
    public Item getSuccess() {
11385
      return this.success;
11386
    }
11387
 
11388
    public getItem_result setSuccess(Item success) {
11389
      this.success = success;
11390
      return this;
11391
    }
11392
 
11393
    public void unsetSuccess() {
11394
      this.success = null;
11395
    }
11396
 
11397
    /** Returns true if field success is set (has been asigned a value) and false otherwise */
11398
    public boolean isSetSuccess() {
11399
      return this.success != null;
11400
    }
11401
 
11402
    public void setSuccessIsSet(boolean value) {
11403
      if (!value) {
11404
        this.success = null;
11405
      }
11406
    }
11407
 
11408
    public CatalogServiceException getCex() {
11409
      return this.cex;
11410
    }
11411
 
11412
    public getItem_result setCex(CatalogServiceException cex) {
11413
      this.cex = cex;
11414
      return this;
11415
    }
11416
 
11417
    public void unsetCex() {
11418
      this.cex = null;
11419
    }
11420
 
11421
    /** Returns true if field cex is set (has been asigned a value) and false otherwise */
11422
    public boolean isSetCex() {
11423
      return this.cex != null;
11424
    }
11425
 
11426
    public void setCexIsSet(boolean value) {
11427
      if (!value) {
11428
        this.cex = null;
11429
      }
11430
    }
11431
 
11432
    public void setFieldValue(_Fields field, Object value) {
11433
      switch (field) {
11434
      case SUCCESS:
11435
        if (value == null) {
11436
          unsetSuccess();
11437
        } else {
11438
          setSuccess((Item)value);
11439
        }
11440
        break;
11441
 
11442
      case CEX:
11443
        if (value == null) {
11444
          unsetCex();
11445
        } else {
11446
          setCex((CatalogServiceException)value);
11447
        }
11448
        break;
11449
 
11450
      }
11451
    }
11452
 
11453
    public void setFieldValue(int fieldID, Object value) {
11454
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
11455
    }
11456
 
11457
    public Object getFieldValue(_Fields field) {
11458
      switch (field) {
11459
      case SUCCESS:
11460
        return getSuccess();
11461
 
11462
      case CEX:
11463
        return getCex();
11464
 
11465
      }
11466
      throw new IllegalStateException();
11467
    }
11468
 
11469
    public Object getFieldValue(int fieldId) {
11470
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
11471
    }
11472
 
11473
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
11474
    public boolean isSet(_Fields field) {
11475
      switch (field) {
11476
      case SUCCESS:
11477
        return isSetSuccess();
11478
      case CEX:
11479
        return isSetCex();
11480
      }
11481
      throw new IllegalStateException();
11482
    }
11483
 
11484
    public boolean isSet(int fieldID) {
11485
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
11486
    }
11487
 
11488
    @Override
11489
    public boolean equals(Object that) {
11490
      if (that == null)
11491
        return false;
11492
      if (that instanceof getItem_result)
11493
        return this.equals((getItem_result)that);
11494
      return false;
11495
    }
11496
 
11497
    public boolean equals(getItem_result that) {
11498
      if (that == null)
11499
        return false;
11500
 
11501
      boolean this_present_success = true && this.isSetSuccess();
11502
      boolean that_present_success = true && that.isSetSuccess();
11503
      if (this_present_success || that_present_success) {
11504
        if (!(this_present_success && that_present_success))
11505
          return false;
11506
        if (!this.success.equals(that.success))
11507
          return false;
11508
      }
11509
 
11510
      boolean this_present_cex = true && this.isSetCex();
11511
      boolean that_present_cex = true && that.isSetCex();
11512
      if (this_present_cex || that_present_cex) {
11513
        if (!(this_present_cex && that_present_cex))
11514
          return false;
11515
        if (!this.cex.equals(that.cex))
11516
          return false;
11517
      }
11518
 
11519
      return true;
11520
    }
11521
 
11522
    @Override
11523
    public int hashCode() {
11524
      return 0;
11525
    }
11526
 
11527
    public void read(TProtocol iprot) throws TException {
11528
      TField field;
11529
      iprot.readStructBegin();
11530
      while (true)
11531
      {
11532
        field = iprot.readFieldBegin();
11533
        if (field.type == TType.STOP) { 
11534
          break;
11535
        }
11536
        _Fields fieldId = _Fields.findByThriftId(field.id);
11537
        if (fieldId == null) {
11538
          TProtocolUtil.skip(iprot, field.type);
11539
        } else {
11540
          switch (fieldId) {
11541
            case SUCCESS:
11542
              if (field.type == TType.STRUCT) {
11543
                this.success = new Item();
11544
                this.success.read(iprot);
11545
              } else { 
11546
                TProtocolUtil.skip(iprot, field.type);
11547
              }
11548
              break;
11549
            case CEX:
11550
              if (field.type == TType.STRUCT) {
11551
                this.cex = new CatalogServiceException();
11552
                this.cex.read(iprot);
11553
              } else { 
11554
                TProtocolUtil.skip(iprot, field.type);
11555
              }
11556
              break;
11557
          }
11558
          iprot.readFieldEnd();
11559
        }
11560
      }
11561
      iprot.readStructEnd();
11562
      validate();
11563
    }
11564
 
11565
    public void write(TProtocol oprot) throws TException {
11566
      oprot.writeStructBegin(STRUCT_DESC);
11567
 
11568
      if (this.isSetSuccess()) {
11569
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
11570
        this.success.write(oprot);
11571
        oprot.writeFieldEnd();
11572
      } else if (this.isSetCex()) {
11573
        oprot.writeFieldBegin(CEX_FIELD_DESC);
11574
        this.cex.write(oprot);
11575
        oprot.writeFieldEnd();
11576
      }
11577
      oprot.writeFieldStop();
11578
      oprot.writeStructEnd();
11579
    }
11580
 
11581
    @Override
11582
    public String toString() {
11583
      StringBuilder sb = new StringBuilder("getItem_result(");
11584
      boolean first = true;
11585
 
11586
      sb.append("success:");
11587
      if (this.success == null) {
11588
        sb.append("null");
11589
      } else {
11590
        sb.append(this.success);
11591
      }
11592
      first = false;
11593
      if (!first) sb.append(", ");
11594
      sb.append("cex:");
11595
      if (this.cex == null) {
11596
        sb.append("null");
11597
      } else {
11598
        sb.append(this.cex);
11599
      }
11600
      first = false;
11601
      sb.append(")");
11602
      return sb.toString();
11603
    }
11604
 
11605
    public void validate() throws TException {
11606
      // check for required fields
11607
    }
11608
 
11609
  }
11610
 
11611
  public static class getAllItemsForCategory_args implements TBase<getAllItemsForCategory_args._Fields>, java.io.Serializable, Cloneable, Comparable<getAllItemsForCategory_args>   {
11612
    private static final TStruct STRUCT_DESC = new TStruct("getAllItemsForCategory_args");
11613
 
11614
    private static final TField CATEGORY_ID_FIELD_DESC = new TField("category_id", TType.I64, (short)1);
103 ashish 11615
    private static final TField IS_ACTIVE_FIELD_DESC = new TField("isActive", TType.BOOL, (short)2);
100 ashish 11616
 
11617
    private long category_id;
103 ashish 11618
    private boolean isActive;
100 ashish 11619
 
11620
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
11621
    public enum _Fields implements TFieldIdEnum {
103 ashish 11622
      CATEGORY_ID((short)1, "category_id"),
11623
      IS_ACTIVE((short)2, "isActive");
100 ashish 11624
 
11625
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
11626
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
11627
 
11628
      static {
11629
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
11630
          byId.put((int)field._thriftId, field);
11631
          byName.put(field.getFieldName(), field);
11632
        }
11633
      }
11634
 
11635
      /**
11636
       * Find the _Fields constant that matches fieldId, or null if its not found.
11637
       */
11638
      public static _Fields findByThriftId(int fieldId) {
11639
        return byId.get(fieldId);
11640
      }
11641
 
11642
      /**
11643
       * Find the _Fields constant that matches fieldId, throwing an exception
11644
       * if it is not found.
11645
       */
11646
      public static _Fields findByThriftIdOrThrow(int fieldId) {
11647
        _Fields fields = findByThriftId(fieldId);
11648
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
11649
        return fields;
11650
      }
11651
 
11652
      /**
11653
       * Find the _Fields constant that matches name, or null if its not found.
11654
       */
11655
      public static _Fields findByName(String name) {
11656
        return byName.get(name);
11657
      }
11658
 
11659
      private final short _thriftId;
11660
      private final String _fieldName;
11661
 
11662
      _Fields(short thriftId, String fieldName) {
11663
        _thriftId = thriftId;
11664
        _fieldName = fieldName;
11665
      }
11666
 
11667
      public short getThriftFieldId() {
11668
        return _thriftId;
11669
      }
11670
 
11671
      public String getFieldName() {
11672
        return _fieldName;
11673
      }
11674
    }
11675
 
11676
    // isset id assignments
11677
    private static final int __CATEGORY_ID_ISSET_ID = 0;
103 ashish 11678
    private static final int __ISACTIVE_ISSET_ID = 1;
11679
    private BitSet __isset_bit_vector = new BitSet(2);
100 ashish 11680
 
11681
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
11682
      put(_Fields.CATEGORY_ID, new FieldMetaData("category_id", TFieldRequirementType.DEFAULT, 
11683
          new FieldValueMetaData(TType.I64)));
103 ashish 11684
      put(_Fields.IS_ACTIVE, new FieldMetaData("isActive", TFieldRequirementType.DEFAULT, 
11685
          new FieldValueMetaData(TType.BOOL)));
100 ashish 11686
    }});
11687
 
11688
    static {
11689
      FieldMetaData.addStructMetaDataMap(getAllItemsForCategory_args.class, metaDataMap);
11690
    }
11691
 
11692
    public getAllItemsForCategory_args() {
11693
    }
11694
 
11695
    public getAllItemsForCategory_args(
103 ashish 11696
      long category_id,
11697
      boolean isActive)
100 ashish 11698
    {
11699
      this();
11700
      this.category_id = category_id;
11701
      setCategory_idIsSet(true);
103 ashish 11702
      this.isActive = isActive;
11703
      setIsActiveIsSet(true);
100 ashish 11704
    }
11705
 
11706
    /**
11707
     * Performs a deep copy on <i>other</i>.
11708
     */
11709
    public getAllItemsForCategory_args(getAllItemsForCategory_args other) {
11710
      __isset_bit_vector.clear();
11711
      __isset_bit_vector.or(other.__isset_bit_vector);
11712
      this.category_id = other.category_id;
103 ashish 11713
      this.isActive = other.isActive;
100 ashish 11714
    }
11715
 
11716
    public getAllItemsForCategory_args deepCopy() {
11717
      return new getAllItemsForCategory_args(this);
11718
    }
11719
 
11720
    @Deprecated
11721
    public getAllItemsForCategory_args clone() {
11722
      return new getAllItemsForCategory_args(this);
11723
    }
11724
 
11725
    public long getCategory_id() {
11726
      return this.category_id;
11727
    }
11728
 
11729
    public getAllItemsForCategory_args setCategory_id(long category_id) {
11730
      this.category_id = category_id;
11731
      setCategory_idIsSet(true);
11732
      return this;
11733
    }
11734
 
11735
    public void unsetCategory_id() {
11736
      __isset_bit_vector.clear(__CATEGORY_ID_ISSET_ID);
11737
    }
11738
 
11739
    /** Returns true if field category_id is set (has been asigned a value) and false otherwise */
11740
    public boolean isSetCategory_id() {
11741
      return __isset_bit_vector.get(__CATEGORY_ID_ISSET_ID);
11742
    }
11743
 
11744
    public void setCategory_idIsSet(boolean value) {
11745
      __isset_bit_vector.set(__CATEGORY_ID_ISSET_ID, value);
11746
    }
11747
 
103 ashish 11748
    public boolean isIsActive() {
11749
      return this.isActive;
11750
    }
11751
 
11752
    public getAllItemsForCategory_args setIsActive(boolean isActive) {
11753
      this.isActive = isActive;
11754
      setIsActiveIsSet(true);
11755
      return this;
11756
    }
11757
 
11758
    public void unsetIsActive() {
11759
      __isset_bit_vector.clear(__ISACTIVE_ISSET_ID);
11760
    }
11761
 
11762
    /** Returns true if field isActive is set (has been asigned a value) and false otherwise */
11763
    public boolean isSetIsActive() {
11764
      return __isset_bit_vector.get(__ISACTIVE_ISSET_ID);
11765
    }
11766
 
11767
    public void setIsActiveIsSet(boolean value) {
11768
      __isset_bit_vector.set(__ISACTIVE_ISSET_ID, value);
11769
    }
11770
 
100 ashish 11771
    public void setFieldValue(_Fields field, Object value) {
11772
      switch (field) {
11773
      case CATEGORY_ID:
11774
        if (value == null) {
11775
          unsetCategory_id();
11776
        } else {
11777
          setCategory_id((Long)value);
11778
        }
11779
        break;
11780
 
103 ashish 11781
      case IS_ACTIVE:
11782
        if (value == null) {
11783
          unsetIsActive();
11784
        } else {
11785
          setIsActive((Boolean)value);
11786
        }
11787
        break;
11788
 
100 ashish 11789
      }
11790
    }
11791
 
11792
    public void setFieldValue(int fieldID, Object value) {
11793
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
11794
    }
11795
 
11796
    public Object getFieldValue(_Fields field) {
11797
      switch (field) {
11798
      case CATEGORY_ID:
11799
        return new Long(getCategory_id());
11800
 
103 ashish 11801
      case IS_ACTIVE:
11802
        return new Boolean(isIsActive());
11803
 
100 ashish 11804
      }
11805
      throw new IllegalStateException();
11806
    }
11807
 
11808
    public Object getFieldValue(int fieldId) {
11809
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
11810
    }
11811
 
11812
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
11813
    public boolean isSet(_Fields field) {
11814
      switch (field) {
11815
      case CATEGORY_ID:
11816
        return isSetCategory_id();
103 ashish 11817
      case IS_ACTIVE:
11818
        return isSetIsActive();
100 ashish 11819
      }
11820
      throw new IllegalStateException();
11821
    }
11822
 
11823
    public boolean isSet(int fieldID) {
11824
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
11825
    }
11826
 
11827
    @Override
11828
    public boolean equals(Object that) {
11829
      if (that == null)
11830
        return false;
11831
      if (that instanceof getAllItemsForCategory_args)
11832
        return this.equals((getAllItemsForCategory_args)that);
11833
      return false;
11834
    }
11835
 
11836
    public boolean equals(getAllItemsForCategory_args that) {
11837
      if (that == null)
11838
        return false;
11839
 
11840
      boolean this_present_category_id = true;
11841
      boolean that_present_category_id = true;
11842
      if (this_present_category_id || that_present_category_id) {
11843
        if (!(this_present_category_id && that_present_category_id))
11844
          return false;
11845
        if (this.category_id != that.category_id)
11846
          return false;
11847
      }
11848
 
103 ashish 11849
      boolean this_present_isActive = true;
11850
      boolean that_present_isActive = true;
11851
      if (this_present_isActive || that_present_isActive) {
11852
        if (!(this_present_isActive && that_present_isActive))
11853
          return false;
11854
        if (this.isActive != that.isActive)
11855
          return false;
11856
      }
11857
 
100 ashish 11858
      return true;
11859
    }
11860
 
11861
    @Override
11862
    public int hashCode() {
11863
      return 0;
11864
    }
11865
 
11866
    public int compareTo(getAllItemsForCategory_args other) {
11867
      if (!getClass().equals(other.getClass())) {
11868
        return getClass().getName().compareTo(other.getClass().getName());
11869
      }
11870
 
11871
      int lastComparison = 0;
11872
      getAllItemsForCategory_args typedOther = (getAllItemsForCategory_args)other;
11873
 
11874
      lastComparison = Boolean.valueOf(isSetCategory_id()).compareTo(isSetCategory_id());
11875
      if (lastComparison != 0) {
11876
        return lastComparison;
11877
      }
11878
      lastComparison = TBaseHelper.compareTo(category_id, typedOther.category_id);
11879
      if (lastComparison != 0) {
11880
        return lastComparison;
11881
      }
103 ashish 11882
      lastComparison = Boolean.valueOf(isSetIsActive()).compareTo(isSetIsActive());
11883
      if (lastComparison != 0) {
11884
        return lastComparison;
11885
      }
11886
      lastComparison = TBaseHelper.compareTo(isActive, typedOther.isActive);
11887
      if (lastComparison != 0) {
11888
        return lastComparison;
11889
      }
100 ashish 11890
      return 0;
11891
    }
11892
 
11893
    public void read(TProtocol iprot) throws TException {
11894
      TField field;
11895
      iprot.readStructBegin();
11896
      while (true)
11897
      {
11898
        field = iprot.readFieldBegin();
11899
        if (field.type == TType.STOP) { 
11900
          break;
11901
        }
11902
        _Fields fieldId = _Fields.findByThriftId(field.id);
11903
        if (fieldId == null) {
11904
          TProtocolUtil.skip(iprot, field.type);
11905
        } else {
11906
          switch (fieldId) {
11907
            case CATEGORY_ID:
11908
              if (field.type == TType.I64) {
11909
                this.category_id = iprot.readI64();
11910
                setCategory_idIsSet(true);
11911
              } else { 
11912
                TProtocolUtil.skip(iprot, field.type);
11913
              }
11914
              break;
103 ashish 11915
            case IS_ACTIVE:
11916
              if (field.type == TType.BOOL) {
11917
                this.isActive = iprot.readBool();
11918
                setIsActiveIsSet(true);
11919
              } else { 
11920
                TProtocolUtil.skip(iprot, field.type);
11921
              }
11922
              break;
100 ashish 11923
          }
11924
          iprot.readFieldEnd();
11925
        }
11926
      }
11927
      iprot.readStructEnd();
11928
      validate();
11929
    }
11930
 
11931
    public void write(TProtocol oprot) throws TException {
11932
      validate();
11933
 
11934
      oprot.writeStructBegin(STRUCT_DESC);
11935
      oprot.writeFieldBegin(CATEGORY_ID_FIELD_DESC);
11936
      oprot.writeI64(this.category_id);
11937
      oprot.writeFieldEnd();
103 ashish 11938
      oprot.writeFieldBegin(IS_ACTIVE_FIELD_DESC);
11939
      oprot.writeBool(this.isActive);
11940
      oprot.writeFieldEnd();
100 ashish 11941
      oprot.writeFieldStop();
11942
      oprot.writeStructEnd();
11943
    }
11944
 
11945
    @Override
11946
    public String toString() {
11947
      StringBuilder sb = new StringBuilder("getAllItemsForCategory_args(");
11948
      boolean first = true;
11949
 
11950
      sb.append("category_id:");
11951
      sb.append(this.category_id);
11952
      first = false;
103 ashish 11953
      if (!first) sb.append(", ");
11954
      sb.append("isActive:");
11955
      sb.append(this.isActive);
11956
      first = false;
100 ashish 11957
      sb.append(")");
11958
      return sb.toString();
11959
    }
11960
 
11961
    public void validate() throws TException {
11962
      // check for required fields
11963
    }
11964
 
11965
  }
11966
 
11967
  public static class getAllItemsForCategory_result implements TBase<getAllItemsForCategory_result._Fields>, java.io.Serializable, Cloneable   {
11968
    private static final TStruct STRUCT_DESC = new TStruct("getAllItemsForCategory_result");
11969
 
11970
    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0);
11971
    private static final TField CEX_FIELD_DESC = new TField("cex", TType.STRUCT, (short)1);
11972
 
11973
    private List<Item> success;
11974
    private CatalogServiceException cex;
11975
 
11976
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
11977
    public enum _Fields implements TFieldIdEnum {
11978
      SUCCESS((short)0, "success"),
11979
      CEX((short)1, "cex");
11980
 
11981
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
11982
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
11983
 
11984
      static {
11985
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
11986
          byId.put((int)field._thriftId, field);
11987
          byName.put(field.getFieldName(), field);
11988
        }
11989
      }
11990
 
11991
      /**
11992
       * Find the _Fields constant that matches fieldId, or null if its not found.
11993
       */
11994
      public static _Fields findByThriftId(int fieldId) {
11995
        return byId.get(fieldId);
11996
      }
11997
 
11998
      /**
11999
       * Find the _Fields constant that matches fieldId, throwing an exception
12000
       * if it is not found.
12001
       */
12002
      public static _Fields findByThriftIdOrThrow(int fieldId) {
12003
        _Fields fields = findByThriftId(fieldId);
12004
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
12005
        return fields;
12006
      }
12007
 
12008
      /**
12009
       * Find the _Fields constant that matches name, or null if its not found.
12010
       */
12011
      public static _Fields findByName(String name) {
12012
        return byName.get(name);
12013
      }
12014
 
12015
      private final short _thriftId;
12016
      private final String _fieldName;
12017
 
12018
      _Fields(short thriftId, String fieldName) {
12019
        _thriftId = thriftId;
12020
        _fieldName = fieldName;
12021
      }
12022
 
12023
      public short getThriftFieldId() {
12024
        return _thriftId;
12025
      }
12026
 
12027
      public String getFieldName() {
12028
        return _fieldName;
12029
      }
12030
    }
12031
 
12032
    // isset id assignments
12033
 
12034
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
12035
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
12036
          new ListMetaData(TType.LIST, 
12037
              new StructMetaData(TType.STRUCT, Item.class))));
12038
      put(_Fields.CEX, new FieldMetaData("cex", TFieldRequirementType.DEFAULT, 
12039
          new FieldValueMetaData(TType.STRUCT)));
12040
    }});
12041
 
12042
    static {
12043
      FieldMetaData.addStructMetaDataMap(getAllItemsForCategory_result.class, metaDataMap);
12044
    }
12045
 
12046
    public getAllItemsForCategory_result() {
12047
    }
12048
 
12049
    public getAllItemsForCategory_result(
12050
      List<Item> success,
12051
      CatalogServiceException cex)
12052
    {
12053
      this();
12054
      this.success = success;
12055
      this.cex = cex;
12056
    }
12057
 
12058
    /**
12059
     * Performs a deep copy on <i>other</i>.
12060
     */
12061
    public getAllItemsForCategory_result(getAllItemsForCategory_result other) {
12062
      if (other.isSetSuccess()) {
12063
        List<Item> __this__success = new ArrayList<Item>();
12064
        for (Item other_element : other.success) {
12065
          __this__success.add(new Item(other_element));
12066
        }
12067
        this.success = __this__success;
12068
      }
12069
      if (other.isSetCex()) {
12070
        this.cex = new CatalogServiceException(other.cex);
12071
      }
12072
    }
12073
 
12074
    public getAllItemsForCategory_result deepCopy() {
12075
      return new getAllItemsForCategory_result(this);
12076
    }
12077
 
12078
    @Deprecated
12079
    public getAllItemsForCategory_result clone() {
12080
      return new getAllItemsForCategory_result(this);
12081
    }
12082
 
12083
    public int getSuccessSize() {
12084
      return (this.success == null) ? 0 : this.success.size();
12085
    }
12086
 
12087
    public java.util.Iterator<Item> getSuccessIterator() {
12088
      return (this.success == null) ? null : this.success.iterator();
12089
    }
12090
 
12091
    public void addToSuccess(Item elem) {
12092
      if (this.success == null) {
12093
        this.success = new ArrayList<Item>();
12094
      }
12095
      this.success.add(elem);
12096
    }
12097
 
12098
    public List<Item> getSuccess() {
12099
      return this.success;
12100
    }
12101
 
12102
    public getAllItemsForCategory_result setSuccess(List<Item> success) {
12103
      this.success = success;
12104
      return this;
12105
    }
12106
 
12107
    public void unsetSuccess() {
12108
      this.success = null;
12109
    }
12110
 
12111
    /** Returns true if field success is set (has been asigned a value) and false otherwise */
12112
    public boolean isSetSuccess() {
12113
      return this.success != null;
12114
    }
12115
 
12116
    public void setSuccessIsSet(boolean value) {
12117
      if (!value) {
12118
        this.success = null;
12119
      }
12120
    }
12121
 
12122
    public CatalogServiceException getCex() {
12123
      return this.cex;
12124
    }
12125
 
12126
    public getAllItemsForCategory_result setCex(CatalogServiceException cex) {
12127
      this.cex = cex;
12128
      return this;
12129
    }
12130
 
12131
    public void unsetCex() {
12132
      this.cex = null;
12133
    }
12134
 
12135
    /** Returns true if field cex is set (has been asigned a value) and false otherwise */
12136
    public boolean isSetCex() {
12137
      return this.cex != null;
12138
    }
12139
 
12140
    public void setCexIsSet(boolean value) {
12141
      if (!value) {
12142
        this.cex = null;
12143
      }
12144
    }
12145
 
12146
    public void setFieldValue(_Fields field, Object value) {
12147
      switch (field) {
12148
      case SUCCESS:
12149
        if (value == null) {
12150
          unsetSuccess();
12151
        } else {
12152
          setSuccess((List<Item>)value);
12153
        }
12154
        break;
12155
 
12156
      case CEX:
12157
        if (value == null) {
12158
          unsetCex();
12159
        } else {
12160
          setCex((CatalogServiceException)value);
12161
        }
12162
        break;
12163
 
12164
      }
12165
    }
12166
 
12167
    public void setFieldValue(int fieldID, Object value) {
12168
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
12169
    }
12170
 
12171
    public Object getFieldValue(_Fields field) {
12172
      switch (field) {
12173
      case SUCCESS:
12174
        return getSuccess();
12175
 
12176
      case CEX:
12177
        return getCex();
12178
 
12179
      }
12180
      throw new IllegalStateException();
12181
    }
12182
 
12183
    public Object getFieldValue(int fieldId) {
12184
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
12185
    }
12186
 
12187
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
12188
    public boolean isSet(_Fields field) {
12189
      switch (field) {
12190
      case SUCCESS:
12191
        return isSetSuccess();
12192
      case CEX:
12193
        return isSetCex();
12194
      }
12195
      throw new IllegalStateException();
12196
    }
12197
 
12198
    public boolean isSet(int fieldID) {
12199
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
12200
    }
12201
 
12202
    @Override
12203
    public boolean equals(Object that) {
12204
      if (that == null)
12205
        return false;
12206
      if (that instanceof getAllItemsForCategory_result)
12207
        return this.equals((getAllItemsForCategory_result)that);
12208
      return false;
12209
    }
12210
 
12211
    public boolean equals(getAllItemsForCategory_result that) {
12212
      if (that == null)
12213
        return false;
12214
 
12215
      boolean this_present_success = true && this.isSetSuccess();
12216
      boolean that_present_success = true && that.isSetSuccess();
12217
      if (this_present_success || that_present_success) {
12218
        if (!(this_present_success && that_present_success))
12219
          return false;
12220
        if (!this.success.equals(that.success))
12221
          return false;
12222
      }
12223
 
12224
      boolean this_present_cex = true && this.isSetCex();
12225
      boolean that_present_cex = true && that.isSetCex();
12226
      if (this_present_cex || that_present_cex) {
12227
        if (!(this_present_cex && that_present_cex))
12228
          return false;
12229
        if (!this.cex.equals(that.cex))
12230
          return false;
12231
      }
12232
 
12233
      return true;
12234
    }
12235
 
12236
    @Override
12237
    public int hashCode() {
12238
      return 0;
12239
    }
12240
 
12241
    public void read(TProtocol iprot) throws TException {
12242
      TField field;
12243
      iprot.readStructBegin();
12244
      while (true)
12245
      {
12246
        field = iprot.readFieldBegin();
12247
        if (field.type == TType.STOP) { 
12248
          break;
12249
        }
12250
        _Fields fieldId = _Fields.findByThriftId(field.id);
12251
        if (fieldId == null) {
12252
          TProtocolUtil.skip(iprot, field.type);
12253
        } else {
12254
          switch (fieldId) {
12255
            case SUCCESS:
12256
              if (field.type == TType.LIST) {
12257
                {
103 ashish 12258
                  TList _list22 = iprot.readListBegin();
12259
                  this.success = new ArrayList<Item>(_list22.size);
12260
                  for (int _i23 = 0; _i23 < _list22.size; ++_i23)
100 ashish 12261
                  {
103 ashish 12262
                    Item _elem24;
12263
                    _elem24 = new Item();
12264
                    _elem24.read(iprot);
12265
                    this.success.add(_elem24);
100 ashish 12266
                  }
12267
                  iprot.readListEnd();
12268
                }
12269
              } else { 
12270
                TProtocolUtil.skip(iprot, field.type);
12271
              }
12272
              break;
12273
            case CEX:
12274
              if (field.type == TType.STRUCT) {
12275
                this.cex = new CatalogServiceException();
12276
                this.cex.read(iprot);
12277
              } else { 
12278
                TProtocolUtil.skip(iprot, field.type);
12279
              }
12280
              break;
12281
          }
12282
          iprot.readFieldEnd();
12283
        }
12284
      }
12285
      iprot.readStructEnd();
12286
      validate();
12287
    }
12288
 
12289
    public void write(TProtocol oprot) throws TException {
12290
      oprot.writeStructBegin(STRUCT_DESC);
12291
 
12292
      if (this.isSetSuccess()) {
12293
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
12294
        {
12295
          oprot.writeListBegin(new TList(TType.STRUCT, this.success.size()));
103 ashish 12296
          for (Item _iter25 : this.success)
100 ashish 12297
          {
103 ashish 12298
            _iter25.write(oprot);
100 ashish 12299
          }
12300
          oprot.writeListEnd();
12301
        }
12302
        oprot.writeFieldEnd();
12303
      } else if (this.isSetCex()) {
12304
        oprot.writeFieldBegin(CEX_FIELD_DESC);
12305
        this.cex.write(oprot);
12306
        oprot.writeFieldEnd();
12307
      }
12308
      oprot.writeFieldStop();
12309
      oprot.writeStructEnd();
12310
    }
12311
 
12312
    @Override
12313
    public String toString() {
12314
      StringBuilder sb = new StringBuilder("getAllItemsForCategory_result(");
12315
      boolean first = true;
12316
 
12317
      sb.append("success:");
12318
      if (this.success == null) {
12319
        sb.append("null");
12320
      } else {
12321
        sb.append(this.success);
12322
      }
12323
      first = false;
12324
      if (!first) sb.append(", ");
12325
      sb.append("cex:");
12326
      if (this.cex == null) {
12327
        sb.append("null");
12328
      } else {
12329
        sb.append(this.cex);
12330
      }
12331
      first = false;
12332
      sb.append(")");
12333
      return sb.toString();
12334
    }
12335
 
12336
    public void validate() throws TException {
12337
      // check for required fields
12338
    }
12339
 
12340
  }
12341
 
103 ashish 12342
  public static class getAllItems_args implements TBase<getAllItems_args._Fields>, java.io.Serializable, Cloneable, Comparable<getAllItems_args>   {
12343
    private static final TStruct STRUCT_DESC = new TStruct("getAllItems_args");
100 ashish 12344
 
103 ashish 12345
    private static final TField IS_ACTIVE_FIELD_DESC = new TField("isActive", TType.BOOL, (short)1);
100 ashish 12346
 
103 ashish 12347
    private boolean isActive;
100 ashish 12348
 
12349
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
12350
    public enum _Fields implements TFieldIdEnum {
103 ashish 12351
      IS_ACTIVE((short)1, "isActive");
100 ashish 12352
 
12353
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
12354
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
12355
 
12356
      static {
12357
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
12358
          byId.put((int)field._thriftId, field);
12359
          byName.put(field.getFieldName(), field);
12360
        }
12361
      }
12362
 
12363
      /**
12364
       * Find the _Fields constant that matches fieldId, or null if its not found.
12365
       */
12366
      public static _Fields findByThriftId(int fieldId) {
12367
        return byId.get(fieldId);
12368
      }
12369
 
12370
      /**
12371
       * Find the _Fields constant that matches fieldId, throwing an exception
12372
       * if it is not found.
12373
       */
12374
      public static _Fields findByThriftIdOrThrow(int fieldId) {
12375
        _Fields fields = findByThriftId(fieldId);
12376
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
12377
        return fields;
12378
      }
12379
 
12380
      /**
12381
       * Find the _Fields constant that matches name, or null if its not found.
12382
       */
12383
      public static _Fields findByName(String name) {
12384
        return byName.get(name);
12385
      }
12386
 
12387
      private final short _thriftId;
12388
      private final String _fieldName;
12389
 
12390
      _Fields(short thriftId, String fieldName) {
12391
        _thriftId = thriftId;
12392
        _fieldName = fieldName;
12393
      }
12394
 
12395
      public short getThriftFieldId() {
12396
        return _thriftId;
12397
      }
12398
 
12399
      public String getFieldName() {
12400
        return _fieldName;
12401
      }
12402
    }
12403
 
12404
    // isset id assignments
103 ashish 12405
    private static final int __ISACTIVE_ISSET_ID = 0;
100 ashish 12406
    private BitSet __isset_bit_vector = new BitSet(1);
12407
 
12408
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
103 ashish 12409
      put(_Fields.IS_ACTIVE, new FieldMetaData("isActive", TFieldRequirementType.DEFAULT, 
12410
          new FieldValueMetaData(TType.BOOL)));
100 ashish 12411
    }});
12412
 
12413
    static {
103 ashish 12414
      FieldMetaData.addStructMetaDataMap(getAllItems_args.class, metaDataMap);
100 ashish 12415
    }
12416
 
103 ashish 12417
    public getAllItems_args() {
100 ashish 12418
    }
12419
 
103 ashish 12420
    public getAllItems_args(
12421
      boolean isActive)
100 ashish 12422
    {
12423
      this();
103 ashish 12424
      this.isActive = isActive;
12425
      setIsActiveIsSet(true);
100 ashish 12426
    }
12427
 
12428
    /**
12429
     * Performs a deep copy on <i>other</i>.
12430
     */
103 ashish 12431
    public getAllItems_args(getAllItems_args other) {
100 ashish 12432
      __isset_bit_vector.clear();
12433
      __isset_bit_vector.or(other.__isset_bit_vector);
103 ashish 12434
      this.isActive = other.isActive;
100 ashish 12435
    }
12436
 
103 ashish 12437
    public getAllItems_args deepCopy() {
12438
      return new getAllItems_args(this);
100 ashish 12439
    }
12440
 
12441
    @Deprecated
103 ashish 12442
    public getAllItems_args clone() {
12443
      return new getAllItems_args(this);
100 ashish 12444
    }
12445
 
103 ashish 12446
    public boolean isIsActive() {
12447
      return this.isActive;
100 ashish 12448
    }
12449
 
103 ashish 12450
    public getAllItems_args setIsActive(boolean isActive) {
12451
      this.isActive = isActive;
12452
      setIsActiveIsSet(true);
100 ashish 12453
      return this;
12454
    }
12455
 
103 ashish 12456
    public void unsetIsActive() {
12457
      __isset_bit_vector.clear(__ISACTIVE_ISSET_ID);
100 ashish 12458
    }
12459
 
103 ashish 12460
    /** Returns true if field isActive is set (has been asigned a value) and false otherwise */
12461
    public boolean isSetIsActive() {
12462
      return __isset_bit_vector.get(__ISACTIVE_ISSET_ID);
100 ashish 12463
    }
12464
 
103 ashish 12465
    public void setIsActiveIsSet(boolean value) {
12466
      __isset_bit_vector.set(__ISACTIVE_ISSET_ID, value);
100 ashish 12467
    }
12468
 
12469
    public void setFieldValue(_Fields field, Object value) {
12470
      switch (field) {
103 ashish 12471
      case IS_ACTIVE:
100 ashish 12472
        if (value == null) {
103 ashish 12473
          unsetIsActive();
100 ashish 12474
        } else {
103 ashish 12475
          setIsActive((Boolean)value);
100 ashish 12476
        }
12477
        break;
12478
 
12479
      }
12480
    }
12481
 
12482
    public void setFieldValue(int fieldID, Object value) {
12483
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
12484
    }
12485
 
12486
    public Object getFieldValue(_Fields field) {
12487
      switch (field) {
103 ashish 12488
      case IS_ACTIVE:
12489
        return new Boolean(isIsActive());
100 ashish 12490
 
12491
      }
12492
      throw new IllegalStateException();
12493
    }
12494
 
12495
    public Object getFieldValue(int fieldId) {
12496
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
12497
    }
12498
 
12499
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
12500
    public boolean isSet(_Fields field) {
12501
      switch (field) {
103 ashish 12502
      case IS_ACTIVE:
12503
        return isSetIsActive();
100 ashish 12504
      }
12505
      throw new IllegalStateException();
12506
    }
12507
 
12508
    public boolean isSet(int fieldID) {
12509
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
12510
    }
12511
 
12512
    @Override
12513
    public boolean equals(Object that) {
12514
      if (that == null)
12515
        return false;
103 ashish 12516
      if (that instanceof getAllItems_args)
12517
        return this.equals((getAllItems_args)that);
100 ashish 12518
      return false;
12519
    }
12520
 
103 ashish 12521
    public boolean equals(getAllItems_args that) {
100 ashish 12522
      if (that == null)
12523
        return false;
12524
 
103 ashish 12525
      boolean this_present_isActive = true;
12526
      boolean that_present_isActive = true;
12527
      if (this_present_isActive || that_present_isActive) {
12528
        if (!(this_present_isActive && that_present_isActive))
100 ashish 12529
          return false;
103 ashish 12530
        if (this.isActive != that.isActive)
100 ashish 12531
          return false;
12532
      }
12533
 
12534
      return true;
12535
    }
12536
 
12537
    @Override
12538
    public int hashCode() {
12539
      return 0;
12540
    }
12541
 
103 ashish 12542
    public int compareTo(getAllItems_args other) {
100 ashish 12543
      if (!getClass().equals(other.getClass())) {
12544
        return getClass().getName().compareTo(other.getClass().getName());
12545
      }
12546
 
12547
      int lastComparison = 0;
103 ashish 12548
      getAllItems_args typedOther = (getAllItems_args)other;
100 ashish 12549
 
103 ashish 12550
      lastComparison = Boolean.valueOf(isSetIsActive()).compareTo(isSetIsActive());
100 ashish 12551
      if (lastComparison != 0) {
12552
        return lastComparison;
12553
      }
103 ashish 12554
      lastComparison = TBaseHelper.compareTo(isActive, typedOther.isActive);
100 ashish 12555
      if (lastComparison != 0) {
12556
        return lastComparison;
12557
      }
12558
      return 0;
12559
    }
12560
 
12561
    public void read(TProtocol iprot) throws TException {
12562
      TField field;
12563
      iprot.readStructBegin();
12564
      while (true)
12565
      {
12566
        field = iprot.readFieldBegin();
12567
        if (field.type == TType.STOP) { 
12568
          break;
12569
        }
12570
        _Fields fieldId = _Fields.findByThriftId(field.id);
12571
        if (fieldId == null) {
12572
          TProtocolUtil.skip(iprot, field.type);
12573
        } else {
12574
          switch (fieldId) {
103 ashish 12575
            case IS_ACTIVE:
12576
              if (field.type == TType.BOOL) {
12577
                this.isActive = iprot.readBool();
12578
                setIsActiveIsSet(true);
100 ashish 12579
              } else { 
12580
                TProtocolUtil.skip(iprot, field.type);
12581
              }
12582
              break;
12583
          }
12584
          iprot.readFieldEnd();
12585
        }
12586
      }
12587
      iprot.readStructEnd();
12588
      validate();
12589
    }
12590
 
12591
    public void write(TProtocol oprot) throws TException {
12592
      validate();
12593
 
12594
      oprot.writeStructBegin(STRUCT_DESC);
103 ashish 12595
      oprot.writeFieldBegin(IS_ACTIVE_FIELD_DESC);
12596
      oprot.writeBool(this.isActive);
100 ashish 12597
      oprot.writeFieldEnd();
12598
      oprot.writeFieldStop();
12599
      oprot.writeStructEnd();
12600
    }
12601
 
12602
    @Override
12603
    public String toString() {
103 ashish 12604
      StringBuilder sb = new StringBuilder("getAllItems_args(");
100 ashish 12605
      boolean first = true;
12606
 
103 ashish 12607
      sb.append("isActive:");
12608
      sb.append(this.isActive);
100 ashish 12609
      first = false;
12610
      sb.append(")");
12611
      return sb.toString();
12612
    }
12613
 
12614
    public void validate() throws TException {
12615
      // check for required fields
12616
    }
12617
 
12618
  }
12619
 
103 ashish 12620
  public static class getAllItems_result implements TBase<getAllItems_result._Fields>, java.io.Serializable, Cloneable   {
12621
    private static final TStruct STRUCT_DESC = new TStruct("getAllItems_result");
100 ashish 12622
 
103 ashish 12623
    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0);
100 ashish 12624
    private static final TField CEX_FIELD_DESC = new TField("cex", TType.STRUCT, (short)1);
12625
 
103 ashish 12626
    private List<Item> success;
100 ashish 12627
    private CatalogServiceException cex;
12628
 
12629
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
12630
    public enum _Fields implements TFieldIdEnum {
12631
      SUCCESS((short)0, "success"),
12632
      CEX((short)1, "cex");
12633
 
12634
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
12635
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
12636
 
12637
      static {
12638
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
12639
          byId.put((int)field._thriftId, field);
12640
          byName.put(field.getFieldName(), field);
12641
        }
12642
      }
12643
 
12644
      /**
12645
       * Find the _Fields constant that matches fieldId, or null if its not found.
12646
       */
12647
      public static _Fields findByThriftId(int fieldId) {
12648
        return byId.get(fieldId);
12649
      }
12650
 
12651
      /**
12652
       * Find the _Fields constant that matches fieldId, throwing an exception
12653
       * if it is not found.
12654
       */
12655
      public static _Fields findByThriftIdOrThrow(int fieldId) {
12656
        _Fields fields = findByThriftId(fieldId);
12657
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
12658
        return fields;
12659
      }
12660
 
12661
      /**
12662
       * Find the _Fields constant that matches name, or null if its not found.
12663
       */
12664
      public static _Fields findByName(String name) {
12665
        return byName.get(name);
12666
      }
12667
 
12668
      private final short _thriftId;
12669
      private final String _fieldName;
12670
 
12671
      _Fields(short thriftId, String fieldName) {
12672
        _thriftId = thriftId;
12673
        _fieldName = fieldName;
12674
      }
12675
 
12676
      public short getThriftFieldId() {
12677
        return _thriftId;
12678
      }
12679
 
12680
      public String getFieldName() {
12681
        return _fieldName;
12682
      }
12683
    }
12684
 
12685
    // isset id assignments
12686
 
12687
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
12688
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
103 ashish 12689
          new ListMetaData(TType.LIST, 
12690
              new StructMetaData(TType.STRUCT, Item.class))));
100 ashish 12691
      put(_Fields.CEX, new FieldMetaData("cex", TFieldRequirementType.DEFAULT, 
12692
          new FieldValueMetaData(TType.STRUCT)));
12693
    }});
12694
 
12695
    static {
103 ashish 12696
      FieldMetaData.addStructMetaDataMap(getAllItems_result.class, metaDataMap);
100 ashish 12697
    }
12698
 
103 ashish 12699
    public getAllItems_result() {
100 ashish 12700
    }
12701
 
103 ashish 12702
    public getAllItems_result(
12703
      List<Item> success,
100 ashish 12704
      CatalogServiceException cex)
12705
    {
12706
      this();
12707
      this.success = success;
12708
      this.cex = cex;
12709
    }
12710
 
12711
    /**
12712
     * Performs a deep copy on <i>other</i>.
12713
     */
103 ashish 12714
    public getAllItems_result(getAllItems_result other) {
100 ashish 12715
      if (other.isSetSuccess()) {
103 ashish 12716
        List<Item> __this__success = new ArrayList<Item>();
12717
        for (Item other_element : other.success) {
12718
          __this__success.add(new Item(other_element));
12719
        }
12720
        this.success = __this__success;
100 ashish 12721
      }
12722
      if (other.isSetCex()) {
12723
        this.cex = new CatalogServiceException(other.cex);
12724
      }
12725
    }
12726
 
103 ashish 12727
    public getAllItems_result deepCopy() {
12728
      return new getAllItems_result(this);
100 ashish 12729
    }
12730
 
12731
    @Deprecated
103 ashish 12732
    public getAllItems_result clone() {
12733
      return new getAllItems_result(this);
100 ashish 12734
    }
12735
 
103 ashish 12736
    public int getSuccessSize() {
12737
      return (this.success == null) ? 0 : this.success.size();
12738
    }
12739
 
12740
    public java.util.Iterator<Item> getSuccessIterator() {
12741
      return (this.success == null) ? null : this.success.iterator();
12742
    }
12743
 
12744
    public void addToSuccess(Item elem) {
12745
      if (this.success == null) {
12746
        this.success = new ArrayList<Item>();
12747
      }
12748
      this.success.add(elem);
12749
    }
12750
 
12751
    public List<Item> getSuccess() {
100 ashish 12752
      return this.success;
12753
    }
12754
 
103 ashish 12755
    public getAllItems_result setSuccess(List<Item> success) {
100 ashish 12756
      this.success = success;
12757
      return this;
12758
    }
12759
 
12760
    public void unsetSuccess() {
12761
      this.success = null;
12762
    }
12763
 
12764
    /** Returns true if field success is set (has been asigned a value) and false otherwise */
12765
    public boolean isSetSuccess() {
12766
      return this.success != null;
12767
    }
12768
 
12769
    public void setSuccessIsSet(boolean value) {
12770
      if (!value) {
12771
        this.success = null;
12772
      }
12773
    }
12774
 
12775
    public CatalogServiceException getCex() {
12776
      return this.cex;
12777
    }
12778
 
103 ashish 12779
    public getAllItems_result setCex(CatalogServiceException cex) {
100 ashish 12780
      this.cex = cex;
12781
      return this;
12782
    }
12783
 
12784
    public void unsetCex() {
12785
      this.cex = null;
12786
    }
12787
 
12788
    /** Returns true if field cex is set (has been asigned a value) and false otherwise */
12789
    public boolean isSetCex() {
12790
      return this.cex != null;
12791
    }
12792
 
12793
    public void setCexIsSet(boolean value) {
12794
      if (!value) {
12795
        this.cex = null;
12796
      }
12797
    }
12798
 
12799
    public void setFieldValue(_Fields field, Object value) {
12800
      switch (field) {
12801
      case SUCCESS:
12802
        if (value == null) {
12803
          unsetSuccess();
12804
        } else {
103 ashish 12805
          setSuccess((List<Item>)value);
100 ashish 12806
        }
12807
        break;
12808
 
12809
      case CEX:
12810
        if (value == null) {
12811
          unsetCex();
12812
        } else {
12813
          setCex((CatalogServiceException)value);
12814
        }
12815
        break;
12816
 
12817
      }
12818
    }
12819
 
12820
    public void setFieldValue(int fieldID, Object value) {
12821
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
12822
    }
12823
 
12824
    public Object getFieldValue(_Fields field) {
12825
      switch (field) {
12826
      case SUCCESS:
12827
        return getSuccess();
12828
 
12829
      case CEX:
12830
        return getCex();
12831
 
12832
      }
12833
      throw new IllegalStateException();
12834
    }
12835
 
12836
    public Object getFieldValue(int fieldId) {
12837
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
12838
    }
12839
 
12840
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
12841
    public boolean isSet(_Fields field) {
12842
      switch (field) {
12843
      case SUCCESS:
12844
        return isSetSuccess();
12845
      case CEX:
12846
        return isSetCex();
12847
      }
12848
      throw new IllegalStateException();
12849
    }
12850
 
12851
    public boolean isSet(int fieldID) {
12852
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
12853
    }
12854
 
12855
    @Override
12856
    public boolean equals(Object that) {
12857
      if (that == null)
12858
        return false;
103 ashish 12859
      if (that instanceof getAllItems_result)
12860
        return this.equals((getAllItems_result)that);
100 ashish 12861
      return false;
12862
    }
12863
 
103 ashish 12864
    public boolean equals(getAllItems_result that) {
100 ashish 12865
      if (that == null)
12866
        return false;
12867
 
12868
      boolean this_present_success = true && this.isSetSuccess();
12869
      boolean that_present_success = true && that.isSetSuccess();
12870
      if (this_present_success || that_present_success) {
12871
        if (!(this_present_success && that_present_success))
12872
          return false;
12873
        if (!this.success.equals(that.success))
12874
          return false;
12875
      }
12876
 
12877
      boolean this_present_cex = true && this.isSetCex();
12878
      boolean that_present_cex = true && that.isSetCex();
12879
      if (this_present_cex || that_present_cex) {
12880
        if (!(this_present_cex && that_present_cex))
12881
          return false;
12882
        if (!this.cex.equals(that.cex))
12883
          return false;
12884
      }
12885
 
12886
      return true;
12887
    }
12888
 
12889
    @Override
12890
    public int hashCode() {
12891
      return 0;
12892
    }
12893
 
103 ashish 12894
    public void read(TProtocol iprot) throws TException {
12895
      TField field;
12896
      iprot.readStructBegin();
12897
      while (true)
12898
      {
12899
        field = iprot.readFieldBegin();
12900
        if (field.type == TType.STOP) { 
12901
          break;
12902
        }
12903
        _Fields fieldId = _Fields.findByThriftId(field.id);
12904
        if (fieldId == null) {
12905
          TProtocolUtil.skip(iprot, field.type);
12906
        } else {
12907
          switch (fieldId) {
12908
            case SUCCESS:
12909
              if (field.type == TType.LIST) {
12910
                {
12911
                  TList _list26 = iprot.readListBegin();
12912
                  this.success = new ArrayList<Item>(_list26.size);
12913
                  for (int _i27 = 0; _i27 < _list26.size; ++_i27)
12914
                  {
12915
                    Item _elem28;
12916
                    _elem28 = new Item();
12917
                    _elem28.read(iprot);
12918
                    this.success.add(_elem28);
12919
                  }
12920
                  iprot.readListEnd();
12921
                }
12922
              } else { 
12923
                TProtocolUtil.skip(iprot, field.type);
12924
              }
12925
              break;
12926
            case CEX:
12927
              if (field.type == TType.STRUCT) {
12928
                this.cex = new CatalogServiceException();
12929
                this.cex.read(iprot);
12930
              } else { 
12931
                TProtocolUtil.skip(iprot, field.type);
12932
              }
12933
              break;
12934
          }
12935
          iprot.readFieldEnd();
12936
        }
12937
      }
12938
      iprot.readStructEnd();
12939
      validate();
12940
    }
12941
 
12942
    public void write(TProtocol oprot) throws TException {
12943
      oprot.writeStructBegin(STRUCT_DESC);
12944
 
12945
      if (this.isSetSuccess()) {
12946
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
12947
        {
12948
          oprot.writeListBegin(new TList(TType.STRUCT, this.success.size()));
12949
          for (Item _iter29 : this.success)
12950
          {
12951
            _iter29.write(oprot);
12952
          }
12953
          oprot.writeListEnd();
12954
        }
12955
        oprot.writeFieldEnd();
12956
      } else if (this.isSetCex()) {
12957
        oprot.writeFieldBegin(CEX_FIELD_DESC);
12958
        this.cex.write(oprot);
12959
        oprot.writeFieldEnd();
12960
      }
12961
      oprot.writeFieldStop();
12962
      oprot.writeStructEnd();
12963
    }
12964
 
12965
    @Override
12966
    public String toString() {
12967
      StringBuilder sb = new StringBuilder("getAllItems_result(");
12968
      boolean first = true;
12969
 
12970
      sb.append("success:");
12971
      if (this.success == null) {
12972
        sb.append("null");
12973
      } else {
12974
        sb.append(this.success);
12975
      }
12976
      first = false;
12977
      if (!first) sb.append(", ");
12978
      sb.append("cex:");
12979
      if (this.cex == null) {
12980
        sb.append("null");
12981
      } else {
12982
        sb.append(this.cex);
12983
      }
12984
      first = false;
12985
      sb.append(")");
12986
      return sb.toString();
12987
    }
12988
 
12989
    public void validate() throws TException {
12990
      // check for required fields
12991
    }
12992
 
12993
  }
12994
 
12995
  public static class getAllItemsByStatus_args implements TBase<getAllItemsByStatus_args._Fields>, java.io.Serializable, Cloneable, Comparable<getAllItemsByStatus_args>   {
12996
    private static final TStruct STRUCT_DESC = new TStruct("getAllItemsByStatus_args");
12997
 
12998
    private static final TField ITEM_STATUS_FIELD_DESC = new TField("itemStatus", TType.I32, (short)1);
12999
 
13000
    private status itemStatus;
13001
 
13002
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
13003
    public enum _Fields implements TFieldIdEnum {
13004
      /**
13005
       * 
13006
       * @see status
13007
       */
13008
      ITEM_STATUS((short)1, "itemStatus");
13009
 
13010
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
13011
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
13012
 
13013
      static {
13014
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
13015
          byId.put((int)field._thriftId, field);
13016
          byName.put(field.getFieldName(), field);
13017
        }
13018
      }
13019
 
13020
      /**
13021
       * Find the _Fields constant that matches fieldId, or null if its not found.
13022
       */
13023
      public static _Fields findByThriftId(int fieldId) {
13024
        return byId.get(fieldId);
13025
      }
13026
 
13027
      /**
13028
       * Find the _Fields constant that matches fieldId, throwing an exception
13029
       * if it is not found.
13030
       */
13031
      public static _Fields findByThriftIdOrThrow(int fieldId) {
13032
        _Fields fields = findByThriftId(fieldId);
13033
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
13034
        return fields;
13035
      }
13036
 
13037
      /**
13038
       * Find the _Fields constant that matches name, or null if its not found.
13039
       */
13040
      public static _Fields findByName(String name) {
13041
        return byName.get(name);
13042
      }
13043
 
13044
      private final short _thriftId;
13045
      private final String _fieldName;
13046
 
13047
      _Fields(short thriftId, String fieldName) {
13048
        _thriftId = thriftId;
13049
        _fieldName = fieldName;
13050
      }
13051
 
13052
      public short getThriftFieldId() {
13053
        return _thriftId;
13054
      }
13055
 
13056
      public String getFieldName() {
13057
        return _fieldName;
13058
      }
13059
    }
13060
 
13061
    // isset id assignments
13062
 
13063
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
13064
      put(_Fields.ITEM_STATUS, new FieldMetaData("itemStatus", TFieldRequirementType.DEFAULT, 
13065
          new EnumMetaData(TType.ENUM, status.class)));
13066
    }});
13067
 
13068
    static {
13069
      FieldMetaData.addStructMetaDataMap(getAllItemsByStatus_args.class, metaDataMap);
13070
    }
13071
 
13072
    public getAllItemsByStatus_args() {
13073
    }
13074
 
13075
    public getAllItemsByStatus_args(
13076
      status itemStatus)
13077
    {
13078
      this();
13079
      this.itemStatus = itemStatus;
13080
    }
13081
 
13082
    /**
13083
     * Performs a deep copy on <i>other</i>.
13084
     */
13085
    public getAllItemsByStatus_args(getAllItemsByStatus_args other) {
13086
      if (other.isSetItemStatus()) {
13087
        this.itemStatus = other.itemStatus;
13088
      }
13089
    }
13090
 
13091
    public getAllItemsByStatus_args deepCopy() {
13092
      return new getAllItemsByStatus_args(this);
13093
    }
13094
 
13095
    @Deprecated
13096
    public getAllItemsByStatus_args clone() {
13097
      return new getAllItemsByStatus_args(this);
13098
    }
13099
 
13100
    /**
13101
     * 
13102
     * @see status
13103
     */
13104
    public status getItemStatus() {
13105
      return this.itemStatus;
13106
    }
13107
 
13108
    /**
13109
     * 
13110
     * @see status
13111
     */
13112
    public getAllItemsByStatus_args setItemStatus(status itemStatus) {
13113
      this.itemStatus = itemStatus;
13114
      return this;
13115
    }
13116
 
13117
    public void unsetItemStatus() {
13118
      this.itemStatus = null;
13119
    }
13120
 
13121
    /** Returns true if field itemStatus is set (has been asigned a value) and false otherwise */
13122
    public boolean isSetItemStatus() {
13123
      return this.itemStatus != null;
13124
    }
13125
 
13126
    public void setItemStatusIsSet(boolean value) {
13127
      if (!value) {
13128
        this.itemStatus = null;
13129
      }
13130
    }
13131
 
13132
    public void setFieldValue(_Fields field, Object value) {
13133
      switch (field) {
13134
      case ITEM_STATUS:
13135
        if (value == null) {
13136
          unsetItemStatus();
13137
        } else {
13138
          setItemStatus((status)value);
13139
        }
13140
        break;
13141
 
13142
      }
13143
    }
13144
 
13145
    public void setFieldValue(int fieldID, Object value) {
13146
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
13147
    }
13148
 
13149
    public Object getFieldValue(_Fields field) {
13150
      switch (field) {
13151
      case ITEM_STATUS:
13152
        return getItemStatus();
13153
 
13154
      }
13155
      throw new IllegalStateException();
13156
    }
13157
 
13158
    public Object getFieldValue(int fieldId) {
13159
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
13160
    }
13161
 
13162
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
13163
    public boolean isSet(_Fields field) {
13164
      switch (field) {
13165
      case ITEM_STATUS:
13166
        return isSetItemStatus();
13167
      }
13168
      throw new IllegalStateException();
13169
    }
13170
 
13171
    public boolean isSet(int fieldID) {
13172
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
13173
    }
13174
 
13175
    @Override
13176
    public boolean equals(Object that) {
13177
      if (that == null)
13178
        return false;
13179
      if (that instanceof getAllItemsByStatus_args)
13180
        return this.equals((getAllItemsByStatus_args)that);
13181
      return false;
13182
    }
13183
 
13184
    public boolean equals(getAllItemsByStatus_args that) {
13185
      if (that == null)
13186
        return false;
13187
 
13188
      boolean this_present_itemStatus = true && this.isSetItemStatus();
13189
      boolean that_present_itemStatus = true && that.isSetItemStatus();
13190
      if (this_present_itemStatus || that_present_itemStatus) {
13191
        if (!(this_present_itemStatus && that_present_itemStatus))
13192
          return false;
13193
        if (!this.itemStatus.equals(that.itemStatus))
13194
          return false;
13195
      }
13196
 
13197
      return true;
13198
    }
13199
 
13200
    @Override
13201
    public int hashCode() {
13202
      return 0;
13203
    }
13204
 
13205
    public int compareTo(getAllItemsByStatus_args other) {
100 ashish 13206
      if (!getClass().equals(other.getClass())) {
13207
        return getClass().getName().compareTo(other.getClass().getName());
13208
      }
13209
 
13210
      int lastComparison = 0;
103 ashish 13211
      getAllItemsByStatus_args typedOther = (getAllItemsByStatus_args)other;
100 ashish 13212
 
103 ashish 13213
      lastComparison = Boolean.valueOf(isSetItemStatus()).compareTo(isSetItemStatus());
100 ashish 13214
      if (lastComparison != 0) {
13215
        return lastComparison;
13216
      }
103 ashish 13217
      lastComparison = TBaseHelper.compareTo(itemStatus, typedOther.itemStatus);
100 ashish 13218
      if (lastComparison != 0) {
13219
        return lastComparison;
13220
      }
103 ashish 13221
      return 0;
13222
    }
13223
 
13224
    public void read(TProtocol iprot) throws TException {
13225
      TField field;
13226
      iprot.readStructBegin();
13227
      while (true)
13228
      {
13229
        field = iprot.readFieldBegin();
13230
        if (field.type == TType.STOP) { 
13231
          break;
13232
        }
13233
        _Fields fieldId = _Fields.findByThriftId(field.id);
13234
        if (fieldId == null) {
13235
          TProtocolUtil.skip(iprot, field.type);
13236
        } else {
13237
          switch (fieldId) {
13238
            case ITEM_STATUS:
13239
              if (field.type == TType.I32) {
13240
                this.itemStatus = status.findByValue(iprot.readI32());
13241
              } else { 
13242
                TProtocolUtil.skip(iprot, field.type);
13243
              }
13244
              break;
13245
          }
13246
          iprot.readFieldEnd();
13247
        }
100 ashish 13248
      }
103 ashish 13249
      iprot.readStructEnd();
13250
      validate();
13251
    }
13252
 
13253
    public void write(TProtocol oprot) throws TException {
13254
      validate();
13255
 
13256
      oprot.writeStructBegin(STRUCT_DESC);
13257
      if (this.itemStatus != null) {
13258
        oprot.writeFieldBegin(ITEM_STATUS_FIELD_DESC);
13259
        oprot.writeI32(this.itemStatus.getValue());
13260
        oprot.writeFieldEnd();
100 ashish 13261
      }
103 ashish 13262
      oprot.writeFieldStop();
13263
      oprot.writeStructEnd();
13264
    }
13265
 
13266
    @Override
13267
    public String toString() {
13268
      StringBuilder sb = new StringBuilder("getAllItemsByStatus_args(");
13269
      boolean first = true;
13270
 
13271
      sb.append("itemStatus:");
13272
      if (this.itemStatus == null) {
13273
        sb.append("null");
13274
      } else {
13275
        String itemStatus_name = itemStatus.name();
13276
        if (itemStatus_name != null) {
13277
          sb.append(itemStatus_name);
13278
          sb.append(" (");
13279
        }
13280
        sb.append(this.itemStatus);
13281
        if (itemStatus_name != null) {
13282
          sb.append(")");
13283
        }
13284
      }
13285
      first = false;
13286
      sb.append(")");
13287
      return sb.toString();
13288
    }
13289
 
13290
    public void validate() throws TException {
13291
      // check for required fields
13292
    }
13293
 
13294
  }
13295
 
13296
  public static class getAllItemsByStatus_result implements TBase<getAllItemsByStatus_result._Fields>, java.io.Serializable, Cloneable   {
13297
    private static final TStruct STRUCT_DESC = new TStruct("getAllItemsByStatus_result");
13298
 
13299
    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0);
13300
    private static final TField CEX_FIELD_DESC = new TField("cex", TType.STRUCT, (short)1);
13301
 
13302
    private List<Item> success;
13303
    private CatalogServiceException cex;
13304
 
13305
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
13306
    public enum _Fields implements TFieldIdEnum {
13307
      SUCCESS((short)0, "success"),
13308
      CEX((short)1, "cex");
13309
 
13310
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
13311
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
13312
 
13313
      static {
13314
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
13315
          byId.put((int)field._thriftId, field);
13316
          byName.put(field.getFieldName(), field);
13317
        }
13318
      }
13319
 
13320
      /**
13321
       * Find the _Fields constant that matches fieldId, or null if its not found.
13322
       */
13323
      public static _Fields findByThriftId(int fieldId) {
13324
        return byId.get(fieldId);
13325
      }
13326
 
13327
      /**
13328
       * Find the _Fields constant that matches fieldId, throwing an exception
13329
       * if it is not found.
13330
       */
13331
      public static _Fields findByThriftIdOrThrow(int fieldId) {
13332
        _Fields fields = findByThriftId(fieldId);
13333
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
13334
        return fields;
13335
      }
13336
 
13337
      /**
13338
       * Find the _Fields constant that matches name, or null if its not found.
13339
       */
13340
      public static _Fields findByName(String name) {
13341
        return byName.get(name);
13342
      }
13343
 
13344
      private final short _thriftId;
13345
      private final String _fieldName;
13346
 
13347
      _Fields(short thriftId, String fieldName) {
13348
        _thriftId = thriftId;
13349
        _fieldName = fieldName;
13350
      }
13351
 
13352
      public short getThriftFieldId() {
13353
        return _thriftId;
13354
      }
13355
 
13356
      public String getFieldName() {
13357
        return _fieldName;
13358
      }
13359
    }
13360
 
13361
    // isset id assignments
13362
 
13363
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
13364
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
13365
          new ListMetaData(TType.LIST, 
13366
              new StructMetaData(TType.STRUCT, Item.class))));
13367
      put(_Fields.CEX, new FieldMetaData("cex", TFieldRequirementType.DEFAULT, 
13368
          new FieldValueMetaData(TType.STRUCT)));
13369
    }});
13370
 
13371
    static {
13372
      FieldMetaData.addStructMetaDataMap(getAllItemsByStatus_result.class, metaDataMap);
13373
    }
13374
 
13375
    public getAllItemsByStatus_result() {
13376
    }
13377
 
13378
    public getAllItemsByStatus_result(
13379
      List<Item> success,
13380
      CatalogServiceException cex)
13381
    {
13382
      this();
13383
      this.success = success;
13384
      this.cex = cex;
13385
    }
13386
 
13387
    /**
13388
     * Performs a deep copy on <i>other</i>.
13389
     */
13390
    public getAllItemsByStatus_result(getAllItemsByStatus_result other) {
13391
      if (other.isSetSuccess()) {
13392
        List<Item> __this__success = new ArrayList<Item>();
13393
        for (Item other_element : other.success) {
13394
          __this__success.add(new Item(other_element));
13395
        }
13396
        this.success = __this__success;
13397
      }
13398
      if (other.isSetCex()) {
13399
        this.cex = new CatalogServiceException(other.cex);
13400
      }
13401
    }
13402
 
13403
    public getAllItemsByStatus_result deepCopy() {
13404
      return new getAllItemsByStatus_result(this);
13405
    }
13406
 
13407
    @Deprecated
13408
    public getAllItemsByStatus_result clone() {
13409
      return new getAllItemsByStatus_result(this);
13410
    }
13411
 
13412
    public int getSuccessSize() {
13413
      return (this.success == null) ? 0 : this.success.size();
13414
    }
13415
 
13416
    public java.util.Iterator<Item> getSuccessIterator() {
13417
      return (this.success == null) ? null : this.success.iterator();
13418
    }
13419
 
13420
    public void addToSuccess(Item elem) {
13421
      if (this.success == null) {
13422
        this.success = new ArrayList<Item>();
13423
      }
13424
      this.success.add(elem);
13425
    }
13426
 
13427
    public List<Item> getSuccess() {
13428
      return this.success;
13429
    }
13430
 
13431
    public getAllItemsByStatus_result setSuccess(List<Item> success) {
13432
      this.success = success;
13433
      return this;
13434
    }
13435
 
13436
    public void unsetSuccess() {
13437
      this.success = null;
13438
    }
13439
 
13440
    /** Returns true if field success is set (has been asigned a value) and false otherwise */
13441
    public boolean isSetSuccess() {
13442
      return this.success != null;
13443
    }
13444
 
13445
    public void setSuccessIsSet(boolean value) {
13446
      if (!value) {
13447
        this.success = null;
13448
      }
13449
    }
13450
 
13451
    public CatalogServiceException getCex() {
13452
      return this.cex;
13453
    }
13454
 
13455
    public getAllItemsByStatus_result setCex(CatalogServiceException cex) {
13456
      this.cex = cex;
13457
      return this;
13458
    }
13459
 
13460
    public void unsetCex() {
13461
      this.cex = null;
13462
    }
13463
 
13464
    /** Returns true if field cex is set (has been asigned a value) and false otherwise */
13465
    public boolean isSetCex() {
13466
      return this.cex != null;
13467
    }
13468
 
13469
    public void setCexIsSet(boolean value) {
13470
      if (!value) {
13471
        this.cex = null;
13472
      }
13473
    }
13474
 
13475
    public void setFieldValue(_Fields field, Object value) {
13476
      switch (field) {
13477
      case SUCCESS:
13478
        if (value == null) {
13479
          unsetSuccess();
13480
        } else {
13481
          setSuccess((List<Item>)value);
13482
        }
13483
        break;
13484
 
13485
      case CEX:
13486
        if (value == null) {
13487
          unsetCex();
13488
        } else {
13489
          setCex((CatalogServiceException)value);
13490
        }
13491
        break;
13492
 
13493
      }
13494
    }
13495
 
13496
    public void setFieldValue(int fieldID, Object value) {
13497
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
13498
    }
13499
 
13500
    public Object getFieldValue(_Fields field) {
13501
      switch (field) {
13502
      case SUCCESS:
13503
        return getSuccess();
13504
 
13505
      case CEX:
13506
        return getCex();
13507
 
13508
      }
13509
      throw new IllegalStateException();
13510
    }
13511
 
13512
    public Object getFieldValue(int fieldId) {
13513
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
13514
    }
13515
 
13516
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
13517
    public boolean isSet(_Fields field) {
13518
      switch (field) {
13519
      case SUCCESS:
13520
        return isSetSuccess();
13521
      case CEX:
13522
        return isSetCex();
13523
      }
13524
      throw new IllegalStateException();
13525
    }
13526
 
13527
    public boolean isSet(int fieldID) {
13528
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
13529
    }
13530
 
13531
    @Override
13532
    public boolean equals(Object that) {
13533
      if (that == null)
13534
        return false;
13535
      if (that instanceof getAllItemsByStatus_result)
13536
        return this.equals((getAllItemsByStatus_result)that);
13537
      return false;
13538
    }
13539
 
13540
    public boolean equals(getAllItemsByStatus_result that) {
13541
      if (that == null)
13542
        return false;
13543
 
13544
      boolean this_present_success = true && this.isSetSuccess();
13545
      boolean that_present_success = true && that.isSetSuccess();
13546
      if (this_present_success || that_present_success) {
13547
        if (!(this_present_success && that_present_success))
13548
          return false;
13549
        if (!this.success.equals(that.success))
13550
          return false;
13551
      }
13552
 
13553
      boolean this_present_cex = true && this.isSetCex();
13554
      boolean that_present_cex = true && that.isSetCex();
13555
      if (this_present_cex || that_present_cex) {
13556
        if (!(this_present_cex && that_present_cex))
13557
          return false;
13558
        if (!this.cex.equals(that.cex))
13559
          return false;
13560
      }
13561
 
13562
      return true;
13563
    }
13564
 
13565
    @Override
13566
    public int hashCode() {
100 ashish 13567
      return 0;
13568
    }
13569
 
13570
    public void read(TProtocol iprot) throws TException {
13571
      TField field;
13572
      iprot.readStructBegin();
13573
      while (true)
13574
      {
13575
        field = iprot.readFieldBegin();
13576
        if (field.type == TType.STOP) { 
13577
          break;
13578
        }
13579
        _Fields fieldId = _Fields.findByThriftId(field.id);
13580
        if (fieldId == null) {
13581
          TProtocolUtil.skip(iprot, field.type);
13582
        } else {
13583
          switch (fieldId) {
13584
            case SUCCESS:
103 ashish 13585
              if (field.type == TType.LIST) {
13586
                {
13587
                  TList _list30 = iprot.readListBegin();
13588
                  this.success = new ArrayList<Item>(_list30.size);
13589
                  for (int _i31 = 0; _i31 < _list30.size; ++_i31)
13590
                  {
13591
                    Item _elem32;
13592
                    _elem32 = new Item();
13593
                    _elem32.read(iprot);
13594
                    this.success.add(_elem32);
13595
                  }
13596
                  iprot.readListEnd();
13597
                }
100 ashish 13598
              } else { 
13599
                TProtocolUtil.skip(iprot, field.type);
13600
              }
13601
              break;
13602
            case CEX:
13603
              if (field.type == TType.STRUCT) {
13604
                this.cex = new CatalogServiceException();
13605
                this.cex.read(iprot);
13606
              } else { 
13607
                TProtocolUtil.skip(iprot, field.type);
13608
              }
13609
              break;
13610
          }
13611
          iprot.readFieldEnd();
13612
        }
13613
      }
13614
      iprot.readStructEnd();
13615
      validate();
13616
    }
13617
 
13618
    public void write(TProtocol oprot) throws TException {
13619
      oprot.writeStructBegin(STRUCT_DESC);
13620
 
13621
      if (this.isSetSuccess()) {
13622
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
103 ashish 13623
        {
13624
          oprot.writeListBegin(new TList(TType.STRUCT, this.success.size()));
13625
          for (Item _iter33 : this.success)
13626
          {
13627
            _iter33.write(oprot);
13628
          }
13629
          oprot.writeListEnd();
13630
        }
100 ashish 13631
        oprot.writeFieldEnd();
13632
      } else if (this.isSetCex()) {
13633
        oprot.writeFieldBegin(CEX_FIELD_DESC);
13634
        this.cex.write(oprot);
13635
        oprot.writeFieldEnd();
13636
      }
13637
      oprot.writeFieldStop();
13638
      oprot.writeStructEnd();
13639
    }
13640
 
13641
    @Override
13642
    public String toString() {
103 ashish 13643
      StringBuilder sb = new StringBuilder("getAllItemsByStatus_result(");
100 ashish 13644
      boolean first = true;
13645
 
13646
      sb.append("success:");
13647
      if (this.success == null) {
13648
        sb.append("null");
13649
      } else {
13650
        sb.append(this.success);
13651
      }
13652
      first = false;
13653
      if (!first) sb.append(", ");
13654
      sb.append("cex:");
13655
      if (this.cex == null) {
13656
        sb.append("null");
13657
      } else {
13658
        sb.append(this.cex);
13659
      }
13660
      first = false;
13661
      sb.append(")");
13662
      return sb.toString();
13663
    }
13664
 
13665
    public void validate() throws TException {
13666
      // check for required fields
13667
    }
13668
 
13669
  }
13670
 
13671
  public static class getItemInventory_args implements TBase<getItemInventory_args._Fields>, java.io.Serializable, Cloneable, Comparable<getItemInventory_args>   {
13672
    private static final TStruct STRUCT_DESC = new TStruct("getItemInventory_args");
13673
 
13674
    private static final TField ITEM_ID_FIELD_DESC = new TField("item_id", TType.I64, (short)1);
13675
 
13676
    private long item_id;
13677
 
13678
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
13679
    public enum _Fields implements TFieldIdEnum {
13680
      ITEM_ID((short)1, "item_id");
13681
 
13682
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
13683
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
13684
 
13685
      static {
13686
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
13687
          byId.put((int)field._thriftId, field);
13688
          byName.put(field.getFieldName(), field);
13689
        }
13690
      }
13691
 
13692
      /**
13693
       * Find the _Fields constant that matches fieldId, or null if its not found.
13694
       */
13695
      public static _Fields findByThriftId(int fieldId) {
13696
        return byId.get(fieldId);
13697
      }
13698
 
13699
      /**
13700
       * Find the _Fields constant that matches fieldId, throwing an exception
13701
       * if it is not found.
13702
       */
13703
      public static _Fields findByThriftIdOrThrow(int fieldId) {
13704
        _Fields fields = findByThriftId(fieldId);
13705
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
13706
        return fields;
13707
      }
13708
 
13709
      /**
13710
       * Find the _Fields constant that matches name, or null if its not found.
13711
       */
13712
      public static _Fields findByName(String name) {
13713
        return byName.get(name);
13714
      }
13715
 
13716
      private final short _thriftId;
13717
      private final String _fieldName;
13718
 
13719
      _Fields(short thriftId, String fieldName) {
13720
        _thriftId = thriftId;
13721
        _fieldName = fieldName;
13722
      }
13723
 
13724
      public short getThriftFieldId() {
13725
        return _thriftId;
13726
      }
13727
 
13728
      public String getFieldName() {
13729
        return _fieldName;
13730
      }
13731
    }
13732
 
13733
    // isset id assignments
13734
    private static final int __ITEM_ID_ISSET_ID = 0;
13735
    private BitSet __isset_bit_vector = new BitSet(1);
13736
 
13737
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
13738
      put(_Fields.ITEM_ID, new FieldMetaData("item_id", TFieldRequirementType.DEFAULT, 
13739
          new FieldValueMetaData(TType.I64)));
13740
    }});
13741
 
13742
    static {
13743
      FieldMetaData.addStructMetaDataMap(getItemInventory_args.class, metaDataMap);
13744
    }
13745
 
13746
    public getItemInventory_args() {
13747
    }
13748
 
13749
    public getItemInventory_args(
13750
      long item_id)
13751
    {
13752
      this();
13753
      this.item_id = item_id;
13754
      setItem_idIsSet(true);
13755
    }
13756
 
13757
    /**
13758
     * Performs a deep copy on <i>other</i>.
13759
     */
13760
    public getItemInventory_args(getItemInventory_args other) {
13761
      __isset_bit_vector.clear();
13762
      __isset_bit_vector.or(other.__isset_bit_vector);
13763
      this.item_id = other.item_id;
13764
    }
13765
 
13766
    public getItemInventory_args deepCopy() {
13767
      return new getItemInventory_args(this);
13768
    }
13769
 
13770
    @Deprecated
13771
    public getItemInventory_args clone() {
13772
      return new getItemInventory_args(this);
13773
    }
13774
 
13775
    public long getItem_id() {
13776
      return this.item_id;
13777
    }
13778
 
13779
    public getItemInventory_args setItem_id(long item_id) {
13780
      this.item_id = item_id;
13781
      setItem_idIsSet(true);
13782
      return this;
13783
    }
13784
 
13785
    public void unsetItem_id() {
13786
      __isset_bit_vector.clear(__ITEM_ID_ISSET_ID);
13787
    }
13788
 
13789
    /** Returns true if field item_id is set (has been asigned a value) and false otherwise */
13790
    public boolean isSetItem_id() {
13791
      return __isset_bit_vector.get(__ITEM_ID_ISSET_ID);
13792
    }
13793
 
13794
    public void setItem_idIsSet(boolean value) {
13795
      __isset_bit_vector.set(__ITEM_ID_ISSET_ID, value);
13796
    }
13797
 
13798
    public void setFieldValue(_Fields field, Object value) {
13799
      switch (field) {
13800
      case ITEM_ID:
13801
        if (value == null) {
13802
          unsetItem_id();
13803
        } else {
13804
          setItem_id((Long)value);
13805
        }
13806
        break;
13807
 
13808
      }
13809
    }
13810
 
13811
    public void setFieldValue(int fieldID, Object value) {
13812
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
13813
    }
13814
 
13815
    public Object getFieldValue(_Fields field) {
13816
      switch (field) {
13817
      case ITEM_ID:
13818
        return new Long(getItem_id());
13819
 
13820
      }
13821
      throw new IllegalStateException();
13822
    }
13823
 
13824
    public Object getFieldValue(int fieldId) {
13825
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
13826
    }
13827
 
13828
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
13829
    public boolean isSet(_Fields field) {
13830
      switch (field) {
13831
      case ITEM_ID:
13832
        return isSetItem_id();
13833
      }
13834
      throw new IllegalStateException();
13835
    }
13836
 
13837
    public boolean isSet(int fieldID) {
13838
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
13839
    }
13840
 
13841
    @Override
13842
    public boolean equals(Object that) {
13843
      if (that == null)
13844
        return false;
13845
      if (that instanceof getItemInventory_args)
13846
        return this.equals((getItemInventory_args)that);
13847
      return false;
13848
    }
13849
 
13850
    public boolean equals(getItemInventory_args that) {
13851
      if (that == null)
13852
        return false;
13853
 
13854
      boolean this_present_item_id = true;
13855
      boolean that_present_item_id = true;
13856
      if (this_present_item_id || that_present_item_id) {
13857
        if (!(this_present_item_id && that_present_item_id))
13858
          return false;
13859
        if (this.item_id != that.item_id)
13860
          return false;
13861
      }
13862
 
13863
      return true;
13864
    }
13865
 
13866
    @Override
13867
    public int hashCode() {
13868
      return 0;
13869
    }
13870
 
13871
    public int compareTo(getItemInventory_args other) {
13872
      if (!getClass().equals(other.getClass())) {
13873
        return getClass().getName().compareTo(other.getClass().getName());
13874
      }
13875
 
13876
      int lastComparison = 0;
13877
      getItemInventory_args typedOther = (getItemInventory_args)other;
13878
 
13879
      lastComparison = Boolean.valueOf(isSetItem_id()).compareTo(isSetItem_id());
13880
      if (lastComparison != 0) {
13881
        return lastComparison;
13882
      }
13883
      lastComparison = TBaseHelper.compareTo(item_id, typedOther.item_id);
13884
      if (lastComparison != 0) {
13885
        return lastComparison;
13886
      }
13887
      return 0;
13888
    }
13889
 
13890
    public void read(TProtocol iprot) throws TException {
13891
      TField field;
13892
      iprot.readStructBegin();
13893
      while (true)
13894
      {
13895
        field = iprot.readFieldBegin();
13896
        if (field.type == TType.STOP) { 
13897
          break;
13898
        }
13899
        _Fields fieldId = _Fields.findByThriftId(field.id);
13900
        if (fieldId == null) {
13901
          TProtocolUtil.skip(iprot, field.type);
13902
        } else {
13903
          switch (fieldId) {
13904
            case ITEM_ID:
13905
              if (field.type == TType.I64) {
13906
                this.item_id = iprot.readI64();
13907
                setItem_idIsSet(true);
13908
              } else { 
13909
                TProtocolUtil.skip(iprot, field.type);
13910
              }
13911
              break;
13912
          }
13913
          iprot.readFieldEnd();
13914
        }
13915
      }
13916
      iprot.readStructEnd();
13917
      validate();
13918
    }
13919
 
13920
    public void write(TProtocol oprot) throws TException {
13921
      validate();
13922
 
13923
      oprot.writeStructBegin(STRUCT_DESC);
13924
      oprot.writeFieldBegin(ITEM_ID_FIELD_DESC);
13925
      oprot.writeI64(this.item_id);
13926
      oprot.writeFieldEnd();
13927
      oprot.writeFieldStop();
13928
      oprot.writeStructEnd();
13929
    }
13930
 
13931
    @Override
13932
    public String toString() {
13933
      StringBuilder sb = new StringBuilder("getItemInventory_args(");
13934
      boolean first = true;
13935
 
13936
      sb.append("item_id:");
13937
      sb.append(this.item_id);
13938
      first = false;
13939
      sb.append(")");
13940
      return sb.toString();
13941
    }
13942
 
13943
    public void validate() throws TException {
13944
      // check for required fields
13945
    }
13946
 
13947
  }
13948
 
13949
  public static class getItemInventory_result implements TBase<getItemInventory_result._Fields>, java.io.Serializable, Cloneable   {
13950
    private static final TStruct STRUCT_DESC = new TStruct("getItemInventory_result");
13951
 
13952
    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRUCT, (short)0);
13953
    private static final TField CEX_FIELD_DESC = new TField("cex", TType.STRUCT, (short)1);
13954
 
13955
    private ItemInventory success;
13956
    private CatalogServiceException cex;
13957
 
13958
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
13959
    public enum _Fields implements TFieldIdEnum {
13960
      SUCCESS((short)0, "success"),
13961
      CEX((short)1, "cex");
13962
 
13963
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
13964
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
13965
 
13966
      static {
13967
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
13968
          byId.put((int)field._thriftId, field);
13969
          byName.put(field.getFieldName(), field);
13970
        }
13971
      }
13972
 
13973
      /**
13974
       * Find the _Fields constant that matches fieldId, or null if its not found.
13975
       */
13976
      public static _Fields findByThriftId(int fieldId) {
13977
        return byId.get(fieldId);
13978
      }
13979
 
13980
      /**
13981
       * Find the _Fields constant that matches fieldId, throwing an exception
13982
       * if it is not found.
13983
       */
13984
      public static _Fields findByThriftIdOrThrow(int fieldId) {
13985
        _Fields fields = findByThriftId(fieldId);
13986
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
13987
        return fields;
13988
      }
13989
 
13990
      /**
13991
       * Find the _Fields constant that matches name, or null if its not found.
13992
       */
13993
      public static _Fields findByName(String name) {
13994
        return byName.get(name);
13995
      }
13996
 
13997
      private final short _thriftId;
13998
      private final String _fieldName;
13999
 
14000
      _Fields(short thriftId, String fieldName) {
14001
        _thriftId = thriftId;
14002
        _fieldName = fieldName;
14003
      }
14004
 
14005
      public short getThriftFieldId() {
14006
        return _thriftId;
14007
      }
14008
 
14009
      public String getFieldName() {
14010
        return _fieldName;
14011
      }
14012
    }
14013
 
14014
    // isset id assignments
14015
 
14016
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
14017
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
14018
          new StructMetaData(TType.STRUCT, ItemInventory.class)));
14019
      put(_Fields.CEX, new FieldMetaData("cex", TFieldRequirementType.DEFAULT, 
14020
          new FieldValueMetaData(TType.STRUCT)));
14021
    }});
14022
 
14023
    static {
14024
      FieldMetaData.addStructMetaDataMap(getItemInventory_result.class, metaDataMap);
14025
    }
14026
 
14027
    public getItemInventory_result() {
14028
    }
14029
 
14030
    public getItemInventory_result(
14031
      ItemInventory success,
14032
      CatalogServiceException cex)
14033
    {
14034
      this();
14035
      this.success = success;
14036
      this.cex = cex;
14037
    }
14038
 
14039
    /**
14040
     * Performs a deep copy on <i>other</i>.
14041
     */
14042
    public getItemInventory_result(getItemInventory_result other) {
14043
      if (other.isSetSuccess()) {
14044
        this.success = new ItemInventory(other.success);
14045
      }
14046
      if (other.isSetCex()) {
14047
        this.cex = new CatalogServiceException(other.cex);
14048
      }
14049
    }
14050
 
14051
    public getItemInventory_result deepCopy() {
14052
      return new getItemInventory_result(this);
14053
    }
14054
 
14055
    @Deprecated
14056
    public getItemInventory_result clone() {
14057
      return new getItemInventory_result(this);
14058
    }
14059
 
14060
    public ItemInventory getSuccess() {
14061
      return this.success;
14062
    }
14063
 
14064
    public getItemInventory_result setSuccess(ItemInventory success) {
14065
      this.success = success;
14066
      return this;
14067
    }
14068
 
14069
    public void unsetSuccess() {
14070
      this.success = null;
14071
    }
14072
 
14073
    /** Returns true if field success is set (has been asigned a value) and false otherwise */
14074
    public boolean isSetSuccess() {
14075
      return this.success != null;
14076
    }
14077
 
14078
    public void setSuccessIsSet(boolean value) {
14079
      if (!value) {
14080
        this.success = null;
14081
      }
14082
    }
14083
 
14084
    public CatalogServiceException getCex() {
14085
      return this.cex;
14086
    }
14087
 
14088
    public getItemInventory_result setCex(CatalogServiceException cex) {
14089
      this.cex = cex;
14090
      return this;
14091
    }
14092
 
14093
    public void unsetCex() {
14094
      this.cex = null;
14095
    }
14096
 
14097
    /** Returns true if field cex is set (has been asigned a value) and false otherwise */
14098
    public boolean isSetCex() {
14099
      return this.cex != null;
14100
    }
14101
 
14102
    public void setCexIsSet(boolean value) {
14103
      if (!value) {
14104
        this.cex = null;
14105
      }
14106
    }
14107
 
14108
    public void setFieldValue(_Fields field, Object value) {
14109
      switch (field) {
14110
      case SUCCESS:
14111
        if (value == null) {
14112
          unsetSuccess();
14113
        } else {
14114
          setSuccess((ItemInventory)value);
14115
        }
14116
        break;
14117
 
14118
      case CEX:
14119
        if (value == null) {
14120
          unsetCex();
14121
        } else {
14122
          setCex((CatalogServiceException)value);
14123
        }
14124
        break;
14125
 
14126
      }
14127
    }
14128
 
14129
    public void setFieldValue(int fieldID, Object value) {
14130
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
14131
    }
14132
 
14133
    public Object getFieldValue(_Fields field) {
14134
      switch (field) {
14135
      case SUCCESS:
14136
        return getSuccess();
14137
 
14138
      case CEX:
14139
        return getCex();
14140
 
14141
      }
14142
      throw new IllegalStateException();
14143
    }
14144
 
14145
    public Object getFieldValue(int fieldId) {
14146
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
14147
    }
14148
 
14149
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
14150
    public boolean isSet(_Fields field) {
14151
      switch (field) {
14152
      case SUCCESS:
14153
        return isSetSuccess();
14154
      case CEX:
14155
        return isSetCex();
14156
      }
14157
      throw new IllegalStateException();
14158
    }
14159
 
14160
    public boolean isSet(int fieldID) {
14161
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
14162
    }
14163
 
14164
    @Override
14165
    public boolean equals(Object that) {
14166
      if (that == null)
14167
        return false;
14168
      if (that instanceof getItemInventory_result)
14169
        return this.equals((getItemInventory_result)that);
14170
      return false;
14171
    }
14172
 
14173
    public boolean equals(getItemInventory_result that) {
14174
      if (that == null)
14175
        return false;
14176
 
14177
      boolean this_present_success = true && this.isSetSuccess();
14178
      boolean that_present_success = true && that.isSetSuccess();
14179
      if (this_present_success || that_present_success) {
14180
        if (!(this_present_success && that_present_success))
14181
          return false;
14182
        if (!this.success.equals(that.success))
14183
          return false;
14184
      }
14185
 
14186
      boolean this_present_cex = true && this.isSetCex();
14187
      boolean that_present_cex = true && that.isSetCex();
14188
      if (this_present_cex || that_present_cex) {
14189
        if (!(this_present_cex && that_present_cex))
14190
          return false;
14191
        if (!this.cex.equals(that.cex))
14192
          return false;
14193
      }
14194
 
14195
      return true;
14196
    }
14197
 
14198
    @Override
14199
    public int hashCode() {
14200
      return 0;
14201
    }
14202
 
14203
    public void read(TProtocol iprot) throws TException {
14204
      TField field;
14205
      iprot.readStructBegin();
14206
      while (true)
14207
      {
14208
        field = iprot.readFieldBegin();
14209
        if (field.type == TType.STOP) { 
14210
          break;
14211
        }
14212
        _Fields fieldId = _Fields.findByThriftId(field.id);
14213
        if (fieldId == null) {
14214
          TProtocolUtil.skip(iprot, field.type);
14215
        } else {
14216
          switch (fieldId) {
14217
            case SUCCESS:
14218
              if (field.type == TType.STRUCT) {
14219
                this.success = new ItemInventory();
14220
                this.success.read(iprot);
14221
              } else { 
14222
                TProtocolUtil.skip(iprot, field.type);
14223
              }
14224
              break;
14225
            case CEX:
14226
              if (field.type == TType.STRUCT) {
14227
                this.cex = new CatalogServiceException();
14228
                this.cex.read(iprot);
14229
              } else { 
14230
                TProtocolUtil.skip(iprot, field.type);
14231
              }
14232
              break;
14233
          }
14234
          iprot.readFieldEnd();
14235
        }
14236
      }
14237
      iprot.readStructEnd();
14238
      validate();
14239
    }
14240
 
14241
    public void write(TProtocol oprot) throws TException {
14242
      oprot.writeStructBegin(STRUCT_DESC);
14243
 
14244
      if (this.isSetSuccess()) {
14245
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
14246
        this.success.write(oprot);
14247
        oprot.writeFieldEnd();
14248
      } else if (this.isSetCex()) {
14249
        oprot.writeFieldBegin(CEX_FIELD_DESC);
14250
        this.cex.write(oprot);
14251
        oprot.writeFieldEnd();
14252
      }
14253
      oprot.writeFieldStop();
14254
      oprot.writeStructEnd();
14255
    }
14256
 
14257
    @Override
14258
    public String toString() {
14259
      StringBuilder sb = new StringBuilder("getItemInventory_result(");
14260
      boolean first = true;
14261
 
14262
      sb.append("success:");
14263
      if (this.success == null) {
14264
        sb.append("null");
14265
      } else {
14266
        sb.append(this.success);
14267
      }
14268
      first = false;
14269
      if (!first) sb.append(", ");
14270
      sb.append("cex:");
14271
      if (this.cex == null) {
14272
        sb.append("null");
14273
      } else {
14274
        sb.append(this.cex);
14275
      }
14276
      first = false;
14277
      sb.append(")");
14278
      return sb.toString();
14279
    }
14280
 
14281
    public void validate() throws TException {
14282
      // check for required fields
14283
    }
14284
 
14285
  }
14286
 
103 ashish 14287
  public static class getItemAvailibilityAtWarehouse_args implements TBase<getItemAvailibilityAtWarehouse_args._Fields>, java.io.Serializable, Cloneable, Comparable<getItemAvailibilityAtWarehouse_args>   {
14288
    private static final TStruct STRUCT_DESC = new TStruct("getItemAvailibilityAtWarehouse_args");
14289
 
14290
    private static final TField WAREHOUSE_ID_FIELD_DESC = new TField("warehouse_id", TType.I64, (short)1);
14291
    private static final TField ITEM_ID_FIELD_DESC = new TField("item_id", TType.I64, (short)2);
14292
 
14293
    private long warehouse_id;
14294
    private long item_id;
14295
 
14296
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
14297
    public enum _Fields implements TFieldIdEnum {
14298
      WAREHOUSE_ID((short)1, "warehouse_id"),
14299
      ITEM_ID((short)2, "item_id");
14300
 
14301
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
14302
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
14303
 
14304
      static {
14305
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
14306
          byId.put((int)field._thriftId, field);
14307
          byName.put(field.getFieldName(), field);
14308
        }
14309
      }
14310
 
14311
      /**
14312
       * Find the _Fields constant that matches fieldId, or null if its not found.
14313
       */
14314
      public static _Fields findByThriftId(int fieldId) {
14315
        return byId.get(fieldId);
14316
      }
14317
 
14318
      /**
14319
       * Find the _Fields constant that matches fieldId, throwing an exception
14320
       * if it is not found.
14321
       */
14322
      public static _Fields findByThriftIdOrThrow(int fieldId) {
14323
        _Fields fields = findByThriftId(fieldId);
14324
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
14325
        return fields;
14326
      }
14327
 
14328
      /**
14329
       * Find the _Fields constant that matches name, or null if its not found.
14330
       */
14331
      public static _Fields findByName(String name) {
14332
        return byName.get(name);
14333
      }
14334
 
14335
      private final short _thriftId;
14336
      private final String _fieldName;
14337
 
14338
      _Fields(short thriftId, String fieldName) {
14339
        _thriftId = thriftId;
14340
        _fieldName = fieldName;
14341
      }
14342
 
14343
      public short getThriftFieldId() {
14344
        return _thriftId;
14345
      }
14346
 
14347
      public String getFieldName() {
14348
        return _fieldName;
14349
      }
14350
    }
14351
 
14352
    // isset id assignments
14353
    private static final int __WAREHOUSE_ID_ISSET_ID = 0;
14354
    private static final int __ITEM_ID_ISSET_ID = 1;
14355
    private BitSet __isset_bit_vector = new BitSet(2);
14356
 
14357
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
14358
      put(_Fields.WAREHOUSE_ID, new FieldMetaData("warehouse_id", TFieldRequirementType.DEFAULT, 
14359
          new FieldValueMetaData(TType.I64)));
14360
      put(_Fields.ITEM_ID, new FieldMetaData("item_id", TFieldRequirementType.DEFAULT, 
14361
          new FieldValueMetaData(TType.I64)));
14362
    }});
14363
 
14364
    static {
14365
      FieldMetaData.addStructMetaDataMap(getItemAvailibilityAtWarehouse_args.class, metaDataMap);
14366
    }
14367
 
14368
    public getItemAvailibilityAtWarehouse_args() {
14369
    }
14370
 
14371
    public getItemAvailibilityAtWarehouse_args(
14372
      long warehouse_id,
14373
      long item_id)
14374
    {
14375
      this();
14376
      this.warehouse_id = warehouse_id;
14377
      setWarehouse_idIsSet(true);
14378
      this.item_id = item_id;
14379
      setItem_idIsSet(true);
14380
    }
14381
 
14382
    /**
14383
     * Performs a deep copy on <i>other</i>.
14384
     */
14385
    public getItemAvailibilityAtWarehouse_args(getItemAvailibilityAtWarehouse_args other) {
14386
      __isset_bit_vector.clear();
14387
      __isset_bit_vector.or(other.__isset_bit_vector);
14388
      this.warehouse_id = other.warehouse_id;
14389
      this.item_id = other.item_id;
14390
    }
14391
 
14392
    public getItemAvailibilityAtWarehouse_args deepCopy() {
14393
      return new getItemAvailibilityAtWarehouse_args(this);
14394
    }
14395
 
14396
    @Deprecated
14397
    public getItemAvailibilityAtWarehouse_args clone() {
14398
      return new getItemAvailibilityAtWarehouse_args(this);
14399
    }
14400
 
14401
    public long getWarehouse_id() {
14402
      return this.warehouse_id;
14403
    }
14404
 
14405
    public getItemAvailibilityAtWarehouse_args setWarehouse_id(long warehouse_id) {
14406
      this.warehouse_id = warehouse_id;
14407
      setWarehouse_idIsSet(true);
14408
      return this;
14409
    }
14410
 
14411
    public void unsetWarehouse_id() {
14412
      __isset_bit_vector.clear(__WAREHOUSE_ID_ISSET_ID);
14413
    }
14414
 
14415
    /** Returns true if field warehouse_id is set (has been asigned a value) and false otherwise */
14416
    public boolean isSetWarehouse_id() {
14417
      return __isset_bit_vector.get(__WAREHOUSE_ID_ISSET_ID);
14418
    }
14419
 
14420
    public void setWarehouse_idIsSet(boolean value) {
14421
      __isset_bit_vector.set(__WAREHOUSE_ID_ISSET_ID, value);
14422
    }
14423
 
14424
    public long getItem_id() {
14425
      return this.item_id;
14426
    }
14427
 
14428
    public getItemAvailibilityAtWarehouse_args setItem_id(long item_id) {
14429
      this.item_id = item_id;
14430
      setItem_idIsSet(true);
14431
      return this;
14432
    }
14433
 
14434
    public void unsetItem_id() {
14435
      __isset_bit_vector.clear(__ITEM_ID_ISSET_ID);
14436
    }
14437
 
14438
    /** Returns true if field item_id is set (has been asigned a value) and false otherwise */
14439
    public boolean isSetItem_id() {
14440
      return __isset_bit_vector.get(__ITEM_ID_ISSET_ID);
14441
    }
14442
 
14443
    public void setItem_idIsSet(boolean value) {
14444
      __isset_bit_vector.set(__ITEM_ID_ISSET_ID, value);
14445
    }
14446
 
14447
    public void setFieldValue(_Fields field, Object value) {
14448
      switch (field) {
14449
      case WAREHOUSE_ID:
14450
        if (value == null) {
14451
          unsetWarehouse_id();
14452
        } else {
14453
          setWarehouse_id((Long)value);
14454
        }
14455
        break;
14456
 
14457
      case ITEM_ID:
14458
        if (value == null) {
14459
          unsetItem_id();
14460
        } else {
14461
          setItem_id((Long)value);
14462
        }
14463
        break;
14464
 
14465
      }
14466
    }
14467
 
14468
    public void setFieldValue(int fieldID, Object value) {
14469
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
14470
    }
14471
 
14472
    public Object getFieldValue(_Fields field) {
14473
      switch (field) {
14474
      case WAREHOUSE_ID:
14475
        return new Long(getWarehouse_id());
14476
 
14477
      case ITEM_ID:
14478
        return new Long(getItem_id());
14479
 
14480
      }
14481
      throw new IllegalStateException();
14482
    }
14483
 
14484
    public Object getFieldValue(int fieldId) {
14485
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
14486
    }
14487
 
14488
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
14489
    public boolean isSet(_Fields field) {
14490
      switch (field) {
14491
      case WAREHOUSE_ID:
14492
        return isSetWarehouse_id();
14493
      case ITEM_ID:
14494
        return isSetItem_id();
14495
      }
14496
      throw new IllegalStateException();
14497
    }
14498
 
14499
    public boolean isSet(int fieldID) {
14500
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
14501
    }
14502
 
14503
    @Override
14504
    public boolean equals(Object that) {
14505
      if (that == null)
14506
        return false;
14507
      if (that instanceof getItemAvailibilityAtWarehouse_args)
14508
        return this.equals((getItemAvailibilityAtWarehouse_args)that);
14509
      return false;
14510
    }
14511
 
14512
    public boolean equals(getItemAvailibilityAtWarehouse_args that) {
14513
      if (that == null)
14514
        return false;
14515
 
14516
      boolean this_present_warehouse_id = true;
14517
      boolean that_present_warehouse_id = true;
14518
      if (this_present_warehouse_id || that_present_warehouse_id) {
14519
        if (!(this_present_warehouse_id && that_present_warehouse_id))
14520
          return false;
14521
        if (this.warehouse_id != that.warehouse_id)
14522
          return false;
14523
      }
14524
 
14525
      boolean this_present_item_id = true;
14526
      boolean that_present_item_id = true;
14527
      if (this_present_item_id || that_present_item_id) {
14528
        if (!(this_present_item_id && that_present_item_id))
14529
          return false;
14530
        if (this.item_id != that.item_id)
14531
          return false;
14532
      }
14533
 
14534
      return true;
14535
    }
14536
 
14537
    @Override
14538
    public int hashCode() {
14539
      return 0;
14540
    }
14541
 
14542
    public int compareTo(getItemAvailibilityAtWarehouse_args other) {
14543
      if (!getClass().equals(other.getClass())) {
14544
        return getClass().getName().compareTo(other.getClass().getName());
14545
      }
14546
 
14547
      int lastComparison = 0;
14548
      getItemAvailibilityAtWarehouse_args typedOther = (getItemAvailibilityAtWarehouse_args)other;
14549
 
14550
      lastComparison = Boolean.valueOf(isSetWarehouse_id()).compareTo(isSetWarehouse_id());
14551
      if (lastComparison != 0) {
14552
        return lastComparison;
14553
      }
14554
      lastComparison = TBaseHelper.compareTo(warehouse_id, typedOther.warehouse_id);
14555
      if (lastComparison != 0) {
14556
        return lastComparison;
14557
      }
14558
      lastComparison = Boolean.valueOf(isSetItem_id()).compareTo(isSetItem_id());
14559
      if (lastComparison != 0) {
14560
        return lastComparison;
14561
      }
14562
      lastComparison = TBaseHelper.compareTo(item_id, typedOther.item_id);
14563
      if (lastComparison != 0) {
14564
        return lastComparison;
14565
      }
14566
      return 0;
14567
    }
14568
 
14569
    public void read(TProtocol iprot) throws TException {
14570
      TField field;
14571
      iprot.readStructBegin();
14572
      while (true)
14573
      {
14574
        field = iprot.readFieldBegin();
14575
        if (field.type == TType.STOP) { 
14576
          break;
14577
        }
14578
        _Fields fieldId = _Fields.findByThriftId(field.id);
14579
        if (fieldId == null) {
14580
          TProtocolUtil.skip(iprot, field.type);
14581
        } else {
14582
          switch (fieldId) {
14583
            case WAREHOUSE_ID:
14584
              if (field.type == TType.I64) {
14585
                this.warehouse_id = iprot.readI64();
14586
                setWarehouse_idIsSet(true);
14587
              } else { 
14588
                TProtocolUtil.skip(iprot, field.type);
14589
              }
14590
              break;
14591
            case ITEM_ID:
14592
              if (field.type == TType.I64) {
14593
                this.item_id = iprot.readI64();
14594
                setItem_idIsSet(true);
14595
              } else { 
14596
                TProtocolUtil.skip(iprot, field.type);
14597
              }
14598
              break;
14599
          }
14600
          iprot.readFieldEnd();
14601
        }
14602
      }
14603
      iprot.readStructEnd();
14604
      validate();
14605
    }
14606
 
14607
    public void write(TProtocol oprot) throws TException {
14608
      validate();
14609
 
14610
      oprot.writeStructBegin(STRUCT_DESC);
14611
      oprot.writeFieldBegin(WAREHOUSE_ID_FIELD_DESC);
14612
      oprot.writeI64(this.warehouse_id);
14613
      oprot.writeFieldEnd();
14614
      oprot.writeFieldBegin(ITEM_ID_FIELD_DESC);
14615
      oprot.writeI64(this.item_id);
14616
      oprot.writeFieldEnd();
14617
      oprot.writeFieldStop();
14618
      oprot.writeStructEnd();
14619
    }
14620
 
14621
    @Override
14622
    public String toString() {
14623
      StringBuilder sb = new StringBuilder("getItemAvailibilityAtWarehouse_args(");
14624
      boolean first = true;
14625
 
14626
      sb.append("warehouse_id:");
14627
      sb.append(this.warehouse_id);
14628
      first = false;
14629
      if (!first) sb.append(", ");
14630
      sb.append("item_id:");
14631
      sb.append(this.item_id);
14632
      first = false;
14633
      sb.append(")");
14634
      return sb.toString();
14635
    }
14636
 
14637
    public void validate() throws TException {
14638
      // check for required fields
14639
    }
14640
 
14641
  }
14642
 
14643
  public static class getItemAvailibilityAtWarehouse_result implements TBase<getItemAvailibilityAtWarehouse_result._Fields>, java.io.Serializable, Cloneable, Comparable<getItemAvailibilityAtWarehouse_result>   {
14644
    private static final TStruct STRUCT_DESC = new TStruct("getItemAvailibilityAtWarehouse_result");
14645
 
14646
    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.I64, (short)0);
14647
    private static final TField CEX_FIELD_DESC = new TField("cex", TType.STRUCT, (short)1);
14648
 
14649
    private long success;
14650
    private CatalogServiceException cex;
14651
 
14652
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
14653
    public enum _Fields implements TFieldIdEnum {
14654
      SUCCESS((short)0, "success"),
14655
      CEX((short)1, "cex");
14656
 
14657
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
14658
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
14659
 
14660
      static {
14661
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
14662
          byId.put((int)field._thriftId, field);
14663
          byName.put(field.getFieldName(), field);
14664
        }
14665
      }
14666
 
14667
      /**
14668
       * Find the _Fields constant that matches fieldId, or null if its not found.
14669
       */
14670
      public static _Fields findByThriftId(int fieldId) {
14671
        return byId.get(fieldId);
14672
      }
14673
 
14674
      /**
14675
       * Find the _Fields constant that matches fieldId, throwing an exception
14676
       * if it is not found.
14677
       */
14678
      public static _Fields findByThriftIdOrThrow(int fieldId) {
14679
        _Fields fields = findByThriftId(fieldId);
14680
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
14681
        return fields;
14682
      }
14683
 
14684
      /**
14685
       * Find the _Fields constant that matches name, or null if its not found.
14686
       */
14687
      public static _Fields findByName(String name) {
14688
        return byName.get(name);
14689
      }
14690
 
14691
      private final short _thriftId;
14692
      private final String _fieldName;
14693
 
14694
      _Fields(short thriftId, String fieldName) {
14695
        _thriftId = thriftId;
14696
        _fieldName = fieldName;
14697
      }
14698
 
14699
      public short getThriftFieldId() {
14700
        return _thriftId;
14701
      }
14702
 
14703
      public String getFieldName() {
14704
        return _fieldName;
14705
      }
14706
    }
14707
 
14708
    // isset id assignments
14709
    private static final int __SUCCESS_ISSET_ID = 0;
14710
    private BitSet __isset_bit_vector = new BitSet(1);
14711
 
14712
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
14713
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
14714
          new FieldValueMetaData(TType.I64)));
14715
      put(_Fields.CEX, new FieldMetaData("cex", TFieldRequirementType.DEFAULT, 
14716
          new FieldValueMetaData(TType.STRUCT)));
14717
    }});
14718
 
14719
    static {
14720
      FieldMetaData.addStructMetaDataMap(getItemAvailibilityAtWarehouse_result.class, metaDataMap);
14721
    }
14722
 
14723
    public getItemAvailibilityAtWarehouse_result() {
14724
    }
14725
 
14726
    public getItemAvailibilityAtWarehouse_result(
14727
      long success,
14728
      CatalogServiceException cex)
14729
    {
14730
      this();
14731
      this.success = success;
14732
      setSuccessIsSet(true);
14733
      this.cex = cex;
14734
    }
14735
 
14736
    /**
14737
     * Performs a deep copy on <i>other</i>.
14738
     */
14739
    public getItemAvailibilityAtWarehouse_result(getItemAvailibilityAtWarehouse_result other) {
14740
      __isset_bit_vector.clear();
14741
      __isset_bit_vector.or(other.__isset_bit_vector);
14742
      this.success = other.success;
14743
      if (other.isSetCex()) {
14744
        this.cex = new CatalogServiceException(other.cex);
14745
      }
14746
    }
14747
 
14748
    public getItemAvailibilityAtWarehouse_result deepCopy() {
14749
      return new getItemAvailibilityAtWarehouse_result(this);
14750
    }
14751
 
14752
    @Deprecated
14753
    public getItemAvailibilityAtWarehouse_result clone() {
14754
      return new getItemAvailibilityAtWarehouse_result(this);
14755
    }
14756
 
14757
    public long getSuccess() {
14758
      return this.success;
14759
    }
14760
 
14761
    public getItemAvailibilityAtWarehouse_result setSuccess(long success) {
14762
      this.success = success;
14763
      setSuccessIsSet(true);
14764
      return this;
14765
    }
14766
 
14767
    public void unsetSuccess() {
14768
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
14769
    }
14770
 
14771
    /** Returns true if field success is set (has been asigned a value) and false otherwise */
14772
    public boolean isSetSuccess() {
14773
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
14774
    }
14775
 
14776
    public void setSuccessIsSet(boolean value) {
14777
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
14778
    }
14779
 
14780
    public CatalogServiceException getCex() {
14781
      return this.cex;
14782
    }
14783
 
14784
    public getItemAvailibilityAtWarehouse_result setCex(CatalogServiceException cex) {
14785
      this.cex = cex;
14786
      return this;
14787
    }
14788
 
14789
    public void unsetCex() {
14790
      this.cex = null;
14791
    }
14792
 
14793
    /** Returns true if field cex is set (has been asigned a value) and false otherwise */
14794
    public boolean isSetCex() {
14795
      return this.cex != null;
14796
    }
14797
 
14798
    public void setCexIsSet(boolean value) {
14799
      if (!value) {
14800
        this.cex = null;
14801
      }
14802
    }
14803
 
14804
    public void setFieldValue(_Fields field, Object value) {
14805
      switch (field) {
14806
      case SUCCESS:
14807
        if (value == null) {
14808
          unsetSuccess();
14809
        } else {
14810
          setSuccess((Long)value);
14811
        }
14812
        break;
14813
 
14814
      case CEX:
14815
        if (value == null) {
14816
          unsetCex();
14817
        } else {
14818
          setCex((CatalogServiceException)value);
14819
        }
14820
        break;
14821
 
14822
      }
14823
    }
14824
 
14825
    public void setFieldValue(int fieldID, Object value) {
14826
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
14827
    }
14828
 
14829
    public Object getFieldValue(_Fields field) {
14830
      switch (field) {
14831
      case SUCCESS:
14832
        return new Long(getSuccess());
14833
 
14834
      case CEX:
14835
        return getCex();
14836
 
14837
      }
14838
      throw new IllegalStateException();
14839
    }
14840
 
14841
    public Object getFieldValue(int fieldId) {
14842
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
14843
    }
14844
 
14845
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
14846
    public boolean isSet(_Fields field) {
14847
      switch (field) {
14848
      case SUCCESS:
14849
        return isSetSuccess();
14850
      case CEX:
14851
        return isSetCex();
14852
      }
14853
      throw new IllegalStateException();
14854
    }
14855
 
14856
    public boolean isSet(int fieldID) {
14857
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
14858
    }
14859
 
14860
    @Override
14861
    public boolean equals(Object that) {
14862
      if (that == null)
14863
        return false;
14864
      if (that instanceof getItemAvailibilityAtWarehouse_result)
14865
        return this.equals((getItemAvailibilityAtWarehouse_result)that);
14866
      return false;
14867
    }
14868
 
14869
    public boolean equals(getItemAvailibilityAtWarehouse_result that) {
14870
      if (that == null)
14871
        return false;
14872
 
14873
      boolean this_present_success = true;
14874
      boolean that_present_success = true;
14875
      if (this_present_success || that_present_success) {
14876
        if (!(this_present_success && that_present_success))
14877
          return false;
14878
        if (this.success != that.success)
14879
          return false;
14880
      }
14881
 
14882
      boolean this_present_cex = true && this.isSetCex();
14883
      boolean that_present_cex = true && that.isSetCex();
14884
      if (this_present_cex || that_present_cex) {
14885
        if (!(this_present_cex && that_present_cex))
14886
          return false;
14887
        if (!this.cex.equals(that.cex))
14888
          return false;
14889
      }
14890
 
14891
      return true;
14892
    }
14893
 
14894
    @Override
14895
    public int hashCode() {
14896
      return 0;
14897
    }
14898
 
14899
    public int compareTo(getItemAvailibilityAtWarehouse_result other) {
14900
      if (!getClass().equals(other.getClass())) {
14901
        return getClass().getName().compareTo(other.getClass().getName());
14902
      }
14903
 
14904
      int lastComparison = 0;
14905
      getItemAvailibilityAtWarehouse_result typedOther = (getItemAvailibilityAtWarehouse_result)other;
14906
 
14907
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
14908
      if (lastComparison != 0) {
14909
        return lastComparison;
14910
      }
14911
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
14912
      if (lastComparison != 0) {
14913
        return lastComparison;
14914
      }
14915
      lastComparison = Boolean.valueOf(isSetCex()).compareTo(isSetCex());
14916
      if (lastComparison != 0) {
14917
        return lastComparison;
14918
      }
14919
      lastComparison = TBaseHelper.compareTo(cex, typedOther.cex);
14920
      if (lastComparison != 0) {
14921
        return lastComparison;
14922
      }
14923
      return 0;
14924
    }
14925
 
14926
    public void read(TProtocol iprot) throws TException {
14927
      TField field;
14928
      iprot.readStructBegin();
14929
      while (true)
14930
      {
14931
        field = iprot.readFieldBegin();
14932
        if (field.type == TType.STOP) { 
14933
          break;
14934
        }
14935
        _Fields fieldId = _Fields.findByThriftId(field.id);
14936
        if (fieldId == null) {
14937
          TProtocolUtil.skip(iprot, field.type);
14938
        } else {
14939
          switch (fieldId) {
14940
            case SUCCESS:
14941
              if (field.type == TType.I64) {
14942
                this.success = iprot.readI64();
14943
                setSuccessIsSet(true);
14944
              } else { 
14945
                TProtocolUtil.skip(iprot, field.type);
14946
              }
14947
              break;
14948
            case CEX:
14949
              if (field.type == TType.STRUCT) {
14950
                this.cex = new CatalogServiceException();
14951
                this.cex.read(iprot);
14952
              } else { 
14953
                TProtocolUtil.skip(iprot, field.type);
14954
              }
14955
              break;
14956
          }
14957
          iprot.readFieldEnd();
14958
        }
14959
      }
14960
      iprot.readStructEnd();
14961
      validate();
14962
    }
14963
 
14964
    public void write(TProtocol oprot) throws TException {
14965
      oprot.writeStructBegin(STRUCT_DESC);
14966
 
14967
      if (this.isSetSuccess()) {
14968
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
14969
        oprot.writeI64(this.success);
14970
        oprot.writeFieldEnd();
14971
      } else if (this.isSetCex()) {
14972
        oprot.writeFieldBegin(CEX_FIELD_DESC);
14973
        this.cex.write(oprot);
14974
        oprot.writeFieldEnd();
14975
      }
14976
      oprot.writeFieldStop();
14977
      oprot.writeStructEnd();
14978
    }
14979
 
14980
    @Override
14981
    public String toString() {
14982
      StringBuilder sb = new StringBuilder("getItemAvailibilityAtWarehouse_result(");
14983
      boolean first = true;
14984
 
14985
      sb.append("success:");
14986
      sb.append(this.success);
14987
      first = false;
14988
      if (!first) sb.append(", ");
14989
      sb.append("cex:");
14990
      if (this.cex == null) {
14991
        sb.append("null");
14992
      } else {
14993
        sb.append(this.cex);
14994
      }
14995
      first = false;
14996
      sb.append(")");
14997
      return sb.toString();
14998
    }
14999
 
15000
    public void validate() throws TException {
15001
      // check for required fields
15002
    }
15003
 
15004
  }
15005
 
100 ashish 15006
  public static class getItemInventoryHistory_args implements TBase<getItemInventoryHistory_args._Fields>, java.io.Serializable, Cloneable, Comparable<getItemInventoryHistory_args>   {
15007
    private static final TStruct STRUCT_DESC = new TStruct("getItemInventoryHistory_args");
15008
 
15009
    private static final TField ID_FIELD_DESC = new TField("id", TType.I64, (short)1);
15010
    private static final TField ITEM_ID_FIELD_DESC = new TField("item_id", TType.I64, (short)2);
15011
    private static final TField WAREHOUSE_ID_FIELD_DESC = new TField("warehouse_id", TType.I64, (short)3);
15012
    private static final TField FROM_DATE_FIELD_DESC = new TField("from_date", TType.I64, (short)4);
15013
    private static final TField TO_DATE_FIELD_DESC = new TField("to_date", TType.I64, (short)5);
15014
 
15015
    private long id;
15016
    private long item_id;
15017
    private long warehouse_id;
15018
    private long from_date;
15019
    private long to_date;
15020
 
15021
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
15022
    public enum _Fields implements TFieldIdEnum {
15023
      ID((short)1, "id"),
15024
      ITEM_ID((short)2, "item_id"),
15025
      WAREHOUSE_ID((short)3, "warehouse_id"),
15026
      FROM_DATE((short)4, "from_date"),
15027
      TO_DATE((short)5, "to_date");
15028
 
15029
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
15030
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
15031
 
15032
      static {
15033
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
15034
          byId.put((int)field._thriftId, field);
15035
          byName.put(field.getFieldName(), field);
15036
        }
15037
      }
15038
 
15039
      /**
15040
       * Find the _Fields constant that matches fieldId, or null if its not found.
15041
       */
15042
      public static _Fields findByThriftId(int fieldId) {
15043
        return byId.get(fieldId);
15044
      }
15045
 
15046
      /**
15047
       * Find the _Fields constant that matches fieldId, throwing an exception
15048
       * if it is not found.
15049
       */
15050
      public static _Fields findByThriftIdOrThrow(int fieldId) {
15051
        _Fields fields = findByThriftId(fieldId);
15052
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
15053
        return fields;
15054
      }
15055
 
15056
      /**
15057
       * Find the _Fields constant that matches name, or null if its not found.
15058
       */
15059
      public static _Fields findByName(String name) {
15060
        return byName.get(name);
15061
      }
15062
 
15063
      private final short _thriftId;
15064
      private final String _fieldName;
15065
 
15066
      _Fields(short thriftId, String fieldName) {
15067
        _thriftId = thriftId;
15068
        _fieldName = fieldName;
15069
      }
15070
 
15071
      public short getThriftFieldId() {
15072
        return _thriftId;
15073
      }
15074
 
15075
      public String getFieldName() {
15076
        return _fieldName;
15077
      }
15078
    }
15079
 
15080
    // isset id assignments
15081
    private static final int __ID_ISSET_ID = 0;
15082
    private static final int __ITEM_ID_ISSET_ID = 1;
15083
    private static final int __WAREHOUSE_ID_ISSET_ID = 2;
15084
    private static final int __FROM_DATE_ISSET_ID = 3;
15085
    private static final int __TO_DATE_ISSET_ID = 4;
15086
    private BitSet __isset_bit_vector = new BitSet(5);
15087
 
15088
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
15089
      put(_Fields.ID, new FieldMetaData("id", TFieldRequirementType.DEFAULT, 
15090
          new FieldValueMetaData(TType.I64)));
15091
      put(_Fields.ITEM_ID, new FieldMetaData("item_id", TFieldRequirementType.DEFAULT, 
15092
          new FieldValueMetaData(TType.I64)));
15093
      put(_Fields.WAREHOUSE_ID, new FieldMetaData("warehouse_id", TFieldRequirementType.DEFAULT, 
15094
          new FieldValueMetaData(TType.I64)));
15095
      put(_Fields.FROM_DATE, new FieldMetaData("from_date", TFieldRequirementType.DEFAULT, 
15096
          new FieldValueMetaData(TType.I64)));
15097
      put(_Fields.TO_DATE, new FieldMetaData("to_date", TFieldRequirementType.DEFAULT, 
15098
          new FieldValueMetaData(TType.I64)));
15099
    }});
15100
 
15101
    static {
15102
      FieldMetaData.addStructMetaDataMap(getItemInventoryHistory_args.class, metaDataMap);
15103
    }
15104
 
15105
    public getItemInventoryHistory_args() {
15106
    }
15107
 
15108
    public getItemInventoryHistory_args(
15109
      long id,
15110
      long item_id,
15111
      long warehouse_id,
15112
      long from_date,
15113
      long to_date)
15114
    {
15115
      this();
15116
      this.id = id;
15117
      setIdIsSet(true);
15118
      this.item_id = item_id;
15119
      setItem_idIsSet(true);
15120
      this.warehouse_id = warehouse_id;
15121
      setWarehouse_idIsSet(true);
15122
      this.from_date = from_date;
15123
      setFrom_dateIsSet(true);
15124
      this.to_date = to_date;
15125
      setTo_dateIsSet(true);
15126
    }
15127
 
15128
    /**
15129
     * Performs a deep copy on <i>other</i>.
15130
     */
15131
    public getItemInventoryHistory_args(getItemInventoryHistory_args other) {
15132
      __isset_bit_vector.clear();
15133
      __isset_bit_vector.or(other.__isset_bit_vector);
15134
      this.id = other.id;
15135
      this.item_id = other.item_id;
15136
      this.warehouse_id = other.warehouse_id;
15137
      this.from_date = other.from_date;
15138
      this.to_date = other.to_date;
15139
    }
15140
 
15141
    public getItemInventoryHistory_args deepCopy() {
15142
      return new getItemInventoryHistory_args(this);
15143
    }
15144
 
15145
    @Deprecated
15146
    public getItemInventoryHistory_args clone() {
15147
      return new getItemInventoryHistory_args(this);
15148
    }
15149
 
15150
    public long getId() {
15151
      return this.id;
15152
    }
15153
 
15154
    public getItemInventoryHistory_args setId(long id) {
15155
      this.id = id;
15156
      setIdIsSet(true);
15157
      return this;
15158
    }
15159
 
15160
    public void unsetId() {
15161
      __isset_bit_vector.clear(__ID_ISSET_ID);
15162
    }
15163
 
15164
    /** Returns true if field id is set (has been asigned a value) and false otherwise */
15165
    public boolean isSetId() {
15166
      return __isset_bit_vector.get(__ID_ISSET_ID);
15167
    }
15168
 
15169
    public void setIdIsSet(boolean value) {
15170
      __isset_bit_vector.set(__ID_ISSET_ID, value);
15171
    }
15172
 
15173
    public long getItem_id() {
15174
      return this.item_id;
15175
    }
15176
 
15177
    public getItemInventoryHistory_args setItem_id(long item_id) {
15178
      this.item_id = item_id;
15179
      setItem_idIsSet(true);
15180
      return this;
15181
    }
15182
 
15183
    public void unsetItem_id() {
15184
      __isset_bit_vector.clear(__ITEM_ID_ISSET_ID);
15185
    }
15186
 
15187
    /** Returns true if field item_id is set (has been asigned a value) and false otherwise */
15188
    public boolean isSetItem_id() {
15189
      return __isset_bit_vector.get(__ITEM_ID_ISSET_ID);
15190
    }
15191
 
15192
    public void setItem_idIsSet(boolean value) {
15193
      __isset_bit_vector.set(__ITEM_ID_ISSET_ID, value);
15194
    }
15195
 
15196
    public long getWarehouse_id() {
15197
      return this.warehouse_id;
15198
    }
15199
 
15200
    public getItemInventoryHistory_args setWarehouse_id(long warehouse_id) {
15201
      this.warehouse_id = warehouse_id;
15202
      setWarehouse_idIsSet(true);
15203
      return this;
15204
    }
15205
 
15206
    public void unsetWarehouse_id() {
15207
      __isset_bit_vector.clear(__WAREHOUSE_ID_ISSET_ID);
15208
    }
15209
 
15210
    /** Returns true if field warehouse_id is set (has been asigned a value) and false otherwise */
15211
    public boolean isSetWarehouse_id() {
15212
      return __isset_bit_vector.get(__WAREHOUSE_ID_ISSET_ID);
15213
    }
15214
 
15215
    public void setWarehouse_idIsSet(boolean value) {
15216
      __isset_bit_vector.set(__WAREHOUSE_ID_ISSET_ID, value);
15217
    }
15218
 
15219
    public long getFrom_date() {
15220
      return this.from_date;
15221
    }
15222
 
15223
    public getItemInventoryHistory_args setFrom_date(long from_date) {
15224
      this.from_date = from_date;
15225
      setFrom_dateIsSet(true);
15226
      return this;
15227
    }
15228
 
15229
    public void unsetFrom_date() {
15230
      __isset_bit_vector.clear(__FROM_DATE_ISSET_ID);
15231
    }
15232
 
15233
    /** Returns true if field from_date is set (has been asigned a value) and false otherwise */
15234
    public boolean isSetFrom_date() {
15235
      return __isset_bit_vector.get(__FROM_DATE_ISSET_ID);
15236
    }
15237
 
15238
    public void setFrom_dateIsSet(boolean value) {
15239
      __isset_bit_vector.set(__FROM_DATE_ISSET_ID, value);
15240
    }
15241
 
15242
    public long getTo_date() {
15243
      return this.to_date;
15244
    }
15245
 
15246
    public getItemInventoryHistory_args setTo_date(long to_date) {
15247
      this.to_date = to_date;
15248
      setTo_dateIsSet(true);
15249
      return this;
15250
    }
15251
 
15252
    public void unsetTo_date() {
15253
      __isset_bit_vector.clear(__TO_DATE_ISSET_ID);
15254
    }
15255
 
15256
    /** Returns true if field to_date is set (has been asigned a value) and false otherwise */
15257
    public boolean isSetTo_date() {
15258
      return __isset_bit_vector.get(__TO_DATE_ISSET_ID);
15259
    }
15260
 
15261
    public void setTo_dateIsSet(boolean value) {
15262
      __isset_bit_vector.set(__TO_DATE_ISSET_ID, value);
15263
    }
15264
 
15265
    public void setFieldValue(_Fields field, Object value) {
15266
      switch (field) {
15267
      case ID:
15268
        if (value == null) {
15269
          unsetId();
15270
        } else {
15271
          setId((Long)value);
15272
        }
15273
        break;
15274
 
15275
      case ITEM_ID:
15276
        if (value == null) {
15277
          unsetItem_id();
15278
        } else {
15279
          setItem_id((Long)value);
15280
        }
15281
        break;
15282
 
15283
      case WAREHOUSE_ID:
15284
        if (value == null) {
15285
          unsetWarehouse_id();
15286
        } else {
15287
          setWarehouse_id((Long)value);
15288
        }
15289
        break;
15290
 
15291
      case FROM_DATE:
15292
        if (value == null) {
15293
          unsetFrom_date();
15294
        } else {
15295
          setFrom_date((Long)value);
15296
        }
15297
        break;
15298
 
15299
      case TO_DATE:
15300
        if (value == null) {
15301
          unsetTo_date();
15302
        } else {
15303
          setTo_date((Long)value);
15304
        }
15305
        break;
15306
 
15307
      }
15308
    }
15309
 
15310
    public void setFieldValue(int fieldID, Object value) {
15311
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
15312
    }
15313
 
15314
    public Object getFieldValue(_Fields field) {
15315
      switch (field) {
15316
      case ID:
15317
        return new Long(getId());
15318
 
15319
      case ITEM_ID:
15320
        return new Long(getItem_id());
15321
 
15322
      case WAREHOUSE_ID:
15323
        return new Long(getWarehouse_id());
15324
 
15325
      case FROM_DATE:
15326
        return new Long(getFrom_date());
15327
 
15328
      case TO_DATE:
15329
        return new Long(getTo_date());
15330
 
15331
      }
15332
      throw new IllegalStateException();
15333
    }
15334
 
15335
    public Object getFieldValue(int fieldId) {
15336
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
15337
    }
15338
 
15339
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
15340
    public boolean isSet(_Fields field) {
15341
      switch (field) {
15342
      case ID:
15343
        return isSetId();
15344
      case ITEM_ID:
15345
        return isSetItem_id();
15346
      case WAREHOUSE_ID:
15347
        return isSetWarehouse_id();
15348
      case FROM_DATE:
15349
        return isSetFrom_date();
15350
      case TO_DATE:
15351
        return isSetTo_date();
15352
      }
15353
      throw new IllegalStateException();
15354
    }
15355
 
15356
    public boolean isSet(int fieldID) {
15357
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
15358
    }
15359
 
15360
    @Override
15361
    public boolean equals(Object that) {
15362
      if (that == null)
15363
        return false;
15364
      if (that instanceof getItemInventoryHistory_args)
15365
        return this.equals((getItemInventoryHistory_args)that);
15366
      return false;
15367
    }
15368
 
15369
    public boolean equals(getItemInventoryHistory_args that) {
15370
      if (that == null)
15371
        return false;
15372
 
15373
      boolean this_present_id = true;
15374
      boolean that_present_id = true;
15375
      if (this_present_id || that_present_id) {
15376
        if (!(this_present_id && that_present_id))
15377
          return false;
15378
        if (this.id != that.id)
15379
          return false;
15380
      }
15381
 
15382
      boolean this_present_item_id = true;
15383
      boolean that_present_item_id = true;
15384
      if (this_present_item_id || that_present_item_id) {
15385
        if (!(this_present_item_id && that_present_item_id))
15386
          return false;
15387
        if (this.item_id != that.item_id)
15388
          return false;
15389
      }
15390
 
15391
      boolean this_present_warehouse_id = true;
15392
      boolean that_present_warehouse_id = true;
15393
      if (this_present_warehouse_id || that_present_warehouse_id) {
15394
        if (!(this_present_warehouse_id && that_present_warehouse_id))
15395
          return false;
15396
        if (this.warehouse_id != that.warehouse_id)
15397
          return false;
15398
      }
15399
 
15400
      boolean this_present_from_date = true;
15401
      boolean that_present_from_date = true;
15402
      if (this_present_from_date || that_present_from_date) {
15403
        if (!(this_present_from_date && that_present_from_date))
15404
          return false;
15405
        if (this.from_date != that.from_date)
15406
          return false;
15407
      }
15408
 
15409
      boolean this_present_to_date = true;
15410
      boolean that_present_to_date = true;
15411
      if (this_present_to_date || that_present_to_date) {
15412
        if (!(this_present_to_date && that_present_to_date))
15413
          return false;
15414
        if (this.to_date != that.to_date)
15415
          return false;
15416
      }
15417
 
15418
      return true;
15419
    }
15420
 
15421
    @Override
15422
    public int hashCode() {
15423
      return 0;
15424
    }
15425
 
15426
    public int compareTo(getItemInventoryHistory_args other) {
15427
      if (!getClass().equals(other.getClass())) {
15428
        return getClass().getName().compareTo(other.getClass().getName());
15429
      }
15430
 
15431
      int lastComparison = 0;
15432
      getItemInventoryHistory_args typedOther = (getItemInventoryHistory_args)other;
15433
 
15434
      lastComparison = Boolean.valueOf(isSetId()).compareTo(isSetId());
15435
      if (lastComparison != 0) {
15436
        return lastComparison;
15437
      }
15438
      lastComparison = TBaseHelper.compareTo(id, typedOther.id);
15439
      if (lastComparison != 0) {
15440
        return lastComparison;
15441
      }
15442
      lastComparison = Boolean.valueOf(isSetItem_id()).compareTo(isSetItem_id());
15443
      if (lastComparison != 0) {
15444
        return lastComparison;
15445
      }
15446
      lastComparison = TBaseHelper.compareTo(item_id, typedOther.item_id);
15447
      if (lastComparison != 0) {
15448
        return lastComparison;
15449
      }
15450
      lastComparison = Boolean.valueOf(isSetWarehouse_id()).compareTo(isSetWarehouse_id());
15451
      if (lastComparison != 0) {
15452
        return lastComparison;
15453
      }
15454
      lastComparison = TBaseHelper.compareTo(warehouse_id, typedOther.warehouse_id);
15455
      if (lastComparison != 0) {
15456
        return lastComparison;
15457
      }
15458
      lastComparison = Boolean.valueOf(isSetFrom_date()).compareTo(isSetFrom_date());
15459
      if (lastComparison != 0) {
15460
        return lastComparison;
15461
      }
15462
      lastComparison = TBaseHelper.compareTo(from_date, typedOther.from_date);
15463
      if (lastComparison != 0) {
15464
        return lastComparison;
15465
      }
15466
      lastComparison = Boolean.valueOf(isSetTo_date()).compareTo(isSetTo_date());
15467
      if (lastComparison != 0) {
15468
        return lastComparison;
15469
      }
15470
      lastComparison = TBaseHelper.compareTo(to_date, typedOther.to_date);
15471
      if (lastComparison != 0) {
15472
        return lastComparison;
15473
      }
15474
      return 0;
15475
    }
15476
 
15477
    public void read(TProtocol iprot) throws TException {
15478
      TField field;
15479
      iprot.readStructBegin();
15480
      while (true)
15481
      {
15482
        field = iprot.readFieldBegin();
15483
        if (field.type == TType.STOP) { 
15484
          break;
15485
        }
15486
        _Fields fieldId = _Fields.findByThriftId(field.id);
15487
        if (fieldId == null) {
15488
          TProtocolUtil.skip(iprot, field.type);
15489
        } else {
15490
          switch (fieldId) {
15491
            case ID:
15492
              if (field.type == TType.I64) {
15493
                this.id = iprot.readI64();
15494
                setIdIsSet(true);
15495
              } else { 
15496
                TProtocolUtil.skip(iprot, field.type);
15497
              }
15498
              break;
15499
            case ITEM_ID:
15500
              if (field.type == TType.I64) {
15501
                this.item_id = iprot.readI64();
15502
                setItem_idIsSet(true);
15503
              } else { 
15504
                TProtocolUtil.skip(iprot, field.type);
15505
              }
15506
              break;
15507
            case WAREHOUSE_ID:
15508
              if (field.type == TType.I64) {
15509
                this.warehouse_id = iprot.readI64();
15510
                setWarehouse_idIsSet(true);
15511
              } else { 
15512
                TProtocolUtil.skip(iprot, field.type);
15513
              }
15514
              break;
15515
            case FROM_DATE:
15516
              if (field.type == TType.I64) {
15517
                this.from_date = iprot.readI64();
15518
                setFrom_dateIsSet(true);
15519
              } else { 
15520
                TProtocolUtil.skip(iprot, field.type);
15521
              }
15522
              break;
15523
            case TO_DATE:
15524
              if (field.type == TType.I64) {
15525
                this.to_date = iprot.readI64();
15526
                setTo_dateIsSet(true);
15527
              } else { 
15528
                TProtocolUtil.skip(iprot, field.type);
15529
              }
15530
              break;
15531
          }
15532
          iprot.readFieldEnd();
15533
        }
15534
      }
15535
      iprot.readStructEnd();
15536
      validate();
15537
    }
15538
 
15539
    public void write(TProtocol oprot) throws TException {
15540
      validate();
15541
 
15542
      oprot.writeStructBegin(STRUCT_DESC);
15543
      oprot.writeFieldBegin(ID_FIELD_DESC);
15544
      oprot.writeI64(this.id);
15545
      oprot.writeFieldEnd();
15546
      oprot.writeFieldBegin(ITEM_ID_FIELD_DESC);
15547
      oprot.writeI64(this.item_id);
15548
      oprot.writeFieldEnd();
15549
      oprot.writeFieldBegin(WAREHOUSE_ID_FIELD_DESC);
15550
      oprot.writeI64(this.warehouse_id);
15551
      oprot.writeFieldEnd();
15552
      oprot.writeFieldBegin(FROM_DATE_FIELD_DESC);
15553
      oprot.writeI64(this.from_date);
15554
      oprot.writeFieldEnd();
15555
      oprot.writeFieldBegin(TO_DATE_FIELD_DESC);
15556
      oprot.writeI64(this.to_date);
15557
      oprot.writeFieldEnd();
15558
      oprot.writeFieldStop();
15559
      oprot.writeStructEnd();
15560
    }
15561
 
15562
    @Override
15563
    public String toString() {
15564
      StringBuilder sb = new StringBuilder("getItemInventoryHistory_args(");
15565
      boolean first = true;
15566
 
15567
      sb.append("id:");
15568
      sb.append(this.id);
15569
      first = false;
15570
      if (!first) sb.append(", ");
15571
      sb.append("item_id:");
15572
      sb.append(this.item_id);
15573
      first = false;
15574
      if (!first) sb.append(", ");
15575
      sb.append("warehouse_id:");
15576
      sb.append(this.warehouse_id);
15577
      first = false;
15578
      if (!first) sb.append(", ");
15579
      sb.append("from_date:");
15580
      sb.append(this.from_date);
15581
      first = false;
15582
      if (!first) sb.append(", ");
15583
      sb.append("to_date:");
15584
      sb.append(this.to_date);
15585
      first = false;
15586
      sb.append(")");
15587
      return sb.toString();
15588
    }
15589
 
15590
    public void validate() throws TException {
15591
      // check for required fields
15592
    }
15593
 
15594
  }
15595
 
15596
  public static class getItemInventoryHistory_result implements TBase<getItemInventoryHistory_result._Fields>, java.io.Serializable, Cloneable, Comparable<getItemInventoryHistory_result>   {
15597
    private static final TStruct STRUCT_DESC = new TStruct("getItemInventoryHistory_result");
15598
 
15599
    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRUCT, (short)0);
15600
    private static final TField CEX_FIELD_DESC = new TField("cex", TType.STRUCT, (short)1);
15601
 
15602
    private ItemInventoryHistory success;
15603
    private CatalogServiceException cex;
15604
 
15605
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
15606
    public enum _Fields implements TFieldIdEnum {
15607
      SUCCESS((short)0, "success"),
15608
      CEX((short)1, "cex");
15609
 
15610
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
15611
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
15612
 
15613
      static {
15614
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
15615
          byId.put((int)field._thriftId, field);
15616
          byName.put(field.getFieldName(), field);
15617
        }
15618
      }
15619
 
15620
      /**
15621
       * Find the _Fields constant that matches fieldId, or null if its not found.
15622
       */
15623
      public static _Fields findByThriftId(int fieldId) {
15624
        return byId.get(fieldId);
15625
      }
15626
 
15627
      /**
15628
       * Find the _Fields constant that matches fieldId, throwing an exception
15629
       * if it is not found.
15630
       */
15631
      public static _Fields findByThriftIdOrThrow(int fieldId) {
15632
        _Fields fields = findByThriftId(fieldId);
15633
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
15634
        return fields;
15635
      }
15636
 
15637
      /**
15638
       * Find the _Fields constant that matches name, or null if its not found.
15639
       */
15640
      public static _Fields findByName(String name) {
15641
        return byName.get(name);
15642
      }
15643
 
15644
      private final short _thriftId;
15645
      private final String _fieldName;
15646
 
15647
      _Fields(short thriftId, String fieldName) {
15648
        _thriftId = thriftId;
15649
        _fieldName = fieldName;
15650
      }
15651
 
15652
      public short getThriftFieldId() {
15653
        return _thriftId;
15654
      }
15655
 
15656
      public String getFieldName() {
15657
        return _fieldName;
15658
      }
15659
    }
15660
 
15661
    // isset id assignments
15662
 
15663
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
15664
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
15665
          new StructMetaData(TType.STRUCT, ItemInventoryHistory.class)));
15666
      put(_Fields.CEX, new FieldMetaData("cex", TFieldRequirementType.DEFAULT, 
15667
          new FieldValueMetaData(TType.STRUCT)));
15668
    }});
15669
 
15670
    static {
15671
      FieldMetaData.addStructMetaDataMap(getItemInventoryHistory_result.class, metaDataMap);
15672
    }
15673
 
15674
    public getItemInventoryHistory_result() {
15675
    }
15676
 
15677
    public getItemInventoryHistory_result(
15678
      ItemInventoryHistory success,
15679
      CatalogServiceException cex)
15680
    {
15681
      this();
15682
      this.success = success;
15683
      this.cex = cex;
15684
    }
15685
 
15686
    /**
15687
     * Performs a deep copy on <i>other</i>.
15688
     */
15689
    public getItemInventoryHistory_result(getItemInventoryHistory_result other) {
15690
      if (other.isSetSuccess()) {
15691
        this.success = new ItemInventoryHistory(other.success);
15692
      }
15693
      if (other.isSetCex()) {
15694
        this.cex = new CatalogServiceException(other.cex);
15695
      }
15696
    }
15697
 
15698
    public getItemInventoryHistory_result deepCopy() {
15699
      return new getItemInventoryHistory_result(this);
15700
    }
15701
 
15702
    @Deprecated
15703
    public getItemInventoryHistory_result clone() {
15704
      return new getItemInventoryHistory_result(this);
15705
    }
15706
 
15707
    public ItemInventoryHistory getSuccess() {
15708
      return this.success;
15709
    }
15710
 
15711
    public getItemInventoryHistory_result setSuccess(ItemInventoryHistory success) {
15712
      this.success = success;
15713
      return this;
15714
    }
15715
 
15716
    public void unsetSuccess() {
15717
      this.success = null;
15718
    }
15719
 
15720
    /** Returns true if field success is set (has been asigned a value) and false otherwise */
15721
    public boolean isSetSuccess() {
15722
      return this.success != null;
15723
    }
15724
 
15725
    public void setSuccessIsSet(boolean value) {
15726
      if (!value) {
15727
        this.success = null;
15728
      }
15729
    }
15730
 
15731
    public CatalogServiceException getCex() {
15732
      return this.cex;
15733
    }
15734
 
15735
    public getItemInventoryHistory_result setCex(CatalogServiceException cex) {
15736
      this.cex = cex;
15737
      return this;
15738
    }
15739
 
15740
    public void unsetCex() {
15741
      this.cex = null;
15742
    }
15743
 
15744
    /** Returns true if field cex is set (has been asigned a value) and false otherwise */
15745
    public boolean isSetCex() {
15746
      return this.cex != null;
15747
    }
15748
 
15749
    public void setCexIsSet(boolean value) {
15750
      if (!value) {
15751
        this.cex = null;
15752
      }
15753
    }
15754
 
15755
    public void setFieldValue(_Fields field, Object value) {
15756
      switch (field) {
15757
      case SUCCESS:
15758
        if (value == null) {
15759
          unsetSuccess();
15760
        } else {
15761
          setSuccess((ItemInventoryHistory)value);
15762
        }
15763
        break;
15764
 
15765
      case CEX:
15766
        if (value == null) {
15767
          unsetCex();
15768
        } else {
15769
          setCex((CatalogServiceException)value);
15770
        }
15771
        break;
15772
 
15773
      }
15774
    }
15775
 
15776
    public void setFieldValue(int fieldID, Object value) {
15777
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
15778
    }
15779
 
15780
    public Object getFieldValue(_Fields field) {
15781
      switch (field) {
15782
      case SUCCESS:
15783
        return getSuccess();
15784
 
15785
      case CEX:
15786
        return getCex();
15787
 
15788
      }
15789
      throw new IllegalStateException();
15790
    }
15791
 
15792
    public Object getFieldValue(int fieldId) {
15793
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
15794
    }
15795
 
15796
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
15797
    public boolean isSet(_Fields field) {
15798
      switch (field) {
15799
      case SUCCESS:
15800
        return isSetSuccess();
15801
      case CEX:
15802
        return isSetCex();
15803
      }
15804
      throw new IllegalStateException();
15805
    }
15806
 
15807
    public boolean isSet(int fieldID) {
15808
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
15809
    }
15810
 
15811
    @Override
15812
    public boolean equals(Object that) {
15813
      if (that == null)
15814
        return false;
15815
      if (that instanceof getItemInventoryHistory_result)
15816
        return this.equals((getItemInventoryHistory_result)that);
15817
      return false;
15818
    }
15819
 
15820
    public boolean equals(getItemInventoryHistory_result that) {
15821
      if (that == null)
15822
        return false;
15823
 
15824
      boolean this_present_success = true && this.isSetSuccess();
15825
      boolean that_present_success = true && that.isSetSuccess();
15826
      if (this_present_success || that_present_success) {
15827
        if (!(this_present_success && that_present_success))
15828
          return false;
15829
        if (!this.success.equals(that.success))
15830
          return false;
15831
      }
15832
 
15833
      boolean this_present_cex = true && this.isSetCex();
15834
      boolean that_present_cex = true && that.isSetCex();
15835
      if (this_present_cex || that_present_cex) {
15836
        if (!(this_present_cex && that_present_cex))
15837
          return false;
15838
        if (!this.cex.equals(that.cex))
15839
          return false;
15840
      }
15841
 
15842
      return true;
15843
    }
15844
 
15845
    @Override
15846
    public int hashCode() {
15847
      return 0;
15848
    }
15849
 
15850
    public int compareTo(getItemInventoryHistory_result other) {
15851
      if (!getClass().equals(other.getClass())) {
15852
        return getClass().getName().compareTo(other.getClass().getName());
15853
      }
15854
 
15855
      int lastComparison = 0;
15856
      getItemInventoryHistory_result typedOther = (getItemInventoryHistory_result)other;
15857
 
15858
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
15859
      if (lastComparison != 0) {
15860
        return lastComparison;
15861
      }
15862
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
15863
      if (lastComparison != 0) {
15864
        return lastComparison;
15865
      }
15866
      lastComparison = Boolean.valueOf(isSetCex()).compareTo(isSetCex());
15867
      if (lastComparison != 0) {
15868
        return lastComparison;
15869
      }
15870
      lastComparison = TBaseHelper.compareTo(cex, typedOther.cex);
15871
      if (lastComparison != 0) {
15872
        return lastComparison;
15873
      }
15874
      return 0;
15875
    }
15876
 
15877
    public void read(TProtocol iprot) throws TException {
15878
      TField field;
15879
      iprot.readStructBegin();
15880
      while (true)
15881
      {
15882
        field = iprot.readFieldBegin();
15883
        if (field.type == TType.STOP) { 
15884
          break;
15885
        }
15886
        _Fields fieldId = _Fields.findByThriftId(field.id);
15887
        if (fieldId == null) {
15888
          TProtocolUtil.skip(iprot, field.type);
15889
        } else {
15890
          switch (fieldId) {
15891
            case SUCCESS:
15892
              if (field.type == TType.STRUCT) {
15893
                this.success = new ItemInventoryHistory();
15894
                this.success.read(iprot);
15895
              } else { 
15896
                TProtocolUtil.skip(iprot, field.type);
15897
              }
15898
              break;
15899
            case CEX:
15900
              if (field.type == TType.STRUCT) {
15901
                this.cex = new CatalogServiceException();
15902
                this.cex.read(iprot);
15903
              } else { 
15904
                TProtocolUtil.skip(iprot, field.type);
15905
              }
15906
              break;
15907
          }
15908
          iprot.readFieldEnd();
15909
        }
15910
      }
15911
      iprot.readStructEnd();
15912
      validate();
15913
    }
15914
 
15915
    public void write(TProtocol oprot) throws TException {
15916
      oprot.writeStructBegin(STRUCT_DESC);
15917
 
15918
      if (this.isSetSuccess()) {
15919
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
15920
        this.success.write(oprot);
15921
        oprot.writeFieldEnd();
15922
      } else if (this.isSetCex()) {
15923
        oprot.writeFieldBegin(CEX_FIELD_DESC);
15924
        this.cex.write(oprot);
15925
        oprot.writeFieldEnd();
15926
      }
15927
      oprot.writeFieldStop();
15928
      oprot.writeStructEnd();
15929
    }
15930
 
15931
    @Override
15932
    public String toString() {
15933
      StringBuilder sb = new StringBuilder("getItemInventoryHistory_result(");
15934
      boolean first = true;
15935
 
15936
      sb.append("success:");
15937
      if (this.success == null) {
15938
        sb.append("null");
15939
      } else {
15940
        sb.append(this.success);
15941
      }
15942
      first = false;
15943
      if (!first) sb.append(", ");
15944
      sb.append("cex:");
15945
      if (this.cex == null) {
15946
        sb.append("null");
15947
      } else {
15948
        sb.append(this.cex);
15949
      }
15950
      first = false;
15951
      sb.append(")");
15952
      return sb.toString();
15953
    }
15954
 
15955
    public void validate() throws TException {
15956
      // check for required fields
15957
    }
15958
 
15959
  }
15960
 
103 ashish 15961
  public static class getAllWarehouses_args implements TBase<getAllWarehouses_args._Fields>, java.io.Serializable, Cloneable, Comparable<getAllWarehouses_args>   {
15962
    private static final TStruct STRUCT_DESC = new TStruct("getAllWarehouses_args");
15963
 
15964
    private static final TField IS_ACTIVE_FIELD_DESC = new TField("isActive", TType.BOOL, (short)1);
15965
 
15966
    private boolean isActive;
15967
 
15968
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
15969
    public enum _Fields implements TFieldIdEnum {
15970
      IS_ACTIVE((short)1, "isActive");
15971
 
15972
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
15973
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
15974
 
15975
      static {
15976
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
15977
          byId.put((int)field._thriftId, field);
15978
          byName.put(field.getFieldName(), field);
15979
        }
15980
      }
15981
 
15982
      /**
15983
       * Find the _Fields constant that matches fieldId, or null if its not found.
15984
       */
15985
      public static _Fields findByThriftId(int fieldId) {
15986
        return byId.get(fieldId);
15987
      }
15988
 
15989
      /**
15990
       * Find the _Fields constant that matches fieldId, throwing an exception
15991
       * if it is not found.
15992
       */
15993
      public static _Fields findByThriftIdOrThrow(int fieldId) {
15994
        _Fields fields = findByThriftId(fieldId);
15995
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
15996
        return fields;
15997
      }
15998
 
15999
      /**
16000
       * Find the _Fields constant that matches name, or null if its not found.
16001
       */
16002
      public static _Fields findByName(String name) {
16003
        return byName.get(name);
16004
      }
16005
 
16006
      private final short _thriftId;
16007
      private final String _fieldName;
16008
 
16009
      _Fields(short thriftId, String fieldName) {
16010
        _thriftId = thriftId;
16011
        _fieldName = fieldName;
16012
      }
16013
 
16014
      public short getThriftFieldId() {
16015
        return _thriftId;
16016
      }
16017
 
16018
      public String getFieldName() {
16019
        return _fieldName;
16020
      }
16021
    }
16022
 
16023
    // isset id assignments
16024
    private static final int __ISACTIVE_ISSET_ID = 0;
16025
    private BitSet __isset_bit_vector = new BitSet(1);
16026
 
16027
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
16028
      put(_Fields.IS_ACTIVE, new FieldMetaData("isActive", TFieldRequirementType.DEFAULT, 
16029
          new FieldValueMetaData(TType.BOOL)));
16030
    }});
16031
 
16032
    static {
16033
      FieldMetaData.addStructMetaDataMap(getAllWarehouses_args.class, metaDataMap);
16034
    }
16035
 
16036
    public getAllWarehouses_args() {
16037
    }
16038
 
16039
    public getAllWarehouses_args(
16040
      boolean isActive)
16041
    {
16042
      this();
16043
      this.isActive = isActive;
16044
      setIsActiveIsSet(true);
16045
    }
16046
 
16047
    /**
16048
     * Performs a deep copy on <i>other</i>.
16049
     */
16050
    public getAllWarehouses_args(getAllWarehouses_args other) {
16051
      __isset_bit_vector.clear();
16052
      __isset_bit_vector.or(other.__isset_bit_vector);
16053
      this.isActive = other.isActive;
16054
    }
16055
 
16056
    public getAllWarehouses_args deepCopy() {
16057
      return new getAllWarehouses_args(this);
16058
    }
16059
 
16060
    @Deprecated
16061
    public getAllWarehouses_args clone() {
16062
      return new getAllWarehouses_args(this);
16063
    }
16064
 
16065
    public boolean isIsActive() {
16066
      return this.isActive;
16067
    }
16068
 
16069
    public getAllWarehouses_args setIsActive(boolean isActive) {
16070
      this.isActive = isActive;
16071
      setIsActiveIsSet(true);
16072
      return this;
16073
    }
16074
 
16075
    public void unsetIsActive() {
16076
      __isset_bit_vector.clear(__ISACTIVE_ISSET_ID);
16077
    }
16078
 
16079
    /** Returns true if field isActive is set (has been asigned a value) and false otherwise */
16080
    public boolean isSetIsActive() {
16081
      return __isset_bit_vector.get(__ISACTIVE_ISSET_ID);
16082
    }
16083
 
16084
    public void setIsActiveIsSet(boolean value) {
16085
      __isset_bit_vector.set(__ISACTIVE_ISSET_ID, value);
16086
    }
16087
 
16088
    public void setFieldValue(_Fields field, Object value) {
16089
      switch (field) {
16090
      case IS_ACTIVE:
16091
        if (value == null) {
16092
          unsetIsActive();
16093
        } else {
16094
          setIsActive((Boolean)value);
16095
        }
16096
        break;
16097
 
16098
      }
16099
    }
16100
 
16101
    public void setFieldValue(int fieldID, Object value) {
16102
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
16103
    }
16104
 
16105
    public Object getFieldValue(_Fields field) {
16106
      switch (field) {
16107
      case IS_ACTIVE:
16108
        return new Boolean(isIsActive());
16109
 
16110
      }
16111
      throw new IllegalStateException();
16112
    }
16113
 
16114
    public Object getFieldValue(int fieldId) {
16115
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
16116
    }
16117
 
16118
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
16119
    public boolean isSet(_Fields field) {
16120
      switch (field) {
16121
      case IS_ACTIVE:
16122
        return isSetIsActive();
16123
      }
16124
      throw new IllegalStateException();
16125
    }
16126
 
16127
    public boolean isSet(int fieldID) {
16128
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
16129
    }
16130
 
16131
    @Override
16132
    public boolean equals(Object that) {
16133
      if (that == null)
16134
        return false;
16135
      if (that instanceof getAllWarehouses_args)
16136
        return this.equals((getAllWarehouses_args)that);
16137
      return false;
16138
    }
16139
 
16140
    public boolean equals(getAllWarehouses_args that) {
16141
      if (that == null)
16142
        return false;
16143
 
16144
      boolean this_present_isActive = true;
16145
      boolean that_present_isActive = true;
16146
      if (this_present_isActive || that_present_isActive) {
16147
        if (!(this_present_isActive && that_present_isActive))
16148
          return false;
16149
        if (this.isActive != that.isActive)
16150
          return false;
16151
      }
16152
 
16153
      return true;
16154
    }
16155
 
16156
    @Override
16157
    public int hashCode() {
16158
      return 0;
16159
    }
16160
 
16161
    public int compareTo(getAllWarehouses_args other) {
16162
      if (!getClass().equals(other.getClass())) {
16163
        return getClass().getName().compareTo(other.getClass().getName());
16164
      }
16165
 
16166
      int lastComparison = 0;
16167
      getAllWarehouses_args typedOther = (getAllWarehouses_args)other;
16168
 
16169
      lastComparison = Boolean.valueOf(isSetIsActive()).compareTo(isSetIsActive());
16170
      if (lastComparison != 0) {
16171
        return lastComparison;
16172
      }
16173
      lastComparison = TBaseHelper.compareTo(isActive, typedOther.isActive);
16174
      if (lastComparison != 0) {
16175
        return lastComparison;
16176
      }
16177
      return 0;
16178
    }
16179
 
16180
    public void read(TProtocol iprot) throws TException {
16181
      TField field;
16182
      iprot.readStructBegin();
16183
      while (true)
16184
      {
16185
        field = iprot.readFieldBegin();
16186
        if (field.type == TType.STOP) { 
16187
          break;
16188
        }
16189
        _Fields fieldId = _Fields.findByThriftId(field.id);
16190
        if (fieldId == null) {
16191
          TProtocolUtil.skip(iprot, field.type);
16192
        } else {
16193
          switch (fieldId) {
16194
            case IS_ACTIVE:
16195
              if (field.type == TType.BOOL) {
16196
                this.isActive = iprot.readBool();
16197
                setIsActiveIsSet(true);
16198
              } else { 
16199
                TProtocolUtil.skip(iprot, field.type);
16200
              }
16201
              break;
16202
          }
16203
          iprot.readFieldEnd();
16204
        }
16205
      }
16206
      iprot.readStructEnd();
16207
      validate();
16208
    }
16209
 
16210
    public void write(TProtocol oprot) throws TException {
16211
      validate();
16212
 
16213
      oprot.writeStructBegin(STRUCT_DESC);
16214
      oprot.writeFieldBegin(IS_ACTIVE_FIELD_DESC);
16215
      oprot.writeBool(this.isActive);
16216
      oprot.writeFieldEnd();
16217
      oprot.writeFieldStop();
16218
      oprot.writeStructEnd();
16219
    }
16220
 
16221
    @Override
16222
    public String toString() {
16223
      StringBuilder sb = new StringBuilder("getAllWarehouses_args(");
16224
      boolean first = true;
16225
 
16226
      sb.append("isActive:");
16227
      sb.append(this.isActive);
16228
      first = false;
16229
      sb.append(")");
16230
      return sb.toString();
16231
    }
16232
 
16233
    public void validate() throws TException {
16234
      // check for required fields
16235
    }
16236
 
16237
  }
16238
 
16239
  public static class getAllWarehouses_result implements TBase<getAllWarehouses_result._Fields>, java.io.Serializable, Cloneable, Comparable<getAllWarehouses_result>   {
16240
    private static final TStruct STRUCT_DESC = new TStruct("getAllWarehouses_result");
16241
 
16242
    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0);
16243
    private static final TField CEX_FIELD_DESC = new TField("cex", TType.STRUCT, (short)1);
16244
 
16245
    private List<Warehouse> success;
16246
    private CatalogServiceException cex;
16247
 
16248
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
16249
    public enum _Fields implements TFieldIdEnum {
16250
      SUCCESS((short)0, "success"),
16251
      CEX((short)1, "cex");
16252
 
16253
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
16254
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
16255
 
16256
      static {
16257
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
16258
          byId.put((int)field._thriftId, field);
16259
          byName.put(field.getFieldName(), field);
16260
        }
16261
      }
16262
 
16263
      /**
16264
       * Find the _Fields constant that matches fieldId, or null if its not found.
16265
       */
16266
      public static _Fields findByThriftId(int fieldId) {
16267
        return byId.get(fieldId);
16268
      }
16269
 
16270
      /**
16271
       * Find the _Fields constant that matches fieldId, throwing an exception
16272
       * if it is not found.
16273
       */
16274
      public static _Fields findByThriftIdOrThrow(int fieldId) {
16275
        _Fields fields = findByThriftId(fieldId);
16276
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
16277
        return fields;
16278
      }
16279
 
16280
      /**
16281
       * Find the _Fields constant that matches name, or null if its not found.
16282
       */
16283
      public static _Fields findByName(String name) {
16284
        return byName.get(name);
16285
      }
16286
 
16287
      private final short _thriftId;
16288
      private final String _fieldName;
16289
 
16290
      _Fields(short thriftId, String fieldName) {
16291
        _thriftId = thriftId;
16292
        _fieldName = fieldName;
16293
      }
16294
 
16295
      public short getThriftFieldId() {
16296
        return _thriftId;
16297
      }
16298
 
16299
      public String getFieldName() {
16300
        return _fieldName;
16301
      }
16302
    }
16303
 
16304
    // isset id assignments
16305
 
16306
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
16307
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
16308
          new ListMetaData(TType.LIST, 
16309
              new StructMetaData(TType.STRUCT, Warehouse.class))));
16310
      put(_Fields.CEX, new FieldMetaData("cex", TFieldRequirementType.DEFAULT, 
16311
          new FieldValueMetaData(TType.STRUCT)));
16312
    }});
16313
 
16314
    static {
16315
      FieldMetaData.addStructMetaDataMap(getAllWarehouses_result.class, metaDataMap);
16316
    }
16317
 
16318
    public getAllWarehouses_result() {
16319
    }
16320
 
16321
    public getAllWarehouses_result(
16322
      List<Warehouse> success,
16323
      CatalogServiceException cex)
16324
    {
16325
      this();
16326
      this.success = success;
16327
      this.cex = cex;
16328
    }
16329
 
16330
    /**
16331
     * Performs a deep copy on <i>other</i>.
16332
     */
16333
    public getAllWarehouses_result(getAllWarehouses_result other) {
16334
      if (other.isSetSuccess()) {
16335
        List<Warehouse> __this__success = new ArrayList<Warehouse>();
16336
        for (Warehouse other_element : other.success) {
16337
          __this__success.add(new Warehouse(other_element));
16338
        }
16339
        this.success = __this__success;
16340
      }
16341
      if (other.isSetCex()) {
16342
        this.cex = new CatalogServiceException(other.cex);
16343
      }
16344
    }
16345
 
16346
    public getAllWarehouses_result deepCopy() {
16347
      return new getAllWarehouses_result(this);
16348
    }
16349
 
16350
    @Deprecated
16351
    public getAllWarehouses_result clone() {
16352
      return new getAllWarehouses_result(this);
16353
    }
16354
 
16355
    public int getSuccessSize() {
16356
      return (this.success == null) ? 0 : this.success.size();
16357
    }
16358
 
16359
    public java.util.Iterator<Warehouse> getSuccessIterator() {
16360
      return (this.success == null) ? null : this.success.iterator();
16361
    }
16362
 
16363
    public void addToSuccess(Warehouse elem) {
16364
      if (this.success == null) {
16365
        this.success = new ArrayList<Warehouse>();
16366
      }
16367
      this.success.add(elem);
16368
    }
16369
 
16370
    public List<Warehouse> getSuccess() {
16371
      return this.success;
16372
    }
16373
 
16374
    public getAllWarehouses_result setSuccess(List<Warehouse> success) {
16375
      this.success = success;
16376
      return this;
16377
    }
16378
 
16379
    public void unsetSuccess() {
16380
      this.success = null;
16381
    }
16382
 
16383
    /** Returns true if field success is set (has been asigned a value) and false otherwise */
16384
    public boolean isSetSuccess() {
16385
      return this.success != null;
16386
    }
16387
 
16388
    public void setSuccessIsSet(boolean value) {
16389
      if (!value) {
16390
        this.success = null;
16391
      }
16392
    }
16393
 
16394
    public CatalogServiceException getCex() {
16395
      return this.cex;
16396
    }
16397
 
16398
    public getAllWarehouses_result setCex(CatalogServiceException cex) {
16399
      this.cex = cex;
16400
      return this;
16401
    }
16402
 
16403
    public void unsetCex() {
16404
      this.cex = null;
16405
    }
16406
 
16407
    /** Returns true if field cex is set (has been asigned a value) and false otherwise */
16408
    public boolean isSetCex() {
16409
      return this.cex != null;
16410
    }
16411
 
16412
    public void setCexIsSet(boolean value) {
16413
      if (!value) {
16414
        this.cex = null;
16415
      }
16416
    }
16417
 
16418
    public void setFieldValue(_Fields field, Object value) {
16419
      switch (field) {
16420
      case SUCCESS:
16421
        if (value == null) {
16422
          unsetSuccess();
16423
        } else {
16424
          setSuccess((List<Warehouse>)value);
16425
        }
16426
        break;
16427
 
16428
      case CEX:
16429
        if (value == null) {
16430
          unsetCex();
16431
        } else {
16432
          setCex((CatalogServiceException)value);
16433
        }
16434
        break;
16435
 
16436
      }
16437
    }
16438
 
16439
    public void setFieldValue(int fieldID, Object value) {
16440
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
16441
    }
16442
 
16443
    public Object getFieldValue(_Fields field) {
16444
      switch (field) {
16445
      case SUCCESS:
16446
        return getSuccess();
16447
 
16448
      case CEX:
16449
        return getCex();
16450
 
16451
      }
16452
      throw new IllegalStateException();
16453
    }
16454
 
16455
    public Object getFieldValue(int fieldId) {
16456
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
16457
    }
16458
 
16459
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
16460
    public boolean isSet(_Fields field) {
16461
      switch (field) {
16462
      case SUCCESS:
16463
        return isSetSuccess();
16464
      case CEX:
16465
        return isSetCex();
16466
      }
16467
      throw new IllegalStateException();
16468
    }
16469
 
16470
    public boolean isSet(int fieldID) {
16471
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
16472
    }
16473
 
16474
    @Override
16475
    public boolean equals(Object that) {
16476
      if (that == null)
16477
        return false;
16478
      if (that instanceof getAllWarehouses_result)
16479
        return this.equals((getAllWarehouses_result)that);
16480
      return false;
16481
    }
16482
 
16483
    public boolean equals(getAllWarehouses_result that) {
16484
      if (that == null)
16485
        return false;
16486
 
16487
      boolean this_present_success = true && this.isSetSuccess();
16488
      boolean that_present_success = true && that.isSetSuccess();
16489
      if (this_present_success || that_present_success) {
16490
        if (!(this_present_success && that_present_success))
16491
          return false;
16492
        if (!this.success.equals(that.success))
16493
          return false;
16494
      }
16495
 
16496
      boolean this_present_cex = true && this.isSetCex();
16497
      boolean that_present_cex = true && that.isSetCex();
16498
      if (this_present_cex || that_present_cex) {
16499
        if (!(this_present_cex && that_present_cex))
16500
          return false;
16501
        if (!this.cex.equals(that.cex))
16502
          return false;
16503
      }
16504
 
16505
      return true;
16506
    }
16507
 
16508
    @Override
16509
    public int hashCode() {
16510
      return 0;
16511
    }
16512
 
16513
    public int compareTo(getAllWarehouses_result other) {
16514
      if (!getClass().equals(other.getClass())) {
16515
        return getClass().getName().compareTo(other.getClass().getName());
16516
      }
16517
 
16518
      int lastComparison = 0;
16519
      getAllWarehouses_result typedOther = (getAllWarehouses_result)other;
16520
 
16521
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
16522
      if (lastComparison != 0) {
16523
        return lastComparison;
16524
      }
16525
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
16526
      if (lastComparison != 0) {
16527
        return lastComparison;
16528
      }
16529
      lastComparison = Boolean.valueOf(isSetCex()).compareTo(isSetCex());
16530
      if (lastComparison != 0) {
16531
        return lastComparison;
16532
      }
16533
      lastComparison = TBaseHelper.compareTo(cex, typedOther.cex);
16534
      if (lastComparison != 0) {
16535
        return lastComparison;
16536
      }
16537
      return 0;
16538
    }
16539
 
16540
    public void read(TProtocol iprot) throws TException {
16541
      TField field;
16542
      iprot.readStructBegin();
16543
      while (true)
16544
      {
16545
        field = iprot.readFieldBegin();
16546
        if (field.type == TType.STOP) { 
16547
          break;
16548
        }
16549
        _Fields fieldId = _Fields.findByThriftId(field.id);
16550
        if (fieldId == null) {
16551
          TProtocolUtil.skip(iprot, field.type);
16552
        } else {
16553
          switch (fieldId) {
16554
            case SUCCESS:
16555
              if (field.type == TType.LIST) {
16556
                {
16557
                  TList _list34 = iprot.readListBegin();
16558
                  this.success = new ArrayList<Warehouse>(_list34.size);
16559
                  for (int _i35 = 0; _i35 < _list34.size; ++_i35)
16560
                  {
16561
                    Warehouse _elem36;
16562
                    _elem36 = new Warehouse();
16563
                    _elem36.read(iprot);
16564
                    this.success.add(_elem36);
16565
                  }
16566
                  iprot.readListEnd();
16567
                }
16568
              } else { 
16569
                TProtocolUtil.skip(iprot, field.type);
16570
              }
16571
              break;
16572
            case CEX:
16573
              if (field.type == TType.STRUCT) {
16574
                this.cex = new CatalogServiceException();
16575
                this.cex.read(iprot);
16576
              } else { 
16577
                TProtocolUtil.skip(iprot, field.type);
16578
              }
16579
              break;
16580
          }
16581
          iprot.readFieldEnd();
16582
        }
16583
      }
16584
      iprot.readStructEnd();
16585
      validate();
16586
    }
16587
 
16588
    public void write(TProtocol oprot) throws TException {
16589
      oprot.writeStructBegin(STRUCT_DESC);
16590
 
16591
      if (this.isSetSuccess()) {
16592
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
16593
        {
16594
          oprot.writeListBegin(new TList(TType.STRUCT, this.success.size()));
16595
          for (Warehouse _iter37 : this.success)
16596
          {
16597
            _iter37.write(oprot);
16598
          }
16599
          oprot.writeListEnd();
16600
        }
16601
        oprot.writeFieldEnd();
16602
      } else if (this.isSetCex()) {
16603
        oprot.writeFieldBegin(CEX_FIELD_DESC);
16604
        this.cex.write(oprot);
16605
        oprot.writeFieldEnd();
16606
      }
16607
      oprot.writeFieldStop();
16608
      oprot.writeStructEnd();
16609
    }
16610
 
16611
    @Override
16612
    public String toString() {
16613
      StringBuilder sb = new StringBuilder("getAllWarehouses_result(");
16614
      boolean first = true;
16615
 
16616
      sb.append("success:");
16617
      if (this.success == null) {
16618
        sb.append("null");
16619
      } else {
16620
        sb.append(this.success);
16621
      }
16622
      first = false;
16623
      if (!first) sb.append(", ");
16624
      sb.append("cex:");
16625
      if (this.cex == null) {
16626
        sb.append("null");
16627
      } else {
16628
        sb.append(this.cex);
16629
      }
16630
      first = false;
16631
      sb.append(")");
16632
      return sb.toString();
16633
    }
16634
 
16635
    public void validate() throws TException {
16636
      // check for required fields
16637
    }
16638
 
16639
  }
16640
 
100 ashish 16641
  public static class getWarehouse_args implements TBase<getWarehouse_args._Fields>, java.io.Serializable, Cloneable, Comparable<getWarehouse_args>   {
16642
    private static final TStruct STRUCT_DESC = new TStruct("getWarehouse_args");
16643
 
16644
    private static final TField WAREHOUSE_ID_FIELD_DESC = new TField("warehouse_id", TType.I64, (short)1);
16645
 
16646
    private long warehouse_id;
16647
 
16648
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
16649
    public enum _Fields implements TFieldIdEnum {
16650
      WAREHOUSE_ID((short)1, "warehouse_id");
16651
 
16652
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
16653
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
16654
 
16655
      static {
16656
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
16657
          byId.put((int)field._thriftId, field);
16658
          byName.put(field.getFieldName(), field);
16659
        }
16660
      }
16661
 
16662
      /**
16663
       * Find the _Fields constant that matches fieldId, or null if its not found.
16664
       */
16665
      public static _Fields findByThriftId(int fieldId) {
16666
        return byId.get(fieldId);
16667
      }
16668
 
16669
      /**
16670
       * Find the _Fields constant that matches fieldId, throwing an exception
16671
       * if it is not found.
16672
       */
16673
      public static _Fields findByThriftIdOrThrow(int fieldId) {
16674
        _Fields fields = findByThriftId(fieldId);
16675
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
16676
        return fields;
16677
      }
16678
 
16679
      /**
16680
       * Find the _Fields constant that matches name, or null if its not found.
16681
       */
16682
      public static _Fields findByName(String name) {
16683
        return byName.get(name);
16684
      }
16685
 
16686
      private final short _thriftId;
16687
      private final String _fieldName;
16688
 
16689
      _Fields(short thriftId, String fieldName) {
16690
        _thriftId = thriftId;
16691
        _fieldName = fieldName;
16692
      }
16693
 
16694
      public short getThriftFieldId() {
16695
        return _thriftId;
16696
      }
16697
 
16698
      public String getFieldName() {
16699
        return _fieldName;
16700
      }
16701
    }
16702
 
16703
    // isset id assignments
16704
    private static final int __WAREHOUSE_ID_ISSET_ID = 0;
16705
    private BitSet __isset_bit_vector = new BitSet(1);
16706
 
16707
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
16708
      put(_Fields.WAREHOUSE_ID, new FieldMetaData("warehouse_id", TFieldRequirementType.DEFAULT, 
16709
          new FieldValueMetaData(TType.I64)));
16710
    }});
16711
 
16712
    static {
16713
      FieldMetaData.addStructMetaDataMap(getWarehouse_args.class, metaDataMap);
16714
    }
16715
 
16716
    public getWarehouse_args() {
16717
    }
16718
 
16719
    public getWarehouse_args(
16720
      long warehouse_id)
16721
    {
16722
      this();
16723
      this.warehouse_id = warehouse_id;
16724
      setWarehouse_idIsSet(true);
16725
    }
16726
 
16727
    /**
16728
     * Performs a deep copy on <i>other</i>.
16729
     */
16730
    public getWarehouse_args(getWarehouse_args other) {
16731
      __isset_bit_vector.clear();
16732
      __isset_bit_vector.or(other.__isset_bit_vector);
16733
      this.warehouse_id = other.warehouse_id;
16734
    }
16735
 
16736
    public getWarehouse_args deepCopy() {
16737
      return new getWarehouse_args(this);
16738
    }
16739
 
16740
    @Deprecated
16741
    public getWarehouse_args clone() {
16742
      return new getWarehouse_args(this);
16743
    }
16744
 
16745
    public long getWarehouse_id() {
16746
      return this.warehouse_id;
16747
    }
16748
 
16749
    public getWarehouse_args setWarehouse_id(long warehouse_id) {
16750
      this.warehouse_id = warehouse_id;
16751
      setWarehouse_idIsSet(true);
16752
      return this;
16753
    }
16754
 
16755
    public void unsetWarehouse_id() {
16756
      __isset_bit_vector.clear(__WAREHOUSE_ID_ISSET_ID);
16757
    }
16758
 
16759
    /** Returns true if field warehouse_id is set (has been asigned a value) and false otherwise */
16760
    public boolean isSetWarehouse_id() {
16761
      return __isset_bit_vector.get(__WAREHOUSE_ID_ISSET_ID);
16762
    }
16763
 
16764
    public void setWarehouse_idIsSet(boolean value) {
16765
      __isset_bit_vector.set(__WAREHOUSE_ID_ISSET_ID, value);
16766
    }
16767
 
16768
    public void setFieldValue(_Fields field, Object value) {
16769
      switch (field) {
16770
      case WAREHOUSE_ID:
16771
        if (value == null) {
16772
          unsetWarehouse_id();
16773
        } else {
16774
          setWarehouse_id((Long)value);
16775
        }
16776
        break;
16777
 
16778
      }
16779
    }
16780
 
16781
    public void setFieldValue(int fieldID, Object value) {
16782
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
16783
    }
16784
 
16785
    public Object getFieldValue(_Fields field) {
16786
      switch (field) {
16787
      case WAREHOUSE_ID:
16788
        return new Long(getWarehouse_id());
16789
 
16790
      }
16791
      throw new IllegalStateException();
16792
    }
16793
 
16794
    public Object getFieldValue(int fieldId) {
16795
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
16796
    }
16797
 
16798
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
16799
    public boolean isSet(_Fields field) {
16800
      switch (field) {
16801
      case WAREHOUSE_ID:
16802
        return isSetWarehouse_id();
16803
      }
16804
      throw new IllegalStateException();
16805
    }
16806
 
16807
    public boolean isSet(int fieldID) {
16808
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
16809
    }
16810
 
16811
    @Override
16812
    public boolean equals(Object that) {
16813
      if (that == null)
16814
        return false;
16815
      if (that instanceof getWarehouse_args)
16816
        return this.equals((getWarehouse_args)that);
16817
      return false;
16818
    }
16819
 
16820
    public boolean equals(getWarehouse_args that) {
16821
      if (that == null)
16822
        return false;
16823
 
16824
      boolean this_present_warehouse_id = true;
16825
      boolean that_present_warehouse_id = true;
16826
      if (this_present_warehouse_id || that_present_warehouse_id) {
16827
        if (!(this_present_warehouse_id && that_present_warehouse_id))
16828
          return false;
16829
        if (this.warehouse_id != that.warehouse_id)
16830
          return false;
16831
      }
16832
 
16833
      return true;
16834
    }
16835
 
16836
    @Override
16837
    public int hashCode() {
16838
      return 0;
16839
    }
16840
 
16841
    public int compareTo(getWarehouse_args other) {
16842
      if (!getClass().equals(other.getClass())) {
16843
        return getClass().getName().compareTo(other.getClass().getName());
16844
      }
16845
 
16846
      int lastComparison = 0;
16847
      getWarehouse_args typedOther = (getWarehouse_args)other;
16848
 
16849
      lastComparison = Boolean.valueOf(isSetWarehouse_id()).compareTo(isSetWarehouse_id());
16850
      if (lastComparison != 0) {
16851
        return lastComparison;
16852
      }
16853
      lastComparison = TBaseHelper.compareTo(warehouse_id, typedOther.warehouse_id);
16854
      if (lastComparison != 0) {
16855
        return lastComparison;
16856
      }
16857
      return 0;
16858
    }
16859
 
16860
    public void read(TProtocol iprot) throws TException {
16861
      TField field;
16862
      iprot.readStructBegin();
16863
      while (true)
16864
      {
16865
        field = iprot.readFieldBegin();
16866
        if (field.type == TType.STOP) { 
16867
          break;
16868
        }
16869
        _Fields fieldId = _Fields.findByThriftId(field.id);
16870
        if (fieldId == null) {
16871
          TProtocolUtil.skip(iprot, field.type);
16872
        } else {
16873
          switch (fieldId) {
16874
            case WAREHOUSE_ID:
16875
              if (field.type == TType.I64) {
16876
                this.warehouse_id = iprot.readI64();
16877
                setWarehouse_idIsSet(true);
16878
              } else { 
16879
                TProtocolUtil.skip(iprot, field.type);
16880
              }
16881
              break;
16882
          }
16883
          iprot.readFieldEnd();
16884
        }
16885
      }
16886
      iprot.readStructEnd();
16887
      validate();
16888
    }
16889
 
16890
    public void write(TProtocol oprot) throws TException {
16891
      validate();
16892
 
16893
      oprot.writeStructBegin(STRUCT_DESC);
16894
      oprot.writeFieldBegin(WAREHOUSE_ID_FIELD_DESC);
16895
      oprot.writeI64(this.warehouse_id);
16896
      oprot.writeFieldEnd();
16897
      oprot.writeFieldStop();
16898
      oprot.writeStructEnd();
16899
    }
16900
 
16901
    @Override
16902
    public String toString() {
16903
      StringBuilder sb = new StringBuilder("getWarehouse_args(");
16904
      boolean first = true;
16905
 
16906
      sb.append("warehouse_id:");
16907
      sb.append(this.warehouse_id);
16908
      first = false;
16909
      sb.append(")");
16910
      return sb.toString();
16911
    }
16912
 
16913
    public void validate() throws TException {
16914
      // check for required fields
16915
    }
16916
 
16917
  }
16918
 
16919
  public static class getWarehouse_result implements TBase<getWarehouse_result._Fields>, java.io.Serializable, Cloneable, Comparable<getWarehouse_result>   {
16920
    private static final TStruct STRUCT_DESC = new TStruct("getWarehouse_result");
16921
 
16922
    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRUCT, (short)0);
16923
    private static final TField CEX_FIELD_DESC = new TField("cex", TType.STRUCT, (short)1);
16924
 
16925
    private Warehouse success;
16926
    private CatalogServiceException cex;
16927
 
16928
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
16929
    public enum _Fields implements TFieldIdEnum {
16930
      SUCCESS((short)0, "success"),
16931
      CEX((short)1, "cex");
16932
 
16933
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
16934
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
16935
 
16936
      static {
16937
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
16938
          byId.put((int)field._thriftId, field);
16939
          byName.put(field.getFieldName(), field);
16940
        }
16941
      }
16942
 
16943
      /**
16944
       * Find the _Fields constant that matches fieldId, or null if its not found.
16945
       */
16946
      public static _Fields findByThriftId(int fieldId) {
16947
        return byId.get(fieldId);
16948
      }
16949
 
16950
      /**
16951
       * Find the _Fields constant that matches fieldId, throwing an exception
16952
       * if it is not found.
16953
       */
16954
      public static _Fields findByThriftIdOrThrow(int fieldId) {
16955
        _Fields fields = findByThriftId(fieldId);
16956
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
16957
        return fields;
16958
      }
16959
 
16960
      /**
16961
       * Find the _Fields constant that matches name, or null if its not found.
16962
       */
16963
      public static _Fields findByName(String name) {
16964
        return byName.get(name);
16965
      }
16966
 
16967
      private final short _thriftId;
16968
      private final String _fieldName;
16969
 
16970
      _Fields(short thriftId, String fieldName) {
16971
        _thriftId = thriftId;
16972
        _fieldName = fieldName;
16973
      }
16974
 
16975
      public short getThriftFieldId() {
16976
        return _thriftId;
16977
      }
16978
 
16979
      public String getFieldName() {
16980
        return _fieldName;
16981
      }
16982
    }
16983
 
16984
    // isset id assignments
16985
 
16986
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
16987
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
16988
          new StructMetaData(TType.STRUCT, Warehouse.class)));
16989
      put(_Fields.CEX, new FieldMetaData("cex", TFieldRequirementType.DEFAULT, 
16990
          new FieldValueMetaData(TType.STRUCT)));
16991
    }});
16992
 
16993
    static {
16994
      FieldMetaData.addStructMetaDataMap(getWarehouse_result.class, metaDataMap);
16995
    }
16996
 
16997
    public getWarehouse_result() {
16998
    }
16999
 
17000
    public getWarehouse_result(
17001
      Warehouse success,
17002
      CatalogServiceException cex)
17003
    {
17004
      this();
17005
      this.success = success;
17006
      this.cex = cex;
17007
    }
17008
 
17009
    /**
17010
     * Performs a deep copy on <i>other</i>.
17011
     */
17012
    public getWarehouse_result(getWarehouse_result other) {
17013
      if (other.isSetSuccess()) {
17014
        this.success = new Warehouse(other.success);
17015
      }
17016
      if (other.isSetCex()) {
17017
        this.cex = new CatalogServiceException(other.cex);
17018
      }
17019
    }
17020
 
17021
    public getWarehouse_result deepCopy() {
17022
      return new getWarehouse_result(this);
17023
    }
17024
 
17025
    @Deprecated
17026
    public getWarehouse_result clone() {
17027
      return new getWarehouse_result(this);
17028
    }
17029
 
17030
    public Warehouse getSuccess() {
17031
      return this.success;
17032
    }
17033
 
17034
    public getWarehouse_result setSuccess(Warehouse success) {
17035
      this.success = success;
17036
      return this;
17037
    }
17038
 
17039
    public void unsetSuccess() {
17040
      this.success = null;
17041
    }
17042
 
17043
    /** Returns true if field success is set (has been asigned a value) and false otherwise */
17044
    public boolean isSetSuccess() {
17045
      return this.success != null;
17046
    }
17047
 
17048
    public void setSuccessIsSet(boolean value) {
17049
      if (!value) {
17050
        this.success = null;
17051
      }
17052
    }
17053
 
17054
    public CatalogServiceException getCex() {
17055
      return this.cex;
17056
    }
17057
 
17058
    public getWarehouse_result setCex(CatalogServiceException cex) {
17059
      this.cex = cex;
17060
      return this;
17061
    }
17062
 
17063
    public void unsetCex() {
17064
      this.cex = null;
17065
    }
17066
 
17067
    /** Returns true if field cex is set (has been asigned a value) and false otherwise */
17068
    public boolean isSetCex() {
17069
      return this.cex != null;
17070
    }
17071
 
17072
    public void setCexIsSet(boolean value) {
17073
      if (!value) {
17074
        this.cex = null;
17075
      }
17076
    }
17077
 
17078
    public void setFieldValue(_Fields field, Object value) {
17079
      switch (field) {
17080
      case SUCCESS:
17081
        if (value == null) {
17082
          unsetSuccess();
17083
        } else {
17084
          setSuccess((Warehouse)value);
17085
        }
17086
        break;
17087
 
17088
      case CEX:
17089
        if (value == null) {
17090
          unsetCex();
17091
        } else {
17092
          setCex((CatalogServiceException)value);
17093
        }
17094
        break;
17095
 
17096
      }
17097
    }
17098
 
17099
    public void setFieldValue(int fieldID, Object value) {
17100
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
17101
    }
17102
 
17103
    public Object getFieldValue(_Fields field) {
17104
      switch (field) {
17105
      case SUCCESS:
17106
        return getSuccess();
17107
 
17108
      case CEX:
17109
        return getCex();
17110
 
17111
      }
17112
      throw new IllegalStateException();
17113
    }
17114
 
17115
    public Object getFieldValue(int fieldId) {
17116
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
17117
    }
17118
 
17119
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
17120
    public boolean isSet(_Fields field) {
17121
      switch (field) {
17122
      case SUCCESS:
17123
        return isSetSuccess();
17124
      case CEX:
17125
        return isSetCex();
17126
      }
17127
      throw new IllegalStateException();
17128
    }
17129
 
17130
    public boolean isSet(int fieldID) {
17131
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
17132
    }
17133
 
17134
    @Override
17135
    public boolean equals(Object that) {
17136
      if (that == null)
17137
        return false;
17138
      if (that instanceof getWarehouse_result)
17139
        return this.equals((getWarehouse_result)that);
17140
      return false;
17141
    }
17142
 
17143
    public boolean equals(getWarehouse_result that) {
17144
      if (that == null)
17145
        return false;
17146
 
17147
      boolean this_present_success = true && this.isSetSuccess();
17148
      boolean that_present_success = true && that.isSetSuccess();
17149
      if (this_present_success || that_present_success) {
17150
        if (!(this_present_success && that_present_success))
17151
          return false;
17152
        if (!this.success.equals(that.success))
17153
          return false;
17154
      }
17155
 
17156
      boolean this_present_cex = true && this.isSetCex();
17157
      boolean that_present_cex = true && that.isSetCex();
17158
      if (this_present_cex || that_present_cex) {
17159
        if (!(this_present_cex && that_present_cex))
17160
          return false;
17161
        if (!this.cex.equals(that.cex))
17162
          return false;
17163
      }
17164
 
17165
      return true;
17166
    }
17167
 
17168
    @Override
17169
    public int hashCode() {
17170
      return 0;
17171
    }
17172
 
17173
    public int compareTo(getWarehouse_result other) {
17174
      if (!getClass().equals(other.getClass())) {
17175
        return getClass().getName().compareTo(other.getClass().getName());
17176
      }
17177
 
17178
      int lastComparison = 0;
17179
      getWarehouse_result typedOther = (getWarehouse_result)other;
17180
 
17181
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
17182
      if (lastComparison != 0) {
17183
        return lastComparison;
17184
      }
17185
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
17186
      if (lastComparison != 0) {
17187
        return lastComparison;
17188
      }
17189
      lastComparison = Boolean.valueOf(isSetCex()).compareTo(isSetCex());
17190
      if (lastComparison != 0) {
17191
        return lastComparison;
17192
      }
17193
      lastComparison = TBaseHelper.compareTo(cex, typedOther.cex);
17194
      if (lastComparison != 0) {
17195
        return lastComparison;
17196
      }
17197
      return 0;
17198
    }
17199
 
17200
    public void read(TProtocol iprot) throws TException {
17201
      TField field;
17202
      iprot.readStructBegin();
17203
      while (true)
17204
      {
17205
        field = iprot.readFieldBegin();
17206
        if (field.type == TType.STOP) { 
17207
          break;
17208
        }
17209
        _Fields fieldId = _Fields.findByThriftId(field.id);
17210
        if (fieldId == null) {
17211
          TProtocolUtil.skip(iprot, field.type);
17212
        } else {
17213
          switch (fieldId) {
17214
            case SUCCESS:
17215
              if (field.type == TType.STRUCT) {
17216
                this.success = new Warehouse();
17217
                this.success.read(iprot);
17218
              } else { 
17219
                TProtocolUtil.skip(iprot, field.type);
17220
              }
17221
              break;
17222
            case CEX:
17223
              if (field.type == TType.STRUCT) {
17224
                this.cex = new CatalogServiceException();
17225
                this.cex.read(iprot);
17226
              } else { 
17227
                TProtocolUtil.skip(iprot, field.type);
17228
              }
17229
              break;
17230
          }
17231
          iprot.readFieldEnd();
17232
        }
17233
      }
17234
      iprot.readStructEnd();
17235
      validate();
17236
    }
17237
 
17238
    public void write(TProtocol oprot) throws TException {
17239
      oprot.writeStructBegin(STRUCT_DESC);
17240
 
17241
      if (this.isSetSuccess()) {
17242
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
17243
        this.success.write(oprot);
17244
        oprot.writeFieldEnd();
17245
      } else if (this.isSetCex()) {
17246
        oprot.writeFieldBegin(CEX_FIELD_DESC);
17247
        this.cex.write(oprot);
17248
        oprot.writeFieldEnd();
17249
      }
17250
      oprot.writeFieldStop();
17251
      oprot.writeStructEnd();
17252
    }
17253
 
17254
    @Override
17255
    public String toString() {
17256
      StringBuilder sb = new StringBuilder("getWarehouse_result(");
17257
      boolean first = true;
17258
 
17259
      sb.append("success:");
17260
      if (this.success == null) {
17261
        sb.append("null");
17262
      } else {
17263
        sb.append(this.success);
17264
      }
17265
      first = false;
17266
      if (!first) sb.append(", ");
17267
      sb.append("cex:");
17268
      if (this.cex == null) {
17269
        sb.append("null");
17270
      } else {
17271
        sb.append(this.cex);
17272
      }
17273
      first = false;
17274
      sb.append(")");
17275
      return sb.toString();
17276
    }
17277
 
17278
    public void validate() throws TException {
17279
      // check for required fields
17280
    }
17281
 
17282
  }
17283
 
17284
  public static class getAllWarehousesForItem_args implements TBase<getAllWarehousesForItem_args._Fields>, java.io.Serializable, Cloneable, Comparable<getAllWarehousesForItem_args>   {
17285
    private static final TStruct STRUCT_DESC = new TStruct("getAllWarehousesForItem_args");
17286
 
103 ashish 17287
    private static final TField ITEM_ID_FIELD_DESC = new TField("item_id", TType.I64, (short)1);
100 ashish 17288
 
103 ashish 17289
    private long item_id;
100 ashish 17290
 
17291
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
17292
    public enum _Fields implements TFieldIdEnum {
103 ashish 17293
      ITEM_ID((short)1, "item_id");
100 ashish 17294
 
17295
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
17296
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
17297
 
17298
      static {
17299
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
17300
          byId.put((int)field._thriftId, field);
17301
          byName.put(field.getFieldName(), field);
17302
        }
17303
      }
17304
 
17305
      /**
17306
       * Find the _Fields constant that matches fieldId, or null if its not found.
17307
       */
17308
      public static _Fields findByThriftId(int fieldId) {
17309
        return byId.get(fieldId);
17310
      }
17311
 
17312
      /**
17313
       * Find the _Fields constant that matches fieldId, throwing an exception
17314
       * if it is not found.
17315
       */
17316
      public static _Fields findByThriftIdOrThrow(int fieldId) {
17317
        _Fields fields = findByThriftId(fieldId);
17318
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
17319
        return fields;
17320
      }
17321
 
17322
      /**
17323
       * Find the _Fields constant that matches name, or null if its not found.
17324
       */
17325
      public static _Fields findByName(String name) {
17326
        return byName.get(name);
17327
      }
17328
 
17329
      private final short _thriftId;
17330
      private final String _fieldName;
17331
 
17332
      _Fields(short thriftId, String fieldName) {
17333
        _thriftId = thriftId;
17334
        _fieldName = fieldName;
17335
      }
17336
 
17337
      public short getThriftFieldId() {
17338
        return _thriftId;
17339
      }
17340
 
17341
      public String getFieldName() {
17342
        return _fieldName;
17343
      }
17344
    }
17345
 
17346
    // isset id assignments
103 ashish 17347
    private static final int __ITEM_ID_ISSET_ID = 0;
100 ashish 17348
    private BitSet __isset_bit_vector = new BitSet(1);
17349
 
17350
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
103 ashish 17351
      put(_Fields.ITEM_ID, new FieldMetaData("item_id", TFieldRequirementType.DEFAULT, 
100 ashish 17352
          new FieldValueMetaData(TType.I64)));
17353
    }});
17354
 
17355
    static {
17356
      FieldMetaData.addStructMetaDataMap(getAllWarehousesForItem_args.class, metaDataMap);
17357
    }
17358
 
17359
    public getAllWarehousesForItem_args() {
17360
    }
17361
 
17362
    public getAllWarehousesForItem_args(
103 ashish 17363
      long item_id)
100 ashish 17364
    {
17365
      this();
103 ashish 17366
      this.item_id = item_id;
17367
      setItem_idIsSet(true);
100 ashish 17368
    }
17369
 
17370
    /**
17371
     * Performs a deep copy on <i>other</i>.
17372
     */
17373
    public getAllWarehousesForItem_args(getAllWarehousesForItem_args other) {
17374
      __isset_bit_vector.clear();
17375
      __isset_bit_vector.or(other.__isset_bit_vector);
103 ashish 17376
      this.item_id = other.item_id;
100 ashish 17377
    }
17378
 
17379
    public getAllWarehousesForItem_args deepCopy() {
17380
      return new getAllWarehousesForItem_args(this);
17381
    }
17382
 
17383
    @Deprecated
17384
    public getAllWarehousesForItem_args clone() {
17385
      return new getAllWarehousesForItem_args(this);
17386
    }
17387
 
103 ashish 17388
    public long getItem_id() {
17389
      return this.item_id;
100 ashish 17390
    }
17391
 
103 ashish 17392
    public getAllWarehousesForItem_args setItem_id(long item_id) {
17393
      this.item_id = item_id;
17394
      setItem_idIsSet(true);
100 ashish 17395
      return this;
17396
    }
17397
 
103 ashish 17398
    public void unsetItem_id() {
17399
      __isset_bit_vector.clear(__ITEM_ID_ISSET_ID);
100 ashish 17400
    }
17401
 
103 ashish 17402
    /** Returns true if field item_id is set (has been asigned a value) and false otherwise */
17403
    public boolean isSetItem_id() {
17404
      return __isset_bit_vector.get(__ITEM_ID_ISSET_ID);
100 ashish 17405
    }
17406
 
103 ashish 17407
    public void setItem_idIsSet(boolean value) {
17408
      __isset_bit_vector.set(__ITEM_ID_ISSET_ID, value);
100 ashish 17409
    }
17410
 
17411
    public void setFieldValue(_Fields field, Object value) {
17412
      switch (field) {
103 ashish 17413
      case ITEM_ID:
100 ashish 17414
        if (value == null) {
103 ashish 17415
          unsetItem_id();
100 ashish 17416
        } else {
103 ashish 17417
          setItem_id((Long)value);
100 ashish 17418
        }
17419
        break;
17420
 
17421
      }
17422
    }
17423
 
17424
    public void setFieldValue(int fieldID, Object value) {
17425
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
17426
    }
17427
 
17428
    public Object getFieldValue(_Fields field) {
17429
      switch (field) {
103 ashish 17430
      case ITEM_ID:
17431
        return new Long(getItem_id());
100 ashish 17432
 
17433
      }
17434
      throw new IllegalStateException();
17435
    }
17436
 
17437
    public Object getFieldValue(int fieldId) {
17438
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
17439
    }
17440
 
17441
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
17442
    public boolean isSet(_Fields field) {
17443
      switch (field) {
103 ashish 17444
      case ITEM_ID:
17445
        return isSetItem_id();
100 ashish 17446
      }
17447
      throw new IllegalStateException();
17448
    }
17449
 
17450
    public boolean isSet(int fieldID) {
17451
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
17452
    }
17453
 
17454
    @Override
17455
    public boolean equals(Object that) {
17456
      if (that == null)
17457
        return false;
17458
      if (that instanceof getAllWarehousesForItem_args)
17459
        return this.equals((getAllWarehousesForItem_args)that);
17460
      return false;
17461
    }
17462
 
17463
    public boolean equals(getAllWarehousesForItem_args that) {
17464
      if (that == null)
17465
        return false;
17466
 
103 ashish 17467
      boolean this_present_item_id = true;
17468
      boolean that_present_item_id = true;
17469
      if (this_present_item_id || that_present_item_id) {
17470
        if (!(this_present_item_id && that_present_item_id))
100 ashish 17471
          return false;
103 ashish 17472
        if (this.item_id != that.item_id)
100 ashish 17473
          return false;
17474
      }
17475
 
17476
      return true;
17477
    }
17478
 
17479
    @Override
17480
    public int hashCode() {
17481
      return 0;
17482
    }
17483
 
17484
    public int compareTo(getAllWarehousesForItem_args other) {
17485
      if (!getClass().equals(other.getClass())) {
17486
        return getClass().getName().compareTo(other.getClass().getName());
17487
      }
17488
 
17489
      int lastComparison = 0;
17490
      getAllWarehousesForItem_args typedOther = (getAllWarehousesForItem_args)other;
17491
 
103 ashish 17492
      lastComparison = Boolean.valueOf(isSetItem_id()).compareTo(isSetItem_id());
100 ashish 17493
      if (lastComparison != 0) {
17494
        return lastComparison;
17495
      }
103 ashish 17496
      lastComparison = TBaseHelper.compareTo(item_id, typedOther.item_id);
100 ashish 17497
      if (lastComparison != 0) {
17498
        return lastComparison;
17499
      }
17500
      return 0;
17501
    }
17502
 
17503
    public void read(TProtocol iprot) throws TException {
17504
      TField field;
17505
      iprot.readStructBegin();
17506
      while (true)
17507
      {
17508
        field = iprot.readFieldBegin();
17509
        if (field.type == TType.STOP) { 
17510
          break;
17511
        }
17512
        _Fields fieldId = _Fields.findByThriftId(field.id);
17513
        if (fieldId == null) {
17514
          TProtocolUtil.skip(iprot, field.type);
17515
        } else {
17516
          switch (fieldId) {
103 ashish 17517
            case ITEM_ID:
100 ashish 17518
              if (field.type == TType.I64) {
103 ashish 17519
                this.item_id = iprot.readI64();
17520
                setItem_idIsSet(true);
100 ashish 17521
              } else { 
17522
                TProtocolUtil.skip(iprot, field.type);
17523
              }
17524
              break;
17525
          }
17526
          iprot.readFieldEnd();
17527
        }
17528
      }
17529
      iprot.readStructEnd();
17530
      validate();
17531
    }
17532
 
17533
    public void write(TProtocol oprot) throws TException {
17534
      validate();
17535
 
17536
      oprot.writeStructBegin(STRUCT_DESC);
103 ashish 17537
      oprot.writeFieldBegin(ITEM_ID_FIELD_DESC);
17538
      oprot.writeI64(this.item_id);
100 ashish 17539
      oprot.writeFieldEnd();
17540
      oprot.writeFieldStop();
17541
      oprot.writeStructEnd();
17542
    }
17543
 
17544
    @Override
17545
    public String toString() {
17546
      StringBuilder sb = new StringBuilder("getAllWarehousesForItem_args(");
17547
      boolean first = true;
17548
 
103 ashish 17549
      sb.append("item_id:");
17550
      sb.append(this.item_id);
100 ashish 17551
      first = false;
17552
      sb.append(")");
17553
      return sb.toString();
17554
    }
17555
 
17556
    public void validate() throws TException {
17557
      // check for required fields
17558
    }
17559
 
17560
  }
17561
 
17562
  public static class getAllWarehousesForItem_result implements TBase<getAllWarehousesForItem_result._Fields>, java.io.Serializable, Cloneable, Comparable<getAllWarehousesForItem_result>   {
17563
    private static final TStruct STRUCT_DESC = new TStruct("getAllWarehousesForItem_result");
17564
 
17565
    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0);
17566
    private static final TField CEX_FIELD_DESC = new TField("cex", TType.STRUCT, (short)1);
17567
 
17568
    private List<Warehouse> success;
17569
    private CatalogServiceException cex;
17570
 
17571
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
17572
    public enum _Fields implements TFieldIdEnum {
17573
      SUCCESS((short)0, "success"),
17574
      CEX((short)1, "cex");
17575
 
17576
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
17577
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
17578
 
17579
      static {
17580
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
17581
          byId.put((int)field._thriftId, field);
17582
          byName.put(field.getFieldName(), field);
17583
        }
17584
      }
17585
 
17586
      /**
17587
       * Find the _Fields constant that matches fieldId, or null if its not found.
17588
       */
17589
      public static _Fields findByThriftId(int fieldId) {
17590
        return byId.get(fieldId);
17591
      }
17592
 
17593
      /**
17594
       * Find the _Fields constant that matches fieldId, throwing an exception
17595
       * if it is not found.
17596
       */
17597
      public static _Fields findByThriftIdOrThrow(int fieldId) {
17598
        _Fields fields = findByThriftId(fieldId);
17599
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
17600
        return fields;
17601
      }
17602
 
17603
      /**
17604
       * Find the _Fields constant that matches name, or null if its not found.
17605
       */
17606
      public static _Fields findByName(String name) {
17607
        return byName.get(name);
17608
      }
17609
 
17610
      private final short _thriftId;
17611
      private final String _fieldName;
17612
 
17613
      _Fields(short thriftId, String fieldName) {
17614
        _thriftId = thriftId;
17615
        _fieldName = fieldName;
17616
      }
17617
 
17618
      public short getThriftFieldId() {
17619
        return _thriftId;
17620
      }
17621
 
17622
      public String getFieldName() {
17623
        return _fieldName;
17624
      }
17625
    }
17626
 
17627
    // isset id assignments
17628
 
17629
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
17630
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
17631
          new ListMetaData(TType.LIST, 
17632
              new StructMetaData(TType.STRUCT, Warehouse.class))));
17633
      put(_Fields.CEX, new FieldMetaData("cex", TFieldRequirementType.DEFAULT, 
17634
          new FieldValueMetaData(TType.STRUCT)));
17635
    }});
17636
 
17637
    static {
17638
      FieldMetaData.addStructMetaDataMap(getAllWarehousesForItem_result.class, metaDataMap);
17639
    }
17640
 
17641
    public getAllWarehousesForItem_result() {
17642
    }
17643
 
17644
    public getAllWarehousesForItem_result(
17645
      List<Warehouse> success,
17646
      CatalogServiceException cex)
17647
    {
17648
      this();
17649
      this.success = success;
17650
      this.cex = cex;
17651
    }
17652
 
17653
    /**
17654
     * Performs a deep copy on <i>other</i>.
17655
     */
17656
    public getAllWarehousesForItem_result(getAllWarehousesForItem_result other) {
17657
      if (other.isSetSuccess()) {
17658
        List<Warehouse> __this__success = new ArrayList<Warehouse>();
17659
        for (Warehouse other_element : other.success) {
17660
          __this__success.add(new Warehouse(other_element));
17661
        }
17662
        this.success = __this__success;
17663
      }
17664
      if (other.isSetCex()) {
17665
        this.cex = new CatalogServiceException(other.cex);
17666
      }
17667
    }
17668
 
17669
    public getAllWarehousesForItem_result deepCopy() {
17670
      return new getAllWarehousesForItem_result(this);
17671
    }
17672
 
17673
    @Deprecated
17674
    public getAllWarehousesForItem_result clone() {
17675
      return new getAllWarehousesForItem_result(this);
17676
    }
17677
 
17678
    public int getSuccessSize() {
17679
      return (this.success == null) ? 0 : this.success.size();
17680
    }
17681
 
17682
    public java.util.Iterator<Warehouse> getSuccessIterator() {
17683
      return (this.success == null) ? null : this.success.iterator();
17684
    }
17685
 
17686
    public void addToSuccess(Warehouse elem) {
17687
      if (this.success == null) {
17688
        this.success = new ArrayList<Warehouse>();
17689
      }
17690
      this.success.add(elem);
17691
    }
17692
 
17693
    public List<Warehouse> getSuccess() {
17694
      return this.success;
17695
    }
17696
 
17697
    public getAllWarehousesForItem_result setSuccess(List<Warehouse> success) {
17698
      this.success = success;
17699
      return this;
17700
    }
17701
 
17702
    public void unsetSuccess() {
17703
      this.success = null;
17704
    }
17705
 
17706
    /** Returns true if field success is set (has been asigned a value) and false otherwise */
17707
    public boolean isSetSuccess() {
17708
      return this.success != null;
17709
    }
17710
 
17711
    public void setSuccessIsSet(boolean value) {
17712
      if (!value) {
17713
        this.success = null;
17714
      }
17715
    }
17716
 
17717
    public CatalogServiceException getCex() {
17718
      return this.cex;
17719
    }
17720
 
17721
    public getAllWarehousesForItem_result setCex(CatalogServiceException cex) {
17722
      this.cex = cex;
17723
      return this;
17724
    }
17725
 
17726
    public void unsetCex() {
17727
      this.cex = null;
17728
    }
17729
 
17730
    /** Returns true if field cex is set (has been asigned a value) and false otherwise */
17731
    public boolean isSetCex() {
17732
      return this.cex != null;
17733
    }
17734
 
17735
    public void setCexIsSet(boolean value) {
17736
      if (!value) {
17737
        this.cex = null;
17738
      }
17739
    }
17740
 
17741
    public void setFieldValue(_Fields field, Object value) {
17742
      switch (field) {
17743
      case SUCCESS:
17744
        if (value == null) {
17745
          unsetSuccess();
17746
        } else {
17747
          setSuccess((List<Warehouse>)value);
17748
        }
17749
        break;
17750
 
17751
      case CEX:
17752
        if (value == null) {
17753
          unsetCex();
17754
        } else {
17755
          setCex((CatalogServiceException)value);
17756
        }
17757
        break;
17758
 
17759
      }
17760
    }
17761
 
17762
    public void setFieldValue(int fieldID, Object value) {
17763
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
17764
    }
17765
 
17766
    public Object getFieldValue(_Fields field) {
17767
      switch (field) {
17768
      case SUCCESS:
17769
        return getSuccess();
17770
 
17771
      case CEX:
17772
        return getCex();
17773
 
17774
      }
17775
      throw new IllegalStateException();
17776
    }
17777
 
17778
    public Object getFieldValue(int fieldId) {
17779
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
17780
    }
17781
 
17782
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
17783
    public boolean isSet(_Fields field) {
17784
      switch (field) {
17785
      case SUCCESS:
17786
        return isSetSuccess();
17787
      case CEX:
17788
        return isSetCex();
17789
      }
17790
      throw new IllegalStateException();
17791
    }
17792
 
17793
    public boolean isSet(int fieldID) {
17794
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
17795
    }
17796
 
17797
    @Override
17798
    public boolean equals(Object that) {
17799
      if (that == null)
17800
        return false;
17801
      if (that instanceof getAllWarehousesForItem_result)
17802
        return this.equals((getAllWarehousesForItem_result)that);
17803
      return false;
17804
    }
17805
 
17806
    public boolean equals(getAllWarehousesForItem_result that) {
17807
      if (that == null)
17808
        return false;
17809
 
17810
      boolean this_present_success = true && this.isSetSuccess();
17811
      boolean that_present_success = true && that.isSetSuccess();
17812
      if (this_present_success || that_present_success) {
17813
        if (!(this_present_success && that_present_success))
17814
          return false;
17815
        if (!this.success.equals(that.success))
17816
          return false;
17817
      }
17818
 
17819
      boolean this_present_cex = true && this.isSetCex();
17820
      boolean that_present_cex = true && that.isSetCex();
17821
      if (this_present_cex || that_present_cex) {
17822
        if (!(this_present_cex && that_present_cex))
17823
          return false;
17824
        if (!this.cex.equals(that.cex))
17825
          return false;
17826
      }
17827
 
17828
      return true;
17829
    }
17830
 
17831
    @Override
17832
    public int hashCode() {
17833
      return 0;
17834
    }
17835
 
17836
    public int compareTo(getAllWarehousesForItem_result other) {
17837
      if (!getClass().equals(other.getClass())) {
17838
        return getClass().getName().compareTo(other.getClass().getName());
17839
      }
17840
 
17841
      int lastComparison = 0;
17842
      getAllWarehousesForItem_result typedOther = (getAllWarehousesForItem_result)other;
17843
 
17844
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
17845
      if (lastComparison != 0) {
17846
        return lastComparison;
17847
      }
17848
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
17849
      if (lastComparison != 0) {
17850
        return lastComparison;
17851
      }
17852
      lastComparison = Boolean.valueOf(isSetCex()).compareTo(isSetCex());
17853
      if (lastComparison != 0) {
17854
        return lastComparison;
17855
      }
17856
      lastComparison = TBaseHelper.compareTo(cex, typedOther.cex);
17857
      if (lastComparison != 0) {
17858
        return lastComparison;
17859
      }
17860
      return 0;
17861
    }
17862
 
17863
    public void read(TProtocol iprot) throws TException {
17864
      TField field;
17865
      iprot.readStructBegin();
17866
      while (true)
17867
      {
17868
        field = iprot.readFieldBegin();
17869
        if (field.type == TType.STOP) { 
17870
          break;
17871
        }
17872
        _Fields fieldId = _Fields.findByThriftId(field.id);
17873
        if (fieldId == null) {
17874
          TProtocolUtil.skip(iprot, field.type);
17875
        } else {
17876
          switch (fieldId) {
17877
            case SUCCESS:
17878
              if (field.type == TType.LIST) {
17879
                {
103 ashish 17880
                  TList _list38 = iprot.readListBegin();
17881
                  this.success = new ArrayList<Warehouse>(_list38.size);
17882
                  for (int _i39 = 0; _i39 < _list38.size; ++_i39)
100 ashish 17883
                  {
103 ashish 17884
                    Warehouse _elem40;
17885
                    _elem40 = new Warehouse();
17886
                    _elem40.read(iprot);
17887
                    this.success.add(_elem40);
100 ashish 17888
                  }
17889
                  iprot.readListEnd();
17890
                }
17891
              } else { 
17892
                TProtocolUtil.skip(iprot, field.type);
17893
              }
17894
              break;
17895
            case CEX:
17896
              if (field.type == TType.STRUCT) {
17897
                this.cex = new CatalogServiceException();
17898
                this.cex.read(iprot);
17899
              } else { 
17900
                TProtocolUtil.skip(iprot, field.type);
17901
              }
17902
              break;
17903
          }
17904
          iprot.readFieldEnd();
17905
        }
17906
      }
17907
      iprot.readStructEnd();
17908
      validate();
17909
    }
17910
 
17911
    public void write(TProtocol oprot) throws TException {
17912
      oprot.writeStructBegin(STRUCT_DESC);
17913
 
17914
      if (this.isSetSuccess()) {
17915
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
17916
        {
17917
          oprot.writeListBegin(new TList(TType.STRUCT, this.success.size()));
103 ashish 17918
          for (Warehouse _iter41 : this.success)
100 ashish 17919
          {
103 ashish 17920
            _iter41.write(oprot);
100 ashish 17921
          }
17922
          oprot.writeListEnd();
17923
        }
17924
        oprot.writeFieldEnd();
17925
      } else if (this.isSetCex()) {
17926
        oprot.writeFieldBegin(CEX_FIELD_DESC);
17927
        this.cex.write(oprot);
17928
        oprot.writeFieldEnd();
17929
      }
17930
      oprot.writeFieldStop();
17931
      oprot.writeStructEnd();
17932
    }
17933
 
17934
    @Override
17935
    public String toString() {
17936
      StringBuilder sb = new StringBuilder("getAllWarehousesForItem_result(");
17937
      boolean first = true;
17938
 
17939
      sb.append("success:");
17940
      if (this.success == null) {
17941
        sb.append("null");
17942
      } else {
17943
        sb.append(this.success);
17944
      }
17945
      first = false;
17946
      if (!first) sb.append(", ");
17947
      sb.append("cex:");
17948
      if (this.cex == null) {
17949
        sb.append("null");
17950
      } else {
17951
        sb.append(this.cex);
17952
      }
17953
      first = false;
17954
      sb.append(")");
17955
      return sb.toString();
17956
    }
17957
 
17958
    public void validate() throws TException {
17959
      // check for required fields
17960
    }
17961
 
17962
  }
17963
 
103 ashish 17964
  public static class getAllItemsForWarehouse_args implements TBase<getAllItemsForWarehouse_args._Fields>, java.io.Serializable, Cloneable, Comparable<getAllItemsForWarehouse_args>   {
17965
    private static final TStruct STRUCT_DESC = new TStruct("getAllItemsForWarehouse_args");
100 ashish 17966
 
103 ashish 17967
    private static final TField WAREHOUSE_ID_FIELD_DESC = new TField("warehouse_id", TType.I64, (short)1);
100 ashish 17968
 
103 ashish 17969
    private long warehouse_id;
100 ashish 17970
 
17971
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
17972
    public enum _Fields implements TFieldIdEnum {
103 ashish 17973
      WAREHOUSE_ID((short)1, "warehouse_id");
100 ashish 17974
 
17975
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
17976
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
17977
 
17978
      static {
17979
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
17980
          byId.put((int)field._thriftId, field);
17981
          byName.put(field.getFieldName(), field);
17982
        }
17983
      }
17984
 
17985
      /**
17986
       * Find the _Fields constant that matches fieldId, or null if its not found.
17987
       */
17988
      public static _Fields findByThriftId(int fieldId) {
17989
        return byId.get(fieldId);
17990
      }
17991
 
17992
      /**
17993
       * Find the _Fields constant that matches fieldId, throwing an exception
17994
       * if it is not found.
17995
       */
17996
      public static _Fields findByThriftIdOrThrow(int fieldId) {
17997
        _Fields fields = findByThriftId(fieldId);
17998
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
17999
        return fields;
18000
      }
18001
 
18002
      /**
18003
       * Find the _Fields constant that matches name, or null if its not found.
18004
       */
18005
      public static _Fields findByName(String name) {
18006
        return byName.get(name);
18007
      }
18008
 
18009
      private final short _thriftId;
18010
      private final String _fieldName;
18011
 
18012
      _Fields(short thriftId, String fieldName) {
18013
        _thriftId = thriftId;
18014
        _fieldName = fieldName;
18015
      }
18016
 
18017
      public short getThriftFieldId() {
18018
        return _thriftId;
18019
      }
18020
 
18021
      public String getFieldName() {
18022
        return _fieldName;
18023
      }
18024
    }
18025
 
18026
    // isset id assignments
103 ashish 18027
    private static final int __WAREHOUSE_ID_ISSET_ID = 0;
100 ashish 18028
    private BitSet __isset_bit_vector = new BitSet(1);
18029
 
18030
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
103 ashish 18031
      put(_Fields.WAREHOUSE_ID, new FieldMetaData("warehouse_id", TFieldRequirementType.DEFAULT, 
100 ashish 18032
          new FieldValueMetaData(TType.I64)));
18033
    }});
18034
 
18035
    static {
103 ashish 18036
      FieldMetaData.addStructMetaDataMap(getAllItemsForWarehouse_args.class, metaDataMap);
100 ashish 18037
    }
18038
 
103 ashish 18039
    public getAllItemsForWarehouse_args() {
100 ashish 18040
    }
18041
 
103 ashish 18042
    public getAllItemsForWarehouse_args(
18043
      long warehouse_id)
100 ashish 18044
    {
18045
      this();
103 ashish 18046
      this.warehouse_id = warehouse_id;
18047
      setWarehouse_idIsSet(true);
100 ashish 18048
    }
18049
 
18050
    /**
18051
     * Performs a deep copy on <i>other</i>.
18052
     */
103 ashish 18053
    public getAllItemsForWarehouse_args(getAllItemsForWarehouse_args other) {
100 ashish 18054
      __isset_bit_vector.clear();
18055
      __isset_bit_vector.or(other.__isset_bit_vector);
103 ashish 18056
      this.warehouse_id = other.warehouse_id;
100 ashish 18057
    }
18058
 
103 ashish 18059
    public getAllItemsForWarehouse_args deepCopy() {
18060
      return new getAllItemsForWarehouse_args(this);
100 ashish 18061
    }
18062
 
18063
    @Deprecated
103 ashish 18064
    public getAllItemsForWarehouse_args clone() {
18065
      return new getAllItemsForWarehouse_args(this);
100 ashish 18066
    }
18067
 
103 ashish 18068
    public long getWarehouse_id() {
18069
      return this.warehouse_id;
100 ashish 18070
    }
18071
 
103 ashish 18072
    public getAllItemsForWarehouse_args setWarehouse_id(long warehouse_id) {
18073
      this.warehouse_id = warehouse_id;
18074
      setWarehouse_idIsSet(true);
100 ashish 18075
      return this;
18076
    }
18077
 
103 ashish 18078
    public void unsetWarehouse_id() {
18079
      __isset_bit_vector.clear(__WAREHOUSE_ID_ISSET_ID);
100 ashish 18080
    }
18081
 
103 ashish 18082
    /** Returns true if field warehouse_id is set (has been asigned a value) and false otherwise */
18083
    public boolean isSetWarehouse_id() {
18084
      return __isset_bit_vector.get(__WAREHOUSE_ID_ISSET_ID);
100 ashish 18085
    }
18086
 
103 ashish 18087
    public void setWarehouse_idIsSet(boolean value) {
18088
      __isset_bit_vector.set(__WAREHOUSE_ID_ISSET_ID, value);
100 ashish 18089
    }
18090
 
18091
    public void setFieldValue(_Fields field, Object value) {
18092
      switch (field) {
103 ashish 18093
      case WAREHOUSE_ID:
100 ashish 18094
        if (value == null) {
103 ashish 18095
          unsetWarehouse_id();
100 ashish 18096
        } else {
103 ashish 18097
          setWarehouse_id((Long)value);
100 ashish 18098
        }
18099
        break;
18100
 
18101
      }
18102
    }
18103
 
18104
    public void setFieldValue(int fieldID, Object value) {
18105
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
18106
    }
18107
 
18108
    public Object getFieldValue(_Fields field) {
18109
      switch (field) {
103 ashish 18110
      case WAREHOUSE_ID:
18111
        return new Long(getWarehouse_id());
100 ashish 18112
 
18113
      }
18114
      throw new IllegalStateException();
18115
    }
18116
 
18117
    public Object getFieldValue(int fieldId) {
18118
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
18119
    }
18120
 
18121
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
18122
    public boolean isSet(_Fields field) {
18123
      switch (field) {
103 ashish 18124
      case WAREHOUSE_ID:
18125
        return isSetWarehouse_id();
100 ashish 18126
      }
18127
      throw new IllegalStateException();
18128
    }
18129
 
18130
    public boolean isSet(int fieldID) {
18131
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
18132
    }
18133
 
18134
    @Override
18135
    public boolean equals(Object that) {
18136
      if (that == null)
18137
        return false;
103 ashish 18138
      if (that instanceof getAllItemsForWarehouse_args)
18139
        return this.equals((getAllItemsForWarehouse_args)that);
100 ashish 18140
      return false;
18141
    }
18142
 
103 ashish 18143
    public boolean equals(getAllItemsForWarehouse_args that) {
100 ashish 18144
      if (that == null)
18145
        return false;
18146
 
103 ashish 18147
      boolean this_present_warehouse_id = true;
18148
      boolean that_present_warehouse_id = true;
18149
      if (this_present_warehouse_id || that_present_warehouse_id) {
18150
        if (!(this_present_warehouse_id && that_present_warehouse_id))
100 ashish 18151
          return false;
103 ashish 18152
        if (this.warehouse_id != that.warehouse_id)
100 ashish 18153
          return false;
18154
      }
18155
 
18156
      return true;
18157
    }
18158
 
18159
    @Override
18160
    public int hashCode() {
18161
      return 0;
18162
    }
18163
 
103 ashish 18164
    public int compareTo(getAllItemsForWarehouse_args other) {
100 ashish 18165
      if (!getClass().equals(other.getClass())) {
18166
        return getClass().getName().compareTo(other.getClass().getName());
18167
      }
18168
 
18169
      int lastComparison = 0;
103 ashish 18170
      getAllItemsForWarehouse_args typedOther = (getAllItemsForWarehouse_args)other;
100 ashish 18171
 
103 ashish 18172
      lastComparison = Boolean.valueOf(isSetWarehouse_id()).compareTo(isSetWarehouse_id());
100 ashish 18173
      if (lastComparison != 0) {
18174
        return lastComparison;
18175
      }
103 ashish 18176
      lastComparison = TBaseHelper.compareTo(warehouse_id, typedOther.warehouse_id);
100 ashish 18177
      if (lastComparison != 0) {
18178
        return lastComparison;
18179
      }
18180
      return 0;
18181
    }
18182
 
18183
    public void read(TProtocol iprot) throws TException {
18184
      TField field;
18185
      iprot.readStructBegin();
18186
      while (true)
18187
      {
18188
        field = iprot.readFieldBegin();
18189
        if (field.type == TType.STOP) { 
18190
          break;
18191
        }
18192
        _Fields fieldId = _Fields.findByThriftId(field.id);
18193
        if (fieldId == null) {
18194
          TProtocolUtil.skip(iprot, field.type);
18195
        } else {
18196
          switch (fieldId) {
103 ashish 18197
            case WAREHOUSE_ID:
100 ashish 18198
              if (field.type == TType.I64) {
103 ashish 18199
                this.warehouse_id = iprot.readI64();
18200
                setWarehouse_idIsSet(true);
100 ashish 18201
              } else { 
18202
                TProtocolUtil.skip(iprot, field.type);
18203
              }
18204
              break;
18205
          }
18206
          iprot.readFieldEnd();
18207
        }
18208
      }
18209
      iprot.readStructEnd();
18210
      validate();
18211
    }
18212
 
18213
    public void write(TProtocol oprot) throws TException {
18214
      validate();
18215
 
18216
      oprot.writeStructBegin(STRUCT_DESC);
103 ashish 18217
      oprot.writeFieldBegin(WAREHOUSE_ID_FIELD_DESC);
18218
      oprot.writeI64(this.warehouse_id);
100 ashish 18219
      oprot.writeFieldEnd();
18220
      oprot.writeFieldStop();
18221
      oprot.writeStructEnd();
18222
    }
18223
 
18224
    @Override
18225
    public String toString() {
103 ashish 18226
      StringBuilder sb = new StringBuilder("getAllItemsForWarehouse_args(");
100 ashish 18227
      boolean first = true;
18228
 
103 ashish 18229
      sb.append("warehouse_id:");
18230
      sb.append(this.warehouse_id);
100 ashish 18231
      first = false;
18232
      sb.append(")");
18233
      return sb.toString();
18234
    }
18235
 
18236
    public void validate() throws TException {
18237
      // check for required fields
18238
    }
18239
 
18240
  }
18241
 
103 ashish 18242
  public static class getAllItemsForWarehouse_result implements TBase<getAllItemsForWarehouse_result._Fields>, java.io.Serializable, Cloneable   {
18243
    private static final TStruct STRUCT_DESC = new TStruct("getAllItemsForWarehouse_result");
100 ashish 18244
 
103 ashish 18245
    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0);
100 ashish 18246
    private static final TField CEX_FIELD_DESC = new TField("cex", TType.STRUCT, (short)1);
18247
 
103 ashish 18248
    private List<Item> success;
100 ashish 18249
    private CatalogServiceException cex;
18250
 
18251
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
18252
    public enum _Fields implements TFieldIdEnum {
18253
      SUCCESS((short)0, "success"),
18254
      CEX((short)1, "cex");
18255
 
18256
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
18257
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
18258
 
18259
      static {
18260
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
18261
          byId.put((int)field._thriftId, field);
18262
          byName.put(field.getFieldName(), field);
18263
        }
18264
      }
18265
 
18266
      /**
18267
       * Find the _Fields constant that matches fieldId, or null if its not found.
18268
       */
18269
      public static _Fields findByThriftId(int fieldId) {
18270
        return byId.get(fieldId);
18271
      }
18272
 
18273
      /**
18274
       * Find the _Fields constant that matches fieldId, throwing an exception
18275
       * if it is not found.
18276
       */
18277
      public static _Fields findByThriftIdOrThrow(int fieldId) {
18278
        _Fields fields = findByThriftId(fieldId);
18279
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
18280
        return fields;
18281
      }
18282
 
18283
      /**
18284
       * Find the _Fields constant that matches name, or null if its not found.
18285
       */
18286
      public static _Fields findByName(String name) {
18287
        return byName.get(name);
18288
      }
18289
 
18290
      private final short _thriftId;
18291
      private final String _fieldName;
18292
 
18293
      _Fields(short thriftId, String fieldName) {
18294
        _thriftId = thriftId;
18295
        _fieldName = fieldName;
18296
      }
18297
 
18298
      public short getThriftFieldId() {
18299
        return _thriftId;
18300
      }
18301
 
18302
      public String getFieldName() {
18303
        return _fieldName;
18304
      }
18305
    }
18306
 
18307
    // isset id assignments
103 ashish 18308
 
18309
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
18310
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
18311
          new ListMetaData(TType.LIST, 
18312
              new StructMetaData(TType.STRUCT, Item.class))));
18313
      put(_Fields.CEX, new FieldMetaData("cex", TFieldRequirementType.DEFAULT, 
18314
          new FieldValueMetaData(TType.STRUCT)));
18315
    }});
18316
 
18317
    static {
18318
      FieldMetaData.addStructMetaDataMap(getAllItemsForWarehouse_result.class, metaDataMap);
18319
    }
18320
 
18321
    public getAllItemsForWarehouse_result() {
18322
    }
18323
 
18324
    public getAllItemsForWarehouse_result(
18325
      List<Item> success,
18326
      CatalogServiceException cex)
18327
    {
18328
      this();
18329
      this.success = success;
18330
      this.cex = cex;
18331
    }
18332
 
18333
    /**
18334
     * Performs a deep copy on <i>other</i>.
18335
     */
18336
    public getAllItemsForWarehouse_result(getAllItemsForWarehouse_result other) {
18337
      if (other.isSetSuccess()) {
18338
        List<Item> __this__success = new ArrayList<Item>();
18339
        for (Item other_element : other.success) {
18340
          __this__success.add(new Item(other_element));
18341
        }
18342
        this.success = __this__success;
18343
      }
18344
      if (other.isSetCex()) {
18345
        this.cex = new CatalogServiceException(other.cex);
18346
      }
18347
    }
18348
 
18349
    public getAllItemsForWarehouse_result deepCopy() {
18350
      return new getAllItemsForWarehouse_result(this);
18351
    }
18352
 
18353
    @Deprecated
18354
    public getAllItemsForWarehouse_result clone() {
18355
      return new getAllItemsForWarehouse_result(this);
18356
    }
18357
 
18358
    public int getSuccessSize() {
18359
      return (this.success == null) ? 0 : this.success.size();
18360
    }
18361
 
18362
    public java.util.Iterator<Item> getSuccessIterator() {
18363
      return (this.success == null) ? null : this.success.iterator();
18364
    }
18365
 
18366
    public void addToSuccess(Item elem) {
18367
      if (this.success == null) {
18368
        this.success = new ArrayList<Item>();
18369
      }
18370
      this.success.add(elem);
18371
    }
18372
 
18373
    public List<Item> getSuccess() {
18374
      return this.success;
18375
    }
18376
 
18377
    public getAllItemsForWarehouse_result setSuccess(List<Item> success) {
18378
      this.success = success;
18379
      return this;
18380
    }
18381
 
18382
    public void unsetSuccess() {
18383
      this.success = null;
18384
    }
18385
 
18386
    /** Returns true if field success is set (has been asigned a value) and false otherwise */
18387
    public boolean isSetSuccess() {
18388
      return this.success != null;
18389
    }
18390
 
18391
    public void setSuccessIsSet(boolean value) {
18392
      if (!value) {
18393
        this.success = null;
18394
      }
18395
    }
18396
 
18397
    public CatalogServiceException getCex() {
18398
      return this.cex;
18399
    }
18400
 
18401
    public getAllItemsForWarehouse_result setCex(CatalogServiceException cex) {
18402
      this.cex = cex;
18403
      return this;
18404
    }
18405
 
18406
    public void unsetCex() {
18407
      this.cex = null;
18408
    }
18409
 
18410
    /** Returns true if field cex is set (has been asigned a value) and false otherwise */
18411
    public boolean isSetCex() {
18412
      return this.cex != null;
18413
    }
18414
 
18415
    public void setCexIsSet(boolean value) {
18416
      if (!value) {
18417
        this.cex = null;
18418
      }
18419
    }
18420
 
18421
    public void setFieldValue(_Fields field, Object value) {
18422
      switch (field) {
18423
      case SUCCESS:
18424
        if (value == null) {
18425
          unsetSuccess();
18426
        } else {
18427
          setSuccess((List<Item>)value);
18428
        }
18429
        break;
18430
 
18431
      case CEX:
18432
        if (value == null) {
18433
          unsetCex();
18434
        } else {
18435
          setCex((CatalogServiceException)value);
18436
        }
18437
        break;
18438
 
18439
      }
18440
    }
18441
 
18442
    public void setFieldValue(int fieldID, Object value) {
18443
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
18444
    }
18445
 
18446
    public Object getFieldValue(_Fields field) {
18447
      switch (field) {
18448
      case SUCCESS:
18449
        return getSuccess();
18450
 
18451
      case CEX:
18452
        return getCex();
18453
 
18454
      }
18455
      throw new IllegalStateException();
18456
    }
18457
 
18458
    public Object getFieldValue(int fieldId) {
18459
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
18460
    }
18461
 
18462
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
18463
    public boolean isSet(_Fields field) {
18464
      switch (field) {
18465
      case SUCCESS:
18466
        return isSetSuccess();
18467
      case CEX:
18468
        return isSetCex();
18469
      }
18470
      throw new IllegalStateException();
18471
    }
18472
 
18473
    public boolean isSet(int fieldID) {
18474
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
18475
    }
18476
 
18477
    @Override
18478
    public boolean equals(Object that) {
18479
      if (that == null)
18480
        return false;
18481
      if (that instanceof getAllItemsForWarehouse_result)
18482
        return this.equals((getAllItemsForWarehouse_result)that);
18483
      return false;
18484
    }
18485
 
18486
    public boolean equals(getAllItemsForWarehouse_result that) {
18487
      if (that == null)
18488
        return false;
18489
 
18490
      boolean this_present_success = true && this.isSetSuccess();
18491
      boolean that_present_success = true && that.isSetSuccess();
18492
      if (this_present_success || that_present_success) {
18493
        if (!(this_present_success && that_present_success))
18494
          return false;
18495
        if (!this.success.equals(that.success))
18496
          return false;
18497
      }
18498
 
18499
      boolean this_present_cex = true && this.isSetCex();
18500
      boolean that_present_cex = true && that.isSetCex();
18501
      if (this_present_cex || that_present_cex) {
18502
        if (!(this_present_cex && that_present_cex))
18503
          return false;
18504
        if (!this.cex.equals(that.cex))
18505
          return false;
18506
      }
18507
 
18508
      return true;
18509
    }
18510
 
18511
    @Override
18512
    public int hashCode() {
18513
      return 0;
18514
    }
18515
 
18516
    public void read(TProtocol iprot) throws TException {
18517
      TField field;
18518
      iprot.readStructBegin();
18519
      while (true)
18520
      {
18521
        field = iprot.readFieldBegin();
18522
        if (field.type == TType.STOP) { 
18523
          break;
18524
        }
18525
        _Fields fieldId = _Fields.findByThriftId(field.id);
18526
        if (fieldId == null) {
18527
          TProtocolUtil.skip(iprot, field.type);
18528
        } else {
18529
          switch (fieldId) {
18530
            case SUCCESS:
18531
              if (field.type == TType.LIST) {
18532
                {
18533
                  TList _list42 = iprot.readListBegin();
18534
                  this.success = new ArrayList<Item>(_list42.size);
18535
                  for (int _i43 = 0; _i43 < _list42.size; ++_i43)
18536
                  {
18537
                    Item _elem44;
18538
                    _elem44 = new Item();
18539
                    _elem44.read(iprot);
18540
                    this.success.add(_elem44);
18541
                  }
18542
                  iprot.readListEnd();
18543
                }
18544
              } else { 
18545
                TProtocolUtil.skip(iprot, field.type);
18546
              }
18547
              break;
18548
            case CEX:
18549
              if (field.type == TType.STRUCT) {
18550
                this.cex = new CatalogServiceException();
18551
                this.cex.read(iprot);
18552
              } else { 
18553
                TProtocolUtil.skip(iprot, field.type);
18554
              }
18555
              break;
18556
          }
18557
          iprot.readFieldEnd();
18558
        }
18559
      }
18560
      iprot.readStructEnd();
18561
      validate();
18562
    }
18563
 
18564
    public void write(TProtocol oprot) throws TException {
18565
      oprot.writeStructBegin(STRUCT_DESC);
18566
 
18567
      if (this.isSetSuccess()) {
18568
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
18569
        {
18570
          oprot.writeListBegin(new TList(TType.STRUCT, this.success.size()));
18571
          for (Item _iter45 : this.success)
18572
          {
18573
            _iter45.write(oprot);
18574
          }
18575
          oprot.writeListEnd();
18576
        }
18577
        oprot.writeFieldEnd();
18578
      } else if (this.isSetCex()) {
18579
        oprot.writeFieldBegin(CEX_FIELD_DESC);
18580
        this.cex.write(oprot);
18581
        oprot.writeFieldEnd();
18582
      }
18583
      oprot.writeFieldStop();
18584
      oprot.writeStructEnd();
18585
    }
18586
 
18587
    @Override
18588
    public String toString() {
18589
      StringBuilder sb = new StringBuilder("getAllItemsForWarehouse_result(");
18590
      boolean first = true;
18591
 
18592
      sb.append("success:");
18593
      if (this.success == null) {
18594
        sb.append("null");
18595
      } else {
18596
        sb.append(this.success);
18597
      }
18598
      first = false;
18599
      if (!first) sb.append(", ");
18600
      sb.append("cex:");
18601
      if (this.cex == null) {
18602
        sb.append("null");
18603
      } else {
18604
        sb.append(this.cex);
18605
      }
18606
      first = false;
18607
      sb.append(")");
18608
      return sb.toString();
18609
    }
18610
 
18611
    public void validate() throws TException {
18612
      // check for required fields
18613
    }
18614
 
18615
  }
18616
 
18617
  public static class getVendor_args implements TBase<getVendor_args._Fields>, java.io.Serializable, Cloneable, Comparable<getVendor_args>   {
18618
    private static final TStruct STRUCT_DESC = new TStruct("getVendor_args");
18619
 
18620
    private static final TField VENDOR_ID_FIELD_DESC = new TField("vendor_id", TType.I64, (short)1);
18621
 
18622
    private long vendor_id;
18623
 
18624
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
18625
    public enum _Fields implements TFieldIdEnum {
18626
      VENDOR_ID((short)1, "vendor_id");
18627
 
18628
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
18629
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
18630
 
18631
      static {
18632
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
18633
          byId.put((int)field._thriftId, field);
18634
          byName.put(field.getFieldName(), field);
18635
        }
18636
      }
18637
 
18638
      /**
18639
       * Find the _Fields constant that matches fieldId, or null if its not found.
18640
       */
18641
      public static _Fields findByThriftId(int fieldId) {
18642
        return byId.get(fieldId);
18643
      }
18644
 
18645
      /**
18646
       * Find the _Fields constant that matches fieldId, throwing an exception
18647
       * if it is not found.
18648
       */
18649
      public static _Fields findByThriftIdOrThrow(int fieldId) {
18650
        _Fields fields = findByThriftId(fieldId);
18651
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
18652
        return fields;
18653
      }
18654
 
18655
      /**
18656
       * Find the _Fields constant that matches name, or null if its not found.
18657
       */
18658
      public static _Fields findByName(String name) {
18659
        return byName.get(name);
18660
      }
18661
 
18662
      private final short _thriftId;
18663
      private final String _fieldName;
18664
 
18665
      _Fields(short thriftId, String fieldName) {
18666
        _thriftId = thriftId;
18667
        _fieldName = fieldName;
18668
      }
18669
 
18670
      public short getThriftFieldId() {
18671
        return _thriftId;
18672
      }
18673
 
18674
      public String getFieldName() {
18675
        return _fieldName;
18676
      }
18677
    }
18678
 
18679
    // isset id assignments
18680
    private static final int __VENDOR_ID_ISSET_ID = 0;
100 ashish 18681
    private BitSet __isset_bit_vector = new BitSet(1);
18682
 
18683
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
103 ashish 18684
      put(_Fields.VENDOR_ID, new FieldMetaData("vendor_id", TFieldRequirementType.DEFAULT, 
18685
          new FieldValueMetaData(TType.I64)));
18686
    }});
18687
 
18688
    static {
18689
      FieldMetaData.addStructMetaDataMap(getVendor_args.class, metaDataMap);
18690
    }
18691
 
18692
    public getVendor_args() {
18693
    }
18694
 
18695
    public getVendor_args(
18696
      long vendor_id)
18697
    {
18698
      this();
18699
      this.vendor_id = vendor_id;
18700
      setVendor_idIsSet(true);
18701
    }
18702
 
18703
    /**
18704
     * Performs a deep copy on <i>other</i>.
18705
     */
18706
    public getVendor_args(getVendor_args other) {
18707
      __isset_bit_vector.clear();
18708
      __isset_bit_vector.or(other.__isset_bit_vector);
18709
      this.vendor_id = other.vendor_id;
18710
    }
18711
 
18712
    public getVendor_args deepCopy() {
18713
      return new getVendor_args(this);
18714
    }
18715
 
18716
    @Deprecated
18717
    public getVendor_args clone() {
18718
      return new getVendor_args(this);
18719
    }
18720
 
18721
    public long getVendor_id() {
18722
      return this.vendor_id;
18723
    }
18724
 
18725
    public getVendor_args setVendor_id(long vendor_id) {
18726
      this.vendor_id = vendor_id;
18727
      setVendor_idIsSet(true);
18728
      return this;
18729
    }
18730
 
18731
    public void unsetVendor_id() {
18732
      __isset_bit_vector.clear(__VENDOR_ID_ISSET_ID);
18733
    }
18734
 
18735
    /** Returns true if field vendor_id is set (has been asigned a value) and false otherwise */
18736
    public boolean isSetVendor_id() {
18737
      return __isset_bit_vector.get(__VENDOR_ID_ISSET_ID);
18738
    }
18739
 
18740
    public void setVendor_idIsSet(boolean value) {
18741
      __isset_bit_vector.set(__VENDOR_ID_ISSET_ID, value);
18742
    }
18743
 
18744
    public void setFieldValue(_Fields field, Object value) {
18745
      switch (field) {
18746
      case VENDOR_ID:
18747
        if (value == null) {
18748
          unsetVendor_id();
18749
        } else {
18750
          setVendor_id((Long)value);
18751
        }
18752
        break;
18753
 
18754
      }
18755
    }
18756
 
18757
    public void setFieldValue(int fieldID, Object value) {
18758
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
18759
    }
18760
 
18761
    public Object getFieldValue(_Fields field) {
18762
      switch (field) {
18763
      case VENDOR_ID:
18764
        return new Long(getVendor_id());
18765
 
18766
      }
18767
      throw new IllegalStateException();
18768
    }
18769
 
18770
    public Object getFieldValue(int fieldId) {
18771
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
18772
    }
18773
 
18774
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
18775
    public boolean isSet(_Fields field) {
18776
      switch (field) {
18777
      case VENDOR_ID:
18778
        return isSetVendor_id();
18779
      }
18780
      throw new IllegalStateException();
18781
    }
18782
 
18783
    public boolean isSet(int fieldID) {
18784
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
18785
    }
18786
 
18787
    @Override
18788
    public boolean equals(Object that) {
18789
      if (that == null)
18790
        return false;
18791
      if (that instanceof getVendor_args)
18792
        return this.equals((getVendor_args)that);
18793
      return false;
18794
    }
18795
 
18796
    public boolean equals(getVendor_args that) {
18797
      if (that == null)
18798
        return false;
18799
 
18800
      boolean this_present_vendor_id = true;
18801
      boolean that_present_vendor_id = true;
18802
      if (this_present_vendor_id || that_present_vendor_id) {
18803
        if (!(this_present_vendor_id && that_present_vendor_id))
18804
          return false;
18805
        if (this.vendor_id != that.vendor_id)
18806
          return false;
18807
      }
18808
 
18809
      return true;
18810
    }
18811
 
18812
    @Override
18813
    public int hashCode() {
18814
      return 0;
18815
    }
18816
 
18817
    public int compareTo(getVendor_args other) {
18818
      if (!getClass().equals(other.getClass())) {
18819
        return getClass().getName().compareTo(other.getClass().getName());
18820
      }
18821
 
18822
      int lastComparison = 0;
18823
      getVendor_args typedOther = (getVendor_args)other;
18824
 
18825
      lastComparison = Boolean.valueOf(isSetVendor_id()).compareTo(isSetVendor_id());
18826
      if (lastComparison != 0) {
18827
        return lastComparison;
18828
      }
18829
      lastComparison = TBaseHelper.compareTo(vendor_id, typedOther.vendor_id);
18830
      if (lastComparison != 0) {
18831
        return lastComparison;
18832
      }
18833
      return 0;
18834
    }
18835
 
18836
    public void read(TProtocol iprot) throws TException {
18837
      TField field;
18838
      iprot.readStructBegin();
18839
      while (true)
18840
      {
18841
        field = iprot.readFieldBegin();
18842
        if (field.type == TType.STOP) { 
18843
          break;
18844
        }
18845
        _Fields fieldId = _Fields.findByThriftId(field.id);
18846
        if (fieldId == null) {
18847
          TProtocolUtil.skip(iprot, field.type);
18848
        } else {
18849
          switch (fieldId) {
18850
            case VENDOR_ID:
18851
              if (field.type == TType.I64) {
18852
                this.vendor_id = iprot.readI64();
18853
                setVendor_idIsSet(true);
18854
              } else { 
18855
                TProtocolUtil.skip(iprot, field.type);
18856
              }
18857
              break;
18858
          }
18859
          iprot.readFieldEnd();
18860
        }
18861
      }
18862
      iprot.readStructEnd();
18863
      validate();
18864
    }
18865
 
18866
    public void write(TProtocol oprot) throws TException {
18867
      validate();
18868
 
18869
      oprot.writeStructBegin(STRUCT_DESC);
18870
      oprot.writeFieldBegin(VENDOR_ID_FIELD_DESC);
18871
      oprot.writeI64(this.vendor_id);
18872
      oprot.writeFieldEnd();
18873
      oprot.writeFieldStop();
18874
      oprot.writeStructEnd();
18875
    }
18876
 
18877
    @Override
18878
    public String toString() {
18879
      StringBuilder sb = new StringBuilder("getVendor_args(");
18880
      boolean first = true;
18881
 
18882
      sb.append("vendor_id:");
18883
      sb.append(this.vendor_id);
18884
      first = false;
18885
      sb.append(")");
18886
      return sb.toString();
18887
    }
18888
 
18889
    public void validate() throws TException {
18890
      // check for required fields
18891
    }
18892
 
18893
  }
18894
 
18895
  public static class getVendor_result implements TBase<getVendor_result._Fields>, java.io.Serializable, Cloneable, Comparable<getVendor_result>   {
18896
    private static final TStruct STRUCT_DESC = new TStruct("getVendor_result");
18897
 
18898
    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRUCT, (short)0);
18899
    private static final TField CEX_FIELD_DESC = new TField("cex", TType.STRUCT, (short)1);
18900
 
18901
    private Vendor success;
18902
    private CatalogServiceException cex;
18903
 
18904
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
18905
    public enum _Fields implements TFieldIdEnum {
18906
      SUCCESS((short)0, "success"),
18907
      CEX((short)1, "cex");
18908
 
18909
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
18910
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
18911
 
18912
      static {
18913
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
18914
          byId.put((int)field._thriftId, field);
18915
          byName.put(field.getFieldName(), field);
18916
        }
18917
      }
18918
 
18919
      /**
18920
       * Find the _Fields constant that matches fieldId, or null if its not found.
18921
       */
18922
      public static _Fields findByThriftId(int fieldId) {
18923
        return byId.get(fieldId);
18924
      }
18925
 
18926
      /**
18927
       * Find the _Fields constant that matches fieldId, throwing an exception
18928
       * if it is not found.
18929
       */
18930
      public static _Fields findByThriftIdOrThrow(int fieldId) {
18931
        _Fields fields = findByThriftId(fieldId);
18932
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
18933
        return fields;
18934
      }
18935
 
18936
      /**
18937
       * Find the _Fields constant that matches name, or null if its not found.
18938
       */
18939
      public static _Fields findByName(String name) {
18940
        return byName.get(name);
18941
      }
18942
 
18943
      private final short _thriftId;
18944
      private final String _fieldName;
18945
 
18946
      _Fields(short thriftId, String fieldName) {
18947
        _thriftId = thriftId;
18948
        _fieldName = fieldName;
18949
      }
18950
 
18951
      public short getThriftFieldId() {
18952
        return _thriftId;
18953
      }
18954
 
18955
      public String getFieldName() {
18956
        return _fieldName;
18957
      }
18958
    }
18959
 
18960
    // isset id assignments
18961
 
18962
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
100 ashish 18963
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
103 ashish 18964
          new StructMetaData(TType.STRUCT, Vendor.class)));
100 ashish 18965
      put(_Fields.CEX, new FieldMetaData("cex", TFieldRequirementType.DEFAULT, 
18966
          new FieldValueMetaData(TType.STRUCT)));
18967
    }});
18968
 
18969
    static {
103 ashish 18970
      FieldMetaData.addStructMetaDataMap(getVendor_result.class, metaDataMap);
100 ashish 18971
    }
18972
 
103 ashish 18973
    public getVendor_result() {
100 ashish 18974
    }
18975
 
103 ashish 18976
    public getVendor_result(
18977
      Vendor success,
100 ashish 18978
      CatalogServiceException cex)
18979
    {
18980
      this();
18981
      this.success = success;
18982
      this.cex = cex;
18983
    }
18984
 
18985
    /**
18986
     * Performs a deep copy on <i>other</i>.
18987
     */
103 ashish 18988
    public getVendor_result(getVendor_result other) {
18989
      if (other.isSetSuccess()) {
18990
        this.success = new Vendor(other.success);
18991
      }
18992
      if (other.isSetCex()) {
18993
        this.cex = new CatalogServiceException(other.cex);
18994
      }
18995
    }
18996
 
18997
    public getVendor_result deepCopy() {
18998
      return new getVendor_result(this);
18999
    }
19000
 
19001
    @Deprecated
19002
    public getVendor_result clone() {
19003
      return new getVendor_result(this);
19004
    }
19005
 
19006
    public Vendor getSuccess() {
19007
      return this.success;
19008
    }
19009
 
19010
    public getVendor_result setSuccess(Vendor success) {
19011
      this.success = success;
19012
      return this;
19013
    }
19014
 
19015
    public void unsetSuccess() {
19016
      this.success = null;
19017
    }
19018
 
19019
    /** Returns true if field success is set (has been asigned a value) and false otherwise */
19020
    public boolean isSetSuccess() {
19021
      return this.success != null;
19022
    }
19023
 
19024
    public void setSuccessIsSet(boolean value) {
19025
      if (!value) {
19026
        this.success = null;
19027
      }
19028
    }
19029
 
19030
    public CatalogServiceException getCex() {
19031
      return this.cex;
19032
    }
19033
 
19034
    public getVendor_result setCex(CatalogServiceException cex) {
19035
      this.cex = cex;
19036
      return this;
19037
    }
19038
 
19039
    public void unsetCex() {
19040
      this.cex = null;
19041
    }
19042
 
19043
    /** Returns true if field cex is set (has been asigned a value) and false otherwise */
19044
    public boolean isSetCex() {
19045
      return this.cex != null;
19046
    }
19047
 
19048
    public void setCexIsSet(boolean value) {
19049
      if (!value) {
19050
        this.cex = null;
19051
      }
19052
    }
19053
 
19054
    public void setFieldValue(_Fields field, Object value) {
19055
      switch (field) {
19056
      case SUCCESS:
19057
        if (value == null) {
19058
          unsetSuccess();
19059
        } else {
19060
          setSuccess((Vendor)value);
19061
        }
19062
        break;
19063
 
19064
      case CEX:
19065
        if (value == null) {
19066
          unsetCex();
19067
        } else {
19068
          setCex((CatalogServiceException)value);
19069
        }
19070
        break;
19071
 
19072
      }
19073
    }
19074
 
19075
    public void setFieldValue(int fieldID, Object value) {
19076
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
19077
    }
19078
 
19079
    public Object getFieldValue(_Fields field) {
19080
      switch (field) {
19081
      case SUCCESS:
19082
        return getSuccess();
19083
 
19084
      case CEX:
19085
        return getCex();
19086
 
19087
      }
19088
      throw new IllegalStateException();
19089
    }
19090
 
19091
    public Object getFieldValue(int fieldId) {
19092
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
19093
    }
19094
 
19095
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
19096
    public boolean isSet(_Fields field) {
19097
      switch (field) {
19098
      case SUCCESS:
19099
        return isSetSuccess();
19100
      case CEX:
19101
        return isSetCex();
19102
      }
19103
      throw new IllegalStateException();
19104
    }
19105
 
19106
    public boolean isSet(int fieldID) {
19107
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
19108
    }
19109
 
19110
    @Override
19111
    public boolean equals(Object that) {
19112
      if (that == null)
19113
        return false;
19114
      if (that instanceof getVendor_result)
19115
        return this.equals((getVendor_result)that);
19116
      return false;
19117
    }
19118
 
19119
    public boolean equals(getVendor_result that) {
19120
      if (that == null)
19121
        return false;
19122
 
19123
      boolean this_present_success = true && this.isSetSuccess();
19124
      boolean that_present_success = true && that.isSetSuccess();
19125
      if (this_present_success || that_present_success) {
19126
        if (!(this_present_success && that_present_success))
19127
          return false;
19128
        if (!this.success.equals(that.success))
19129
          return false;
19130
      }
19131
 
19132
      boolean this_present_cex = true && this.isSetCex();
19133
      boolean that_present_cex = true && that.isSetCex();
19134
      if (this_present_cex || that_present_cex) {
19135
        if (!(this_present_cex && that_present_cex))
19136
          return false;
19137
        if (!this.cex.equals(that.cex))
19138
          return false;
19139
      }
19140
 
19141
      return true;
19142
    }
19143
 
19144
    @Override
19145
    public int hashCode() {
19146
      return 0;
19147
    }
19148
 
19149
    public int compareTo(getVendor_result other) {
19150
      if (!getClass().equals(other.getClass())) {
19151
        return getClass().getName().compareTo(other.getClass().getName());
19152
      }
19153
 
19154
      int lastComparison = 0;
19155
      getVendor_result typedOther = (getVendor_result)other;
19156
 
19157
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
19158
      if (lastComparison != 0) {
19159
        return lastComparison;
19160
      }
19161
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
19162
      if (lastComparison != 0) {
19163
        return lastComparison;
19164
      }
19165
      lastComparison = Boolean.valueOf(isSetCex()).compareTo(isSetCex());
19166
      if (lastComparison != 0) {
19167
        return lastComparison;
19168
      }
19169
      lastComparison = TBaseHelper.compareTo(cex, typedOther.cex);
19170
      if (lastComparison != 0) {
19171
        return lastComparison;
19172
      }
19173
      return 0;
19174
    }
19175
 
19176
    public void read(TProtocol iprot) throws TException {
19177
      TField field;
19178
      iprot.readStructBegin();
19179
      while (true)
19180
      {
19181
        field = iprot.readFieldBegin();
19182
        if (field.type == TType.STOP) { 
19183
          break;
19184
        }
19185
        _Fields fieldId = _Fields.findByThriftId(field.id);
19186
        if (fieldId == null) {
19187
          TProtocolUtil.skip(iprot, field.type);
19188
        } else {
19189
          switch (fieldId) {
19190
            case SUCCESS:
19191
              if (field.type == TType.STRUCT) {
19192
                this.success = new Vendor();
19193
                this.success.read(iprot);
19194
              } else { 
19195
                TProtocolUtil.skip(iprot, field.type);
19196
              }
19197
              break;
19198
            case CEX:
19199
              if (field.type == TType.STRUCT) {
19200
                this.cex = new CatalogServiceException();
19201
                this.cex.read(iprot);
19202
              } else { 
19203
                TProtocolUtil.skip(iprot, field.type);
19204
              }
19205
              break;
19206
          }
19207
          iprot.readFieldEnd();
19208
        }
19209
      }
19210
      iprot.readStructEnd();
19211
      validate();
19212
    }
19213
 
19214
    public void write(TProtocol oprot) throws TException {
19215
      oprot.writeStructBegin(STRUCT_DESC);
19216
 
19217
      if (this.isSetSuccess()) {
19218
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
19219
        this.success.write(oprot);
19220
        oprot.writeFieldEnd();
19221
      } else if (this.isSetCex()) {
19222
        oprot.writeFieldBegin(CEX_FIELD_DESC);
19223
        this.cex.write(oprot);
19224
        oprot.writeFieldEnd();
19225
      }
19226
      oprot.writeFieldStop();
19227
      oprot.writeStructEnd();
19228
    }
19229
 
19230
    @Override
19231
    public String toString() {
19232
      StringBuilder sb = new StringBuilder("getVendor_result(");
19233
      boolean first = true;
19234
 
19235
      sb.append("success:");
19236
      if (this.success == null) {
19237
        sb.append("null");
19238
      } else {
19239
        sb.append(this.success);
19240
      }
19241
      first = false;
19242
      if (!first) sb.append(", ");
19243
      sb.append("cex:");
19244
      if (this.cex == null) {
19245
        sb.append("null");
19246
      } else {
19247
        sb.append(this.cex);
19248
      }
19249
      first = false;
19250
      sb.append(")");
19251
      return sb.toString();
19252
    }
19253
 
19254
    public void validate() throws TException {
19255
      // check for required fields
19256
    }
19257
 
19258
  }
19259
 
19260
  public static class getAllVendors_args implements TBase<getAllVendors_args._Fields>, java.io.Serializable, Cloneable, Comparable<getAllVendors_args>   {
19261
    private static final TStruct STRUCT_DESC = new TStruct("getAllVendors_args");
19262
 
19263
    private static final TField IS_ACTIVE_FIELD_DESC = new TField("isActive", TType.BOOL, (short)1);
19264
 
19265
    private boolean isActive;
19266
 
19267
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
19268
    public enum _Fields implements TFieldIdEnum {
19269
      IS_ACTIVE((short)1, "isActive");
19270
 
19271
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
19272
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
19273
 
19274
      static {
19275
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
19276
          byId.put((int)field._thriftId, field);
19277
          byName.put(field.getFieldName(), field);
19278
        }
19279
      }
19280
 
19281
      /**
19282
       * Find the _Fields constant that matches fieldId, or null if its not found.
19283
       */
19284
      public static _Fields findByThriftId(int fieldId) {
19285
        return byId.get(fieldId);
19286
      }
19287
 
19288
      /**
19289
       * Find the _Fields constant that matches fieldId, throwing an exception
19290
       * if it is not found.
19291
       */
19292
      public static _Fields findByThriftIdOrThrow(int fieldId) {
19293
        _Fields fields = findByThriftId(fieldId);
19294
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
19295
        return fields;
19296
      }
19297
 
19298
      /**
19299
       * Find the _Fields constant that matches name, or null if its not found.
19300
       */
19301
      public static _Fields findByName(String name) {
19302
        return byName.get(name);
19303
      }
19304
 
19305
      private final short _thriftId;
19306
      private final String _fieldName;
19307
 
19308
      _Fields(short thriftId, String fieldName) {
19309
        _thriftId = thriftId;
19310
        _fieldName = fieldName;
19311
      }
19312
 
19313
      public short getThriftFieldId() {
19314
        return _thriftId;
19315
      }
19316
 
19317
      public String getFieldName() {
19318
        return _fieldName;
19319
      }
19320
    }
19321
 
19322
    // isset id assignments
19323
    private static final int __ISACTIVE_ISSET_ID = 0;
19324
    private BitSet __isset_bit_vector = new BitSet(1);
19325
 
19326
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
19327
      put(_Fields.IS_ACTIVE, new FieldMetaData("isActive", TFieldRequirementType.DEFAULT, 
19328
          new FieldValueMetaData(TType.BOOL)));
19329
    }});
19330
 
19331
    static {
19332
      FieldMetaData.addStructMetaDataMap(getAllVendors_args.class, metaDataMap);
19333
    }
19334
 
19335
    public getAllVendors_args() {
19336
    }
19337
 
19338
    public getAllVendors_args(
19339
      boolean isActive)
19340
    {
19341
      this();
19342
      this.isActive = isActive;
19343
      setIsActiveIsSet(true);
19344
    }
19345
 
19346
    /**
19347
     * Performs a deep copy on <i>other</i>.
19348
     */
19349
    public getAllVendors_args(getAllVendors_args other) {
100 ashish 19350
      __isset_bit_vector.clear();
19351
      __isset_bit_vector.or(other.__isset_bit_vector);
103 ashish 19352
      this.isActive = other.isActive;
19353
    }
19354
 
19355
    public getAllVendors_args deepCopy() {
19356
      return new getAllVendors_args(this);
19357
    }
19358
 
19359
    @Deprecated
19360
    public getAllVendors_args clone() {
19361
      return new getAllVendors_args(this);
19362
    }
19363
 
19364
    public boolean isIsActive() {
19365
      return this.isActive;
19366
    }
19367
 
19368
    public getAllVendors_args setIsActive(boolean isActive) {
19369
      this.isActive = isActive;
19370
      setIsActiveIsSet(true);
19371
      return this;
19372
    }
19373
 
19374
    public void unsetIsActive() {
19375
      __isset_bit_vector.clear(__ISACTIVE_ISSET_ID);
19376
    }
19377
 
19378
    /** Returns true if field isActive is set (has been asigned a value) and false otherwise */
19379
    public boolean isSetIsActive() {
19380
      return __isset_bit_vector.get(__ISACTIVE_ISSET_ID);
19381
    }
19382
 
19383
    public void setIsActiveIsSet(boolean value) {
19384
      __isset_bit_vector.set(__ISACTIVE_ISSET_ID, value);
19385
    }
19386
 
19387
    public void setFieldValue(_Fields field, Object value) {
19388
      switch (field) {
19389
      case IS_ACTIVE:
19390
        if (value == null) {
19391
          unsetIsActive();
19392
        } else {
19393
          setIsActive((Boolean)value);
19394
        }
19395
        break;
19396
 
19397
      }
19398
    }
19399
 
19400
    public void setFieldValue(int fieldID, Object value) {
19401
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
19402
    }
19403
 
19404
    public Object getFieldValue(_Fields field) {
19405
      switch (field) {
19406
      case IS_ACTIVE:
19407
        return new Boolean(isIsActive());
19408
 
19409
      }
19410
      throw new IllegalStateException();
19411
    }
19412
 
19413
    public Object getFieldValue(int fieldId) {
19414
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
19415
    }
19416
 
19417
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
19418
    public boolean isSet(_Fields field) {
19419
      switch (field) {
19420
      case IS_ACTIVE:
19421
        return isSetIsActive();
19422
      }
19423
      throw new IllegalStateException();
19424
    }
19425
 
19426
    public boolean isSet(int fieldID) {
19427
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
19428
    }
19429
 
19430
    @Override
19431
    public boolean equals(Object that) {
19432
      if (that == null)
19433
        return false;
19434
      if (that instanceof getAllVendors_args)
19435
        return this.equals((getAllVendors_args)that);
19436
      return false;
19437
    }
19438
 
19439
    public boolean equals(getAllVendors_args that) {
19440
      if (that == null)
19441
        return false;
19442
 
19443
      boolean this_present_isActive = true;
19444
      boolean that_present_isActive = true;
19445
      if (this_present_isActive || that_present_isActive) {
19446
        if (!(this_present_isActive && that_present_isActive))
19447
          return false;
19448
        if (this.isActive != that.isActive)
19449
          return false;
19450
      }
19451
 
19452
      return true;
19453
    }
19454
 
19455
    @Override
19456
    public int hashCode() {
19457
      return 0;
19458
    }
19459
 
19460
    public int compareTo(getAllVendors_args other) {
19461
      if (!getClass().equals(other.getClass())) {
19462
        return getClass().getName().compareTo(other.getClass().getName());
19463
      }
19464
 
19465
      int lastComparison = 0;
19466
      getAllVendors_args typedOther = (getAllVendors_args)other;
19467
 
19468
      lastComparison = Boolean.valueOf(isSetIsActive()).compareTo(isSetIsActive());
19469
      if (lastComparison != 0) {
19470
        return lastComparison;
19471
      }
19472
      lastComparison = TBaseHelper.compareTo(isActive, typedOther.isActive);
19473
      if (lastComparison != 0) {
19474
        return lastComparison;
19475
      }
19476
      return 0;
19477
    }
19478
 
19479
    public void read(TProtocol iprot) throws TException {
19480
      TField field;
19481
      iprot.readStructBegin();
19482
      while (true)
19483
      {
19484
        field = iprot.readFieldBegin();
19485
        if (field.type == TType.STOP) { 
19486
          break;
19487
        }
19488
        _Fields fieldId = _Fields.findByThriftId(field.id);
19489
        if (fieldId == null) {
19490
          TProtocolUtil.skip(iprot, field.type);
19491
        } else {
19492
          switch (fieldId) {
19493
            case IS_ACTIVE:
19494
              if (field.type == TType.BOOL) {
19495
                this.isActive = iprot.readBool();
19496
                setIsActiveIsSet(true);
19497
              } else { 
19498
                TProtocolUtil.skip(iprot, field.type);
19499
              }
19500
              break;
19501
          }
19502
          iprot.readFieldEnd();
19503
        }
19504
      }
19505
      iprot.readStructEnd();
19506
      validate();
19507
    }
19508
 
19509
    public void write(TProtocol oprot) throws TException {
19510
      validate();
19511
 
19512
      oprot.writeStructBegin(STRUCT_DESC);
19513
      oprot.writeFieldBegin(IS_ACTIVE_FIELD_DESC);
19514
      oprot.writeBool(this.isActive);
19515
      oprot.writeFieldEnd();
19516
      oprot.writeFieldStop();
19517
      oprot.writeStructEnd();
19518
    }
19519
 
19520
    @Override
19521
    public String toString() {
19522
      StringBuilder sb = new StringBuilder("getAllVendors_args(");
19523
      boolean first = true;
19524
 
19525
      sb.append("isActive:");
19526
      sb.append(this.isActive);
19527
      first = false;
19528
      sb.append(")");
19529
      return sb.toString();
19530
    }
19531
 
19532
    public void validate() throws TException {
19533
      // check for required fields
19534
    }
19535
 
19536
  }
19537
 
19538
  public static class getAllVendors_result implements TBase<getAllVendors_result._Fields>, java.io.Serializable, Cloneable, Comparable<getAllVendors_result>   {
19539
    private static final TStruct STRUCT_DESC = new TStruct("getAllVendors_result");
19540
 
19541
    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0);
19542
    private static final TField CEX_FIELD_DESC = new TField("cex", TType.STRUCT, (short)1);
19543
 
19544
    private List<Vendor> success;
19545
    private CatalogServiceException cex;
19546
 
19547
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
19548
    public enum _Fields implements TFieldIdEnum {
19549
      SUCCESS((short)0, "success"),
19550
      CEX((short)1, "cex");
19551
 
19552
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
19553
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
19554
 
19555
      static {
19556
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
19557
          byId.put((int)field._thriftId, field);
19558
          byName.put(field.getFieldName(), field);
19559
        }
19560
      }
19561
 
19562
      /**
19563
       * Find the _Fields constant that matches fieldId, or null if its not found.
19564
       */
19565
      public static _Fields findByThriftId(int fieldId) {
19566
        return byId.get(fieldId);
19567
      }
19568
 
19569
      /**
19570
       * Find the _Fields constant that matches fieldId, throwing an exception
19571
       * if it is not found.
19572
       */
19573
      public static _Fields findByThriftIdOrThrow(int fieldId) {
19574
        _Fields fields = findByThriftId(fieldId);
19575
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
19576
        return fields;
19577
      }
19578
 
19579
      /**
19580
       * Find the _Fields constant that matches name, or null if its not found.
19581
       */
19582
      public static _Fields findByName(String name) {
19583
        return byName.get(name);
19584
      }
19585
 
19586
      private final short _thriftId;
19587
      private final String _fieldName;
19588
 
19589
      _Fields(short thriftId, String fieldName) {
19590
        _thriftId = thriftId;
19591
        _fieldName = fieldName;
19592
      }
19593
 
19594
      public short getThriftFieldId() {
19595
        return _thriftId;
19596
      }
19597
 
19598
      public String getFieldName() {
19599
        return _fieldName;
19600
      }
19601
    }
19602
 
19603
    // isset id assignments
19604
 
19605
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
19606
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
19607
          new ListMetaData(TType.LIST, 
19608
              new StructMetaData(TType.STRUCT, Vendor.class))));
19609
      put(_Fields.CEX, new FieldMetaData("cex", TFieldRequirementType.DEFAULT, 
19610
          new FieldValueMetaData(TType.STRUCT)));
19611
    }});
19612
 
19613
    static {
19614
      FieldMetaData.addStructMetaDataMap(getAllVendors_result.class, metaDataMap);
19615
    }
19616
 
19617
    public getAllVendors_result() {
19618
    }
19619
 
19620
    public getAllVendors_result(
19621
      List<Vendor> success,
19622
      CatalogServiceException cex)
19623
    {
19624
      this();
19625
      this.success = success;
19626
      this.cex = cex;
19627
    }
19628
 
19629
    /**
19630
     * Performs a deep copy on <i>other</i>.
19631
     */
19632
    public getAllVendors_result(getAllVendors_result other) {
19633
      if (other.isSetSuccess()) {
19634
        List<Vendor> __this__success = new ArrayList<Vendor>();
19635
        for (Vendor other_element : other.success) {
19636
          __this__success.add(new Vendor(other_element));
19637
        }
19638
        this.success = __this__success;
19639
      }
100 ashish 19640
      if (other.isSetCex()) {
19641
        this.cex = new CatalogServiceException(other.cex);
19642
      }
19643
    }
19644
 
103 ashish 19645
    public getAllVendors_result deepCopy() {
19646
      return new getAllVendors_result(this);
100 ashish 19647
    }
19648
 
19649
    @Deprecated
103 ashish 19650
    public getAllVendors_result clone() {
19651
      return new getAllVendors_result(this);
100 ashish 19652
    }
19653
 
103 ashish 19654
    public int getSuccessSize() {
19655
      return (this.success == null) ? 0 : this.success.size();
19656
    }
19657
 
19658
    public java.util.Iterator<Vendor> getSuccessIterator() {
19659
      return (this.success == null) ? null : this.success.iterator();
19660
    }
19661
 
19662
    public void addToSuccess(Vendor elem) {
19663
      if (this.success == null) {
19664
        this.success = new ArrayList<Vendor>();
19665
      }
19666
      this.success.add(elem);
19667
    }
19668
 
19669
    public List<Vendor> getSuccess() {
100 ashish 19670
      return this.success;
19671
    }
19672
 
103 ashish 19673
    public getAllVendors_result setSuccess(List<Vendor> success) {
100 ashish 19674
      this.success = success;
19675
      return this;
19676
    }
19677
 
19678
    public void unsetSuccess() {
103 ashish 19679
      this.success = null;
100 ashish 19680
    }
19681
 
19682
    /** Returns true if field success is set (has been asigned a value) and false otherwise */
19683
    public boolean isSetSuccess() {
103 ashish 19684
      return this.success != null;
100 ashish 19685
    }
19686
 
19687
    public void setSuccessIsSet(boolean value) {
103 ashish 19688
      if (!value) {
19689
        this.success = null;
19690
      }
100 ashish 19691
    }
19692
 
19693
    public CatalogServiceException getCex() {
19694
      return this.cex;
19695
    }
19696
 
103 ashish 19697
    public getAllVendors_result setCex(CatalogServiceException cex) {
100 ashish 19698
      this.cex = cex;
19699
      return this;
19700
    }
19701
 
19702
    public void unsetCex() {
19703
      this.cex = null;
19704
    }
19705
 
19706
    /** Returns true if field cex is set (has been asigned a value) and false otherwise */
19707
    public boolean isSetCex() {
19708
      return this.cex != null;
19709
    }
19710
 
19711
    public void setCexIsSet(boolean value) {
19712
      if (!value) {
19713
        this.cex = null;
19714
      }
19715
    }
19716
 
19717
    public void setFieldValue(_Fields field, Object value) {
19718
      switch (field) {
19719
      case SUCCESS:
19720
        if (value == null) {
19721
          unsetSuccess();
19722
        } else {
103 ashish 19723
          setSuccess((List<Vendor>)value);
100 ashish 19724
        }
19725
        break;
19726
 
19727
      case CEX:
19728
        if (value == null) {
19729
          unsetCex();
19730
        } else {
19731
          setCex((CatalogServiceException)value);
19732
        }
19733
        break;
19734
 
19735
      }
19736
    }
19737
 
19738
    public void setFieldValue(int fieldID, Object value) {
19739
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
19740
    }
19741
 
19742
    public Object getFieldValue(_Fields field) {
19743
      switch (field) {
19744
      case SUCCESS:
103 ashish 19745
        return getSuccess();
100 ashish 19746
 
19747
      case CEX:
19748
        return getCex();
19749
 
19750
      }
19751
      throw new IllegalStateException();
19752
    }
19753
 
19754
    public Object getFieldValue(int fieldId) {
19755
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
19756
    }
19757
 
19758
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
19759
    public boolean isSet(_Fields field) {
19760
      switch (field) {
19761
      case SUCCESS:
19762
        return isSetSuccess();
19763
      case CEX:
19764
        return isSetCex();
19765
      }
19766
      throw new IllegalStateException();
19767
    }
19768
 
19769
    public boolean isSet(int fieldID) {
19770
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
19771
    }
19772
 
19773
    @Override
19774
    public boolean equals(Object that) {
19775
      if (that == null)
19776
        return false;
103 ashish 19777
      if (that instanceof getAllVendors_result)
19778
        return this.equals((getAllVendors_result)that);
100 ashish 19779
      return false;
19780
    }
19781
 
103 ashish 19782
    public boolean equals(getAllVendors_result that) {
100 ashish 19783
      if (that == null)
19784
        return false;
19785
 
103 ashish 19786
      boolean this_present_success = true && this.isSetSuccess();
19787
      boolean that_present_success = true && that.isSetSuccess();
100 ashish 19788
      if (this_present_success || that_present_success) {
19789
        if (!(this_present_success && that_present_success))
19790
          return false;
103 ashish 19791
        if (!this.success.equals(that.success))
100 ashish 19792
          return false;
19793
      }
19794
 
19795
      boolean this_present_cex = true && this.isSetCex();
19796
      boolean that_present_cex = true && that.isSetCex();
19797
      if (this_present_cex || that_present_cex) {
19798
        if (!(this_present_cex && that_present_cex))
19799
          return false;
19800
        if (!this.cex.equals(that.cex))
19801
          return false;
19802
      }
19803
 
19804
      return true;
19805
    }
19806
 
19807
    @Override
19808
    public int hashCode() {
19809
      return 0;
19810
    }
19811
 
103 ashish 19812
    public int compareTo(getAllVendors_result other) {
100 ashish 19813
      if (!getClass().equals(other.getClass())) {
19814
        return getClass().getName().compareTo(other.getClass().getName());
19815
      }
19816
 
19817
      int lastComparison = 0;
103 ashish 19818
      getAllVendors_result typedOther = (getAllVendors_result)other;
100 ashish 19819
 
19820
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
19821
      if (lastComparison != 0) {
19822
        return lastComparison;
19823
      }
19824
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
19825
      if (lastComparison != 0) {
19826
        return lastComparison;
19827
      }
19828
      lastComparison = Boolean.valueOf(isSetCex()).compareTo(isSetCex());
19829
      if (lastComparison != 0) {
19830
        return lastComparison;
19831
      }
19832
      lastComparison = TBaseHelper.compareTo(cex, typedOther.cex);
19833
      if (lastComparison != 0) {
19834
        return lastComparison;
19835
      }
19836
      return 0;
19837
    }
19838
 
19839
    public void read(TProtocol iprot) throws TException {
19840
      TField field;
19841
      iprot.readStructBegin();
19842
      while (true)
19843
      {
19844
        field = iprot.readFieldBegin();
19845
        if (field.type == TType.STOP) { 
19846
          break;
19847
        }
19848
        _Fields fieldId = _Fields.findByThriftId(field.id);
19849
        if (fieldId == null) {
19850
          TProtocolUtil.skip(iprot, field.type);
19851
        } else {
19852
          switch (fieldId) {
19853
            case SUCCESS:
103 ashish 19854
              if (field.type == TType.LIST) {
19855
                {
19856
                  TList _list46 = iprot.readListBegin();
19857
                  this.success = new ArrayList<Vendor>(_list46.size);
19858
                  for (int _i47 = 0; _i47 < _list46.size; ++_i47)
19859
                  {
19860
                    Vendor _elem48;
19861
                    _elem48 = new Vendor();
19862
                    _elem48.read(iprot);
19863
                    this.success.add(_elem48);
19864
                  }
19865
                  iprot.readListEnd();
19866
                }
100 ashish 19867
              } else { 
19868
                TProtocolUtil.skip(iprot, field.type);
19869
              }
19870
              break;
19871
            case CEX:
19872
              if (field.type == TType.STRUCT) {
19873
                this.cex = new CatalogServiceException();
19874
                this.cex.read(iprot);
19875
              } else { 
19876
                TProtocolUtil.skip(iprot, field.type);
19877
              }
19878
              break;
19879
          }
19880
          iprot.readFieldEnd();
19881
        }
19882
      }
19883
      iprot.readStructEnd();
19884
      validate();
19885
    }
19886
 
19887
    public void write(TProtocol oprot) throws TException {
19888
      oprot.writeStructBegin(STRUCT_DESC);
19889
 
19890
      if (this.isSetSuccess()) {
19891
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
103 ashish 19892
        {
19893
          oprot.writeListBegin(new TList(TType.STRUCT, this.success.size()));
19894
          for (Vendor _iter49 : this.success)
19895
          {
19896
            _iter49.write(oprot);
19897
          }
19898
          oprot.writeListEnd();
19899
        }
100 ashish 19900
        oprot.writeFieldEnd();
19901
      } else if (this.isSetCex()) {
19902
        oprot.writeFieldBegin(CEX_FIELD_DESC);
19903
        this.cex.write(oprot);
19904
        oprot.writeFieldEnd();
19905
      }
19906
      oprot.writeFieldStop();
19907
      oprot.writeStructEnd();
19908
    }
19909
 
19910
    @Override
19911
    public String toString() {
103 ashish 19912
      StringBuilder sb = new StringBuilder("getAllVendors_result(");
100 ashish 19913
      boolean first = true;
19914
 
19915
      sb.append("success:");
103 ashish 19916
      if (this.success == null) {
19917
        sb.append("null");
19918
      } else {
19919
        sb.append(this.success);
19920
      }
100 ashish 19921
      first = false;
19922
      if (!first) sb.append(", ");
19923
      sb.append("cex:");
19924
      if (this.cex == null) {
19925
        sb.append("null");
19926
      } else {
19927
        sb.append(this.cex);
19928
      }
19929
      first = false;
19930
      sb.append(")");
19931
      return sb.toString();
19932
    }
19933
 
19934
    public void validate() throws TException {
19935
      // check for required fields
19936
    }
19937
 
19938
  }
19939
 
19940
}