Subversion Repositories SmartDukaan

Rev

Rev 103 | Blame | Last modification | View Log | RSS feed

/**
 * Autogenerated by Thrift
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 */
package in.shop2020.model.v1.catalog;

import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;
import java.util.EnumMap;
import java.util.Set;
import java.util.HashSet;
import java.util.EnumSet;
import java.util.Collections;
import java.util.BitSet;
import java.util.Arrays;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import org.apache.thrift.*;
import org.apache.thrift.meta_data.*;
import org.apache.thrift.protocol.*;

public class CatalogService {

  public interface Iface {

    /**
     * Availability and inventory attributes
     * 
     * @param category
     */
    public long addCategory(Category category) throws CatalogServiceException, TException;

    public long addItem(Item item) throws CatalogServiceException, TException;

    public long addItemToCategory(long item_id, long category_id) throws CatalogServiceException, TException;

    public long addWarehouse(Warehouse warehouse) throws CatalogServiceException, TException;

    public long addVendor(Vendor vendor) throws CatalogServiceException, TException;

    public void updateInventory(long item_id, long warehouse_id, long quantity, long timestamp) throws CatalogServiceException, TException;

    public void retireCategory(long category_id) throws CatalogServiceException, TException;

    public void retireVendor(long vendor_id) throws CatalogServiceException, TException;

    public void retireWarehouse(long warehouse_id) throws CatalogServiceException, TException;

    public void startItemOn(long item_id, long timestamp) throws CatalogServiceException, TException;

    public void retireItemOn(long item_id, long timestamp) throws CatalogServiceException, TException;

    public void changeItemStatus(long item_id, long timestamp, status newstatus) throws CatalogServiceException, TException;

    public Category getCategory(long id) throws CatalogServiceException, TException;

    public List<Category> getAllCategories(boolean isActive) throws CatalogServiceException, TException;

    public Item getItem(long item_id) throws CatalogServiceException, TException;

    public List<Item> getAllItemsForCategory(long category_id, boolean isActive) throws CatalogServiceException, TException;

    public List<Item> getAllItems(boolean isActive) throws CatalogServiceException, TException;

    public List<Item> getAllItemsByStatus(status itemStatus) throws CatalogServiceException, TException;

    public ItemInventory getItemInventory(long item_id) throws CatalogServiceException, TException;

    public long getItemAvailibilityAtWarehouse(long warehouse_id, long item_id) throws CatalogServiceException, TException;

    public ItemInventoryHistory getItemInventoryHistory(long id, long item_id, long warehouse_id, long from_date, long to_date) throws CatalogServiceException, TException;

    public List<Warehouse> getAllWarehouses(boolean isActive) throws CatalogServiceException, TException;

    public Warehouse getWarehouse(long warehouse_id) throws CatalogServiceException, TException;

    public List<Warehouse> getAllWarehousesForItem(long item_id) throws CatalogServiceException, TException;

    public List<Item> getAllItemsForWarehouse(long warehouse_id) throws CatalogServiceException, TException;

    public Vendor getVendor(long vendor_id) throws CatalogServiceException, TException;

    public List<Vendor> getAllVendors(boolean isActive) throws CatalogServiceException, TException;

  }

  public static class Client implements Iface {
    public Client(TProtocol prot)
    {
      this(prot, prot);
    }

    public Client(TProtocol iprot, TProtocol oprot)
    {
      iprot_ = iprot;
      oprot_ = oprot;
    }

    protected TProtocol iprot_;
    protected TProtocol oprot_;

    protected int seqid_;

    public TProtocol getInputProtocol()
    {
      return this.iprot_;
    }

    public TProtocol getOutputProtocol()
    {
      return this.oprot_;
    }

    public long addCategory(Category category) throws CatalogServiceException, TException
    {
      send_addCategory(category);
      return recv_addCategory();
    }

    public void send_addCategory(Category category) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("addCategory", TMessageType.CALL, seqid_));
      addCategory_args args = new addCategory_args();
      args.category = category;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public long recv_addCategory() throws CatalogServiceException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      addCategory_result result = new addCategory_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.cex != null) {
        throw result.cex;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "addCategory failed: unknown result");
    }

    public long addItem(Item item) throws CatalogServiceException, TException
    {
      send_addItem(item);
      return recv_addItem();
    }

    public void send_addItem(Item item) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("addItem", TMessageType.CALL, seqid_));
      addItem_args args = new addItem_args();
      args.item = item;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public long recv_addItem() throws CatalogServiceException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      addItem_result result = new addItem_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.cex != null) {
        throw result.cex;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "addItem failed: unknown result");
    }

    public long addItemToCategory(long item_id, long category_id) throws CatalogServiceException, TException
    {
      send_addItemToCategory(item_id, category_id);
      return recv_addItemToCategory();
    }

    public void send_addItemToCategory(long item_id, long category_id) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("addItemToCategory", TMessageType.CALL, seqid_));
      addItemToCategory_args args = new addItemToCategory_args();
      args.item_id = item_id;
      args.category_id = category_id;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public long recv_addItemToCategory() throws CatalogServiceException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      addItemToCategory_result result = new addItemToCategory_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.cex != null) {
        throw result.cex;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "addItemToCategory failed: unknown result");
    }

    public long addWarehouse(Warehouse warehouse) throws CatalogServiceException, TException
    {
      send_addWarehouse(warehouse);
      return recv_addWarehouse();
    }

    public void send_addWarehouse(Warehouse warehouse) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("addWarehouse", TMessageType.CALL, seqid_));
      addWarehouse_args args = new addWarehouse_args();
      args.warehouse = warehouse;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public long recv_addWarehouse() throws CatalogServiceException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      addWarehouse_result result = new addWarehouse_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.cex != null) {
        throw result.cex;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "addWarehouse failed: unknown result");
    }

    public long addVendor(Vendor vendor) throws CatalogServiceException, TException
    {
      send_addVendor(vendor);
      return recv_addVendor();
    }

    public void send_addVendor(Vendor vendor) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("addVendor", TMessageType.CALL, seqid_));
      addVendor_args args = new addVendor_args();
      args.vendor = vendor;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public long recv_addVendor() throws CatalogServiceException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      addVendor_result result = new addVendor_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.cex != null) {
        throw result.cex;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "addVendor failed: unknown result");
    }

    public void updateInventory(long item_id, long warehouse_id, long quantity, long timestamp) throws CatalogServiceException, TException
    {
      send_updateInventory(item_id, warehouse_id, quantity, timestamp);
      recv_updateInventory();
    }

    public void send_updateInventory(long item_id, long warehouse_id, long quantity, long timestamp) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("updateInventory", TMessageType.CALL, seqid_));
      updateInventory_args args = new updateInventory_args();
      args.item_id = item_id;
      args.warehouse_id = warehouse_id;
      args.quantity = quantity;
      args.timestamp = timestamp;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public void recv_updateInventory() throws CatalogServiceException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      updateInventory_result result = new updateInventory_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.cex != null) {
        throw result.cex;
      }
      return;
    }

    public void retireCategory(long category_id) throws CatalogServiceException, TException
    {
      send_retireCategory(category_id);
      recv_retireCategory();
    }

    public void send_retireCategory(long category_id) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("retireCategory", TMessageType.CALL, seqid_));
      retireCategory_args args = new retireCategory_args();
      args.category_id = category_id;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public void recv_retireCategory() throws CatalogServiceException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      retireCategory_result result = new retireCategory_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.cex != null) {
        throw result.cex;
      }
      return;
    }

    public void retireVendor(long vendor_id) throws CatalogServiceException, TException
    {
      send_retireVendor(vendor_id);
      recv_retireVendor();
    }

    public void send_retireVendor(long vendor_id) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("retireVendor", TMessageType.CALL, seqid_));
      retireVendor_args args = new retireVendor_args();
      args.vendor_id = vendor_id;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public void recv_retireVendor() throws CatalogServiceException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      retireVendor_result result = new retireVendor_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.cex != null) {
        throw result.cex;
      }
      return;
    }

    public void retireWarehouse(long warehouse_id) throws CatalogServiceException, TException
    {
      send_retireWarehouse(warehouse_id);
      recv_retireWarehouse();
    }

    public void send_retireWarehouse(long warehouse_id) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("retireWarehouse", TMessageType.CALL, seqid_));
      retireWarehouse_args args = new retireWarehouse_args();
      args.warehouse_id = warehouse_id;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public void recv_retireWarehouse() throws CatalogServiceException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      retireWarehouse_result result = new retireWarehouse_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.cex != null) {
        throw result.cex;
      }
      return;
    }

    public void startItemOn(long item_id, long timestamp) throws CatalogServiceException, TException
    {
      send_startItemOn(item_id, timestamp);
      recv_startItemOn();
    }

    public void send_startItemOn(long item_id, long timestamp) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("startItemOn", TMessageType.CALL, seqid_));
      startItemOn_args args = new startItemOn_args();
      args.item_id = item_id;
      args.timestamp = timestamp;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public void recv_startItemOn() throws CatalogServiceException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      startItemOn_result result = new startItemOn_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.cex != null) {
        throw result.cex;
      }
      return;
    }

    public void retireItemOn(long item_id, long timestamp) throws CatalogServiceException, TException
    {
      send_retireItemOn(item_id, timestamp);
      recv_retireItemOn();
    }

    public void send_retireItemOn(long item_id, long timestamp) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("retireItemOn", TMessageType.CALL, seqid_));
      retireItemOn_args args = new retireItemOn_args();
      args.item_id = item_id;
      args.timestamp = timestamp;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public void recv_retireItemOn() throws CatalogServiceException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      retireItemOn_result result = new retireItemOn_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.cex != null) {
        throw result.cex;
      }
      return;
    }

    public void changeItemStatus(long item_id, long timestamp, status newstatus) throws CatalogServiceException, TException
    {
      send_changeItemStatus(item_id, timestamp, newstatus);
      recv_changeItemStatus();
    }

    public void send_changeItemStatus(long item_id, long timestamp, status newstatus) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("changeItemStatus", TMessageType.CALL, seqid_));
      changeItemStatus_args args = new changeItemStatus_args();
      args.item_id = item_id;
      args.timestamp = timestamp;
      args.newstatus = newstatus;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public void recv_changeItemStatus() throws CatalogServiceException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      changeItemStatus_result result = new changeItemStatus_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.cex != null) {
        throw result.cex;
      }
      return;
    }

    public Category getCategory(long id) throws CatalogServiceException, TException
    {
      send_getCategory(id);
      return recv_getCategory();
    }

    public void send_getCategory(long id) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("getCategory", TMessageType.CALL, seqid_));
      getCategory_args args = new getCategory_args();
      args.id = id;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public Category recv_getCategory() throws CatalogServiceException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      getCategory_result result = new getCategory_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.cex != null) {
        throw result.cex;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getCategory failed: unknown result");
    }

    public List<Category> getAllCategories(boolean isActive) throws CatalogServiceException, TException
    {
      send_getAllCategories(isActive);
      return recv_getAllCategories();
    }

    public void send_getAllCategories(boolean isActive) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("getAllCategories", TMessageType.CALL, seqid_));
      getAllCategories_args args = new getAllCategories_args();
      args.isActive = isActive;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public List<Category> recv_getAllCategories() throws CatalogServiceException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      getAllCategories_result result = new getAllCategories_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.cex != null) {
        throw result.cex;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getAllCategories failed: unknown result");
    }

    public Item getItem(long item_id) throws CatalogServiceException, TException
    {
      send_getItem(item_id);
      return recv_getItem();
    }

    public void send_getItem(long item_id) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("getItem", TMessageType.CALL, seqid_));
      getItem_args args = new getItem_args();
      args.item_id = item_id;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public Item recv_getItem() throws CatalogServiceException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      getItem_result result = new getItem_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.cex != null) {
        throw result.cex;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getItem failed: unknown result");
    }

    public List<Item> getAllItemsForCategory(long category_id, boolean isActive) throws CatalogServiceException, TException
    {
      send_getAllItemsForCategory(category_id, isActive);
      return recv_getAllItemsForCategory();
    }

    public void send_getAllItemsForCategory(long category_id, boolean isActive) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("getAllItemsForCategory", TMessageType.CALL, seqid_));
      getAllItemsForCategory_args args = new getAllItemsForCategory_args();
      args.category_id = category_id;
      args.isActive = isActive;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public List<Item> recv_getAllItemsForCategory() throws CatalogServiceException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      getAllItemsForCategory_result result = new getAllItemsForCategory_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.cex != null) {
        throw result.cex;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getAllItemsForCategory failed: unknown result");
    }

    public List<Item> getAllItems(boolean isActive) throws CatalogServiceException, TException
    {
      send_getAllItems(isActive);
      return recv_getAllItems();
    }

    public void send_getAllItems(boolean isActive) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("getAllItems", TMessageType.CALL, seqid_));
      getAllItems_args args = new getAllItems_args();
      args.isActive = isActive;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public List<Item> recv_getAllItems() throws CatalogServiceException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      getAllItems_result result = new getAllItems_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.cex != null) {
        throw result.cex;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getAllItems failed: unknown result");
    }

    public List<Item> getAllItemsByStatus(status itemStatus) throws CatalogServiceException, TException
    {
      send_getAllItemsByStatus(itemStatus);
      return recv_getAllItemsByStatus();
    }

    public void send_getAllItemsByStatus(status itemStatus) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("getAllItemsByStatus", TMessageType.CALL, seqid_));
      getAllItemsByStatus_args args = new getAllItemsByStatus_args();
      args.itemStatus = itemStatus;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public List<Item> recv_getAllItemsByStatus() throws CatalogServiceException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      getAllItemsByStatus_result result = new getAllItemsByStatus_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.cex != null) {
        throw result.cex;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getAllItemsByStatus failed: unknown result");
    }

    public ItemInventory getItemInventory(long item_id) throws CatalogServiceException, TException
    {
      send_getItemInventory(item_id);
      return recv_getItemInventory();
    }

    public void send_getItemInventory(long item_id) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("getItemInventory", TMessageType.CALL, seqid_));
      getItemInventory_args args = new getItemInventory_args();
      args.item_id = item_id;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public ItemInventory recv_getItemInventory() throws CatalogServiceException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      getItemInventory_result result = new getItemInventory_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.cex != null) {
        throw result.cex;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getItemInventory failed: unknown result");
    }

    public long getItemAvailibilityAtWarehouse(long warehouse_id, long item_id) throws CatalogServiceException, TException
    {
      send_getItemAvailibilityAtWarehouse(warehouse_id, item_id);
      return recv_getItemAvailibilityAtWarehouse();
    }

    public void send_getItemAvailibilityAtWarehouse(long warehouse_id, long item_id) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("getItemAvailibilityAtWarehouse", TMessageType.CALL, seqid_));
      getItemAvailibilityAtWarehouse_args args = new getItemAvailibilityAtWarehouse_args();
      args.warehouse_id = warehouse_id;
      args.item_id = item_id;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public long recv_getItemAvailibilityAtWarehouse() throws CatalogServiceException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      getItemAvailibilityAtWarehouse_result result = new getItemAvailibilityAtWarehouse_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.cex != null) {
        throw result.cex;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getItemAvailibilityAtWarehouse failed: unknown result");
    }

    public ItemInventoryHistory getItemInventoryHistory(long id, long item_id, long warehouse_id, long from_date, long to_date) throws CatalogServiceException, TException
    {
      send_getItemInventoryHistory(id, item_id, warehouse_id, from_date, to_date);
      return recv_getItemInventoryHistory();
    }

    public void send_getItemInventoryHistory(long id, long item_id, long warehouse_id, long from_date, long to_date) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("getItemInventoryHistory", TMessageType.CALL, seqid_));
      getItemInventoryHistory_args args = new getItemInventoryHistory_args();
      args.id = id;
      args.item_id = item_id;
      args.warehouse_id = warehouse_id;
      args.from_date = from_date;
      args.to_date = to_date;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public ItemInventoryHistory recv_getItemInventoryHistory() throws CatalogServiceException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      getItemInventoryHistory_result result = new getItemInventoryHistory_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.cex != null) {
        throw result.cex;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getItemInventoryHistory failed: unknown result");
    }

    public List<Warehouse> getAllWarehouses(boolean isActive) throws CatalogServiceException, TException
    {
      send_getAllWarehouses(isActive);
      return recv_getAllWarehouses();
    }

    public void send_getAllWarehouses(boolean isActive) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("getAllWarehouses", TMessageType.CALL, seqid_));
      getAllWarehouses_args args = new getAllWarehouses_args();
      args.isActive = isActive;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public List<Warehouse> recv_getAllWarehouses() throws CatalogServiceException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      getAllWarehouses_result result = new getAllWarehouses_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.cex != null) {
        throw result.cex;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getAllWarehouses failed: unknown result");
    }

    public Warehouse getWarehouse(long warehouse_id) throws CatalogServiceException, TException
    {
      send_getWarehouse(warehouse_id);
      return recv_getWarehouse();
    }

    public void send_getWarehouse(long warehouse_id) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("getWarehouse", TMessageType.CALL, seqid_));
      getWarehouse_args args = new getWarehouse_args();
      args.warehouse_id = warehouse_id;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public Warehouse recv_getWarehouse() throws CatalogServiceException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      getWarehouse_result result = new getWarehouse_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.cex != null) {
        throw result.cex;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getWarehouse failed: unknown result");
    }

    public List<Warehouse> getAllWarehousesForItem(long item_id) throws CatalogServiceException, TException
    {
      send_getAllWarehousesForItem(item_id);
      return recv_getAllWarehousesForItem();
    }

    public void send_getAllWarehousesForItem(long item_id) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("getAllWarehousesForItem", TMessageType.CALL, seqid_));
      getAllWarehousesForItem_args args = new getAllWarehousesForItem_args();
      args.item_id = item_id;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public List<Warehouse> recv_getAllWarehousesForItem() throws CatalogServiceException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      getAllWarehousesForItem_result result = new getAllWarehousesForItem_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.cex != null) {
        throw result.cex;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getAllWarehousesForItem failed: unknown result");
    }

    public List<Item> getAllItemsForWarehouse(long warehouse_id) throws CatalogServiceException, TException
    {
      send_getAllItemsForWarehouse(warehouse_id);
      return recv_getAllItemsForWarehouse();
    }

    public void send_getAllItemsForWarehouse(long warehouse_id) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("getAllItemsForWarehouse", TMessageType.CALL, seqid_));
      getAllItemsForWarehouse_args args = new getAllItemsForWarehouse_args();
      args.warehouse_id = warehouse_id;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public List<Item> recv_getAllItemsForWarehouse() throws CatalogServiceException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      getAllItemsForWarehouse_result result = new getAllItemsForWarehouse_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.cex != null) {
        throw result.cex;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getAllItemsForWarehouse failed: unknown result");
    }

    public Vendor getVendor(long vendor_id) throws CatalogServiceException, TException
    {
      send_getVendor(vendor_id);
      return recv_getVendor();
    }

    public void send_getVendor(long vendor_id) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("getVendor", TMessageType.CALL, seqid_));
      getVendor_args args = new getVendor_args();
      args.vendor_id = vendor_id;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public Vendor recv_getVendor() throws CatalogServiceException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      getVendor_result result = new getVendor_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.cex != null) {
        throw result.cex;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getVendor failed: unknown result");
    }

    public List<Vendor> getAllVendors(boolean isActive) throws CatalogServiceException, TException
    {
      send_getAllVendors(isActive);
      return recv_getAllVendors();
    }

    public void send_getAllVendors(boolean isActive) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("getAllVendors", TMessageType.CALL, seqid_));
      getAllVendors_args args = new getAllVendors_args();
      args.isActive = isActive;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public List<Vendor> recv_getAllVendors() throws CatalogServiceException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      getAllVendors_result result = new getAllVendors_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.cex != null) {
        throw result.cex;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getAllVendors failed: unknown result");
    }

  }
  public static class Processor implements TProcessor {
    private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName());
    public Processor(Iface iface)
    {
      iface_ = iface;
      processMap_.put("addCategory", new addCategory());
      processMap_.put("addItem", new addItem());
      processMap_.put("addItemToCategory", new addItemToCategory());
      processMap_.put("addWarehouse", new addWarehouse());
      processMap_.put("addVendor", new addVendor());
      processMap_.put("updateInventory", new updateInventory());
      processMap_.put("retireCategory", new retireCategory());
      processMap_.put("retireVendor", new retireVendor());
      processMap_.put("retireWarehouse", new retireWarehouse());
      processMap_.put("startItemOn", new startItemOn());
      processMap_.put("retireItemOn", new retireItemOn());
      processMap_.put("changeItemStatus", new changeItemStatus());
      processMap_.put("getCategory", new getCategory());
      processMap_.put("getAllCategories", new getAllCategories());
      processMap_.put("getItem", new getItem());
      processMap_.put("getAllItemsForCategory", new getAllItemsForCategory());
      processMap_.put("getAllItems", new getAllItems());
      processMap_.put("getAllItemsByStatus", new getAllItemsByStatus());
      processMap_.put("getItemInventory", new getItemInventory());
      processMap_.put("getItemAvailibilityAtWarehouse", new getItemAvailibilityAtWarehouse());
      processMap_.put("getItemInventoryHistory", new getItemInventoryHistory());
      processMap_.put("getAllWarehouses", new getAllWarehouses());
      processMap_.put("getWarehouse", new getWarehouse());
      processMap_.put("getAllWarehousesForItem", new getAllWarehousesForItem());
      processMap_.put("getAllItemsForWarehouse", new getAllItemsForWarehouse());
      processMap_.put("getVendor", new getVendor());
      processMap_.put("getAllVendors", new getAllVendors());
    }

    protected static interface ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException;
    }

    private Iface iface_;
    protected final HashMap<String,ProcessFunction> processMap_ = new HashMap<String,ProcessFunction>();

    public boolean process(TProtocol iprot, TProtocol oprot) throws TException
    {
      TMessage msg = iprot.readMessageBegin();
      ProcessFunction fn = processMap_.get(msg.name);
      if (fn == null) {
        TProtocolUtil.skip(iprot, TType.STRUCT);
        iprot.readMessageEnd();
        TApplicationException x = new TApplicationException(TApplicationException.UNKNOWN_METHOD, "Invalid method name: '"+msg.name+"'");
        oprot.writeMessageBegin(new TMessage(msg.name, TMessageType.EXCEPTION, msg.seqid));
        x.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
        return true;
      }
      fn.process(msg.seqid, iprot, oprot);
      return true;
    }

    private class addCategory implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        addCategory_args args = new addCategory_args();
        args.read(iprot);
        iprot.readMessageEnd();
        addCategory_result result = new addCategory_result();
        try {
          result.success = iface_.addCategory(args.category);
          result.setSuccessIsSet(true);
        } catch (CatalogServiceException cex) {
          result.cex = cex;
        } catch (Throwable th) {
          LOGGER.error("Internal error processing addCategory", th);
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing addCategory");
          oprot.writeMessageBegin(new TMessage("addCategory", TMessageType.EXCEPTION, seqid));
          x.write(oprot);
          oprot.writeMessageEnd();
          oprot.getTransport().flush();
          return;
        }
        oprot.writeMessageBegin(new TMessage("addCategory", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

    private class addItem implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        addItem_args args = new addItem_args();
        args.read(iprot);
        iprot.readMessageEnd();
        addItem_result result = new addItem_result();
        try {
          result.success = iface_.addItem(args.item);
          result.setSuccessIsSet(true);
        } catch (CatalogServiceException cex) {
          result.cex = cex;
        } catch (Throwable th) {
          LOGGER.error("Internal error processing addItem", th);
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing addItem");
          oprot.writeMessageBegin(new TMessage("addItem", TMessageType.EXCEPTION, seqid));
          x.write(oprot);
          oprot.writeMessageEnd();
          oprot.getTransport().flush();
          return;
        }
        oprot.writeMessageBegin(new TMessage("addItem", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

    private class addItemToCategory implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        addItemToCategory_args args = new addItemToCategory_args();
        args.read(iprot);
        iprot.readMessageEnd();
        addItemToCategory_result result = new addItemToCategory_result();
        try {
          result.success = iface_.addItemToCategory(args.item_id, args.category_id);
          result.setSuccessIsSet(true);
        } catch (CatalogServiceException cex) {
          result.cex = cex;
        } catch (Throwable th) {
          LOGGER.error("Internal error processing addItemToCategory", th);
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing addItemToCategory");
          oprot.writeMessageBegin(new TMessage("addItemToCategory", TMessageType.EXCEPTION, seqid));
          x.write(oprot);
          oprot.writeMessageEnd();
          oprot.getTransport().flush();
          return;
        }
        oprot.writeMessageBegin(new TMessage("addItemToCategory", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

    private class addWarehouse implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        addWarehouse_args args = new addWarehouse_args();
        args.read(iprot);
        iprot.readMessageEnd();
        addWarehouse_result result = new addWarehouse_result();
        try {
          result.success = iface_.addWarehouse(args.warehouse);
          result.setSuccessIsSet(true);
        } catch (CatalogServiceException cex) {
          result.cex = cex;
        } catch (Throwable th) {
          LOGGER.error("Internal error processing addWarehouse", th);
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing addWarehouse");
          oprot.writeMessageBegin(new TMessage("addWarehouse", TMessageType.EXCEPTION, seqid));
          x.write(oprot);
          oprot.writeMessageEnd();
          oprot.getTransport().flush();
          return;
        }
        oprot.writeMessageBegin(new TMessage("addWarehouse", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

    private class addVendor implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        addVendor_args args = new addVendor_args();
        args.read(iprot);
        iprot.readMessageEnd();
        addVendor_result result = new addVendor_result();
        try {
          result.success = iface_.addVendor(args.vendor);
          result.setSuccessIsSet(true);
        } catch (CatalogServiceException cex) {
          result.cex = cex;
        } catch (Throwable th) {
          LOGGER.error("Internal error processing addVendor", th);
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing addVendor");
          oprot.writeMessageBegin(new TMessage("addVendor", TMessageType.EXCEPTION, seqid));
          x.write(oprot);
          oprot.writeMessageEnd();
          oprot.getTransport().flush();
          return;
        }
        oprot.writeMessageBegin(new TMessage("addVendor", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

    private class updateInventory implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        updateInventory_args args = new updateInventory_args();
        args.read(iprot);
        iprot.readMessageEnd();
        updateInventory_result result = new updateInventory_result();
        try {
          iface_.updateInventory(args.item_id, args.warehouse_id, args.quantity, args.timestamp);
        } catch (CatalogServiceException cex) {
          result.cex = cex;
        } catch (Throwable th) {
          LOGGER.error("Internal error processing updateInventory", th);
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing updateInventory");
          oprot.writeMessageBegin(new TMessage("updateInventory", TMessageType.EXCEPTION, seqid));
          x.write(oprot);
          oprot.writeMessageEnd();
          oprot.getTransport().flush();
          return;
        }
        oprot.writeMessageBegin(new TMessage("updateInventory", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

    private class retireCategory implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        retireCategory_args args = new retireCategory_args();
        args.read(iprot);
        iprot.readMessageEnd();
        retireCategory_result result = new retireCategory_result();
        try {
          iface_.retireCategory(args.category_id);
        } catch (CatalogServiceException cex) {
          result.cex = cex;
        } catch (Throwable th) {
          LOGGER.error("Internal error processing retireCategory", th);
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing retireCategory");
          oprot.writeMessageBegin(new TMessage("retireCategory", TMessageType.EXCEPTION, seqid));
          x.write(oprot);
          oprot.writeMessageEnd();
          oprot.getTransport().flush();
          return;
        }
        oprot.writeMessageBegin(new TMessage("retireCategory", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

    private class retireVendor implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        retireVendor_args args = new retireVendor_args();
        args.read(iprot);
        iprot.readMessageEnd();
        retireVendor_result result = new retireVendor_result();
        try {
          iface_.retireVendor(args.vendor_id);
        } catch (CatalogServiceException cex) {
          result.cex = cex;
        } catch (Throwable th) {
          LOGGER.error("Internal error processing retireVendor", th);
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing retireVendor");
          oprot.writeMessageBegin(new TMessage("retireVendor", TMessageType.EXCEPTION, seqid));
          x.write(oprot);
          oprot.writeMessageEnd();
          oprot.getTransport().flush();
          return;
        }
        oprot.writeMessageBegin(new TMessage("retireVendor", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

    private class retireWarehouse implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        retireWarehouse_args args = new retireWarehouse_args();
        args.read(iprot);
        iprot.readMessageEnd();
        retireWarehouse_result result = new retireWarehouse_result();
        try {
          iface_.retireWarehouse(args.warehouse_id);
        } catch (CatalogServiceException cex) {
          result.cex = cex;
        } catch (Throwable th) {
          LOGGER.error("Internal error processing retireWarehouse", th);
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing retireWarehouse");
          oprot.writeMessageBegin(new TMessage("retireWarehouse", TMessageType.EXCEPTION, seqid));
          x.write(oprot);
          oprot.writeMessageEnd();
          oprot.getTransport().flush();
          return;
        }
        oprot.writeMessageBegin(new TMessage("retireWarehouse", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

    private class startItemOn implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        startItemOn_args args = new startItemOn_args();
        args.read(iprot);
        iprot.readMessageEnd();
        startItemOn_result result = new startItemOn_result();
        try {
          iface_.startItemOn(args.item_id, args.timestamp);
        } catch (CatalogServiceException cex) {
          result.cex = cex;
        } catch (Throwable th) {
          LOGGER.error("Internal error processing startItemOn", th);
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing startItemOn");
          oprot.writeMessageBegin(new TMessage("startItemOn", TMessageType.EXCEPTION, seqid));
          x.write(oprot);
          oprot.writeMessageEnd();
          oprot.getTransport().flush();
          return;
        }
        oprot.writeMessageBegin(new TMessage("startItemOn", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

    private class retireItemOn implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        retireItemOn_args args = new retireItemOn_args();
        args.read(iprot);
        iprot.readMessageEnd();
        retireItemOn_result result = new retireItemOn_result();
        try {
          iface_.retireItemOn(args.item_id, args.timestamp);
        } catch (CatalogServiceException cex) {
          result.cex = cex;
        } catch (Throwable th) {
          LOGGER.error("Internal error processing retireItemOn", th);
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing retireItemOn");
          oprot.writeMessageBegin(new TMessage("retireItemOn", TMessageType.EXCEPTION, seqid));
          x.write(oprot);
          oprot.writeMessageEnd();
          oprot.getTransport().flush();
          return;
        }
        oprot.writeMessageBegin(new TMessage("retireItemOn", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

    private class changeItemStatus implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        changeItemStatus_args args = new changeItemStatus_args();
        args.read(iprot);
        iprot.readMessageEnd();
        changeItemStatus_result result = new changeItemStatus_result();
        try {
          iface_.changeItemStatus(args.item_id, args.timestamp, args.newstatus);
        } catch (CatalogServiceException cex) {
          result.cex = cex;
        } catch (Throwable th) {
          LOGGER.error("Internal error processing changeItemStatus", th);
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing changeItemStatus");
          oprot.writeMessageBegin(new TMessage("changeItemStatus", TMessageType.EXCEPTION, seqid));
          x.write(oprot);
          oprot.writeMessageEnd();
          oprot.getTransport().flush();
          return;
        }
        oprot.writeMessageBegin(new TMessage("changeItemStatus", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

    private class getCategory implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        getCategory_args args = new getCategory_args();
        args.read(iprot);
        iprot.readMessageEnd();
        getCategory_result result = new getCategory_result();
        try {
          result.success = iface_.getCategory(args.id);
        } catch (CatalogServiceException cex) {
          result.cex = cex;
        } catch (Throwable th) {
          LOGGER.error("Internal error processing getCategory", th);
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing getCategory");
          oprot.writeMessageBegin(new TMessage("getCategory", TMessageType.EXCEPTION, seqid));
          x.write(oprot);
          oprot.writeMessageEnd();
          oprot.getTransport().flush();
          return;
        }
        oprot.writeMessageBegin(new TMessage("getCategory", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

    private class getAllCategories implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        getAllCategories_args args = new getAllCategories_args();
        args.read(iprot);
        iprot.readMessageEnd();
        getAllCategories_result result = new getAllCategories_result();
        try {
          result.success = iface_.getAllCategories(args.isActive);
        } catch (CatalogServiceException cex) {
          result.cex = cex;
        } catch (Throwable th) {
          LOGGER.error("Internal error processing getAllCategories", th);
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing getAllCategories");
          oprot.writeMessageBegin(new TMessage("getAllCategories", TMessageType.EXCEPTION, seqid));
          x.write(oprot);
          oprot.writeMessageEnd();
          oprot.getTransport().flush();
          return;
        }
        oprot.writeMessageBegin(new TMessage("getAllCategories", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

    private class getItem implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        getItem_args args = new getItem_args();
        args.read(iprot);
        iprot.readMessageEnd();
        getItem_result result = new getItem_result();
        try {
          result.success = iface_.getItem(args.item_id);
        } catch (CatalogServiceException cex) {
          result.cex = cex;
        } catch (Throwable th) {
          LOGGER.error("Internal error processing getItem", th);
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing getItem");
          oprot.writeMessageBegin(new TMessage("getItem", TMessageType.EXCEPTION, seqid));
          x.write(oprot);
          oprot.writeMessageEnd();
          oprot.getTransport().flush();
          return;
        }
        oprot.writeMessageBegin(new TMessage("getItem", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

    private class getAllItemsForCategory implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        getAllItemsForCategory_args args = new getAllItemsForCategory_args();
        args.read(iprot);
        iprot.readMessageEnd();
        getAllItemsForCategory_result result = new getAllItemsForCategory_result();
        try {
          result.success = iface_.getAllItemsForCategory(args.category_id, args.isActive);
        } catch (CatalogServiceException cex) {
          result.cex = cex;
        } catch (Throwable th) {
          LOGGER.error("Internal error processing getAllItemsForCategory", th);
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing getAllItemsForCategory");
          oprot.writeMessageBegin(new TMessage("getAllItemsForCategory", TMessageType.EXCEPTION, seqid));
          x.write(oprot);
          oprot.writeMessageEnd();
          oprot.getTransport().flush();
          return;
        }
        oprot.writeMessageBegin(new TMessage("getAllItemsForCategory", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

    private class getAllItems implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        getAllItems_args args = new getAllItems_args();
        args.read(iprot);
        iprot.readMessageEnd();
        getAllItems_result result = new getAllItems_result();
        try {
          result.success = iface_.getAllItems(args.isActive);
        } catch (CatalogServiceException cex) {
          result.cex = cex;
        } catch (Throwable th) {
          LOGGER.error("Internal error processing getAllItems", th);
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing getAllItems");
          oprot.writeMessageBegin(new TMessage("getAllItems", TMessageType.EXCEPTION, seqid));
          x.write(oprot);
          oprot.writeMessageEnd();
          oprot.getTransport().flush();
          return;
        }
        oprot.writeMessageBegin(new TMessage("getAllItems", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

    private class getAllItemsByStatus implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        getAllItemsByStatus_args args = new getAllItemsByStatus_args();
        args.read(iprot);
        iprot.readMessageEnd();
        getAllItemsByStatus_result result = new getAllItemsByStatus_result();
        try {
          result.success = iface_.getAllItemsByStatus(args.itemStatus);
        } catch (CatalogServiceException cex) {
          result.cex = cex;
        } catch (Throwable th) {
          LOGGER.error("Internal error processing getAllItemsByStatus", th);
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing getAllItemsByStatus");
          oprot.writeMessageBegin(new TMessage("getAllItemsByStatus", TMessageType.EXCEPTION, seqid));
          x.write(oprot);
          oprot.writeMessageEnd();
          oprot.getTransport().flush();
          return;
        }
        oprot.writeMessageBegin(new TMessage("getAllItemsByStatus", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

    private class getItemInventory implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        getItemInventory_args args = new getItemInventory_args();
        args.read(iprot);
        iprot.readMessageEnd();
        getItemInventory_result result = new getItemInventory_result();
        try {
          result.success = iface_.getItemInventory(args.item_id);
        } catch (CatalogServiceException cex) {
          result.cex = cex;
        } catch (Throwable th) {
          LOGGER.error("Internal error processing getItemInventory", th);
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing getItemInventory");
          oprot.writeMessageBegin(new TMessage("getItemInventory", TMessageType.EXCEPTION, seqid));
          x.write(oprot);
          oprot.writeMessageEnd();
          oprot.getTransport().flush();
          return;
        }
        oprot.writeMessageBegin(new TMessage("getItemInventory", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

    private class getItemAvailibilityAtWarehouse implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        getItemAvailibilityAtWarehouse_args args = new getItemAvailibilityAtWarehouse_args();
        args.read(iprot);
        iprot.readMessageEnd();
        getItemAvailibilityAtWarehouse_result result = new getItemAvailibilityAtWarehouse_result();
        try {
          result.success = iface_.getItemAvailibilityAtWarehouse(args.warehouse_id, args.item_id);
          result.setSuccessIsSet(true);
        } catch (CatalogServiceException cex) {
          result.cex = cex;
        } catch (Throwable th) {
          LOGGER.error("Internal error processing getItemAvailibilityAtWarehouse", th);
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing getItemAvailibilityAtWarehouse");
          oprot.writeMessageBegin(new TMessage("getItemAvailibilityAtWarehouse", TMessageType.EXCEPTION, seqid));
          x.write(oprot);
          oprot.writeMessageEnd();
          oprot.getTransport().flush();
          return;
        }
        oprot.writeMessageBegin(new TMessage("getItemAvailibilityAtWarehouse", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

    private class getItemInventoryHistory implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        getItemInventoryHistory_args args = new getItemInventoryHistory_args();
        args.read(iprot);
        iprot.readMessageEnd();
        getItemInventoryHistory_result result = new getItemInventoryHistory_result();
        try {
          result.success = iface_.getItemInventoryHistory(args.id, args.item_id, args.warehouse_id, args.from_date, args.to_date);
        } catch (CatalogServiceException cex) {
          result.cex = cex;
        } catch (Throwable th) {
          LOGGER.error("Internal error processing getItemInventoryHistory", th);
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing getItemInventoryHistory");
          oprot.writeMessageBegin(new TMessage("getItemInventoryHistory", TMessageType.EXCEPTION, seqid));
          x.write(oprot);
          oprot.writeMessageEnd();
          oprot.getTransport().flush();
          return;
        }
        oprot.writeMessageBegin(new TMessage("getItemInventoryHistory", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

    private class getAllWarehouses implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        getAllWarehouses_args args = new getAllWarehouses_args();
        args.read(iprot);
        iprot.readMessageEnd();
        getAllWarehouses_result result = new getAllWarehouses_result();
        try {
          result.success = iface_.getAllWarehouses(args.isActive);
        } catch (CatalogServiceException cex) {
          result.cex = cex;
        } catch (Throwable th) {
          LOGGER.error("Internal error processing getAllWarehouses", th);
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing getAllWarehouses");
          oprot.writeMessageBegin(new TMessage("getAllWarehouses", TMessageType.EXCEPTION, seqid));
          x.write(oprot);
          oprot.writeMessageEnd();
          oprot.getTransport().flush();
          return;
        }
        oprot.writeMessageBegin(new TMessage("getAllWarehouses", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

    private class getWarehouse implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        getWarehouse_args args = new getWarehouse_args();
        args.read(iprot);
        iprot.readMessageEnd();
        getWarehouse_result result = new getWarehouse_result();
        try {
          result.success = iface_.getWarehouse(args.warehouse_id);
        } catch (CatalogServiceException cex) {
          result.cex = cex;
        } catch (Throwable th) {
          LOGGER.error("Internal error processing getWarehouse", th);
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing getWarehouse");
          oprot.writeMessageBegin(new TMessage("getWarehouse", TMessageType.EXCEPTION, seqid));
          x.write(oprot);
          oprot.writeMessageEnd();
          oprot.getTransport().flush();
          return;
        }
        oprot.writeMessageBegin(new TMessage("getWarehouse", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

    private class getAllWarehousesForItem implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        getAllWarehousesForItem_args args = new getAllWarehousesForItem_args();
        args.read(iprot);
        iprot.readMessageEnd();
        getAllWarehousesForItem_result result = new getAllWarehousesForItem_result();
        try {
          result.success = iface_.getAllWarehousesForItem(args.item_id);
        } catch (CatalogServiceException cex) {
          result.cex = cex;
        } catch (Throwable th) {
          LOGGER.error("Internal error processing getAllWarehousesForItem", th);
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing getAllWarehousesForItem");
          oprot.writeMessageBegin(new TMessage("getAllWarehousesForItem", TMessageType.EXCEPTION, seqid));
          x.write(oprot);
          oprot.writeMessageEnd();
          oprot.getTransport().flush();
          return;
        }
        oprot.writeMessageBegin(new TMessage("getAllWarehousesForItem", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

    private class getAllItemsForWarehouse implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        getAllItemsForWarehouse_args args = new getAllItemsForWarehouse_args();
        args.read(iprot);
        iprot.readMessageEnd();
        getAllItemsForWarehouse_result result = new getAllItemsForWarehouse_result();
        try {
          result.success = iface_.getAllItemsForWarehouse(args.warehouse_id);
        } catch (CatalogServiceException cex) {
          result.cex = cex;
        } catch (Throwable th) {
          LOGGER.error("Internal error processing getAllItemsForWarehouse", th);
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing getAllItemsForWarehouse");
          oprot.writeMessageBegin(new TMessage("getAllItemsForWarehouse", TMessageType.EXCEPTION, seqid));
          x.write(oprot);
          oprot.writeMessageEnd();
          oprot.getTransport().flush();
          return;
        }
        oprot.writeMessageBegin(new TMessage("getAllItemsForWarehouse", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

    private class getVendor implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        getVendor_args args = new getVendor_args();
        args.read(iprot);
        iprot.readMessageEnd();
        getVendor_result result = new getVendor_result();
        try {
          result.success = iface_.getVendor(args.vendor_id);
        } catch (CatalogServiceException cex) {
          result.cex = cex;
        } catch (Throwable th) {
          LOGGER.error("Internal error processing getVendor", th);
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing getVendor");
          oprot.writeMessageBegin(new TMessage("getVendor", TMessageType.EXCEPTION, seqid));
          x.write(oprot);
          oprot.writeMessageEnd();
          oprot.getTransport().flush();
          return;
        }
        oprot.writeMessageBegin(new TMessage("getVendor", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

    private class getAllVendors implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        getAllVendors_args args = new getAllVendors_args();
        args.read(iprot);
        iprot.readMessageEnd();
        getAllVendors_result result = new getAllVendors_result();
        try {
          result.success = iface_.getAllVendors(args.isActive);
        } catch (CatalogServiceException cex) {
          result.cex = cex;
        } catch (Throwable th) {
          LOGGER.error("Internal error processing getAllVendors", th);
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing getAllVendors");
          oprot.writeMessageBegin(new TMessage("getAllVendors", TMessageType.EXCEPTION, seqid));
          x.write(oprot);
          oprot.writeMessageEnd();
          oprot.getTransport().flush();
          return;
        }
        oprot.writeMessageBegin(new TMessage("getAllVendors", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

  }

  public static class addCategory_args implements TBase<addCategory_args._Fields>, java.io.Serializable, Cloneable, Comparable<addCategory_args>   {
    private static final TStruct STRUCT_DESC = new TStruct("addCategory_args");

    private static final TField CATEGORY_FIELD_DESC = new TField("category", TType.STRUCT, (short)1);

    private Category category;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      CATEGORY((short)1, "category");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.CATEGORY, new FieldMetaData("category", TFieldRequirementType.DEFAULT, 
          new StructMetaData(TType.STRUCT, Category.class)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(addCategory_args.class, metaDataMap);
    }

    public addCategory_args() {
    }

    public addCategory_args(
      Category category)
    {
      this();
      this.category = category;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public addCategory_args(addCategory_args other) {
      if (other.isSetCategory()) {
        this.category = new Category(other.category);
      }
    }

    public addCategory_args deepCopy() {
      return new addCategory_args(this);
    }

    @Deprecated
    public addCategory_args clone() {
      return new addCategory_args(this);
    }

    public Category getCategory() {
      return this.category;
    }

    public addCategory_args setCategory(Category category) {
      this.category = category;
      return this;
    }

    public void unsetCategory() {
      this.category = null;
    }

    /** Returns true if field category is set (has been asigned a value) and false otherwise */
    public boolean isSetCategory() {
      return this.category != null;
    }

    public void setCategoryIsSet(boolean value) {
      if (!value) {
        this.category = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case CATEGORY:
        if (value == null) {
          unsetCategory();
        } else {
          setCategory((Category)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case CATEGORY:
        return getCategory();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case CATEGORY:
        return isSetCategory();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof addCategory_args)
        return this.equals((addCategory_args)that);
      return false;
    }

    public boolean equals(addCategory_args that) {
      if (that == null)
        return false;

      boolean this_present_category = true && this.isSetCategory();
      boolean that_present_category = true && that.isSetCategory();
      if (this_present_category || that_present_category) {
        if (!(this_present_category && that_present_category))
          return false;
        if (!this.category.equals(that.category))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(addCategory_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      addCategory_args typedOther = (addCategory_args)other;

      lastComparison = Boolean.valueOf(isSetCategory()).compareTo(isSetCategory());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(category, typedOther.category);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case CATEGORY:
              if (field.type == TType.STRUCT) {
                this.category = new Category();
                this.category.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (this.category != null) {
        oprot.writeFieldBegin(CATEGORY_FIELD_DESC);
        this.category.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("addCategory_args(");
      boolean first = true;

      sb.append("category:");
      if (this.category == null) {
        sb.append("null");
      } else {
        sb.append(this.category);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class addCategory_result implements TBase<addCategory_result._Fields>, java.io.Serializable, Cloneable, Comparable<addCategory_result>   {
    private static final TStruct STRUCT_DESC = new TStruct("addCategory_result");

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.I64, (short)0);
    private static final TField CEX_FIELD_DESC = new TField("cex", TType.STRUCT, (short)1);

    private long success;
    private CatalogServiceException cex;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      SUCCESS((short)0, "success"),
      CEX((short)1, "cex");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __SUCCESS_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
      put(_Fields.CEX, new FieldMetaData("cex", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(addCategory_result.class, metaDataMap);
    }

    public addCategory_result() {
    }

    public addCategory_result(
      long success,
      CatalogServiceException cex)
    {
      this();
      this.success = success;
      setSuccessIsSet(true);
      this.cex = cex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public addCategory_result(addCategory_result other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.success = other.success;
      if (other.isSetCex()) {
        this.cex = new CatalogServiceException(other.cex);
      }
    }

    public addCategory_result deepCopy() {
      return new addCategory_result(this);
    }

    @Deprecated
    public addCategory_result clone() {
      return new addCategory_result(this);
    }

    public long getSuccess() {
      return this.success;
    }

    public addCategory_result setSuccess(long success) {
      this.success = success;
      setSuccessIsSet(true);
      return this;
    }

    public void unsetSuccess() {
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
    }

    /** Returns true if field success is set (has been asigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
    }

    public void setSuccessIsSet(boolean value) {
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
    }

    public CatalogServiceException getCex() {
      return this.cex;
    }

    public addCategory_result setCex(CatalogServiceException cex) {
      this.cex = cex;
      return this;
    }

    public void unsetCex() {
      this.cex = null;
    }

    /** Returns true if field cex is set (has been asigned a value) and false otherwise */
    public boolean isSetCex() {
      return this.cex != null;
    }

    public void setCexIsSet(boolean value) {
      if (!value) {
        this.cex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((Long)value);
        }
        break;

      case CEX:
        if (value == null) {
          unsetCex();
        } else {
          setCex((CatalogServiceException)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return new Long(getSuccess());

      case CEX:
        return getCex();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case CEX:
        return isSetCex();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof addCategory_result)
        return this.equals((addCategory_result)that);
      return false;
    }

    public boolean equals(addCategory_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true;
      boolean that_present_success = true;
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (this.success != that.success)
          return false;
      }

      boolean this_present_cex = true && this.isSetCex();
      boolean that_present_cex = true && that.isSetCex();
      if (this_present_cex || that_present_cex) {
        if (!(this_present_cex && that_present_cex))
          return false;
        if (!this.cex.equals(that.cex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(addCategory_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      addCategory_result typedOther = (addCategory_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetCex()).compareTo(isSetCex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(cex, typedOther.cex);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case SUCCESS:
              if (field.type == TType.I64) {
                this.success = iprot.readI64();
                setSuccessIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case CEX:
              if (field.type == TType.STRUCT) {
                this.cex = new CatalogServiceException();
                this.cex.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        oprot.writeI64(this.success);
        oprot.writeFieldEnd();
      } else if (this.isSetCex()) {
        oprot.writeFieldBegin(CEX_FIELD_DESC);
        this.cex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("addCategory_result(");
      boolean first = true;

      sb.append("success:");
      sb.append(this.success);
      first = false;
      if (!first) sb.append(", ");
      sb.append("cex:");
      if (this.cex == null) {
        sb.append("null");
      } else {
        sb.append(this.cex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class addItem_args implements TBase<addItem_args._Fields>, java.io.Serializable, Cloneable   {
    private static final TStruct STRUCT_DESC = new TStruct("addItem_args");

    private static final TField ITEM_FIELD_DESC = new TField("item", TType.STRUCT, (short)1);

    private Item item;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      ITEM((short)1, "item");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.ITEM, new FieldMetaData("item", TFieldRequirementType.DEFAULT, 
          new StructMetaData(TType.STRUCT, Item.class)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(addItem_args.class, metaDataMap);
    }

    public addItem_args() {
    }

    public addItem_args(
      Item item)
    {
      this();
      this.item = item;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public addItem_args(addItem_args other) {
      if (other.isSetItem()) {
        this.item = new Item(other.item);
      }
    }

    public addItem_args deepCopy() {
      return new addItem_args(this);
    }

    @Deprecated
    public addItem_args clone() {
      return new addItem_args(this);
    }

    public Item getItem() {
      return this.item;
    }

    public addItem_args setItem(Item item) {
      this.item = item;
      return this;
    }

    public void unsetItem() {
      this.item = null;
    }

    /** Returns true if field item is set (has been asigned a value) and false otherwise */
    public boolean isSetItem() {
      return this.item != null;
    }

    public void setItemIsSet(boolean value) {
      if (!value) {
        this.item = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case ITEM:
        if (value == null) {
          unsetItem();
        } else {
          setItem((Item)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case ITEM:
        return getItem();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case ITEM:
        return isSetItem();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof addItem_args)
        return this.equals((addItem_args)that);
      return false;
    }

    public boolean equals(addItem_args that) {
      if (that == null)
        return false;

      boolean this_present_item = true && this.isSetItem();
      boolean that_present_item = true && that.isSetItem();
      if (this_present_item || that_present_item) {
        if (!(this_present_item && that_present_item))
          return false;
        if (!this.item.equals(that.item))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case ITEM:
              if (field.type == TType.STRUCT) {
                this.item = new Item();
                this.item.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (this.item != null) {
        oprot.writeFieldBegin(ITEM_FIELD_DESC);
        this.item.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("addItem_args(");
      boolean first = true;

      sb.append("item:");
      if (this.item == null) {
        sb.append("null");
      } else {
        sb.append(this.item);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class addItem_result implements TBase<addItem_result._Fields>, java.io.Serializable, Cloneable, Comparable<addItem_result>   {
    private static final TStruct STRUCT_DESC = new TStruct("addItem_result");

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.I64, (short)0);
    private static final TField CEX_FIELD_DESC = new TField("cex", TType.STRUCT, (short)1);

    private long success;
    private CatalogServiceException cex;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      SUCCESS((short)0, "success"),
      CEX((short)1, "cex");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __SUCCESS_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
      put(_Fields.CEX, new FieldMetaData("cex", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(addItem_result.class, metaDataMap);
    }

    public addItem_result() {
    }

    public addItem_result(
      long success,
      CatalogServiceException cex)
    {
      this();
      this.success = success;
      setSuccessIsSet(true);
      this.cex = cex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public addItem_result(addItem_result other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.success = other.success;
      if (other.isSetCex()) {
        this.cex = new CatalogServiceException(other.cex);
      }
    }

    public addItem_result deepCopy() {
      return new addItem_result(this);
    }

    @Deprecated
    public addItem_result clone() {
      return new addItem_result(this);
    }

    public long getSuccess() {
      return this.success;
    }

    public addItem_result setSuccess(long success) {
      this.success = success;
      setSuccessIsSet(true);
      return this;
    }

    public void unsetSuccess() {
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
    }

    /** Returns true if field success is set (has been asigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
    }

    public void setSuccessIsSet(boolean value) {
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
    }

    public CatalogServiceException getCex() {
      return this.cex;
    }

    public addItem_result setCex(CatalogServiceException cex) {
      this.cex = cex;
      return this;
    }

    public void unsetCex() {
      this.cex = null;
    }

    /** Returns true if field cex is set (has been asigned a value) and false otherwise */
    public boolean isSetCex() {
      return this.cex != null;
    }

    public void setCexIsSet(boolean value) {
      if (!value) {
        this.cex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((Long)value);
        }
        break;

      case CEX:
        if (value == null) {
          unsetCex();
        } else {
          setCex((CatalogServiceException)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return new Long(getSuccess());

      case CEX:
        return getCex();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case CEX:
        return isSetCex();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof addItem_result)
        return this.equals((addItem_result)that);
      return false;
    }

    public boolean equals(addItem_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true;
      boolean that_present_success = true;
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (this.success != that.success)
          return false;
      }

      boolean this_present_cex = true && this.isSetCex();
      boolean that_present_cex = true && that.isSetCex();
      if (this_present_cex || that_present_cex) {
        if (!(this_present_cex && that_present_cex))
          return false;
        if (!this.cex.equals(that.cex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(addItem_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      addItem_result typedOther = (addItem_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetCex()).compareTo(isSetCex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(cex, typedOther.cex);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case SUCCESS:
              if (field.type == TType.I64) {
                this.success = iprot.readI64();
                setSuccessIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case CEX:
              if (field.type == TType.STRUCT) {
                this.cex = new CatalogServiceException();
                this.cex.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        oprot.writeI64(this.success);
        oprot.writeFieldEnd();
      } else if (this.isSetCex()) {
        oprot.writeFieldBegin(CEX_FIELD_DESC);
        this.cex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("addItem_result(");
      boolean first = true;

      sb.append("success:");
      sb.append(this.success);
      first = false;
      if (!first) sb.append(", ");
      sb.append("cex:");
      if (this.cex == null) {
        sb.append("null");
      } else {
        sb.append(this.cex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class addItemToCategory_args implements TBase<addItemToCategory_args._Fields>, java.io.Serializable, Cloneable, Comparable<addItemToCategory_args>   {
    private static final TStruct STRUCT_DESC = new TStruct("addItemToCategory_args");

    private static final TField ITEM_ID_FIELD_DESC = new TField("item_id", TType.I64, (short)1);
    private static final TField CATEGORY_ID_FIELD_DESC = new TField("category_id", TType.I64, (short)2);

    private long item_id;
    private long category_id;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      ITEM_ID((short)1, "item_id"),
      CATEGORY_ID((short)2, "category_id");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __ITEM_ID_ISSET_ID = 0;
    private static final int __CATEGORY_ID_ISSET_ID = 1;
    private BitSet __isset_bit_vector = new BitSet(2);

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.ITEM_ID, new FieldMetaData("item_id", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
      put(_Fields.CATEGORY_ID, new FieldMetaData("category_id", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(addItemToCategory_args.class, metaDataMap);
    }

    public addItemToCategory_args() {
    }

    public addItemToCategory_args(
      long item_id,
      long category_id)
    {
      this();
      this.item_id = item_id;
      setItem_idIsSet(true);
      this.category_id = category_id;
      setCategory_idIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public addItemToCategory_args(addItemToCategory_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.item_id = other.item_id;
      this.category_id = other.category_id;
    }

    public addItemToCategory_args deepCopy() {
      return new addItemToCategory_args(this);
    }

    @Deprecated
    public addItemToCategory_args clone() {
      return new addItemToCategory_args(this);
    }

    public long getItem_id() {
      return this.item_id;
    }

    public addItemToCategory_args setItem_id(long item_id) {
      this.item_id = item_id;
      setItem_idIsSet(true);
      return this;
    }

    public void unsetItem_id() {
      __isset_bit_vector.clear(__ITEM_ID_ISSET_ID);
    }

    /** Returns true if field item_id is set (has been asigned a value) and false otherwise */
    public boolean isSetItem_id() {
      return __isset_bit_vector.get(__ITEM_ID_ISSET_ID);
    }

    public void setItem_idIsSet(boolean value) {
      __isset_bit_vector.set(__ITEM_ID_ISSET_ID, value);
    }

    public long getCategory_id() {
      return this.category_id;
    }

    public addItemToCategory_args setCategory_id(long category_id) {
      this.category_id = category_id;
      setCategory_idIsSet(true);
      return this;
    }

    public void unsetCategory_id() {
      __isset_bit_vector.clear(__CATEGORY_ID_ISSET_ID);
    }

    /** Returns true if field category_id is set (has been asigned a value) and false otherwise */
    public boolean isSetCategory_id() {
      return __isset_bit_vector.get(__CATEGORY_ID_ISSET_ID);
    }

    public void setCategory_idIsSet(boolean value) {
      __isset_bit_vector.set(__CATEGORY_ID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case ITEM_ID:
        if (value == null) {
          unsetItem_id();
        } else {
          setItem_id((Long)value);
        }
        break;

      case CATEGORY_ID:
        if (value == null) {
          unsetCategory_id();
        } else {
          setCategory_id((Long)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case ITEM_ID:
        return new Long(getItem_id());

      case CATEGORY_ID:
        return new Long(getCategory_id());

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case ITEM_ID:
        return isSetItem_id();
      case CATEGORY_ID:
        return isSetCategory_id();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof addItemToCategory_args)
        return this.equals((addItemToCategory_args)that);
      return false;
    }

    public boolean equals(addItemToCategory_args that) {
      if (that == null)
        return false;

      boolean this_present_item_id = true;
      boolean that_present_item_id = true;
      if (this_present_item_id || that_present_item_id) {
        if (!(this_present_item_id && that_present_item_id))
          return false;
        if (this.item_id != that.item_id)
          return false;
      }

      boolean this_present_category_id = true;
      boolean that_present_category_id = true;
      if (this_present_category_id || that_present_category_id) {
        if (!(this_present_category_id && that_present_category_id))
          return false;
        if (this.category_id != that.category_id)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(addItemToCategory_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      addItemToCategory_args typedOther = (addItemToCategory_args)other;

      lastComparison = Boolean.valueOf(isSetItem_id()).compareTo(isSetItem_id());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(item_id, typedOther.item_id);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetCategory_id()).compareTo(isSetCategory_id());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(category_id, typedOther.category_id);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case ITEM_ID:
              if (field.type == TType.I64) {
                this.item_id = iprot.readI64();
                setItem_idIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case CATEGORY_ID:
              if (field.type == TType.I64) {
                this.category_id = iprot.readI64();
                setCategory_idIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(ITEM_ID_FIELD_DESC);
      oprot.writeI64(this.item_id);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(CATEGORY_ID_FIELD_DESC);
      oprot.writeI64(this.category_id);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("addItemToCategory_args(");
      boolean first = true;

      sb.append("item_id:");
      sb.append(this.item_id);
      first = false;
      if (!first) sb.append(", ");
      sb.append("category_id:");
      sb.append(this.category_id);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class addItemToCategory_result implements TBase<addItemToCategory_result._Fields>, java.io.Serializable, Cloneable, Comparable<addItemToCategory_result>   {
    private static final TStruct STRUCT_DESC = new TStruct("addItemToCategory_result");

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.I64, (short)0);
    private static final TField CEX_FIELD_DESC = new TField("cex", TType.STRUCT, (short)1);

    private long success;
    private CatalogServiceException cex;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      SUCCESS((short)0, "success"),
      CEX((short)1, "cex");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __SUCCESS_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
      put(_Fields.CEX, new FieldMetaData("cex", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(addItemToCategory_result.class, metaDataMap);
    }

    public addItemToCategory_result() {
    }

    public addItemToCategory_result(
      long success,
      CatalogServiceException cex)
    {
      this();
      this.success = success;
      setSuccessIsSet(true);
      this.cex = cex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public addItemToCategory_result(addItemToCategory_result other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.success = other.success;
      if (other.isSetCex()) {
        this.cex = new CatalogServiceException(other.cex);
      }
    }

    public addItemToCategory_result deepCopy() {
      return new addItemToCategory_result(this);
    }

    @Deprecated
    public addItemToCategory_result clone() {
      return new addItemToCategory_result(this);
    }

    public long getSuccess() {
      return this.success;
    }

    public addItemToCategory_result setSuccess(long success) {
      this.success = success;
      setSuccessIsSet(true);
      return this;
    }

    public void unsetSuccess() {
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
    }

    /** Returns true if field success is set (has been asigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
    }

    public void setSuccessIsSet(boolean value) {
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
    }

    public CatalogServiceException getCex() {
      return this.cex;
    }

    public addItemToCategory_result setCex(CatalogServiceException cex) {
      this.cex = cex;
      return this;
    }

    public void unsetCex() {
      this.cex = null;
    }

    /** Returns true if field cex is set (has been asigned a value) and false otherwise */
    public boolean isSetCex() {
      return this.cex != null;
    }

    public void setCexIsSet(boolean value) {
      if (!value) {
        this.cex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((Long)value);
        }
        break;

      case CEX:
        if (value == null) {
          unsetCex();
        } else {
          setCex((CatalogServiceException)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return new Long(getSuccess());

      case CEX:
        return getCex();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case CEX:
        return isSetCex();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof addItemToCategory_result)
        return this.equals((addItemToCategory_result)that);
      return false;
    }

    public boolean equals(addItemToCategory_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true;
      boolean that_present_success = true;
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (this.success != that.success)
          return false;
      }

      boolean this_present_cex = true && this.isSetCex();
      boolean that_present_cex = true && that.isSetCex();
      if (this_present_cex || that_present_cex) {
        if (!(this_present_cex && that_present_cex))
          return false;
        if (!this.cex.equals(that.cex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(addItemToCategory_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      addItemToCategory_result typedOther = (addItemToCategory_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetCex()).compareTo(isSetCex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(cex, typedOther.cex);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case SUCCESS:
              if (field.type == TType.I64) {
                this.success = iprot.readI64();
                setSuccessIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case CEX:
              if (field.type == TType.STRUCT) {
                this.cex = new CatalogServiceException();
                this.cex.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        oprot.writeI64(this.success);
        oprot.writeFieldEnd();
      } else if (this.isSetCex()) {
        oprot.writeFieldBegin(CEX_FIELD_DESC);
        this.cex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("addItemToCategory_result(");
      boolean first = true;

      sb.append("success:");
      sb.append(this.success);
      first = false;
      if (!first) sb.append(", ");
      sb.append("cex:");
      if (this.cex == null) {
        sb.append("null");
      } else {
        sb.append(this.cex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class addWarehouse_args implements TBase<addWarehouse_args._Fields>, java.io.Serializable, Cloneable, Comparable<addWarehouse_args>   {
    private static final TStruct STRUCT_DESC = new TStruct("addWarehouse_args");

    private static final TField WAREHOUSE_FIELD_DESC = new TField("warehouse", TType.STRUCT, (short)1);

    private Warehouse warehouse;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      WAREHOUSE((short)1, "warehouse");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.WAREHOUSE, new FieldMetaData("warehouse", TFieldRequirementType.DEFAULT, 
          new StructMetaData(TType.STRUCT, Warehouse.class)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(addWarehouse_args.class, metaDataMap);
    }

    public addWarehouse_args() {
    }

    public addWarehouse_args(
      Warehouse warehouse)
    {
      this();
      this.warehouse = warehouse;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public addWarehouse_args(addWarehouse_args other) {
      if (other.isSetWarehouse()) {
        this.warehouse = new Warehouse(other.warehouse);
      }
    }

    public addWarehouse_args deepCopy() {
      return new addWarehouse_args(this);
    }

    @Deprecated
    public addWarehouse_args clone() {
      return new addWarehouse_args(this);
    }

    public Warehouse getWarehouse() {
      return this.warehouse;
    }

    public addWarehouse_args setWarehouse(Warehouse warehouse) {
      this.warehouse = warehouse;
      return this;
    }

    public void unsetWarehouse() {
      this.warehouse = null;
    }

    /** Returns true if field warehouse is set (has been asigned a value) and false otherwise */
    public boolean isSetWarehouse() {
      return this.warehouse != null;
    }

    public void setWarehouseIsSet(boolean value) {
      if (!value) {
        this.warehouse = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case WAREHOUSE:
        if (value == null) {
          unsetWarehouse();
        } else {
          setWarehouse((Warehouse)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case WAREHOUSE:
        return getWarehouse();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case WAREHOUSE:
        return isSetWarehouse();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof addWarehouse_args)
        return this.equals((addWarehouse_args)that);
      return false;
    }

    public boolean equals(addWarehouse_args that) {
      if (that == null)
        return false;

      boolean this_present_warehouse = true && this.isSetWarehouse();
      boolean that_present_warehouse = true && that.isSetWarehouse();
      if (this_present_warehouse || that_present_warehouse) {
        if (!(this_present_warehouse && that_present_warehouse))
          return false;
        if (!this.warehouse.equals(that.warehouse))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(addWarehouse_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      addWarehouse_args typedOther = (addWarehouse_args)other;

      lastComparison = Boolean.valueOf(isSetWarehouse()).compareTo(isSetWarehouse());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(warehouse, typedOther.warehouse);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case WAREHOUSE:
              if (field.type == TType.STRUCT) {
                this.warehouse = new Warehouse();
                this.warehouse.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (this.warehouse != null) {
        oprot.writeFieldBegin(WAREHOUSE_FIELD_DESC);
        this.warehouse.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("addWarehouse_args(");
      boolean first = true;

      sb.append("warehouse:");
      if (this.warehouse == null) {
        sb.append("null");
      } else {
        sb.append(this.warehouse);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class addWarehouse_result implements TBase<addWarehouse_result._Fields>, java.io.Serializable, Cloneable, Comparable<addWarehouse_result>   {
    private static final TStruct STRUCT_DESC = new TStruct("addWarehouse_result");

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.I64, (short)0);
    private static final TField CEX_FIELD_DESC = new TField("cex", TType.STRUCT, (short)1);

    private long success;
    private CatalogServiceException cex;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      SUCCESS((short)0, "success"),
      CEX((short)1, "cex");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __SUCCESS_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
      put(_Fields.CEX, new FieldMetaData("cex", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(addWarehouse_result.class, metaDataMap);
    }

    public addWarehouse_result() {
    }

    public addWarehouse_result(
      long success,
      CatalogServiceException cex)
    {
      this();
      this.success = success;
      setSuccessIsSet(true);
      this.cex = cex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public addWarehouse_result(addWarehouse_result other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.success = other.success;
      if (other.isSetCex()) {
        this.cex = new CatalogServiceException(other.cex);
      }
    }

    public addWarehouse_result deepCopy() {
      return new addWarehouse_result(this);
    }

    @Deprecated
    public addWarehouse_result clone() {
      return new addWarehouse_result(this);
    }

    public long getSuccess() {
      return this.success;
    }

    public addWarehouse_result setSuccess(long success) {
      this.success = success;
      setSuccessIsSet(true);
      return this;
    }

    public void unsetSuccess() {
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
    }

    /** Returns true if field success is set (has been asigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
    }

    public void setSuccessIsSet(boolean value) {
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
    }

    public CatalogServiceException getCex() {
      return this.cex;
    }

    public addWarehouse_result setCex(CatalogServiceException cex) {
      this.cex = cex;
      return this;
    }

    public void unsetCex() {
      this.cex = null;
    }

    /** Returns true if field cex is set (has been asigned a value) and false otherwise */
    public boolean isSetCex() {
      return this.cex != null;
    }

    public void setCexIsSet(boolean value) {
      if (!value) {
        this.cex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((Long)value);
        }
        break;

      case CEX:
        if (value == null) {
          unsetCex();
        } else {
          setCex((CatalogServiceException)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return new Long(getSuccess());

      case CEX:
        return getCex();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case CEX:
        return isSetCex();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof addWarehouse_result)
        return this.equals((addWarehouse_result)that);
      return false;
    }

    public boolean equals(addWarehouse_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true;
      boolean that_present_success = true;
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (this.success != that.success)
          return false;
      }

      boolean this_present_cex = true && this.isSetCex();
      boolean that_present_cex = true && that.isSetCex();
      if (this_present_cex || that_present_cex) {
        if (!(this_present_cex && that_present_cex))
          return false;
        if (!this.cex.equals(that.cex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(addWarehouse_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      addWarehouse_result typedOther = (addWarehouse_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetCex()).compareTo(isSetCex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(cex, typedOther.cex);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case SUCCESS:
              if (field.type == TType.I64) {
                this.success = iprot.readI64();
                setSuccessIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case CEX:
              if (field.type == TType.STRUCT) {
                this.cex = new CatalogServiceException();
                this.cex.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        oprot.writeI64(this.success);
        oprot.writeFieldEnd();
      } else if (this.isSetCex()) {
        oprot.writeFieldBegin(CEX_FIELD_DESC);
        this.cex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("addWarehouse_result(");
      boolean first = true;

      sb.append("success:");
      sb.append(this.success);
      first = false;
      if (!first) sb.append(", ");
      sb.append("cex:");
      if (this.cex == null) {
        sb.append("null");
      } else {
        sb.append(this.cex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class addVendor_args implements TBase<addVendor_args._Fields>, java.io.Serializable, Cloneable, Comparable<addVendor_args>   {
    private static final TStruct STRUCT_DESC = new TStruct("addVendor_args");

    private static final TField VENDOR_FIELD_DESC = new TField("vendor", TType.STRUCT, (short)1);

    private Vendor vendor;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      VENDOR((short)1, "vendor");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.VENDOR, new FieldMetaData("vendor", TFieldRequirementType.DEFAULT, 
          new StructMetaData(TType.STRUCT, Vendor.class)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(addVendor_args.class, metaDataMap);
    }

    public addVendor_args() {
    }

    public addVendor_args(
      Vendor vendor)
    {
      this();
      this.vendor = vendor;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public addVendor_args(addVendor_args other) {
      if (other.isSetVendor()) {
        this.vendor = new Vendor(other.vendor);
      }
    }

    public addVendor_args deepCopy() {
      return new addVendor_args(this);
    }

    @Deprecated
    public addVendor_args clone() {
      return new addVendor_args(this);
    }

    public Vendor getVendor() {
      return this.vendor;
    }

    public addVendor_args setVendor(Vendor vendor) {
      this.vendor = vendor;
      return this;
    }

    public void unsetVendor() {
      this.vendor = null;
    }

    /** Returns true if field vendor is set (has been asigned a value) and false otherwise */
    public boolean isSetVendor() {
      return this.vendor != null;
    }

    public void setVendorIsSet(boolean value) {
      if (!value) {
        this.vendor = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case VENDOR:
        if (value == null) {
          unsetVendor();
        } else {
          setVendor((Vendor)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case VENDOR:
        return getVendor();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case VENDOR:
        return isSetVendor();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof addVendor_args)
        return this.equals((addVendor_args)that);
      return false;
    }

    public boolean equals(addVendor_args that) {
      if (that == null)
        return false;

      boolean this_present_vendor = true && this.isSetVendor();
      boolean that_present_vendor = true && that.isSetVendor();
      if (this_present_vendor || that_present_vendor) {
        if (!(this_present_vendor && that_present_vendor))
          return false;
        if (!this.vendor.equals(that.vendor))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(addVendor_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      addVendor_args typedOther = (addVendor_args)other;

      lastComparison = Boolean.valueOf(isSetVendor()).compareTo(isSetVendor());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(vendor, typedOther.vendor);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case VENDOR:
              if (field.type == TType.STRUCT) {
                this.vendor = new Vendor();
                this.vendor.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (this.vendor != null) {
        oprot.writeFieldBegin(VENDOR_FIELD_DESC);
        this.vendor.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("addVendor_args(");
      boolean first = true;

      sb.append("vendor:");
      if (this.vendor == null) {
        sb.append("null");
      } else {
        sb.append(this.vendor);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class addVendor_result implements TBase<addVendor_result._Fields>, java.io.Serializable, Cloneable, Comparable<addVendor_result>   {
    private static final TStruct STRUCT_DESC = new TStruct("addVendor_result");

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.I64, (short)0);
    private static final TField CEX_FIELD_DESC = new TField("cex", TType.STRUCT, (short)1);

    private long success;
    private CatalogServiceException cex;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      SUCCESS((short)0, "success"),
      CEX((short)1, "cex");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __SUCCESS_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
      put(_Fields.CEX, new FieldMetaData("cex", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(addVendor_result.class, metaDataMap);
    }

    public addVendor_result() {
    }

    public addVendor_result(
      long success,
      CatalogServiceException cex)
    {
      this();
      this.success = success;
      setSuccessIsSet(true);
      this.cex = cex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public addVendor_result(addVendor_result other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.success = other.success;
      if (other.isSetCex()) {
        this.cex = new CatalogServiceException(other.cex);
      }
    }

    public addVendor_result deepCopy() {
      return new addVendor_result(this);
    }

    @Deprecated
    public addVendor_result clone() {
      return new addVendor_result(this);
    }

    public long getSuccess() {
      return this.success;
    }

    public addVendor_result setSuccess(long success) {
      this.success = success;
      setSuccessIsSet(true);
      return this;
    }

    public void unsetSuccess() {
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
    }

    /** Returns true if field success is set (has been asigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
    }

    public void setSuccessIsSet(boolean value) {
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
    }

    public CatalogServiceException getCex() {
      return this.cex;
    }

    public addVendor_result setCex(CatalogServiceException cex) {
      this.cex = cex;
      return this;
    }

    public void unsetCex() {
      this.cex = null;
    }

    /** Returns true if field cex is set (has been asigned a value) and false otherwise */
    public boolean isSetCex() {
      return this.cex != null;
    }

    public void setCexIsSet(boolean value) {
      if (!value) {
        this.cex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((Long)value);
        }
        break;

      case CEX:
        if (value == null) {
          unsetCex();
        } else {
          setCex((CatalogServiceException)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return new Long(getSuccess());

      case CEX:
        return getCex();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case CEX:
        return isSetCex();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof addVendor_result)
        return this.equals((addVendor_result)that);
      return false;
    }

    public boolean equals(addVendor_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true;
      boolean that_present_success = true;
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (this.success != that.success)
          return false;
      }

      boolean this_present_cex = true && this.isSetCex();
      boolean that_present_cex = true && that.isSetCex();
      if (this_present_cex || that_present_cex) {
        if (!(this_present_cex && that_present_cex))
          return false;
        if (!this.cex.equals(that.cex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(addVendor_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      addVendor_result typedOther = (addVendor_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetCex()).compareTo(isSetCex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(cex, typedOther.cex);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case SUCCESS:
              if (field.type == TType.I64) {
                this.success = iprot.readI64();
                setSuccessIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case CEX:
              if (field.type == TType.STRUCT) {
                this.cex = new CatalogServiceException();
                this.cex.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        oprot.writeI64(this.success);
        oprot.writeFieldEnd();
      } else if (this.isSetCex()) {
        oprot.writeFieldBegin(CEX_FIELD_DESC);
        this.cex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("addVendor_result(");
      boolean first = true;

      sb.append("success:");
      sb.append(this.success);
      first = false;
      if (!first) sb.append(", ");
      sb.append("cex:");
      if (this.cex == null) {
        sb.append("null");
      } else {
        sb.append(this.cex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class updateInventory_args implements TBase<updateInventory_args._Fields>, java.io.Serializable, Cloneable, Comparable<updateInventory_args>   {
    private static final TStruct STRUCT_DESC = new TStruct("updateInventory_args");

    private static final TField ITEM_ID_FIELD_DESC = new TField("item_id", TType.I64, (short)1);
    private static final TField WAREHOUSE_ID_FIELD_DESC = new TField("warehouse_id", TType.I64, (short)2);
    private static final TField QUANTITY_FIELD_DESC = new TField("quantity", TType.I64, (short)3);
    private static final TField TIMESTAMP_FIELD_DESC = new TField("timestamp", TType.I64, (short)4);

    private long item_id;
    private long warehouse_id;
    private long quantity;
    private long timestamp;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      ITEM_ID((short)1, "item_id"),
      WAREHOUSE_ID((short)2, "warehouse_id"),
      QUANTITY((short)3, "quantity"),
      TIMESTAMP((short)4, "timestamp");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __ITEM_ID_ISSET_ID = 0;
    private static final int __WAREHOUSE_ID_ISSET_ID = 1;
    private static final int __QUANTITY_ISSET_ID = 2;
    private static final int __TIMESTAMP_ISSET_ID = 3;
    private BitSet __isset_bit_vector = new BitSet(4);

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.ITEM_ID, new FieldMetaData("item_id", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
      put(_Fields.WAREHOUSE_ID, new FieldMetaData("warehouse_id", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
      put(_Fields.QUANTITY, new FieldMetaData("quantity", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
      put(_Fields.TIMESTAMP, new FieldMetaData("timestamp", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(updateInventory_args.class, metaDataMap);
    }

    public updateInventory_args() {
    }

    public updateInventory_args(
      long item_id,
      long warehouse_id,
      long quantity,
      long timestamp)
    {
      this();
      this.item_id = item_id;
      setItem_idIsSet(true);
      this.warehouse_id = warehouse_id;
      setWarehouse_idIsSet(true);
      this.quantity = quantity;
      setQuantityIsSet(true);
      this.timestamp = timestamp;
      setTimestampIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public updateInventory_args(updateInventory_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.item_id = other.item_id;
      this.warehouse_id = other.warehouse_id;
      this.quantity = other.quantity;
      this.timestamp = other.timestamp;
    }

    public updateInventory_args deepCopy() {
      return new updateInventory_args(this);
    }

    @Deprecated
    public updateInventory_args clone() {
      return new updateInventory_args(this);
    }

    public long getItem_id() {
      return this.item_id;
    }

    public updateInventory_args setItem_id(long item_id) {
      this.item_id = item_id;
      setItem_idIsSet(true);
      return this;
    }

    public void unsetItem_id() {
      __isset_bit_vector.clear(__ITEM_ID_ISSET_ID);
    }

    /** Returns true if field item_id is set (has been asigned a value) and false otherwise */
    public boolean isSetItem_id() {
      return __isset_bit_vector.get(__ITEM_ID_ISSET_ID);
    }

    public void setItem_idIsSet(boolean value) {
      __isset_bit_vector.set(__ITEM_ID_ISSET_ID, value);
    }

    public long getWarehouse_id() {
      return this.warehouse_id;
    }

    public updateInventory_args setWarehouse_id(long warehouse_id) {
      this.warehouse_id = warehouse_id;
      setWarehouse_idIsSet(true);
      return this;
    }

    public void unsetWarehouse_id() {
      __isset_bit_vector.clear(__WAREHOUSE_ID_ISSET_ID);
    }

    /** Returns true if field warehouse_id is set (has been asigned a value) and false otherwise */
    public boolean isSetWarehouse_id() {
      return __isset_bit_vector.get(__WAREHOUSE_ID_ISSET_ID);
    }

    public void setWarehouse_idIsSet(boolean value) {
      __isset_bit_vector.set(__WAREHOUSE_ID_ISSET_ID, value);
    }

    public long getQuantity() {
      return this.quantity;
    }

    public updateInventory_args setQuantity(long quantity) {
      this.quantity = quantity;
      setQuantityIsSet(true);
      return this;
    }

    public void unsetQuantity() {
      __isset_bit_vector.clear(__QUANTITY_ISSET_ID);
    }

    /** Returns true if field quantity is set (has been asigned a value) and false otherwise */
    public boolean isSetQuantity() {
      return __isset_bit_vector.get(__QUANTITY_ISSET_ID);
    }

    public void setQuantityIsSet(boolean value) {
      __isset_bit_vector.set(__QUANTITY_ISSET_ID, value);
    }

    public long getTimestamp() {
      return this.timestamp;
    }

    public updateInventory_args setTimestamp(long timestamp) {
      this.timestamp = timestamp;
      setTimestampIsSet(true);
      return this;
    }

    public void unsetTimestamp() {
      __isset_bit_vector.clear(__TIMESTAMP_ISSET_ID);
    }

    /** Returns true if field timestamp is set (has been asigned a value) and false otherwise */
    public boolean isSetTimestamp() {
      return __isset_bit_vector.get(__TIMESTAMP_ISSET_ID);
    }

    public void setTimestampIsSet(boolean value) {
      __isset_bit_vector.set(__TIMESTAMP_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case ITEM_ID:
        if (value == null) {
          unsetItem_id();
        } else {
          setItem_id((Long)value);
        }
        break;

      case WAREHOUSE_ID:
        if (value == null) {
          unsetWarehouse_id();
        } else {
          setWarehouse_id((Long)value);
        }
        break;

      case QUANTITY:
        if (value == null) {
          unsetQuantity();
        } else {
          setQuantity((Long)value);
        }
        break;

      case TIMESTAMP:
        if (value == null) {
          unsetTimestamp();
        } else {
          setTimestamp((Long)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case ITEM_ID:
        return new Long(getItem_id());

      case WAREHOUSE_ID:
        return new Long(getWarehouse_id());

      case QUANTITY:
        return new Long(getQuantity());

      case TIMESTAMP:
        return new Long(getTimestamp());

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case ITEM_ID:
        return isSetItem_id();
      case WAREHOUSE_ID:
        return isSetWarehouse_id();
      case QUANTITY:
        return isSetQuantity();
      case TIMESTAMP:
        return isSetTimestamp();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof updateInventory_args)
        return this.equals((updateInventory_args)that);
      return false;
    }

    public boolean equals(updateInventory_args that) {
      if (that == null)
        return false;

      boolean this_present_item_id = true;
      boolean that_present_item_id = true;
      if (this_present_item_id || that_present_item_id) {
        if (!(this_present_item_id && that_present_item_id))
          return false;
        if (this.item_id != that.item_id)
          return false;
      }

      boolean this_present_warehouse_id = true;
      boolean that_present_warehouse_id = true;
      if (this_present_warehouse_id || that_present_warehouse_id) {
        if (!(this_present_warehouse_id && that_present_warehouse_id))
          return false;
        if (this.warehouse_id != that.warehouse_id)
          return false;
      }

      boolean this_present_quantity = true;
      boolean that_present_quantity = true;
      if (this_present_quantity || that_present_quantity) {
        if (!(this_present_quantity && that_present_quantity))
          return false;
        if (this.quantity != that.quantity)
          return false;
      }

      boolean this_present_timestamp = true;
      boolean that_present_timestamp = true;
      if (this_present_timestamp || that_present_timestamp) {
        if (!(this_present_timestamp && that_present_timestamp))
          return false;
        if (this.timestamp != that.timestamp)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(updateInventory_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      updateInventory_args typedOther = (updateInventory_args)other;

      lastComparison = Boolean.valueOf(isSetItem_id()).compareTo(isSetItem_id());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(item_id, typedOther.item_id);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetWarehouse_id()).compareTo(isSetWarehouse_id());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(warehouse_id, typedOther.warehouse_id);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetQuantity()).compareTo(isSetQuantity());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(quantity, typedOther.quantity);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetTimestamp()).compareTo(isSetTimestamp());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(timestamp, typedOther.timestamp);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case ITEM_ID:
              if (field.type == TType.I64) {
                this.item_id = iprot.readI64();
                setItem_idIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case WAREHOUSE_ID:
              if (field.type == TType.I64) {
                this.warehouse_id = iprot.readI64();
                setWarehouse_idIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case QUANTITY:
              if (field.type == TType.I64) {
                this.quantity = iprot.readI64();
                setQuantityIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case TIMESTAMP:
              if (field.type == TType.I64) {
                this.timestamp = iprot.readI64();
                setTimestampIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(ITEM_ID_FIELD_DESC);
      oprot.writeI64(this.item_id);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(WAREHOUSE_ID_FIELD_DESC);
      oprot.writeI64(this.warehouse_id);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(QUANTITY_FIELD_DESC);
      oprot.writeI64(this.quantity);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(TIMESTAMP_FIELD_DESC);
      oprot.writeI64(this.timestamp);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("updateInventory_args(");
      boolean first = true;

      sb.append("item_id:");
      sb.append(this.item_id);
      first = false;
      if (!first) sb.append(", ");
      sb.append("warehouse_id:");
      sb.append(this.warehouse_id);
      first = false;
      if (!first) sb.append(", ");
      sb.append("quantity:");
      sb.append(this.quantity);
      first = false;
      if (!first) sb.append(", ");
      sb.append("timestamp:");
      sb.append(this.timestamp);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class updateInventory_result implements TBase<updateInventory_result._Fields>, java.io.Serializable, Cloneable, Comparable<updateInventory_result>   {
    private static final TStruct STRUCT_DESC = new TStruct("updateInventory_result");

    private static final TField CEX_FIELD_DESC = new TField("cex", TType.STRUCT, (short)1);

    private CatalogServiceException cex;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      CEX((short)1, "cex");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.CEX, new FieldMetaData("cex", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(updateInventory_result.class, metaDataMap);
    }

    public updateInventory_result() {
    }

    public updateInventory_result(
      CatalogServiceException cex)
    {
      this();
      this.cex = cex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public updateInventory_result(updateInventory_result other) {
      if (other.isSetCex()) {
        this.cex = new CatalogServiceException(other.cex);
      }
    }

    public updateInventory_result deepCopy() {
      return new updateInventory_result(this);
    }

    @Deprecated
    public updateInventory_result clone() {
      return new updateInventory_result(this);
    }

    public CatalogServiceException getCex() {
      return this.cex;
    }

    public updateInventory_result setCex(CatalogServiceException cex) {
      this.cex = cex;
      return this;
    }

    public void unsetCex() {
      this.cex = null;
    }

    /** Returns true if field cex is set (has been asigned a value) and false otherwise */
    public boolean isSetCex() {
      return this.cex != null;
    }

    public void setCexIsSet(boolean value) {
      if (!value) {
        this.cex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case CEX:
        if (value == null) {
          unsetCex();
        } else {
          setCex((CatalogServiceException)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case CEX:
        return getCex();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case CEX:
        return isSetCex();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof updateInventory_result)
        return this.equals((updateInventory_result)that);
      return false;
    }

    public boolean equals(updateInventory_result that) {
      if (that == null)
        return false;

      boolean this_present_cex = true && this.isSetCex();
      boolean that_present_cex = true && that.isSetCex();
      if (this_present_cex || that_present_cex) {
        if (!(this_present_cex && that_present_cex))
          return false;
        if (!this.cex.equals(that.cex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(updateInventory_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      updateInventory_result typedOther = (updateInventory_result)other;

      lastComparison = Boolean.valueOf(isSetCex()).compareTo(isSetCex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(cex, typedOther.cex);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case CEX:
              if (field.type == TType.STRUCT) {
                this.cex = new CatalogServiceException();
                this.cex.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetCex()) {
        oprot.writeFieldBegin(CEX_FIELD_DESC);
        this.cex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("updateInventory_result(");
      boolean first = true;

      sb.append("cex:");
      if (this.cex == null) {
        sb.append("null");
      } else {
        sb.append(this.cex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class retireCategory_args implements TBase<retireCategory_args._Fields>, java.io.Serializable, Cloneable, Comparable<retireCategory_args>   {
    private static final TStruct STRUCT_DESC = new TStruct("retireCategory_args");

    private static final TField CATEGORY_ID_FIELD_DESC = new TField("category_id", TType.I64, (short)1);

    private long category_id;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      CATEGORY_ID((short)1, "category_id");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __CATEGORY_ID_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.CATEGORY_ID, new FieldMetaData("category_id", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(retireCategory_args.class, metaDataMap);
    }

    public retireCategory_args() {
    }

    public retireCategory_args(
      long category_id)
    {
      this();
      this.category_id = category_id;
      setCategory_idIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public retireCategory_args(retireCategory_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.category_id = other.category_id;
    }

    public retireCategory_args deepCopy() {
      return new retireCategory_args(this);
    }

    @Deprecated
    public retireCategory_args clone() {
      return new retireCategory_args(this);
    }

    public long getCategory_id() {
      return this.category_id;
    }

    public retireCategory_args setCategory_id(long category_id) {
      this.category_id = category_id;
      setCategory_idIsSet(true);
      return this;
    }

    public void unsetCategory_id() {
      __isset_bit_vector.clear(__CATEGORY_ID_ISSET_ID);
    }

    /** Returns true if field category_id is set (has been asigned a value) and false otherwise */
    public boolean isSetCategory_id() {
      return __isset_bit_vector.get(__CATEGORY_ID_ISSET_ID);
    }

    public void setCategory_idIsSet(boolean value) {
      __isset_bit_vector.set(__CATEGORY_ID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case CATEGORY_ID:
        if (value == null) {
          unsetCategory_id();
        } else {
          setCategory_id((Long)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case CATEGORY_ID:
        return new Long(getCategory_id());

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case CATEGORY_ID:
        return isSetCategory_id();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof retireCategory_args)
        return this.equals((retireCategory_args)that);
      return false;
    }

    public boolean equals(retireCategory_args that) {
      if (that == null)
        return false;

      boolean this_present_category_id = true;
      boolean that_present_category_id = true;
      if (this_present_category_id || that_present_category_id) {
        if (!(this_present_category_id && that_present_category_id))
          return false;
        if (this.category_id != that.category_id)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(retireCategory_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      retireCategory_args typedOther = (retireCategory_args)other;

      lastComparison = Boolean.valueOf(isSetCategory_id()).compareTo(isSetCategory_id());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(category_id, typedOther.category_id);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case CATEGORY_ID:
              if (field.type == TType.I64) {
                this.category_id = iprot.readI64();
                setCategory_idIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(CATEGORY_ID_FIELD_DESC);
      oprot.writeI64(this.category_id);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("retireCategory_args(");
      boolean first = true;

      sb.append("category_id:");
      sb.append(this.category_id);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class retireCategory_result implements TBase<retireCategory_result._Fields>, java.io.Serializable, Cloneable, Comparable<retireCategory_result>   {
    private static final TStruct STRUCT_DESC = new TStruct("retireCategory_result");

    private static final TField CEX_FIELD_DESC = new TField("cex", TType.STRUCT, (short)1);

    private CatalogServiceException cex;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      CEX((short)1, "cex");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.CEX, new FieldMetaData("cex", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(retireCategory_result.class, metaDataMap);
    }

    public retireCategory_result() {
    }

    public retireCategory_result(
      CatalogServiceException cex)
    {
      this();
      this.cex = cex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public retireCategory_result(retireCategory_result other) {
      if (other.isSetCex()) {
        this.cex = new CatalogServiceException(other.cex);
      }
    }

    public retireCategory_result deepCopy() {
      return new retireCategory_result(this);
    }

    @Deprecated
    public retireCategory_result clone() {
      return new retireCategory_result(this);
    }

    public CatalogServiceException getCex() {
      return this.cex;
    }

    public retireCategory_result setCex(CatalogServiceException cex) {
      this.cex = cex;
      return this;
    }

    public void unsetCex() {
      this.cex = null;
    }

    /** Returns true if field cex is set (has been asigned a value) and false otherwise */
    public boolean isSetCex() {
      return this.cex != null;
    }

    public void setCexIsSet(boolean value) {
      if (!value) {
        this.cex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case CEX:
        if (value == null) {
          unsetCex();
        } else {
          setCex((CatalogServiceException)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case CEX:
        return getCex();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case CEX:
        return isSetCex();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof retireCategory_result)
        return this.equals((retireCategory_result)that);
      return false;
    }

    public boolean equals(retireCategory_result that) {
      if (that == null)
        return false;

      boolean this_present_cex = true && this.isSetCex();
      boolean that_present_cex = true && that.isSetCex();
      if (this_present_cex || that_present_cex) {
        if (!(this_present_cex && that_present_cex))
          return false;
        if (!this.cex.equals(that.cex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(retireCategory_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      retireCategory_result typedOther = (retireCategory_result)other;

      lastComparison = Boolean.valueOf(isSetCex()).compareTo(isSetCex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(cex, typedOther.cex);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case CEX:
              if (field.type == TType.STRUCT) {
                this.cex = new CatalogServiceException();
                this.cex.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetCex()) {
        oprot.writeFieldBegin(CEX_FIELD_DESC);
        this.cex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("retireCategory_result(");
      boolean first = true;

      sb.append("cex:");
      if (this.cex == null) {
        sb.append("null");
      } else {
        sb.append(this.cex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class retireVendor_args implements TBase<retireVendor_args._Fields>, java.io.Serializable, Cloneable, Comparable<retireVendor_args>   {
    private static final TStruct STRUCT_DESC = new TStruct("retireVendor_args");

    private static final TField VENDOR_ID_FIELD_DESC = new TField("vendor_id", TType.I64, (short)1);

    private long vendor_id;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      VENDOR_ID((short)1, "vendor_id");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __VENDOR_ID_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.VENDOR_ID, new FieldMetaData("vendor_id", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(retireVendor_args.class, metaDataMap);
    }

    public retireVendor_args() {
    }

    public retireVendor_args(
      long vendor_id)
    {
      this();
      this.vendor_id = vendor_id;
      setVendor_idIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public retireVendor_args(retireVendor_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.vendor_id = other.vendor_id;
    }

    public retireVendor_args deepCopy() {
      return new retireVendor_args(this);
    }

    @Deprecated
    public retireVendor_args clone() {
      return new retireVendor_args(this);
    }

    public long getVendor_id() {
      return this.vendor_id;
    }

    public retireVendor_args setVendor_id(long vendor_id) {
      this.vendor_id = vendor_id;
      setVendor_idIsSet(true);
      return this;
    }

    public void unsetVendor_id() {
      __isset_bit_vector.clear(__VENDOR_ID_ISSET_ID);
    }

    /** Returns true if field vendor_id is set (has been asigned a value) and false otherwise */
    public boolean isSetVendor_id() {
      return __isset_bit_vector.get(__VENDOR_ID_ISSET_ID);
    }

    public void setVendor_idIsSet(boolean value) {
      __isset_bit_vector.set(__VENDOR_ID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case VENDOR_ID:
        if (value == null) {
          unsetVendor_id();
        } else {
          setVendor_id((Long)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case VENDOR_ID:
        return new Long(getVendor_id());

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case VENDOR_ID:
        return isSetVendor_id();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof retireVendor_args)
        return this.equals((retireVendor_args)that);
      return false;
    }

    public boolean equals(retireVendor_args that) {
      if (that == null)
        return false;

      boolean this_present_vendor_id = true;
      boolean that_present_vendor_id = true;
      if (this_present_vendor_id || that_present_vendor_id) {
        if (!(this_present_vendor_id && that_present_vendor_id))
          return false;
        if (this.vendor_id != that.vendor_id)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(retireVendor_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      retireVendor_args typedOther = (retireVendor_args)other;

      lastComparison = Boolean.valueOf(isSetVendor_id()).compareTo(isSetVendor_id());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(vendor_id, typedOther.vendor_id);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case VENDOR_ID:
              if (field.type == TType.I64) {
                this.vendor_id = iprot.readI64();
                setVendor_idIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(VENDOR_ID_FIELD_DESC);
      oprot.writeI64(this.vendor_id);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("retireVendor_args(");
      boolean first = true;

      sb.append("vendor_id:");
      sb.append(this.vendor_id);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class retireVendor_result implements TBase<retireVendor_result._Fields>, java.io.Serializable, Cloneable, Comparable<retireVendor_result>   {
    private static final TStruct STRUCT_DESC = new TStruct("retireVendor_result");

    private static final TField CEX_FIELD_DESC = new TField("cex", TType.STRUCT, (short)1);

    private CatalogServiceException cex;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      CEX((short)1, "cex");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.CEX, new FieldMetaData("cex", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(retireVendor_result.class, metaDataMap);
    }

    public retireVendor_result() {
    }

    public retireVendor_result(
      CatalogServiceException cex)
    {
      this();
      this.cex = cex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public retireVendor_result(retireVendor_result other) {
      if (other.isSetCex()) {
        this.cex = new CatalogServiceException(other.cex);
      }
    }

    public retireVendor_result deepCopy() {
      return new retireVendor_result(this);
    }

    @Deprecated
    public retireVendor_result clone() {
      return new retireVendor_result(this);
    }

    public CatalogServiceException getCex() {
      return this.cex;
    }

    public retireVendor_result setCex(CatalogServiceException cex) {
      this.cex = cex;
      return this;
    }

    public void unsetCex() {
      this.cex = null;
    }

    /** Returns true if field cex is set (has been asigned a value) and false otherwise */
    public boolean isSetCex() {
      return this.cex != null;
    }

    public void setCexIsSet(boolean value) {
      if (!value) {
        this.cex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case CEX:
        if (value == null) {
          unsetCex();
        } else {
          setCex((CatalogServiceException)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case CEX:
        return getCex();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case CEX:
        return isSetCex();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof retireVendor_result)
        return this.equals((retireVendor_result)that);
      return false;
    }

    public boolean equals(retireVendor_result that) {
      if (that == null)
        return false;

      boolean this_present_cex = true && this.isSetCex();
      boolean that_present_cex = true && that.isSetCex();
      if (this_present_cex || that_present_cex) {
        if (!(this_present_cex && that_present_cex))
          return false;
        if (!this.cex.equals(that.cex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(retireVendor_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      retireVendor_result typedOther = (retireVendor_result)other;

      lastComparison = Boolean.valueOf(isSetCex()).compareTo(isSetCex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(cex, typedOther.cex);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case CEX:
              if (field.type == TType.STRUCT) {
                this.cex = new CatalogServiceException();
                this.cex.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetCex()) {
        oprot.writeFieldBegin(CEX_FIELD_DESC);
        this.cex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("retireVendor_result(");
      boolean first = true;

      sb.append("cex:");
      if (this.cex == null) {
        sb.append("null");
      } else {
        sb.append(this.cex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class retireWarehouse_args implements TBase<retireWarehouse_args._Fields>, java.io.Serializable, Cloneable, Comparable<retireWarehouse_args>   {
    private static final TStruct STRUCT_DESC = new TStruct("retireWarehouse_args");

    private static final TField WAREHOUSE_ID_FIELD_DESC = new TField("warehouse_id", TType.I64, (short)1);

    private long warehouse_id;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      WAREHOUSE_ID((short)1, "warehouse_id");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __WAREHOUSE_ID_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.WAREHOUSE_ID, new FieldMetaData("warehouse_id", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(retireWarehouse_args.class, metaDataMap);
    }

    public retireWarehouse_args() {
    }

    public retireWarehouse_args(
      long warehouse_id)
    {
      this();
      this.warehouse_id = warehouse_id;
      setWarehouse_idIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public retireWarehouse_args(retireWarehouse_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.warehouse_id = other.warehouse_id;
    }

    public retireWarehouse_args deepCopy() {
      return new retireWarehouse_args(this);
    }

    @Deprecated
    public retireWarehouse_args clone() {
      return new retireWarehouse_args(this);
    }

    public long getWarehouse_id() {
      return this.warehouse_id;
    }

    public retireWarehouse_args setWarehouse_id(long warehouse_id) {
      this.warehouse_id = warehouse_id;
      setWarehouse_idIsSet(true);
      return this;
    }

    public void unsetWarehouse_id() {
      __isset_bit_vector.clear(__WAREHOUSE_ID_ISSET_ID);
    }

    /** Returns true if field warehouse_id is set (has been asigned a value) and false otherwise */
    public boolean isSetWarehouse_id() {
      return __isset_bit_vector.get(__WAREHOUSE_ID_ISSET_ID);
    }

    public void setWarehouse_idIsSet(boolean value) {
      __isset_bit_vector.set(__WAREHOUSE_ID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case WAREHOUSE_ID:
        if (value == null) {
          unsetWarehouse_id();
        } else {
          setWarehouse_id((Long)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case WAREHOUSE_ID:
        return new Long(getWarehouse_id());

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case WAREHOUSE_ID:
        return isSetWarehouse_id();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof retireWarehouse_args)
        return this.equals((retireWarehouse_args)that);
      return false;
    }

    public boolean equals(retireWarehouse_args that) {
      if (that == null)
        return false;

      boolean this_present_warehouse_id = true;
      boolean that_present_warehouse_id = true;
      if (this_present_warehouse_id || that_present_warehouse_id) {
        if (!(this_present_warehouse_id && that_present_warehouse_id))
          return false;
        if (this.warehouse_id != that.warehouse_id)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(retireWarehouse_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      retireWarehouse_args typedOther = (retireWarehouse_args)other;

      lastComparison = Boolean.valueOf(isSetWarehouse_id()).compareTo(isSetWarehouse_id());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(warehouse_id, typedOther.warehouse_id);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case WAREHOUSE_ID:
              if (field.type == TType.I64) {
                this.warehouse_id = iprot.readI64();
                setWarehouse_idIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(WAREHOUSE_ID_FIELD_DESC);
      oprot.writeI64(this.warehouse_id);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("retireWarehouse_args(");
      boolean first = true;

      sb.append("warehouse_id:");
      sb.append(this.warehouse_id);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class retireWarehouse_result implements TBase<retireWarehouse_result._Fields>, java.io.Serializable, Cloneable, Comparable<retireWarehouse_result>   {
    private static final TStruct STRUCT_DESC = new TStruct("retireWarehouse_result");

    private static final TField CEX_FIELD_DESC = new TField("cex", TType.STRUCT, (short)1);

    private CatalogServiceException cex;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      CEX((short)1, "cex");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.CEX, new FieldMetaData("cex", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(retireWarehouse_result.class, metaDataMap);
    }

    public retireWarehouse_result() {
    }

    public retireWarehouse_result(
      CatalogServiceException cex)
    {
      this();
      this.cex = cex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public retireWarehouse_result(retireWarehouse_result other) {
      if (other.isSetCex()) {
        this.cex = new CatalogServiceException(other.cex);
      }
    }

    public retireWarehouse_result deepCopy() {
      return new retireWarehouse_result(this);
    }

    @Deprecated
    public retireWarehouse_result clone() {
      return new retireWarehouse_result(this);
    }

    public CatalogServiceException getCex() {
      return this.cex;
    }

    public retireWarehouse_result setCex(CatalogServiceException cex) {
      this.cex = cex;
      return this;
    }

    public void unsetCex() {
      this.cex = null;
    }

    /** Returns true if field cex is set (has been asigned a value) and false otherwise */
    public boolean isSetCex() {
      return this.cex != null;
    }

    public void setCexIsSet(boolean value) {
      if (!value) {
        this.cex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case CEX:
        if (value == null) {
          unsetCex();
        } else {
          setCex((CatalogServiceException)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case CEX:
        return getCex();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case CEX:
        return isSetCex();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof retireWarehouse_result)
        return this.equals((retireWarehouse_result)that);
      return false;
    }

    public boolean equals(retireWarehouse_result that) {
      if (that == null)
        return false;

      boolean this_present_cex = true && this.isSetCex();
      boolean that_present_cex = true && that.isSetCex();
      if (this_present_cex || that_present_cex) {
        if (!(this_present_cex && that_present_cex))
          return false;
        if (!this.cex.equals(that.cex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(retireWarehouse_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      retireWarehouse_result typedOther = (retireWarehouse_result)other;

      lastComparison = Boolean.valueOf(isSetCex()).compareTo(isSetCex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(cex, typedOther.cex);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case CEX:
              if (field.type == TType.STRUCT) {
                this.cex = new CatalogServiceException();
                this.cex.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetCex()) {
        oprot.writeFieldBegin(CEX_FIELD_DESC);
        this.cex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("retireWarehouse_result(");
      boolean first = true;

      sb.append("cex:");
      if (this.cex == null) {
        sb.append("null");
      } else {
        sb.append(this.cex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class startItemOn_args implements TBase<startItemOn_args._Fields>, java.io.Serializable, Cloneable, Comparable<startItemOn_args>   {
    private static final TStruct STRUCT_DESC = new TStruct("startItemOn_args");

    private static final TField ITEM_ID_FIELD_DESC = new TField("item_id", TType.I64, (short)1);
    private static final TField TIMESTAMP_FIELD_DESC = new TField("timestamp", TType.I64, (short)2);

    private long item_id;
    private long timestamp;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      ITEM_ID((short)1, "item_id"),
      TIMESTAMP((short)2, "timestamp");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __ITEM_ID_ISSET_ID = 0;
    private static final int __TIMESTAMP_ISSET_ID = 1;
    private BitSet __isset_bit_vector = new BitSet(2);

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.ITEM_ID, new FieldMetaData("item_id", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
      put(_Fields.TIMESTAMP, new FieldMetaData("timestamp", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(startItemOn_args.class, metaDataMap);
    }

    public startItemOn_args() {
    }

    public startItemOn_args(
      long item_id,
      long timestamp)
    {
      this();
      this.item_id = item_id;
      setItem_idIsSet(true);
      this.timestamp = timestamp;
      setTimestampIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public startItemOn_args(startItemOn_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.item_id = other.item_id;
      this.timestamp = other.timestamp;
    }

    public startItemOn_args deepCopy() {
      return new startItemOn_args(this);
    }

    @Deprecated
    public startItemOn_args clone() {
      return new startItemOn_args(this);
    }

    public long getItem_id() {
      return this.item_id;
    }

    public startItemOn_args setItem_id(long item_id) {
      this.item_id = item_id;
      setItem_idIsSet(true);
      return this;
    }

    public void unsetItem_id() {
      __isset_bit_vector.clear(__ITEM_ID_ISSET_ID);
    }

    /** Returns true if field item_id is set (has been asigned a value) and false otherwise */
    public boolean isSetItem_id() {
      return __isset_bit_vector.get(__ITEM_ID_ISSET_ID);
    }

    public void setItem_idIsSet(boolean value) {
      __isset_bit_vector.set(__ITEM_ID_ISSET_ID, value);
    }

    public long getTimestamp() {
      return this.timestamp;
    }

    public startItemOn_args setTimestamp(long timestamp) {
      this.timestamp = timestamp;
      setTimestampIsSet(true);
      return this;
    }

    public void unsetTimestamp() {
      __isset_bit_vector.clear(__TIMESTAMP_ISSET_ID);
    }

    /** Returns true if field timestamp is set (has been asigned a value) and false otherwise */
    public boolean isSetTimestamp() {
      return __isset_bit_vector.get(__TIMESTAMP_ISSET_ID);
    }

    public void setTimestampIsSet(boolean value) {
      __isset_bit_vector.set(__TIMESTAMP_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case ITEM_ID:
        if (value == null) {
          unsetItem_id();
        } else {
          setItem_id((Long)value);
        }
        break;

      case TIMESTAMP:
        if (value == null) {
          unsetTimestamp();
        } else {
          setTimestamp((Long)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case ITEM_ID:
        return new Long(getItem_id());

      case TIMESTAMP:
        return new Long(getTimestamp());

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case ITEM_ID:
        return isSetItem_id();
      case TIMESTAMP:
        return isSetTimestamp();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof startItemOn_args)
        return this.equals((startItemOn_args)that);
      return false;
    }

    public boolean equals(startItemOn_args that) {
      if (that == null)
        return false;

      boolean this_present_item_id = true;
      boolean that_present_item_id = true;
      if (this_present_item_id || that_present_item_id) {
        if (!(this_present_item_id && that_present_item_id))
          return false;
        if (this.item_id != that.item_id)
          return false;
      }

      boolean this_present_timestamp = true;
      boolean that_present_timestamp = true;
      if (this_present_timestamp || that_present_timestamp) {
        if (!(this_present_timestamp && that_present_timestamp))
          return false;
        if (this.timestamp != that.timestamp)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(startItemOn_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      startItemOn_args typedOther = (startItemOn_args)other;

      lastComparison = Boolean.valueOf(isSetItem_id()).compareTo(isSetItem_id());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(item_id, typedOther.item_id);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetTimestamp()).compareTo(isSetTimestamp());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(timestamp, typedOther.timestamp);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case ITEM_ID:
              if (field.type == TType.I64) {
                this.item_id = iprot.readI64();
                setItem_idIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case TIMESTAMP:
              if (field.type == TType.I64) {
                this.timestamp = iprot.readI64();
                setTimestampIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(ITEM_ID_FIELD_DESC);
      oprot.writeI64(this.item_id);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(TIMESTAMP_FIELD_DESC);
      oprot.writeI64(this.timestamp);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("startItemOn_args(");
      boolean first = true;

      sb.append("item_id:");
      sb.append(this.item_id);
      first = false;
      if (!first) sb.append(", ");
      sb.append("timestamp:");
      sb.append(this.timestamp);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class startItemOn_result implements TBase<startItemOn_result._Fields>, java.io.Serializable, Cloneable, Comparable<startItemOn_result>   {
    private static final TStruct STRUCT_DESC = new TStruct("startItemOn_result");

    private static final TField CEX_FIELD_DESC = new TField("cex", TType.STRUCT, (short)1);

    private CatalogServiceException cex;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      CEX((short)1, "cex");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.CEX, new FieldMetaData("cex", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(startItemOn_result.class, metaDataMap);
    }

    public startItemOn_result() {
    }

    public startItemOn_result(
      CatalogServiceException cex)
    {
      this();
      this.cex = cex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public startItemOn_result(startItemOn_result other) {
      if (other.isSetCex()) {
        this.cex = new CatalogServiceException(other.cex);
      }
    }

    public startItemOn_result deepCopy() {
      return new startItemOn_result(this);
    }

    @Deprecated
    public startItemOn_result clone() {
      return new startItemOn_result(this);
    }

    public CatalogServiceException getCex() {
      return this.cex;
    }

    public startItemOn_result setCex(CatalogServiceException cex) {
      this.cex = cex;
      return this;
    }

    public void unsetCex() {
      this.cex = null;
    }

    /** Returns true if field cex is set (has been asigned a value) and false otherwise */
    public boolean isSetCex() {
      return this.cex != null;
    }

    public void setCexIsSet(boolean value) {
      if (!value) {
        this.cex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case CEX:
        if (value == null) {
          unsetCex();
        } else {
          setCex((CatalogServiceException)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case CEX:
        return getCex();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case CEX:
        return isSetCex();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof startItemOn_result)
        return this.equals((startItemOn_result)that);
      return false;
    }

    public boolean equals(startItemOn_result that) {
      if (that == null)
        return false;

      boolean this_present_cex = true && this.isSetCex();
      boolean that_present_cex = true && that.isSetCex();
      if (this_present_cex || that_present_cex) {
        if (!(this_present_cex && that_present_cex))
          return false;
        if (!this.cex.equals(that.cex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(startItemOn_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      startItemOn_result typedOther = (startItemOn_result)other;

      lastComparison = Boolean.valueOf(isSetCex()).compareTo(isSetCex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(cex, typedOther.cex);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case CEX:
              if (field.type == TType.STRUCT) {
                this.cex = new CatalogServiceException();
                this.cex.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetCex()) {
        oprot.writeFieldBegin(CEX_FIELD_DESC);
        this.cex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("startItemOn_result(");
      boolean first = true;

      sb.append("cex:");
      if (this.cex == null) {
        sb.append("null");
      } else {
        sb.append(this.cex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class retireItemOn_args implements TBase<retireItemOn_args._Fields>, java.io.Serializable, Cloneable, Comparable<retireItemOn_args>   {
    private static final TStruct STRUCT_DESC = new TStruct("retireItemOn_args");

    private static final TField ITEM_ID_FIELD_DESC = new TField("item_id", TType.I64, (short)1);
    private static final TField TIMESTAMP_FIELD_DESC = new TField("timestamp", TType.I64, (short)2);

    private long item_id;
    private long timestamp;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      ITEM_ID((short)1, "item_id"),
      TIMESTAMP((short)2, "timestamp");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __ITEM_ID_ISSET_ID = 0;
    private static final int __TIMESTAMP_ISSET_ID = 1;
    private BitSet __isset_bit_vector = new BitSet(2);

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.ITEM_ID, new FieldMetaData("item_id", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
      put(_Fields.TIMESTAMP, new FieldMetaData("timestamp", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(retireItemOn_args.class, metaDataMap);
    }

    public retireItemOn_args() {
    }

    public retireItemOn_args(
      long item_id,
      long timestamp)
    {
      this();
      this.item_id = item_id;
      setItem_idIsSet(true);
      this.timestamp = timestamp;
      setTimestampIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public retireItemOn_args(retireItemOn_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.item_id = other.item_id;
      this.timestamp = other.timestamp;
    }

    public retireItemOn_args deepCopy() {
      return new retireItemOn_args(this);
    }

    @Deprecated
    public retireItemOn_args clone() {
      return new retireItemOn_args(this);
    }

    public long getItem_id() {
      return this.item_id;
    }

    public retireItemOn_args setItem_id(long item_id) {
      this.item_id = item_id;
      setItem_idIsSet(true);
      return this;
    }

    public void unsetItem_id() {
      __isset_bit_vector.clear(__ITEM_ID_ISSET_ID);
    }

    /** Returns true if field item_id is set (has been asigned a value) and false otherwise */
    public boolean isSetItem_id() {
      return __isset_bit_vector.get(__ITEM_ID_ISSET_ID);
    }

    public void setItem_idIsSet(boolean value) {
      __isset_bit_vector.set(__ITEM_ID_ISSET_ID, value);
    }

    public long getTimestamp() {
      return this.timestamp;
    }

    public retireItemOn_args setTimestamp(long timestamp) {
      this.timestamp = timestamp;
      setTimestampIsSet(true);
      return this;
    }

    public void unsetTimestamp() {
      __isset_bit_vector.clear(__TIMESTAMP_ISSET_ID);
    }

    /** Returns true if field timestamp is set (has been asigned a value) and false otherwise */
    public boolean isSetTimestamp() {
      return __isset_bit_vector.get(__TIMESTAMP_ISSET_ID);
    }

    public void setTimestampIsSet(boolean value) {
      __isset_bit_vector.set(__TIMESTAMP_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case ITEM_ID:
        if (value == null) {
          unsetItem_id();
        } else {
          setItem_id((Long)value);
        }
        break;

      case TIMESTAMP:
        if (value == null) {
          unsetTimestamp();
        } else {
          setTimestamp((Long)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case ITEM_ID:
        return new Long(getItem_id());

      case TIMESTAMP:
        return new Long(getTimestamp());

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case ITEM_ID:
        return isSetItem_id();
      case TIMESTAMP:
        return isSetTimestamp();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof retireItemOn_args)
        return this.equals((retireItemOn_args)that);
      return false;
    }

    public boolean equals(retireItemOn_args that) {
      if (that == null)
        return false;

      boolean this_present_item_id = true;
      boolean that_present_item_id = true;
      if (this_present_item_id || that_present_item_id) {
        if (!(this_present_item_id && that_present_item_id))
          return false;
        if (this.item_id != that.item_id)
          return false;
      }

      boolean this_present_timestamp = true;
      boolean that_present_timestamp = true;
      if (this_present_timestamp || that_present_timestamp) {
        if (!(this_present_timestamp && that_present_timestamp))
          return false;
        if (this.timestamp != that.timestamp)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(retireItemOn_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      retireItemOn_args typedOther = (retireItemOn_args)other;

      lastComparison = Boolean.valueOf(isSetItem_id()).compareTo(isSetItem_id());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(item_id, typedOther.item_id);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetTimestamp()).compareTo(isSetTimestamp());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(timestamp, typedOther.timestamp);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case ITEM_ID:
              if (field.type == TType.I64) {
                this.item_id = iprot.readI64();
                setItem_idIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case TIMESTAMP:
              if (field.type == TType.I64) {
                this.timestamp = iprot.readI64();
                setTimestampIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(ITEM_ID_FIELD_DESC);
      oprot.writeI64(this.item_id);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(TIMESTAMP_FIELD_DESC);
      oprot.writeI64(this.timestamp);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("retireItemOn_args(");
      boolean first = true;

      sb.append("item_id:");
      sb.append(this.item_id);
      first = false;
      if (!first) sb.append(", ");
      sb.append("timestamp:");
      sb.append(this.timestamp);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class retireItemOn_result implements TBase<retireItemOn_result._Fields>, java.io.Serializable, Cloneable, Comparable<retireItemOn_result>   {
    private static final TStruct STRUCT_DESC = new TStruct("retireItemOn_result");

    private static final TField CEX_FIELD_DESC = new TField("cex", TType.STRUCT, (short)1);

    private CatalogServiceException cex;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      CEX((short)1, "cex");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.CEX, new FieldMetaData("cex", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(retireItemOn_result.class, metaDataMap);
    }

    public retireItemOn_result() {
    }

    public retireItemOn_result(
      CatalogServiceException cex)
    {
      this();
      this.cex = cex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public retireItemOn_result(retireItemOn_result other) {
      if (other.isSetCex()) {
        this.cex = new CatalogServiceException(other.cex);
      }
    }

    public retireItemOn_result deepCopy() {
      return new retireItemOn_result(this);
    }

    @Deprecated
    public retireItemOn_result clone() {
      return new retireItemOn_result(this);
    }

    public CatalogServiceException getCex() {
      return this.cex;
    }

    public retireItemOn_result setCex(CatalogServiceException cex) {
      this.cex = cex;
      return this;
    }

    public void unsetCex() {
      this.cex = null;
    }

    /** Returns true if field cex is set (has been asigned a value) and false otherwise */
    public boolean isSetCex() {
      return this.cex != null;
    }

    public void setCexIsSet(boolean value) {
      if (!value) {
        this.cex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case CEX:
        if (value == null) {
          unsetCex();
        } else {
          setCex((CatalogServiceException)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case CEX:
        return getCex();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case CEX:
        return isSetCex();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof retireItemOn_result)
        return this.equals((retireItemOn_result)that);
      return false;
    }

    public boolean equals(retireItemOn_result that) {
      if (that == null)
        return false;

      boolean this_present_cex = true && this.isSetCex();
      boolean that_present_cex = true && that.isSetCex();
      if (this_present_cex || that_present_cex) {
        if (!(this_present_cex && that_present_cex))
          return false;
        if (!this.cex.equals(that.cex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(retireItemOn_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      retireItemOn_result typedOther = (retireItemOn_result)other;

      lastComparison = Boolean.valueOf(isSetCex()).compareTo(isSetCex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(cex, typedOther.cex);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case CEX:
              if (field.type == TType.STRUCT) {
                this.cex = new CatalogServiceException();
                this.cex.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetCex()) {
        oprot.writeFieldBegin(CEX_FIELD_DESC);
        this.cex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("retireItemOn_result(");
      boolean first = true;

      sb.append("cex:");
      if (this.cex == null) {
        sb.append("null");
      } else {
        sb.append(this.cex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class changeItemStatus_args implements TBase<changeItemStatus_args._Fields>, java.io.Serializable, Cloneable, Comparable<changeItemStatus_args>   {
    private static final TStruct STRUCT_DESC = new TStruct("changeItemStatus_args");

    private static final TField ITEM_ID_FIELD_DESC = new TField("item_id", TType.I64, (short)1);
    private static final TField TIMESTAMP_FIELD_DESC = new TField("timestamp", TType.I64, (short)2);
    private static final TField NEWSTATUS_FIELD_DESC = new TField("newstatus", TType.I32, (short)3);

    private long item_id;
    private long timestamp;
    private status newstatus;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      ITEM_ID((short)1, "item_id"),
      TIMESTAMP((short)2, "timestamp"),
      /**
       * 
       * @see status
       */
      NEWSTATUS((short)3, "newstatus");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __ITEM_ID_ISSET_ID = 0;
    private static final int __TIMESTAMP_ISSET_ID = 1;
    private BitSet __isset_bit_vector = new BitSet(2);

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.ITEM_ID, new FieldMetaData("item_id", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
      put(_Fields.TIMESTAMP, new FieldMetaData("timestamp", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
      put(_Fields.NEWSTATUS, new FieldMetaData("newstatus", TFieldRequirementType.DEFAULT, 
          new EnumMetaData(TType.ENUM, status.class)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(changeItemStatus_args.class, metaDataMap);
    }

    public changeItemStatus_args() {
    }

    public changeItemStatus_args(
      long item_id,
      long timestamp,
      status newstatus)
    {
      this();
      this.item_id = item_id;
      setItem_idIsSet(true);
      this.timestamp = timestamp;
      setTimestampIsSet(true);
      this.newstatus = newstatus;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public changeItemStatus_args(changeItemStatus_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.item_id = other.item_id;
      this.timestamp = other.timestamp;
      if (other.isSetNewstatus()) {
        this.newstatus = other.newstatus;
      }
    }

    public changeItemStatus_args deepCopy() {
      return new changeItemStatus_args(this);
    }

    @Deprecated
    public changeItemStatus_args clone() {
      return new changeItemStatus_args(this);
    }

    public long getItem_id() {
      return this.item_id;
    }

    public changeItemStatus_args setItem_id(long item_id) {
      this.item_id = item_id;
      setItem_idIsSet(true);
      return this;
    }

    public void unsetItem_id() {
      __isset_bit_vector.clear(__ITEM_ID_ISSET_ID);
    }

    /** Returns true if field item_id is set (has been asigned a value) and false otherwise */
    public boolean isSetItem_id() {
      return __isset_bit_vector.get(__ITEM_ID_ISSET_ID);
    }

    public void setItem_idIsSet(boolean value) {
      __isset_bit_vector.set(__ITEM_ID_ISSET_ID, value);
    }

    public long getTimestamp() {
      return this.timestamp;
    }

    public changeItemStatus_args setTimestamp(long timestamp) {
      this.timestamp = timestamp;
      setTimestampIsSet(true);
      return this;
    }

    public void unsetTimestamp() {
      __isset_bit_vector.clear(__TIMESTAMP_ISSET_ID);
    }

    /** Returns true if field timestamp is set (has been asigned a value) and false otherwise */
    public boolean isSetTimestamp() {
      return __isset_bit_vector.get(__TIMESTAMP_ISSET_ID);
    }

    public void setTimestampIsSet(boolean value) {
      __isset_bit_vector.set(__TIMESTAMP_ISSET_ID, value);
    }

    /**
     * 
     * @see status
     */
    public status getNewstatus() {
      return this.newstatus;
    }

    /**
     * 
     * @see status
     */
    public changeItemStatus_args setNewstatus(status newstatus) {
      this.newstatus = newstatus;
      return this;
    }

    public void unsetNewstatus() {
      this.newstatus = null;
    }

    /** Returns true if field newstatus is set (has been asigned a value) and false otherwise */
    public boolean isSetNewstatus() {
      return this.newstatus != null;
    }

    public void setNewstatusIsSet(boolean value) {
      if (!value) {
        this.newstatus = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case ITEM_ID:
        if (value == null) {
          unsetItem_id();
        } else {
          setItem_id((Long)value);
        }
        break;

      case TIMESTAMP:
        if (value == null) {
          unsetTimestamp();
        } else {
          setTimestamp((Long)value);
        }
        break;

      case NEWSTATUS:
        if (value == null) {
          unsetNewstatus();
        } else {
          setNewstatus((status)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case ITEM_ID:
        return new Long(getItem_id());

      case TIMESTAMP:
        return new Long(getTimestamp());

      case NEWSTATUS:
        return getNewstatus();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case ITEM_ID:
        return isSetItem_id();
      case TIMESTAMP:
        return isSetTimestamp();
      case NEWSTATUS:
        return isSetNewstatus();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof changeItemStatus_args)
        return this.equals((changeItemStatus_args)that);
      return false;
    }

    public boolean equals(changeItemStatus_args that) {
      if (that == null)
        return false;

      boolean this_present_item_id = true;
      boolean that_present_item_id = true;
      if (this_present_item_id || that_present_item_id) {
        if (!(this_present_item_id && that_present_item_id))
          return false;
        if (this.item_id != that.item_id)
          return false;
      }

      boolean this_present_timestamp = true;
      boolean that_present_timestamp = true;
      if (this_present_timestamp || that_present_timestamp) {
        if (!(this_present_timestamp && that_present_timestamp))
          return false;
        if (this.timestamp != that.timestamp)
          return false;
      }

      boolean this_present_newstatus = true && this.isSetNewstatus();
      boolean that_present_newstatus = true && that.isSetNewstatus();
      if (this_present_newstatus || that_present_newstatus) {
        if (!(this_present_newstatus && that_present_newstatus))
          return false;
        if (!this.newstatus.equals(that.newstatus))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(changeItemStatus_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      changeItemStatus_args typedOther = (changeItemStatus_args)other;

      lastComparison = Boolean.valueOf(isSetItem_id()).compareTo(isSetItem_id());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(item_id, typedOther.item_id);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetTimestamp()).compareTo(isSetTimestamp());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(timestamp, typedOther.timestamp);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetNewstatus()).compareTo(isSetNewstatus());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(newstatus, typedOther.newstatus);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case ITEM_ID:
              if (field.type == TType.I64) {
                this.item_id = iprot.readI64();
                setItem_idIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case TIMESTAMP:
              if (field.type == TType.I64) {
                this.timestamp = iprot.readI64();
                setTimestampIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case NEWSTATUS:
              if (field.type == TType.I32) {
                this.newstatus = status.findByValue(iprot.readI32());
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(ITEM_ID_FIELD_DESC);
      oprot.writeI64(this.item_id);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(TIMESTAMP_FIELD_DESC);
      oprot.writeI64(this.timestamp);
      oprot.writeFieldEnd();
      if (this.newstatus != null) {
        oprot.writeFieldBegin(NEWSTATUS_FIELD_DESC);
        oprot.writeI32(this.newstatus.getValue());
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("changeItemStatus_args(");
      boolean first = true;

      sb.append("item_id:");
      sb.append(this.item_id);
      first = false;
      if (!first) sb.append(", ");
      sb.append("timestamp:");
      sb.append(this.timestamp);
      first = false;
      if (!first) sb.append(", ");
      sb.append("newstatus:");
      if (this.newstatus == null) {
        sb.append("null");
      } else {
        String newstatus_name = newstatus.name();
        if (newstatus_name != null) {
          sb.append(newstatus_name);
          sb.append(" (");
        }
        sb.append(this.newstatus);
        if (newstatus_name != null) {
          sb.append(")");
        }
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class changeItemStatus_result implements TBase<changeItemStatus_result._Fields>, java.io.Serializable, Cloneable, Comparable<changeItemStatus_result>   {
    private static final TStruct STRUCT_DESC = new TStruct("changeItemStatus_result");

    private static final TField CEX_FIELD_DESC = new TField("cex", TType.STRUCT, (short)1);

    private CatalogServiceException cex;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      CEX((short)1, "cex");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.CEX, new FieldMetaData("cex", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(changeItemStatus_result.class, metaDataMap);
    }

    public changeItemStatus_result() {
    }

    public changeItemStatus_result(
      CatalogServiceException cex)
    {
      this();
      this.cex = cex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public changeItemStatus_result(changeItemStatus_result other) {
      if (other.isSetCex()) {
        this.cex = new CatalogServiceException(other.cex);
      }
    }

    public changeItemStatus_result deepCopy() {
      return new changeItemStatus_result(this);
    }

    @Deprecated
    public changeItemStatus_result clone() {
      return new changeItemStatus_result(this);
    }

    public CatalogServiceException getCex() {
      return this.cex;
    }

    public changeItemStatus_result setCex(CatalogServiceException cex) {
      this.cex = cex;
      return this;
    }

    public void unsetCex() {
      this.cex = null;
    }

    /** Returns true if field cex is set (has been asigned a value) and false otherwise */
    public boolean isSetCex() {
      return this.cex != null;
    }

    public void setCexIsSet(boolean value) {
      if (!value) {
        this.cex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case CEX:
        if (value == null) {
          unsetCex();
        } else {
          setCex((CatalogServiceException)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case CEX:
        return getCex();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case CEX:
        return isSetCex();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof changeItemStatus_result)
        return this.equals((changeItemStatus_result)that);
      return false;
    }

    public boolean equals(changeItemStatus_result that) {
      if (that == null)
        return false;

      boolean this_present_cex = true && this.isSetCex();
      boolean that_present_cex = true && that.isSetCex();
      if (this_present_cex || that_present_cex) {
        if (!(this_present_cex && that_present_cex))
          return false;
        if (!this.cex.equals(that.cex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(changeItemStatus_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      changeItemStatus_result typedOther = (changeItemStatus_result)other;

      lastComparison = Boolean.valueOf(isSetCex()).compareTo(isSetCex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(cex, typedOther.cex);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case CEX:
              if (field.type == TType.STRUCT) {
                this.cex = new CatalogServiceException();
                this.cex.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetCex()) {
        oprot.writeFieldBegin(CEX_FIELD_DESC);
        this.cex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("changeItemStatus_result(");
      boolean first = true;

      sb.append("cex:");
      if (this.cex == null) {
        sb.append("null");
      } else {
        sb.append(this.cex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class getCategory_args implements TBase<getCategory_args._Fields>, java.io.Serializable, Cloneable, Comparable<getCategory_args>   {
    private static final TStruct STRUCT_DESC = new TStruct("getCategory_args");

    private static final TField ID_FIELD_DESC = new TField("id", TType.I64, (short)1);

    private long id;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      ID((short)1, "id");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __ID_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.ID, new FieldMetaData("id", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(getCategory_args.class, metaDataMap);
    }

    public getCategory_args() {
    }

    public getCategory_args(
      long id)
    {
      this();
      this.id = id;
      setIdIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getCategory_args(getCategory_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.id = other.id;
    }

    public getCategory_args deepCopy() {
      return new getCategory_args(this);
    }

    @Deprecated
    public getCategory_args clone() {
      return new getCategory_args(this);
    }

    public long getId() {
      return this.id;
    }

    public getCategory_args setId(long id) {
      this.id = id;
      setIdIsSet(true);
      return this;
    }

    public void unsetId() {
      __isset_bit_vector.clear(__ID_ISSET_ID);
    }

    /** Returns true if field id is set (has been asigned a value) and false otherwise */
    public boolean isSetId() {
      return __isset_bit_vector.get(__ID_ISSET_ID);
    }

    public void setIdIsSet(boolean value) {
      __isset_bit_vector.set(__ID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case ID:
        if (value == null) {
          unsetId();
        } else {
          setId((Long)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case ID:
        return new Long(getId());

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case ID:
        return isSetId();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getCategory_args)
        return this.equals((getCategory_args)that);
      return false;
    }

    public boolean equals(getCategory_args that) {
      if (that == null)
        return false;

      boolean this_present_id = true;
      boolean that_present_id = true;
      if (this_present_id || that_present_id) {
        if (!(this_present_id && that_present_id))
          return false;
        if (this.id != that.id)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getCategory_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getCategory_args typedOther = (getCategory_args)other;

      lastComparison = Boolean.valueOf(isSetId()).compareTo(isSetId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(id, typedOther.id);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case ID:
              if (field.type == TType.I64) {
                this.id = iprot.readI64();
                setIdIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(ID_FIELD_DESC);
      oprot.writeI64(this.id);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getCategory_args(");
      boolean first = true;

      sb.append("id:");
      sb.append(this.id);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class getCategory_result implements TBase<getCategory_result._Fields>, java.io.Serializable, Cloneable, Comparable<getCategory_result>   {
    private static final TStruct STRUCT_DESC = new TStruct("getCategory_result");

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRUCT, (short)0);
    private static final TField CEX_FIELD_DESC = new TField("cex", TType.STRUCT, (short)1);

    private Category success;
    private CatalogServiceException cex;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      SUCCESS((short)0, "success"),
      CEX((short)1, "cex");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
          new StructMetaData(TType.STRUCT, Category.class)));
      put(_Fields.CEX, new FieldMetaData("cex", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(getCategory_result.class, metaDataMap);
    }

    public getCategory_result() {
    }

    public getCategory_result(
      Category success,
      CatalogServiceException cex)
    {
      this();
      this.success = success;
      this.cex = cex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getCategory_result(getCategory_result other) {
      if (other.isSetSuccess()) {
        this.success = new Category(other.success);
      }
      if (other.isSetCex()) {
        this.cex = new CatalogServiceException(other.cex);
      }
    }

    public getCategory_result deepCopy() {
      return new getCategory_result(this);
    }

    @Deprecated
    public getCategory_result clone() {
      return new getCategory_result(this);
    }

    public Category getSuccess() {
      return this.success;
    }

    public getCategory_result setSuccess(Category success) {
      this.success = success;
      return this;
    }

    public void unsetSuccess() {
      this.success = null;
    }

    /** Returns true if field success is set (has been asigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return this.success != null;
    }

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public CatalogServiceException getCex() {
      return this.cex;
    }

    public getCategory_result setCex(CatalogServiceException cex) {
      this.cex = cex;
      return this;
    }

    public void unsetCex() {
      this.cex = null;
    }

    /** Returns true if field cex is set (has been asigned a value) and false otherwise */
    public boolean isSetCex() {
      return this.cex != null;
    }

    public void setCexIsSet(boolean value) {
      if (!value) {
        this.cex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((Category)value);
        }
        break;

      case CEX:
        if (value == null) {
          unsetCex();
        } else {
          setCex((CatalogServiceException)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case CEX:
        return getCex();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case CEX:
        return isSetCex();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getCategory_result)
        return this.equals((getCategory_result)that);
      return false;
    }

    public boolean equals(getCategory_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      boolean this_present_cex = true && this.isSetCex();
      boolean that_present_cex = true && that.isSetCex();
      if (this_present_cex || that_present_cex) {
        if (!(this_present_cex && that_present_cex))
          return false;
        if (!this.cex.equals(that.cex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getCategory_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getCategory_result typedOther = (getCategory_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetCex()).compareTo(isSetCex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(cex, typedOther.cex);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case SUCCESS:
              if (field.type == TType.STRUCT) {
                this.success = new Category();
                this.success.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case CEX:
              if (field.type == TType.STRUCT) {
                this.cex = new CatalogServiceException();
                this.cex.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        this.success.write(oprot);
        oprot.writeFieldEnd();
      } else if (this.isSetCex()) {
        oprot.writeFieldBegin(CEX_FIELD_DESC);
        this.cex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getCategory_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("cex:");
      if (this.cex == null) {
        sb.append("null");
      } else {
        sb.append(this.cex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class getAllCategories_args implements TBase<getAllCategories_args._Fields>, java.io.Serializable, Cloneable, Comparable<getAllCategories_args>   {
    private static final TStruct STRUCT_DESC = new TStruct("getAllCategories_args");

    private static final TField IS_ACTIVE_FIELD_DESC = new TField("isActive", TType.BOOL, (short)1);

    private boolean isActive;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      IS_ACTIVE((short)1, "isActive");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __ISACTIVE_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.IS_ACTIVE, new FieldMetaData("isActive", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.BOOL)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(getAllCategories_args.class, metaDataMap);
    }

    public getAllCategories_args() {
    }

    public getAllCategories_args(
      boolean isActive)
    {
      this();
      this.isActive = isActive;
      setIsActiveIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getAllCategories_args(getAllCategories_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.isActive = other.isActive;
    }

    public getAllCategories_args deepCopy() {
      return new getAllCategories_args(this);
    }

    @Deprecated
    public getAllCategories_args clone() {
      return new getAllCategories_args(this);
    }

    public boolean isIsActive() {
      return this.isActive;
    }

    public getAllCategories_args setIsActive(boolean isActive) {
      this.isActive = isActive;
      setIsActiveIsSet(true);
      return this;
    }

    public void unsetIsActive() {
      __isset_bit_vector.clear(__ISACTIVE_ISSET_ID);
    }

    /** Returns true if field isActive is set (has been asigned a value) and false otherwise */
    public boolean isSetIsActive() {
      return __isset_bit_vector.get(__ISACTIVE_ISSET_ID);
    }

    public void setIsActiveIsSet(boolean value) {
      __isset_bit_vector.set(__ISACTIVE_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case IS_ACTIVE:
        if (value == null) {
          unsetIsActive();
        } else {
          setIsActive((Boolean)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case IS_ACTIVE:
        return new Boolean(isIsActive());

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case IS_ACTIVE:
        return isSetIsActive();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getAllCategories_args)
        return this.equals((getAllCategories_args)that);
      return false;
    }

    public boolean equals(getAllCategories_args that) {
      if (that == null)
        return false;

      boolean this_present_isActive = true;
      boolean that_present_isActive = true;
      if (this_present_isActive || that_present_isActive) {
        if (!(this_present_isActive && that_present_isActive))
          return false;
        if (this.isActive != that.isActive)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getAllCategories_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getAllCategories_args typedOther = (getAllCategories_args)other;

      lastComparison = Boolean.valueOf(isSetIsActive()).compareTo(isSetIsActive());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(isActive, typedOther.isActive);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case IS_ACTIVE:
              if (field.type == TType.BOOL) {
                this.isActive = iprot.readBool();
                setIsActiveIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(IS_ACTIVE_FIELD_DESC);
      oprot.writeBool(this.isActive);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getAllCategories_args(");
      boolean first = true;

      sb.append("isActive:");
      sb.append(this.isActive);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class getAllCategories_result implements TBase<getAllCategories_result._Fields>, java.io.Serializable, Cloneable, Comparable<getAllCategories_result>   {
    private static final TStruct STRUCT_DESC = new TStruct("getAllCategories_result");

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0);
    private static final TField CEX_FIELD_DESC = new TField("cex", TType.STRUCT, (short)1);

    private List<Category> success;
    private CatalogServiceException cex;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      SUCCESS((short)0, "success"),
      CEX((short)1, "cex");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
          new ListMetaData(TType.LIST, 
              new StructMetaData(TType.STRUCT, Category.class))));
      put(_Fields.CEX, new FieldMetaData("cex", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(getAllCategories_result.class, metaDataMap);
    }

    public getAllCategories_result() {
    }

    public getAllCategories_result(
      List<Category> success,
      CatalogServiceException cex)
    {
      this();
      this.success = success;
      this.cex = cex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getAllCategories_result(getAllCategories_result other) {
      if (other.isSetSuccess()) {
        List<Category> __this__success = new ArrayList<Category>();
        for (Category other_element : other.success) {
          __this__success.add(new Category(other_element));
        }
        this.success = __this__success;
      }
      if (other.isSetCex()) {
        this.cex = new CatalogServiceException(other.cex);
      }
    }

    public getAllCategories_result deepCopy() {
      return new getAllCategories_result(this);
    }

    @Deprecated
    public getAllCategories_result clone() {
      return new getAllCategories_result(this);
    }

    public int getSuccessSize() {
      return (this.success == null) ? 0 : this.success.size();
    }

    public java.util.Iterator<Category> getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(Category elem) {
      if (this.success == null) {
        this.success = new ArrayList<Category>();
      }
      this.success.add(elem);
    }

    public List<Category> getSuccess() {
      return this.success;
    }

    public getAllCategories_result setSuccess(List<Category> success) {
      this.success = success;
      return this;
    }

    public void unsetSuccess() {
      this.success = null;
    }

    /** Returns true if field success is set (has been asigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return this.success != null;
    }

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public CatalogServiceException getCex() {
      return this.cex;
    }

    public getAllCategories_result setCex(CatalogServiceException cex) {
      this.cex = cex;
      return this;
    }

    public void unsetCex() {
      this.cex = null;
    }

    /** Returns true if field cex is set (has been asigned a value) and false otherwise */
    public boolean isSetCex() {
      return this.cex != null;
    }

    public void setCexIsSet(boolean value) {
      if (!value) {
        this.cex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((List<Category>)value);
        }
        break;

      case CEX:
        if (value == null) {
          unsetCex();
        } else {
          setCex((CatalogServiceException)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case CEX:
        return getCex();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case CEX:
        return isSetCex();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getAllCategories_result)
        return this.equals((getAllCategories_result)that);
      return false;
    }

    public boolean equals(getAllCategories_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      boolean this_present_cex = true && this.isSetCex();
      boolean that_present_cex = true && that.isSetCex();
      if (this_present_cex || that_present_cex) {
        if (!(this_present_cex && that_present_cex))
          return false;
        if (!this.cex.equals(that.cex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getAllCategories_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getAllCategories_result typedOther = (getAllCategories_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetCex()).compareTo(isSetCex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(cex, typedOther.cex);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case SUCCESS:
              if (field.type == TType.LIST) {
                {
                  TList _list18 = iprot.readListBegin();
                  this.success = new ArrayList<Category>(_list18.size);
                  for (int _i19 = 0; _i19 < _list18.size; ++_i19)
                  {
                    Category _elem20;
                    _elem20 = new Category();
                    _elem20.read(iprot);
                    this.success.add(_elem20);
                  }
                  iprot.readListEnd();
                }
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case CEX:
              if (field.type == TType.STRUCT) {
                this.cex = new CatalogServiceException();
                this.cex.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        {
          oprot.writeListBegin(new TList(TType.STRUCT, this.success.size()));
          for (Category _iter21 : this.success)
          {
            _iter21.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      } else if (this.isSetCex()) {
        oprot.writeFieldBegin(CEX_FIELD_DESC);
        this.cex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getAllCategories_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("cex:");
      if (this.cex == null) {
        sb.append("null");
      } else {
        sb.append(this.cex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class getItem_args implements TBase<getItem_args._Fields>, java.io.Serializable, Cloneable, Comparable<getItem_args>   {
    private static final TStruct STRUCT_DESC = new TStruct("getItem_args");

    private static final TField ITEM_ID_FIELD_DESC = new TField("item_id", TType.I64, (short)1);

    private long item_id;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      ITEM_ID((short)1, "item_id");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __ITEM_ID_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.ITEM_ID, new FieldMetaData("item_id", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(getItem_args.class, metaDataMap);
    }

    public getItem_args() {
    }

    public getItem_args(
      long item_id)
    {
      this();
      this.item_id = item_id;
      setItem_idIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getItem_args(getItem_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.item_id = other.item_id;
    }

    public getItem_args deepCopy() {
      return new getItem_args(this);
    }

    @Deprecated
    public getItem_args clone() {
      return new getItem_args(this);
    }

    public long getItem_id() {
      return this.item_id;
    }

    public getItem_args setItem_id(long item_id) {
      this.item_id = item_id;
      setItem_idIsSet(true);
      return this;
    }

    public void unsetItem_id() {
      __isset_bit_vector.clear(__ITEM_ID_ISSET_ID);
    }

    /** Returns true if field item_id is set (has been asigned a value) and false otherwise */
    public boolean isSetItem_id() {
      return __isset_bit_vector.get(__ITEM_ID_ISSET_ID);
    }

    public void setItem_idIsSet(boolean value) {
      __isset_bit_vector.set(__ITEM_ID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case ITEM_ID:
        if (value == null) {
          unsetItem_id();
        } else {
          setItem_id((Long)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case ITEM_ID:
        return new Long(getItem_id());

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case ITEM_ID:
        return isSetItem_id();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getItem_args)
        return this.equals((getItem_args)that);
      return false;
    }

    public boolean equals(getItem_args that) {
      if (that == null)
        return false;

      boolean this_present_item_id = true;
      boolean that_present_item_id = true;
      if (this_present_item_id || that_present_item_id) {
        if (!(this_present_item_id && that_present_item_id))
          return false;
        if (this.item_id != that.item_id)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getItem_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getItem_args typedOther = (getItem_args)other;

      lastComparison = Boolean.valueOf(isSetItem_id()).compareTo(isSetItem_id());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(item_id, typedOther.item_id);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case ITEM_ID:
              if (field.type == TType.I64) {
                this.item_id = iprot.readI64();
                setItem_idIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(ITEM_ID_FIELD_DESC);
      oprot.writeI64(this.item_id);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getItem_args(");
      boolean first = true;

      sb.append("item_id:");
      sb.append(this.item_id);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class getItem_result implements TBase<getItem_result._Fields>, java.io.Serializable, Cloneable   {
    private static final TStruct STRUCT_DESC = new TStruct("getItem_result");

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRUCT, (short)0);
    private static final TField CEX_FIELD_DESC = new TField("cex", TType.STRUCT, (short)1);

    private Item success;
    private CatalogServiceException cex;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      SUCCESS((short)0, "success"),
      CEX((short)1, "cex");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
          new StructMetaData(TType.STRUCT, Item.class)));
      put(_Fields.CEX, new FieldMetaData("cex", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(getItem_result.class, metaDataMap);
    }

    public getItem_result() {
    }

    public getItem_result(
      Item success,
      CatalogServiceException cex)
    {
      this();
      this.success = success;
      this.cex = cex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getItem_result(getItem_result other) {
      if (other.isSetSuccess()) {
        this.success = new Item(other.success);
      }
      if (other.isSetCex()) {
        this.cex = new CatalogServiceException(other.cex);
      }
    }

    public getItem_result deepCopy() {
      return new getItem_result(this);
    }

    @Deprecated
    public getItem_result clone() {
      return new getItem_result(this);
    }

    public Item getSuccess() {
      return this.success;
    }

    public getItem_result setSuccess(Item success) {
      this.success = success;
      return this;
    }

    public void unsetSuccess() {
      this.success = null;
    }

    /** Returns true if field success is set (has been asigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return this.success != null;
    }

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public CatalogServiceException getCex() {
      return this.cex;
    }

    public getItem_result setCex(CatalogServiceException cex) {
      this.cex = cex;
      return this;
    }

    public void unsetCex() {
      this.cex = null;
    }

    /** Returns true if field cex is set (has been asigned a value) and false otherwise */
    public boolean isSetCex() {
      return this.cex != null;
    }

    public void setCexIsSet(boolean value) {
      if (!value) {
        this.cex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((Item)value);
        }
        break;

      case CEX:
        if (value == null) {
          unsetCex();
        } else {
          setCex((CatalogServiceException)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case CEX:
        return getCex();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case CEX:
        return isSetCex();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getItem_result)
        return this.equals((getItem_result)that);
      return false;
    }

    public boolean equals(getItem_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      boolean this_present_cex = true && this.isSetCex();
      boolean that_present_cex = true && that.isSetCex();
      if (this_present_cex || that_present_cex) {
        if (!(this_present_cex && that_present_cex))
          return false;
        if (!this.cex.equals(that.cex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case SUCCESS:
              if (field.type == TType.STRUCT) {
                this.success = new Item();
                this.success.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case CEX:
              if (field.type == TType.STRUCT) {
                this.cex = new CatalogServiceException();
                this.cex.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        this.success.write(oprot);
        oprot.writeFieldEnd();
      } else if (this.isSetCex()) {
        oprot.writeFieldBegin(CEX_FIELD_DESC);
        this.cex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getItem_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("cex:");
      if (this.cex == null) {
        sb.append("null");
      } else {
        sb.append(this.cex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class getAllItemsForCategory_args implements TBase<getAllItemsForCategory_args._Fields>, java.io.Serializable, Cloneable, Comparable<getAllItemsForCategory_args>   {
    private static final TStruct STRUCT_DESC = new TStruct("getAllItemsForCategory_args");

    private static final TField CATEGORY_ID_FIELD_DESC = new TField("category_id", TType.I64, (short)1);
    private static final TField IS_ACTIVE_FIELD_DESC = new TField("isActive", TType.BOOL, (short)2);

    private long category_id;
    private boolean isActive;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      CATEGORY_ID((short)1, "category_id"),
      IS_ACTIVE((short)2, "isActive");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __CATEGORY_ID_ISSET_ID = 0;
    private static final int __ISACTIVE_ISSET_ID = 1;
    private BitSet __isset_bit_vector = new BitSet(2);

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.CATEGORY_ID, new FieldMetaData("category_id", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
      put(_Fields.IS_ACTIVE, new FieldMetaData("isActive", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.BOOL)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(getAllItemsForCategory_args.class, metaDataMap);
    }

    public getAllItemsForCategory_args() {
    }

    public getAllItemsForCategory_args(
      long category_id,
      boolean isActive)
    {
      this();
      this.category_id = category_id;
      setCategory_idIsSet(true);
      this.isActive = isActive;
      setIsActiveIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getAllItemsForCategory_args(getAllItemsForCategory_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.category_id = other.category_id;
      this.isActive = other.isActive;
    }

    public getAllItemsForCategory_args deepCopy() {
      return new getAllItemsForCategory_args(this);
    }

    @Deprecated
    public getAllItemsForCategory_args clone() {
      return new getAllItemsForCategory_args(this);
    }

    public long getCategory_id() {
      return this.category_id;
    }

    public getAllItemsForCategory_args setCategory_id(long category_id) {
      this.category_id = category_id;
      setCategory_idIsSet(true);
      return this;
    }

    public void unsetCategory_id() {
      __isset_bit_vector.clear(__CATEGORY_ID_ISSET_ID);
    }

    /** Returns true if field category_id is set (has been asigned a value) and false otherwise */
    public boolean isSetCategory_id() {
      return __isset_bit_vector.get(__CATEGORY_ID_ISSET_ID);
    }

    public void setCategory_idIsSet(boolean value) {
      __isset_bit_vector.set(__CATEGORY_ID_ISSET_ID, value);
    }

    public boolean isIsActive() {
      return this.isActive;
    }

    public getAllItemsForCategory_args setIsActive(boolean isActive) {
      this.isActive = isActive;
      setIsActiveIsSet(true);
      return this;
    }

    public void unsetIsActive() {
      __isset_bit_vector.clear(__ISACTIVE_ISSET_ID);
    }

    /** Returns true if field isActive is set (has been asigned a value) and false otherwise */
    public boolean isSetIsActive() {
      return __isset_bit_vector.get(__ISACTIVE_ISSET_ID);
    }

    public void setIsActiveIsSet(boolean value) {
      __isset_bit_vector.set(__ISACTIVE_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case CATEGORY_ID:
        if (value == null) {
          unsetCategory_id();
        } else {
          setCategory_id((Long)value);
        }
        break;

      case IS_ACTIVE:
        if (value == null) {
          unsetIsActive();
        } else {
          setIsActive((Boolean)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case CATEGORY_ID:
        return new Long(getCategory_id());

      case IS_ACTIVE:
        return new Boolean(isIsActive());

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case CATEGORY_ID:
        return isSetCategory_id();
      case IS_ACTIVE:
        return isSetIsActive();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getAllItemsForCategory_args)
        return this.equals((getAllItemsForCategory_args)that);
      return false;
    }

    public boolean equals(getAllItemsForCategory_args that) {
      if (that == null)
        return false;

      boolean this_present_category_id = true;
      boolean that_present_category_id = true;
      if (this_present_category_id || that_present_category_id) {
        if (!(this_present_category_id && that_present_category_id))
          return false;
        if (this.category_id != that.category_id)
          return false;
      }

      boolean this_present_isActive = true;
      boolean that_present_isActive = true;
      if (this_present_isActive || that_present_isActive) {
        if (!(this_present_isActive && that_present_isActive))
          return false;
        if (this.isActive != that.isActive)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getAllItemsForCategory_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getAllItemsForCategory_args typedOther = (getAllItemsForCategory_args)other;

      lastComparison = Boolean.valueOf(isSetCategory_id()).compareTo(isSetCategory_id());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(category_id, typedOther.category_id);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetIsActive()).compareTo(isSetIsActive());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(isActive, typedOther.isActive);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case CATEGORY_ID:
              if (field.type == TType.I64) {
                this.category_id = iprot.readI64();
                setCategory_idIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case IS_ACTIVE:
              if (field.type == TType.BOOL) {
                this.isActive = iprot.readBool();
                setIsActiveIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(CATEGORY_ID_FIELD_DESC);
      oprot.writeI64(this.category_id);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(IS_ACTIVE_FIELD_DESC);
      oprot.writeBool(this.isActive);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getAllItemsForCategory_args(");
      boolean first = true;

      sb.append("category_id:");
      sb.append(this.category_id);
      first = false;
      if (!first) sb.append(", ");
      sb.append("isActive:");
      sb.append(this.isActive);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class getAllItemsForCategory_result implements TBase<getAllItemsForCategory_result._Fields>, java.io.Serializable, Cloneable   {
    private static final TStruct STRUCT_DESC = new TStruct("getAllItemsForCategory_result");

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0);
    private static final TField CEX_FIELD_DESC = new TField("cex", TType.STRUCT, (short)1);

    private List<Item> success;
    private CatalogServiceException cex;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      SUCCESS((short)0, "success"),
      CEX((short)1, "cex");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
          new ListMetaData(TType.LIST, 
              new StructMetaData(TType.STRUCT, Item.class))));
      put(_Fields.CEX, new FieldMetaData("cex", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(getAllItemsForCategory_result.class, metaDataMap);
    }

    public getAllItemsForCategory_result() {
    }

    public getAllItemsForCategory_result(
      List<Item> success,
      CatalogServiceException cex)
    {
      this();
      this.success = success;
      this.cex = cex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getAllItemsForCategory_result(getAllItemsForCategory_result other) {
      if (other.isSetSuccess()) {
        List<Item> __this__success = new ArrayList<Item>();
        for (Item other_element : other.success) {
          __this__success.add(new Item(other_element));
        }
        this.success = __this__success;
      }
      if (other.isSetCex()) {
        this.cex = new CatalogServiceException(other.cex);
      }
    }

    public getAllItemsForCategory_result deepCopy() {
      return new getAllItemsForCategory_result(this);
    }

    @Deprecated
    public getAllItemsForCategory_result clone() {
      return new getAllItemsForCategory_result(this);
    }

    public int getSuccessSize() {
      return (this.success == null) ? 0 : this.success.size();
    }

    public java.util.Iterator<Item> getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(Item elem) {
      if (this.success == null) {
        this.success = new ArrayList<Item>();
      }
      this.success.add(elem);
    }

    public List<Item> getSuccess() {
      return this.success;
    }

    public getAllItemsForCategory_result setSuccess(List<Item> success) {
      this.success = success;
      return this;
    }

    public void unsetSuccess() {
      this.success = null;
    }

    /** Returns true if field success is set (has been asigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return this.success != null;
    }

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public CatalogServiceException getCex() {
      return this.cex;
    }

    public getAllItemsForCategory_result setCex(CatalogServiceException cex) {
      this.cex = cex;
      return this;
    }

    public void unsetCex() {
      this.cex = null;
    }

    /** Returns true if field cex is set (has been asigned a value) and false otherwise */
    public boolean isSetCex() {
      return this.cex != null;
    }

    public void setCexIsSet(boolean value) {
      if (!value) {
        this.cex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((List<Item>)value);
        }
        break;

      case CEX:
        if (value == null) {
          unsetCex();
        } else {
          setCex((CatalogServiceException)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case CEX:
        return getCex();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case CEX:
        return isSetCex();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getAllItemsForCategory_result)
        return this.equals((getAllItemsForCategory_result)that);
      return false;
    }

    public boolean equals(getAllItemsForCategory_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      boolean this_present_cex = true && this.isSetCex();
      boolean that_present_cex = true && that.isSetCex();
      if (this_present_cex || that_present_cex) {
        if (!(this_present_cex && that_present_cex))
          return false;
        if (!this.cex.equals(that.cex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case SUCCESS:
              if (field.type == TType.LIST) {
                {
                  TList _list22 = iprot.readListBegin();
                  this.success = new ArrayList<Item>(_list22.size);
                  for (int _i23 = 0; _i23 < _list22.size; ++_i23)
                  {
                    Item _elem24;
                    _elem24 = new Item();
                    _elem24.read(iprot);
                    this.success.add(_elem24);
                  }
                  iprot.readListEnd();
                }
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case CEX:
              if (field.type == TType.STRUCT) {
                this.cex = new CatalogServiceException();
                this.cex.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        {
          oprot.writeListBegin(new TList(TType.STRUCT, this.success.size()));
          for (Item _iter25 : this.success)
          {
            _iter25.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      } else if (this.isSetCex()) {
        oprot.writeFieldBegin(CEX_FIELD_DESC);
        this.cex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getAllItemsForCategory_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("cex:");
      if (this.cex == null) {
        sb.append("null");
      } else {
        sb.append(this.cex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class getAllItems_args implements TBase<getAllItems_args._Fields>, java.io.Serializable, Cloneable, Comparable<getAllItems_args>   {
    private static final TStruct STRUCT_DESC = new TStruct("getAllItems_args");

    private static final TField IS_ACTIVE_FIELD_DESC = new TField("isActive", TType.BOOL, (short)1);

    private boolean isActive;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      IS_ACTIVE((short)1, "isActive");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __ISACTIVE_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.IS_ACTIVE, new FieldMetaData("isActive", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.BOOL)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(getAllItems_args.class, metaDataMap);
    }

    public getAllItems_args() {
    }

    public getAllItems_args(
      boolean isActive)
    {
      this();
      this.isActive = isActive;
      setIsActiveIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getAllItems_args(getAllItems_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.isActive = other.isActive;
    }

    public getAllItems_args deepCopy() {
      return new getAllItems_args(this);
    }

    @Deprecated
    public getAllItems_args clone() {
      return new getAllItems_args(this);
    }

    public boolean isIsActive() {
      return this.isActive;
    }

    public getAllItems_args setIsActive(boolean isActive) {
      this.isActive = isActive;
      setIsActiveIsSet(true);
      return this;
    }

    public void unsetIsActive() {
      __isset_bit_vector.clear(__ISACTIVE_ISSET_ID);
    }

    /** Returns true if field isActive is set (has been asigned a value) and false otherwise */
    public boolean isSetIsActive() {
      return __isset_bit_vector.get(__ISACTIVE_ISSET_ID);
    }

    public void setIsActiveIsSet(boolean value) {
      __isset_bit_vector.set(__ISACTIVE_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case IS_ACTIVE:
        if (value == null) {
          unsetIsActive();
        } else {
          setIsActive((Boolean)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case IS_ACTIVE:
        return new Boolean(isIsActive());

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case IS_ACTIVE:
        return isSetIsActive();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getAllItems_args)
        return this.equals((getAllItems_args)that);
      return false;
    }

    public boolean equals(getAllItems_args that) {
      if (that == null)
        return false;

      boolean this_present_isActive = true;
      boolean that_present_isActive = true;
      if (this_present_isActive || that_present_isActive) {
        if (!(this_present_isActive && that_present_isActive))
          return false;
        if (this.isActive != that.isActive)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getAllItems_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getAllItems_args typedOther = (getAllItems_args)other;

      lastComparison = Boolean.valueOf(isSetIsActive()).compareTo(isSetIsActive());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(isActive, typedOther.isActive);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case IS_ACTIVE:
              if (field.type == TType.BOOL) {
                this.isActive = iprot.readBool();
                setIsActiveIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(IS_ACTIVE_FIELD_DESC);
      oprot.writeBool(this.isActive);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getAllItems_args(");
      boolean first = true;

      sb.append("isActive:");
      sb.append(this.isActive);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class getAllItems_result implements TBase<getAllItems_result._Fields>, java.io.Serializable, Cloneable   {
    private static final TStruct STRUCT_DESC = new TStruct("getAllItems_result");

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0);
    private static final TField CEX_FIELD_DESC = new TField("cex", TType.STRUCT, (short)1);

    private List<Item> success;
    private CatalogServiceException cex;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      SUCCESS((short)0, "success"),
      CEX((short)1, "cex");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
          new ListMetaData(TType.LIST, 
              new StructMetaData(TType.STRUCT, Item.class))));
      put(_Fields.CEX, new FieldMetaData("cex", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(getAllItems_result.class, metaDataMap);
    }

    public getAllItems_result() {
    }

    public getAllItems_result(
      List<Item> success,
      CatalogServiceException cex)
    {
      this();
      this.success = success;
      this.cex = cex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getAllItems_result(getAllItems_result other) {
      if (other.isSetSuccess()) {
        List<Item> __this__success = new ArrayList<Item>();
        for (Item other_element : other.success) {
          __this__success.add(new Item(other_element));
        }
        this.success = __this__success;
      }
      if (other.isSetCex()) {
        this.cex = new CatalogServiceException(other.cex);
      }
    }

    public getAllItems_result deepCopy() {
      return new getAllItems_result(this);
    }

    @Deprecated
    public getAllItems_result clone() {
      return new getAllItems_result(this);
    }

    public int getSuccessSize() {
      return (this.success == null) ? 0 : this.success.size();
    }

    public java.util.Iterator<Item> getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(Item elem) {
      if (this.success == null) {
        this.success = new ArrayList<Item>();
      }
      this.success.add(elem);
    }

    public List<Item> getSuccess() {
      return this.success;
    }

    public getAllItems_result setSuccess(List<Item> success) {
      this.success = success;
      return this;
    }

    public void unsetSuccess() {
      this.success = null;
    }

    /** Returns true if field success is set (has been asigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return this.success != null;
    }

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public CatalogServiceException getCex() {
      return this.cex;
    }

    public getAllItems_result setCex(CatalogServiceException cex) {
      this.cex = cex;
      return this;
    }

    public void unsetCex() {
      this.cex = null;
    }

    /** Returns true if field cex is set (has been asigned a value) and false otherwise */
    public boolean isSetCex() {
      return this.cex != null;
    }

    public void setCexIsSet(boolean value) {
      if (!value) {
        this.cex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((List<Item>)value);
        }
        break;

      case CEX:
        if (value == null) {
          unsetCex();
        } else {
          setCex((CatalogServiceException)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case CEX:
        return getCex();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case CEX:
        return isSetCex();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getAllItems_result)
        return this.equals((getAllItems_result)that);
      return false;
    }

    public boolean equals(getAllItems_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      boolean this_present_cex = true && this.isSetCex();
      boolean that_present_cex = true && that.isSetCex();
      if (this_present_cex || that_present_cex) {
        if (!(this_present_cex && that_present_cex))
          return false;
        if (!this.cex.equals(that.cex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case SUCCESS:
              if (field.type == TType.LIST) {
                {
                  TList _list26 = iprot.readListBegin();
                  this.success = new ArrayList<Item>(_list26.size);
                  for (int _i27 = 0; _i27 < _list26.size; ++_i27)
                  {
                    Item _elem28;
                    _elem28 = new Item();
                    _elem28.read(iprot);
                    this.success.add(_elem28);
                  }
                  iprot.readListEnd();
                }
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case CEX:
              if (field.type == TType.STRUCT) {
                this.cex = new CatalogServiceException();
                this.cex.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        {
          oprot.writeListBegin(new TList(TType.STRUCT, this.success.size()));
          for (Item _iter29 : this.success)
          {
            _iter29.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      } else if (this.isSetCex()) {
        oprot.writeFieldBegin(CEX_FIELD_DESC);
        this.cex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getAllItems_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("cex:");
      if (this.cex == null) {
        sb.append("null");
      } else {
        sb.append(this.cex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class getAllItemsByStatus_args implements TBase<getAllItemsByStatus_args._Fields>, java.io.Serializable, Cloneable, Comparable<getAllItemsByStatus_args>   {
    private static final TStruct STRUCT_DESC = new TStruct("getAllItemsByStatus_args");

    private static final TField ITEM_STATUS_FIELD_DESC = new TField("itemStatus", TType.I32, (short)1);

    private status itemStatus;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      /**
       * 
       * @see status
       */
      ITEM_STATUS((short)1, "itemStatus");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.ITEM_STATUS, new FieldMetaData("itemStatus", TFieldRequirementType.DEFAULT, 
          new EnumMetaData(TType.ENUM, status.class)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(getAllItemsByStatus_args.class, metaDataMap);
    }

    public getAllItemsByStatus_args() {
    }

    public getAllItemsByStatus_args(
      status itemStatus)
    {
      this();
      this.itemStatus = itemStatus;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getAllItemsByStatus_args(getAllItemsByStatus_args other) {
      if (other.isSetItemStatus()) {
        this.itemStatus = other.itemStatus;
      }
    }

    public getAllItemsByStatus_args deepCopy() {
      return new getAllItemsByStatus_args(this);
    }

    @Deprecated
    public getAllItemsByStatus_args clone() {
      return new getAllItemsByStatus_args(this);
    }

    /**
     * 
     * @see status
     */
    public status getItemStatus() {
      return this.itemStatus;
    }

    /**
     * 
     * @see status
     */
    public getAllItemsByStatus_args setItemStatus(status itemStatus) {
      this.itemStatus = itemStatus;
      return this;
    }

    public void unsetItemStatus() {
      this.itemStatus = null;
    }

    /** Returns true if field itemStatus is set (has been asigned a value) and false otherwise */
    public boolean isSetItemStatus() {
      return this.itemStatus != null;
    }

    public void setItemStatusIsSet(boolean value) {
      if (!value) {
        this.itemStatus = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case ITEM_STATUS:
        if (value == null) {
          unsetItemStatus();
        } else {
          setItemStatus((status)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case ITEM_STATUS:
        return getItemStatus();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case ITEM_STATUS:
        return isSetItemStatus();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getAllItemsByStatus_args)
        return this.equals((getAllItemsByStatus_args)that);
      return false;
    }

    public boolean equals(getAllItemsByStatus_args that) {
      if (that == null)
        return false;

      boolean this_present_itemStatus = true && this.isSetItemStatus();
      boolean that_present_itemStatus = true && that.isSetItemStatus();
      if (this_present_itemStatus || that_present_itemStatus) {
        if (!(this_present_itemStatus && that_present_itemStatus))
          return false;
        if (!this.itemStatus.equals(that.itemStatus))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getAllItemsByStatus_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getAllItemsByStatus_args typedOther = (getAllItemsByStatus_args)other;

      lastComparison = Boolean.valueOf(isSetItemStatus()).compareTo(isSetItemStatus());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(itemStatus, typedOther.itemStatus);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case ITEM_STATUS:
              if (field.type == TType.I32) {
                this.itemStatus = status.findByValue(iprot.readI32());
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (this.itemStatus != null) {
        oprot.writeFieldBegin(ITEM_STATUS_FIELD_DESC);
        oprot.writeI32(this.itemStatus.getValue());
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getAllItemsByStatus_args(");
      boolean first = true;

      sb.append("itemStatus:");
      if (this.itemStatus == null) {
        sb.append("null");
      } else {
        String itemStatus_name = itemStatus.name();
        if (itemStatus_name != null) {
          sb.append(itemStatus_name);
          sb.append(" (");
        }
        sb.append(this.itemStatus);
        if (itemStatus_name != null) {
          sb.append(")");
        }
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class getAllItemsByStatus_result implements TBase<getAllItemsByStatus_result._Fields>, java.io.Serializable, Cloneable   {
    private static final TStruct STRUCT_DESC = new TStruct("getAllItemsByStatus_result");

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0);
    private static final TField CEX_FIELD_DESC = new TField("cex", TType.STRUCT, (short)1);

    private List<Item> success;
    private CatalogServiceException cex;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      SUCCESS((short)0, "success"),
      CEX((short)1, "cex");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
          new ListMetaData(TType.LIST, 
              new StructMetaData(TType.STRUCT, Item.class))));
      put(_Fields.CEX, new FieldMetaData("cex", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(getAllItemsByStatus_result.class, metaDataMap);
    }

    public getAllItemsByStatus_result() {
    }

    public getAllItemsByStatus_result(
      List<Item> success,
      CatalogServiceException cex)
    {
      this();
      this.success = success;
      this.cex = cex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getAllItemsByStatus_result(getAllItemsByStatus_result other) {
      if (other.isSetSuccess()) {
        List<Item> __this__success = new ArrayList<Item>();
        for (Item other_element : other.success) {
          __this__success.add(new Item(other_element));
        }
        this.success = __this__success;
      }
      if (other.isSetCex()) {
        this.cex = new CatalogServiceException(other.cex);
      }
    }

    public getAllItemsByStatus_result deepCopy() {
      return new getAllItemsByStatus_result(this);
    }

    @Deprecated
    public getAllItemsByStatus_result clone() {
      return new getAllItemsByStatus_result(this);
    }

    public int getSuccessSize() {
      return (this.success == null) ? 0 : this.success.size();
    }

    public java.util.Iterator<Item> getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(Item elem) {
      if (this.success == null) {
        this.success = new ArrayList<Item>();
      }
      this.success.add(elem);
    }

    public List<Item> getSuccess() {
      return this.success;
    }

    public getAllItemsByStatus_result setSuccess(List<Item> success) {
      this.success = success;
      return this;
    }

    public void unsetSuccess() {
      this.success = null;
    }

    /** Returns true if field success is set (has been asigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return this.success != null;
    }

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public CatalogServiceException getCex() {
      return this.cex;
    }

    public getAllItemsByStatus_result setCex(CatalogServiceException cex) {
      this.cex = cex;
      return this;
    }

    public void unsetCex() {
      this.cex = null;
    }

    /** Returns true if field cex is set (has been asigned a value) and false otherwise */
    public boolean isSetCex() {
      return this.cex != null;
    }

    public void setCexIsSet(boolean value) {
      if (!value) {
        this.cex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((List<Item>)value);
        }
        break;

      case CEX:
        if (value == null) {
          unsetCex();
        } else {
          setCex((CatalogServiceException)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case CEX:
        return getCex();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case CEX:
        return isSetCex();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getAllItemsByStatus_result)
        return this.equals((getAllItemsByStatus_result)that);
      return false;
    }

    public boolean equals(getAllItemsByStatus_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      boolean this_present_cex = true && this.isSetCex();
      boolean that_present_cex = true && that.isSetCex();
      if (this_present_cex || that_present_cex) {
        if (!(this_present_cex && that_present_cex))
          return false;
        if (!this.cex.equals(that.cex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case SUCCESS:
              if (field.type == TType.LIST) {
                {
                  TList _list30 = iprot.readListBegin();
                  this.success = new ArrayList<Item>(_list30.size);
                  for (int _i31 = 0; _i31 < _list30.size; ++_i31)
                  {
                    Item _elem32;
                    _elem32 = new Item();
                    _elem32.read(iprot);
                    this.success.add(_elem32);
                  }
                  iprot.readListEnd();
                }
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case CEX:
              if (field.type == TType.STRUCT) {
                this.cex = new CatalogServiceException();
                this.cex.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        {
          oprot.writeListBegin(new TList(TType.STRUCT, this.success.size()));
          for (Item _iter33 : this.success)
          {
            _iter33.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      } else if (this.isSetCex()) {
        oprot.writeFieldBegin(CEX_FIELD_DESC);
        this.cex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getAllItemsByStatus_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("cex:");
      if (this.cex == null) {
        sb.append("null");
      } else {
        sb.append(this.cex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class getItemInventory_args implements TBase<getItemInventory_args._Fields>, java.io.Serializable, Cloneable, Comparable<getItemInventory_args>   {
    private static final TStruct STRUCT_DESC = new TStruct("getItemInventory_args");

    private static final TField ITEM_ID_FIELD_DESC = new TField("item_id", TType.I64, (short)1);

    private long item_id;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      ITEM_ID((short)1, "item_id");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __ITEM_ID_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.ITEM_ID, new FieldMetaData("item_id", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(getItemInventory_args.class, metaDataMap);
    }

    public getItemInventory_args() {
    }

    public getItemInventory_args(
      long item_id)
    {
      this();
      this.item_id = item_id;
      setItem_idIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getItemInventory_args(getItemInventory_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.item_id = other.item_id;
    }

    public getItemInventory_args deepCopy() {
      return new getItemInventory_args(this);
    }

    @Deprecated
    public getItemInventory_args clone() {
      return new getItemInventory_args(this);
    }

    public long getItem_id() {
      return this.item_id;
    }

    public getItemInventory_args setItem_id(long item_id) {
      this.item_id = item_id;
      setItem_idIsSet(true);
      return this;
    }

    public void unsetItem_id() {
      __isset_bit_vector.clear(__ITEM_ID_ISSET_ID);
    }

    /** Returns true if field item_id is set (has been asigned a value) and false otherwise */
    public boolean isSetItem_id() {
      return __isset_bit_vector.get(__ITEM_ID_ISSET_ID);
    }

    public void setItem_idIsSet(boolean value) {
      __isset_bit_vector.set(__ITEM_ID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case ITEM_ID:
        if (value == null) {
          unsetItem_id();
        } else {
          setItem_id((Long)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case ITEM_ID:
        return new Long(getItem_id());

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case ITEM_ID:
        return isSetItem_id();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getItemInventory_args)
        return this.equals((getItemInventory_args)that);
      return false;
    }

    public boolean equals(getItemInventory_args that) {
      if (that == null)
        return false;

      boolean this_present_item_id = true;
      boolean that_present_item_id = true;
      if (this_present_item_id || that_present_item_id) {
        if (!(this_present_item_id && that_present_item_id))
          return false;
        if (this.item_id != that.item_id)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getItemInventory_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getItemInventory_args typedOther = (getItemInventory_args)other;

      lastComparison = Boolean.valueOf(isSetItem_id()).compareTo(isSetItem_id());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(item_id, typedOther.item_id);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case ITEM_ID:
              if (field.type == TType.I64) {
                this.item_id = iprot.readI64();
                setItem_idIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(ITEM_ID_FIELD_DESC);
      oprot.writeI64(this.item_id);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getItemInventory_args(");
      boolean first = true;

      sb.append("item_id:");
      sb.append(this.item_id);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class getItemInventory_result implements TBase<getItemInventory_result._Fields>, java.io.Serializable, Cloneable   {
    private static final TStruct STRUCT_DESC = new TStruct("getItemInventory_result");

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRUCT, (short)0);
    private static final TField CEX_FIELD_DESC = new TField("cex", TType.STRUCT, (short)1);

    private ItemInventory success;
    private CatalogServiceException cex;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      SUCCESS((short)0, "success"),
      CEX((short)1, "cex");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
          new StructMetaData(TType.STRUCT, ItemInventory.class)));
      put(_Fields.CEX, new FieldMetaData("cex", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(getItemInventory_result.class, metaDataMap);
    }

    public getItemInventory_result() {
    }

    public getItemInventory_result(
      ItemInventory success,
      CatalogServiceException cex)
    {
      this();
      this.success = success;
      this.cex = cex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getItemInventory_result(getItemInventory_result other) {
      if (other.isSetSuccess()) {
        this.success = new ItemInventory(other.success);
      }
      if (other.isSetCex()) {
        this.cex = new CatalogServiceException(other.cex);
      }
    }

    public getItemInventory_result deepCopy() {
      return new getItemInventory_result(this);
    }

    @Deprecated
    public getItemInventory_result clone() {
      return new getItemInventory_result(this);
    }

    public ItemInventory getSuccess() {
      return this.success;
    }

    public getItemInventory_result setSuccess(ItemInventory success) {
      this.success = success;
      return this;
    }

    public void unsetSuccess() {
      this.success = null;
    }

    /** Returns true if field success is set (has been asigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return this.success != null;
    }

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public CatalogServiceException getCex() {
      return this.cex;
    }

    public getItemInventory_result setCex(CatalogServiceException cex) {
      this.cex = cex;
      return this;
    }

    public void unsetCex() {
      this.cex = null;
    }

    /** Returns true if field cex is set (has been asigned a value) and false otherwise */
    public boolean isSetCex() {
      return this.cex != null;
    }

    public void setCexIsSet(boolean value) {
      if (!value) {
        this.cex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((ItemInventory)value);
        }
        break;

      case CEX:
        if (value == null) {
          unsetCex();
        } else {
          setCex((CatalogServiceException)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case CEX:
        return getCex();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case CEX:
        return isSetCex();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getItemInventory_result)
        return this.equals((getItemInventory_result)that);
      return false;
    }

    public boolean equals(getItemInventory_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      boolean this_present_cex = true && this.isSetCex();
      boolean that_present_cex = true && that.isSetCex();
      if (this_present_cex || that_present_cex) {
        if (!(this_present_cex && that_present_cex))
          return false;
        if (!this.cex.equals(that.cex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case SUCCESS:
              if (field.type == TType.STRUCT) {
                this.success = new ItemInventory();
                this.success.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case CEX:
              if (field.type == TType.STRUCT) {
                this.cex = new CatalogServiceException();
                this.cex.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        this.success.write(oprot);
        oprot.writeFieldEnd();
      } else if (this.isSetCex()) {
        oprot.writeFieldBegin(CEX_FIELD_DESC);
        this.cex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getItemInventory_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("cex:");
      if (this.cex == null) {
        sb.append("null");
      } else {
        sb.append(this.cex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class getItemAvailibilityAtWarehouse_args implements TBase<getItemAvailibilityAtWarehouse_args._Fields>, java.io.Serializable, Cloneable, Comparable<getItemAvailibilityAtWarehouse_args>   {
    private static final TStruct STRUCT_DESC = new TStruct("getItemAvailibilityAtWarehouse_args");

    private static final TField WAREHOUSE_ID_FIELD_DESC = new TField("warehouse_id", TType.I64, (short)1);
    private static final TField ITEM_ID_FIELD_DESC = new TField("item_id", TType.I64, (short)2);

    private long warehouse_id;
    private long item_id;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      WAREHOUSE_ID((short)1, "warehouse_id"),
      ITEM_ID((short)2, "item_id");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __WAREHOUSE_ID_ISSET_ID = 0;
    private static final int __ITEM_ID_ISSET_ID = 1;
    private BitSet __isset_bit_vector = new BitSet(2);

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.WAREHOUSE_ID, new FieldMetaData("warehouse_id", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
      put(_Fields.ITEM_ID, new FieldMetaData("item_id", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(getItemAvailibilityAtWarehouse_args.class, metaDataMap);
    }

    public getItemAvailibilityAtWarehouse_args() {
    }

    public getItemAvailibilityAtWarehouse_args(
      long warehouse_id,
      long item_id)
    {
      this();
      this.warehouse_id = warehouse_id;
      setWarehouse_idIsSet(true);
      this.item_id = item_id;
      setItem_idIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getItemAvailibilityAtWarehouse_args(getItemAvailibilityAtWarehouse_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.warehouse_id = other.warehouse_id;
      this.item_id = other.item_id;
    }

    public getItemAvailibilityAtWarehouse_args deepCopy() {
      return new getItemAvailibilityAtWarehouse_args(this);
    }

    @Deprecated
    public getItemAvailibilityAtWarehouse_args clone() {
      return new getItemAvailibilityAtWarehouse_args(this);
    }

    public long getWarehouse_id() {
      return this.warehouse_id;
    }

    public getItemAvailibilityAtWarehouse_args setWarehouse_id(long warehouse_id) {
      this.warehouse_id = warehouse_id;
      setWarehouse_idIsSet(true);
      return this;
    }

    public void unsetWarehouse_id() {
      __isset_bit_vector.clear(__WAREHOUSE_ID_ISSET_ID);
    }

    /** Returns true if field warehouse_id is set (has been asigned a value) and false otherwise */
    public boolean isSetWarehouse_id() {
      return __isset_bit_vector.get(__WAREHOUSE_ID_ISSET_ID);
    }

    public void setWarehouse_idIsSet(boolean value) {
      __isset_bit_vector.set(__WAREHOUSE_ID_ISSET_ID, value);
    }

    public long getItem_id() {
      return this.item_id;
    }

    public getItemAvailibilityAtWarehouse_args setItem_id(long item_id) {
      this.item_id = item_id;
      setItem_idIsSet(true);
      return this;
    }

    public void unsetItem_id() {
      __isset_bit_vector.clear(__ITEM_ID_ISSET_ID);
    }

    /** Returns true if field item_id is set (has been asigned a value) and false otherwise */
    public boolean isSetItem_id() {
      return __isset_bit_vector.get(__ITEM_ID_ISSET_ID);
    }

    public void setItem_idIsSet(boolean value) {
      __isset_bit_vector.set(__ITEM_ID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case WAREHOUSE_ID:
        if (value == null) {
          unsetWarehouse_id();
        } else {
          setWarehouse_id((Long)value);
        }
        break;

      case ITEM_ID:
        if (value == null) {
          unsetItem_id();
        } else {
          setItem_id((Long)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case WAREHOUSE_ID:
        return new Long(getWarehouse_id());

      case ITEM_ID:
        return new Long(getItem_id());

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case WAREHOUSE_ID:
        return isSetWarehouse_id();
      case ITEM_ID:
        return isSetItem_id();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getItemAvailibilityAtWarehouse_args)
        return this.equals((getItemAvailibilityAtWarehouse_args)that);
      return false;
    }

    public boolean equals(getItemAvailibilityAtWarehouse_args that) {
      if (that == null)
        return false;

      boolean this_present_warehouse_id = true;
      boolean that_present_warehouse_id = true;
      if (this_present_warehouse_id || that_present_warehouse_id) {
        if (!(this_present_warehouse_id && that_present_warehouse_id))
          return false;
        if (this.warehouse_id != that.warehouse_id)
          return false;
      }

      boolean this_present_item_id = true;
      boolean that_present_item_id = true;
      if (this_present_item_id || that_present_item_id) {
        if (!(this_present_item_id && that_present_item_id))
          return false;
        if (this.item_id != that.item_id)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getItemAvailibilityAtWarehouse_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getItemAvailibilityAtWarehouse_args typedOther = (getItemAvailibilityAtWarehouse_args)other;

      lastComparison = Boolean.valueOf(isSetWarehouse_id()).compareTo(isSetWarehouse_id());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(warehouse_id, typedOther.warehouse_id);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetItem_id()).compareTo(isSetItem_id());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(item_id, typedOther.item_id);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case WAREHOUSE_ID:
              if (field.type == TType.I64) {
                this.warehouse_id = iprot.readI64();
                setWarehouse_idIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case ITEM_ID:
              if (field.type == TType.I64) {
                this.item_id = iprot.readI64();
                setItem_idIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(WAREHOUSE_ID_FIELD_DESC);
      oprot.writeI64(this.warehouse_id);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(ITEM_ID_FIELD_DESC);
      oprot.writeI64(this.item_id);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getItemAvailibilityAtWarehouse_args(");
      boolean first = true;

      sb.append("warehouse_id:");
      sb.append(this.warehouse_id);
      first = false;
      if (!first) sb.append(", ");
      sb.append("item_id:");
      sb.append(this.item_id);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class getItemAvailibilityAtWarehouse_result implements TBase<getItemAvailibilityAtWarehouse_result._Fields>, java.io.Serializable, Cloneable, Comparable<getItemAvailibilityAtWarehouse_result>   {
    private static final TStruct STRUCT_DESC = new TStruct("getItemAvailibilityAtWarehouse_result");

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.I64, (short)0);
    private static final TField CEX_FIELD_DESC = new TField("cex", TType.STRUCT, (short)1);

    private long success;
    private CatalogServiceException cex;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      SUCCESS((short)0, "success"),
      CEX((short)1, "cex");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __SUCCESS_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
      put(_Fields.CEX, new FieldMetaData("cex", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(getItemAvailibilityAtWarehouse_result.class, metaDataMap);
    }

    public getItemAvailibilityAtWarehouse_result() {
    }

    public getItemAvailibilityAtWarehouse_result(
      long success,
      CatalogServiceException cex)
    {
      this();
      this.success = success;
      setSuccessIsSet(true);
      this.cex = cex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getItemAvailibilityAtWarehouse_result(getItemAvailibilityAtWarehouse_result other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.success = other.success;
      if (other.isSetCex()) {
        this.cex = new CatalogServiceException(other.cex);
      }
    }

    public getItemAvailibilityAtWarehouse_result deepCopy() {
      return new getItemAvailibilityAtWarehouse_result(this);
    }

    @Deprecated
    public getItemAvailibilityAtWarehouse_result clone() {
      return new getItemAvailibilityAtWarehouse_result(this);
    }

    public long getSuccess() {
      return this.success;
    }

    public getItemAvailibilityAtWarehouse_result setSuccess(long success) {
      this.success = success;
      setSuccessIsSet(true);
      return this;
    }

    public void unsetSuccess() {
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
    }

    /** Returns true if field success is set (has been asigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
    }

    public void setSuccessIsSet(boolean value) {
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
    }

    public CatalogServiceException getCex() {
      return this.cex;
    }

    public getItemAvailibilityAtWarehouse_result setCex(CatalogServiceException cex) {
      this.cex = cex;
      return this;
    }

    public void unsetCex() {
      this.cex = null;
    }

    /** Returns true if field cex is set (has been asigned a value) and false otherwise */
    public boolean isSetCex() {
      return this.cex != null;
    }

    public void setCexIsSet(boolean value) {
      if (!value) {
        this.cex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((Long)value);
        }
        break;

      case CEX:
        if (value == null) {
          unsetCex();
        } else {
          setCex((CatalogServiceException)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return new Long(getSuccess());

      case CEX:
        return getCex();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case CEX:
        return isSetCex();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getItemAvailibilityAtWarehouse_result)
        return this.equals((getItemAvailibilityAtWarehouse_result)that);
      return false;
    }

    public boolean equals(getItemAvailibilityAtWarehouse_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true;
      boolean that_present_success = true;
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (this.success != that.success)
          return false;
      }

      boolean this_present_cex = true && this.isSetCex();
      boolean that_present_cex = true && that.isSetCex();
      if (this_present_cex || that_present_cex) {
        if (!(this_present_cex && that_present_cex))
          return false;
        if (!this.cex.equals(that.cex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getItemAvailibilityAtWarehouse_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getItemAvailibilityAtWarehouse_result typedOther = (getItemAvailibilityAtWarehouse_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetCex()).compareTo(isSetCex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(cex, typedOther.cex);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case SUCCESS:
              if (field.type == TType.I64) {
                this.success = iprot.readI64();
                setSuccessIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case CEX:
              if (field.type == TType.STRUCT) {
                this.cex = new CatalogServiceException();
                this.cex.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        oprot.writeI64(this.success);
        oprot.writeFieldEnd();
      } else if (this.isSetCex()) {
        oprot.writeFieldBegin(CEX_FIELD_DESC);
        this.cex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getItemAvailibilityAtWarehouse_result(");
      boolean first = true;

      sb.append("success:");
      sb.append(this.success);
      first = false;
      if (!first) sb.append(", ");
      sb.append("cex:");
      if (this.cex == null) {
        sb.append("null");
      } else {
        sb.append(this.cex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class getItemInventoryHistory_args implements TBase<getItemInventoryHistory_args._Fields>, java.io.Serializable, Cloneable, Comparable<getItemInventoryHistory_args>   {
    private static final TStruct STRUCT_DESC = new TStruct("getItemInventoryHistory_args");

    private static final TField ID_FIELD_DESC = new TField("id", TType.I64, (short)1);
    private static final TField ITEM_ID_FIELD_DESC = new TField("item_id", TType.I64, (short)2);
    private static final TField WAREHOUSE_ID_FIELD_DESC = new TField("warehouse_id", TType.I64, (short)3);
    private static final TField FROM_DATE_FIELD_DESC = new TField("from_date", TType.I64, (short)4);
    private static final TField TO_DATE_FIELD_DESC = new TField("to_date", TType.I64, (short)5);

    private long id;
    private long item_id;
    private long warehouse_id;
    private long from_date;
    private long to_date;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      ID((short)1, "id"),
      ITEM_ID((short)2, "item_id"),
      WAREHOUSE_ID((short)3, "warehouse_id"),
      FROM_DATE((short)4, "from_date"),
      TO_DATE((short)5, "to_date");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __ID_ISSET_ID = 0;
    private static final int __ITEM_ID_ISSET_ID = 1;
    private static final int __WAREHOUSE_ID_ISSET_ID = 2;
    private static final int __FROM_DATE_ISSET_ID = 3;
    private static final int __TO_DATE_ISSET_ID = 4;
    private BitSet __isset_bit_vector = new BitSet(5);

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.ID, new FieldMetaData("id", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
      put(_Fields.ITEM_ID, new FieldMetaData("item_id", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
      put(_Fields.WAREHOUSE_ID, new FieldMetaData("warehouse_id", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
      put(_Fields.FROM_DATE, new FieldMetaData("from_date", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
      put(_Fields.TO_DATE, new FieldMetaData("to_date", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(getItemInventoryHistory_args.class, metaDataMap);
    }

    public getItemInventoryHistory_args() {
    }

    public getItemInventoryHistory_args(
      long id,
      long item_id,
      long warehouse_id,
      long from_date,
      long to_date)
    {
      this();
      this.id = id;
      setIdIsSet(true);
      this.item_id = item_id;
      setItem_idIsSet(true);
      this.warehouse_id = warehouse_id;
      setWarehouse_idIsSet(true);
      this.from_date = from_date;
      setFrom_dateIsSet(true);
      this.to_date = to_date;
      setTo_dateIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getItemInventoryHistory_args(getItemInventoryHistory_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.id = other.id;
      this.item_id = other.item_id;
      this.warehouse_id = other.warehouse_id;
      this.from_date = other.from_date;
      this.to_date = other.to_date;
    }

    public getItemInventoryHistory_args deepCopy() {
      return new getItemInventoryHistory_args(this);
    }

    @Deprecated
    public getItemInventoryHistory_args clone() {
      return new getItemInventoryHistory_args(this);
    }

    public long getId() {
      return this.id;
    }

    public getItemInventoryHistory_args setId(long id) {
      this.id = id;
      setIdIsSet(true);
      return this;
    }

    public void unsetId() {
      __isset_bit_vector.clear(__ID_ISSET_ID);
    }

    /** Returns true if field id is set (has been asigned a value) and false otherwise */
    public boolean isSetId() {
      return __isset_bit_vector.get(__ID_ISSET_ID);
    }

    public void setIdIsSet(boolean value) {
      __isset_bit_vector.set(__ID_ISSET_ID, value);
    }

    public long getItem_id() {
      return this.item_id;
    }

    public getItemInventoryHistory_args setItem_id(long item_id) {
      this.item_id = item_id;
      setItem_idIsSet(true);
      return this;
    }

    public void unsetItem_id() {
      __isset_bit_vector.clear(__ITEM_ID_ISSET_ID);
    }

    /** Returns true if field item_id is set (has been asigned a value) and false otherwise */
    public boolean isSetItem_id() {
      return __isset_bit_vector.get(__ITEM_ID_ISSET_ID);
    }

    public void setItem_idIsSet(boolean value) {
      __isset_bit_vector.set(__ITEM_ID_ISSET_ID, value);
    }

    public long getWarehouse_id() {
      return this.warehouse_id;
    }

    public getItemInventoryHistory_args setWarehouse_id(long warehouse_id) {
      this.warehouse_id = warehouse_id;
      setWarehouse_idIsSet(true);
      return this;
    }

    public void unsetWarehouse_id() {
      __isset_bit_vector.clear(__WAREHOUSE_ID_ISSET_ID);
    }

    /** Returns true if field warehouse_id is set (has been asigned a value) and false otherwise */
    public boolean isSetWarehouse_id() {
      return __isset_bit_vector.get(__WAREHOUSE_ID_ISSET_ID);
    }

    public void setWarehouse_idIsSet(boolean value) {
      __isset_bit_vector.set(__WAREHOUSE_ID_ISSET_ID, value);
    }

    public long getFrom_date() {
      return this.from_date;
    }

    public getItemInventoryHistory_args setFrom_date(long from_date) {
      this.from_date = from_date;
      setFrom_dateIsSet(true);
      return this;
    }

    public void unsetFrom_date() {
      __isset_bit_vector.clear(__FROM_DATE_ISSET_ID);
    }

    /** Returns true if field from_date is set (has been asigned a value) and false otherwise */
    public boolean isSetFrom_date() {
      return __isset_bit_vector.get(__FROM_DATE_ISSET_ID);
    }

    public void setFrom_dateIsSet(boolean value) {
      __isset_bit_vector.set(__FROM_DATE_ISSET_ID, value);
    }

    public long getTo_date() {
      return this.to_date;
    }

    public getItemInventoryHistory_args setTo_date(long to_date) {
      this.to_date = to_date;
      setTo_dateIsSet(true);
      return this;
    }

    public void unsetTo_date() {
      __isset_bit_vector.clear(__TO_DATE_ISSET_ID);
    }

    /** Returns true if field to_date is set (has been asigned a value) and false otherwise */
    public boolean isSetTo_date() {
      return __isset_bit_vector.get(__TO_DATE_ISSET_ID);
    }

    public void setTo_dateIsSet(boolean value) {
      __isset_bit_vector.set(__TO_DATE_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case ID:
        if (value == null) {
          unsetId();
        } else {
          setId((Long)value);
        }
        break;

      case ITEM_ID:
        if (value == null) {
          unsetItem_id();
        } else {
          setItem_id((Long)value);
        }
        break;

      case WAREHOUSE_ID:
        if (value == null) {
          unsetWarehouse_id();
        } else {
          setWarehouse_id((Long)value);
        }
        break;

      case FROM_DATE:
        if (value == null) {
          unsetFrom_date();
        } else {
          setFrom_date((Long)value);
        }
        break;

      case TO_DATE:
        if (value == null) {
          unsetTo_date();
        } else {
          setTo_date((Long)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case ID:
        return new Long(getId());

      case ITEM_ID:
        return new Long(getItem_id());

      case WAREHOUSE_ID:
        return new Long(getWarehouse_id());

      case FROM_DATE:
        return new Long(getFrom_date());

      case TO_DATE:
        return new Long(getTo_date());

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case ID:
        return isSetId();
      case ITEM_ID:
        return isSetItem_id();
      case WAREHOUSE_ID:
        return isSetWarehouse_id();
      case FROM_DATE:
        return isSetFrom_date();
      case TO_DATE:
        return isSetTo_date();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getItemInventoryHistory_args)
        return this.equals((getItemInventoryHistory_args)that);
      return false;
    }

    public boolean equals(getItemInventoryHistory_args that) {
      if (that == null)
        return false;

      boolean this_present_id = true;
      boolean that_present_id = true;
      if (this_present_id || that_present_id) {
        if (!(this_present_id && that_present_id))
          return false;
        if (this.id != that.id)
          return false;
      }

      boolean this_present_item_id = true;
      boolean that_present_item_id = true;
      if (this_present_item_id || that_present_item_id) {
        if (!(this_present_item_id && that_present_item_id))
          return false;
        if (this.item_id != that.item_id)
          return false;
      }

      boolean this_present_warehouse_id = true;
      boolean that_present_warehouse_id = true;
      if (this_present_warehouse_id || that_present_warehouse_id) {
        if (!(this_present_warehouse_id && that_present_warehouse_id))
          return false;
        if (this.warehouse_id != that.warehouse_id)
          return false;
      }

      boolean this_present_from_date = true;
      boolean that_present_from_date = true;
      if (this_present_from_date || that_present_from_date) {
        if (!(this_present_from_date && that_present_from_date))
          return false;
        if (this.from_date != that.from_date)
          return false;
      }

      boolean this_present_to_date = true;
      boolean that_present_to_date = true;
      if (this_present_to_date || that_present_to_date) {
        if (!(this_present_to_date && that_present_to_date))
          return false;
        if (this.to_date != that.to_date)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getItemInventoryHistory_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getItemInventoryHistory_args typedOther = (getItemInventoryHistory_args)other;

      lastComparison = Boolean.valueOf(isSetId()).compareTo(isSetId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(id, typedOther.id);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetItem_id()).compareTo(isSetItem_id());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(item_id, typedOther.item_id);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetWarehouse_id()).compareTo(isSetWarehouse_id());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(warehouse_id, typedOther.warehouse_id);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetFrom_date()).compareTo(isSetFrom_date());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(from_date, typedOther.from_date);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetTo_date()).compareTo(isSetTo_date());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(to_date, typedOther.to_date);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case ID:
              if (field.type == TType.I64) {
                this.id = iprot.readI64();
                setIdIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case ITEM_ID:
              if (field.type == TType.I64) {
                this.item_id = iprot.readI64();
                setItem_idIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case WAREHOUSE_ID:
              if (field.type == TType.I64) {
                this.warehouse_id = iprot.readI64();
                setWarehouse_idIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case FROM_DATE:
              if (field.type == TType.I64) {
                this.from_date = iprot.readI64();
                setFrom_dateIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case TO_DATE:
              if (field.type == TType.I64) {
                this.to_date = iprot.readI64();
                setTo_dateIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(ID_FIELD_DESC);
      oprot.writeI64(this.id);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(ITEM_ID_FIELD_DESC);
      oprot.writeI64(this.item_id);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(WAREHOUSE_ID_FIELD_DESC);
      oprot.writeI64(this.warehouse_id);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(FROM_DATE_FIELD_DESC);
      oprot.writeI64(this.from_date);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(TO_DATE_FIELD_DESC);
      oprot.writeI64(this.to_date);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getItemInventoryHistory_args(");
      boolean first = true;

      sb.append("id:");
      sb.append(this.id);
      first = false;
      if (!first) sb.append(", ");
      sb.append("item_id:");
      sb.append(this.item_id);
      first = false;
      if (!first) sb.append(", ");
      sb.append("warehouse_id:");
      sb.append(this.warehouse_id);
      first = false;
      if (!first) sb.append(", ");
      sb.append("from_date:");
      sb.append(this.from_date);
      first = false;
      if (!first) sb.append(", ");
      sb.append("to_date:");
      sb.append(this.to_date);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class getItemInventoryHistory_result implements TBase<getItemInventoryHistory_result._Fields>, java.io.Serializable, Cloneable, Comparable<getItemInventoryHistory_result>   {
    private static final TStruct STRUCT_DESC = new TStruct("getItemInventoryHistory_result");

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRUCT, (short)0);
    private static final TField CEX_FIELD_DESC = new TField("cex", TType.STRUCT, (short)1);

    private ItemInventoryHistory success;
    private CatalogServiceException cex;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      SUCCESS((short)0, "success"),
      CEX((short)1, "cex");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
          new StructMetaData(TType.STRUCT, ItemInventoryHistory.class)));
      put(_Fields.CEX, new FieldMetaData("cex", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(getItemInventoryHistory_result.class, metaDataMap);
    }

    public getItemInventoryHistory_result() {
    }

    public getItemInventoryHistory_result(
      ItemInventoryHistory success,
      CatalogServiceException cex)
    {
      this();
      this.success = success;
      this.cex = cex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getItemInventoryHistory_result(getItemInventoryHistory_result other) {
      if (other.isSetSuccess()) {
        this.success = new ItemInventoryHistory(other.success);
      }
      if (other.isSetCex()) {
        this.cex = new CatalogServiceException(other.cex);
      }
    }

    public getItemInventoryHistory_result deepCopy() {
      return new getItemInventoryHistory_result(this);
    }

    @Deprecated
    public getItemInventoryHistory_result clone() {
      return new getItemInventoryHistory_result(this);
    }

    public ItemInventoryHistory getSuccess() {
      return this.success;
    }

    public getItemInventoryHistory_result setSuccess(ItemInventoryHistory success) {
      this.success = success;
      return this;
    }

    public void unsetSuccess() {
      this.success = null;
    }

    /** Returns true if field success is set (has been asigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return this.success != null;
    }

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public CatalogServiceException getCex() {
      return this.cex;
    }

    public getItemInventoryHistory_result setCex(CatalogServiceException cex) {
      this.cex = cex;
      return this;
    }

    public void unsetCex() {
      this.cex = null;
    }

    /** Returns true if field cex is set (has been asigned a value) and false otherwise */
    public boolean isSetCex() {
      return this.cex != null;
    }

    public void setCexIsSet(boolean value) {
      if (!value) {
        this.cex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((ItemInventoryHistory)value);
        }
        break;

      case CEX:
        if (value == null) {
          unsetCex();
        } else {
          setCex((CatalogServiceException)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case CEX:
        return getCex();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case CEX:
        return isSetCex();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getItemInventoryHistory_result)
        return this.equals((getItemInventoryHistory_result)that);
      return false;
    }

    public boolean equals(getItemInventoryHistory_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      boolean this_present_cex = true && this.isSetCex();
      boolean that_present_cex = true && that.isSetCex();
      if (this_present_cex || that_present_cex) {
        if (!(this_present_cex && that_present_cex))
          return false;
        if (!this.cex.equals(that.cex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getItemInventoryHistory_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getItemInventoryHistory_result typedOther = (getItemInventoryHistory_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetCex()).compareTo(isSetCex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(cex, typedOther.cex);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case SUCCESS:
              if (field.type == TType.STRUCT) {
                this.success = new ItemInventoryHistory();
                this.success.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case CEX:
              if (field.type == TType.STRUCT) {
                this.cex = new CatalogServiceException();
                this.cex.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        this.success.write(oprot);
        oprot.writeFieldEnd();
      } else if (this.isSetCex()) {
        oprot.writeFieldBegin(CEX_FIELD_DESC);
        this.cex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getItemInventoryHistory_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("cex:");
      if (this.cex == null) {
        sb.append("null");
      } else {
        sb.append(this.cex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class getAllWarehouses_args implements TBase<getAllWarehouses_args._Fields>, java.io.Serializable, Cloneable, Comparable<getAllWarehouses_args>   {
    private static final TStruct STRUCT_DESC = new TStruct("getAllWarehouses_args");

    private static final TField IS_ACTIVE_FIELD_DESC = new TField("isActive", TType.BOOL, (short)1);

    private boolean isActive;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      IS_ACTIVE((short)1, "isActive");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __ISACTIVE_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.IS_ACTIVE, new FieldMetaData("isActive", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.BOOL)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(getAllWarehouses_args.class, metaDataMap);
    }

    public getAllWarehouses_args() {
    }

    public getAllWarehouses_args(
      boolean isActive)
    {
      this();
      this.isActive = isActive;
      setIsActiveIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getAllWarehouses_args(getAllWarehouses_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.isActive = other.isActive;
    }

    public getAllWarehouses_args deepCopy() {
      return new getAllWarehouses_args(this);
    }

    @Deprecated
    public getAllWarehouses_args clone() {
      return new getAllWarehouses_args(this);
    }

    public boolean isIsActive() {
      return this.isActive;
    }

    public getAllWarehouses_args setIsActive(boolean isActive) {
      this.isActive = isActive;
      setIsActiveIsSet(true);
      return this;
    }

    public void unsetIsActive() {
      __isset_bit_vector.clear(__ISACTIVE_ISSET_ID);
    }

    /** Returns true if field isActive is set (has been asigned a value) and false otherwise */
    public boolean isSetIsActive() {
      return __isset_bit_vector.get(__ISACTIVE_ISSET_ID);
    }

    public void setIsActiveIsSet(boolean value) {
      __isset_bit_vector.set(__ISACTIVE_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case IS_ACTIVE:
        if (value == null) {
          unsetIsActive();
        } else {
          setIsActive((Boolean)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case IS_ACTIVE:
        return new Boolean(isIsActive());

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case IS_ACTIVE:
        return isSetIsActive();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getAllWarehouses_args)
        return this.equals((getAllWarehouses_args)that);
      return false;
    }

    public boolean equals(getAllWarehouses_args that) {
      if (that == null)
        return false;

      boolean this_present_isActive = true;
      boolean that_present_isActive = true;
      if (this_present_isActive || that_present_isActive) {
        if (!(this_present_isActive && that_present_isActive))
          return false;
        if (this.isActive != that.isActive)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getAllWarehouses_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getAllWarehouses_args typedOther = (getAllWarehouses_args)other;

      lastComparison = Boolean.valueOf(isSetIsActive()).compareTo(isSetIsActive());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(isActive, typedOther.isActive);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case IS_ACTIVE:
              if (field.type == TType.BOOL) {
                this.isActive = iprot.readBool();
                setIsActiveIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(IS_ACTIVE_FIELD_DESC);
      oprot.writeBool(this.isActive);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getAllWarehouses_args(");
      boolean first = true;

      sb.append("isActive:");
      sb.append(this.isActive);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class getAllWarehouses_result implements TBase<getAllWarehouses_result._Fields>, java.io.Serializable, Cloneable, Comparable<getAllWarehouses_result>   {
    private static final TStruct STRUCT_DESC = new TStruct("getAllWarehouses_result");

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0);
    private static final TField CEX_FIELD_DESC = new TField("cex", TType.STRUCT, (short)1);

    private List<Warehouse> success;
    private CatalogServiceException cex;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      SUCCESS((short)0, "success"),
      CEX((short)1, "cex");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
          new ListMetaData(TType.LIST, 
              new StructMetaData(TType.STRUCT, Warehouse.class))));
      put(_Fields.CEX, new FieldMetaData("cex", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(getAllWarehouses_result.class, metaDataMap);
    }

    public getAllWarehouses_result() {
    }

    public getAllWarehouses_result(
      List<Warehouse> success,
      CatalogServiceException cex)
    {
      this();
      this.success = success;
      this.cex = cex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getAllWarehouses_result(getAllWarehouses_result other) {
      if (other.isSetSuccess()) {
        List<Warehouse> __this__success = new ArrayList<Warehouse>();
        for (Warehouse other_element : other.success) {
          __this__success.add(new Warehouse(other_element));
        }
        this.success = __this__success;
      }
      if (other.isSetCex()) {
        this.cex = new CatalogServiceException(other.cex);
      }
    }

    public getAllWarehouses_result deepCopy() {
      return new getAllWarehouses_result(this);
    }

    @Deprecated
    public getAllWarehouses_result clone() {
      return new getAllWarehouses_result(this);
    }

    public int getSuccessSize() {
      return (this.success == null) ? 0 : this.success.size();
    }

    public java.util.Iterator<Warehouse> getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(Warehouse elem) {
      if (this.success == null) {
        this.success = new ArrayList<Warehouse>();
      }
      this.success.add(elem);
    }

    public List<Warehouse> getSuccess() {
      return this.success;
    }

    public getAllWarehouses_result setSuccess(List<Warehouse> success) {
      this.success = success;
      return this;
    }

    public void unsetSuccess() {
      this.success = null;
    }

    /** Returns true if field success is set (has been asigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return this.success != null;
    }

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public CatalogServiceException getCex() {
      return this.cex;
    }

    public getAllWarehouses_result setCex(CatalogServiceException cex) {
      this.cex = cex;
      return this;
    }

    public void unsetCex() {
      this.cex = null;
    }

    /** Returns true if field cex is set (has been asigned a value) and false otherwise */
    public boolean isSetCex() {
      return this.cex != null;
    }

    public void setCexIsSet(boolean value) {
      if (!value) {
        this.cex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((List<Warehouse>)value);
        }
        break;

      case CEX:
        if (value == null) {
          unsetCex();
        } else {
          setCex((CatalogServiceException)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case CEX:
        return getCex();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case CEX:
        return isSetCex();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getAllWarehouses_result)
        return this.equals((getAllWarehouses_result)that);
      return false;
    }

    public boolean equals(getAllWarehouses_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      boolean this_present_cex = true && this.isSetCex();
      boolean that_present_cex = true && that.isSetCex();
      if (this_present_cex || that_present_cex) {
        if (!(this_present_cex && that_present_cex))
          return false;
        if (!this.cex.equals(that.cex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getAllWarehouses_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getAllWarehouses_result typedOther = (getAllWarehouses_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetCex()).compareTo(isSetCex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(cex, typedOther.cex);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case SUCCESS:
              if (field.type == TType.LIST) {
                {
                  TList _list34 = iprot.readListBegin();
                  this.success = new ArrayList<Warehouse>(_list34.size);
                  for (int _i35 = 0; _i35 < _list34.size; ++_i35)
                  {
                    Warehouse _elem36;
                    _elem36 = new Warehouse();
                    _elem36.read(iprot);
                    this.success.add(_elem36);
                  }
                  iprot.readListEnd();
                }
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case CEX:
              if (field.type == TType.STRUCT) {
                this.cex = new CatalogServiceException();
                this.cex.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        {
          oprot.writeListBegin(new TList(TType.STRUCT, this.success.size()));
          for (Warehouse _iter37 : this.success)
          {
            _iter37.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      } else if (this.isSetCex()) {
        oprot.writeFieldBegin(CEX_FIELD_DESC);
        this.cex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getAllWarehouses_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("cex:");
      if (this.cex == null) {
        sb.append("null");
      } else {
        sb.append(this.cex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class getWarehouse_args implements TBase<getWarehouse_args._Fields>, java.io.Serializable, Cloneable, Comparable<getWarehouse_args>   {
    private static final TStruct STRUCT_DESC = new TStruct("getWarehouse_args");

    private static final TField WAREHOUSE_ID_FIELD_DESC = new TField("warehouse_id", TType.I64, (short)1);

    private long warehouse_id;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      WAREHOUSE_ID((short)1, "warehouse_id");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __WAREHOUSE_ID_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.WAREHOUSE_ID, new FieldMetaData("warehouse_id", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(getWarehouse_args.class, metaDataMap);
    }

    public getWarehouse_args() {
    }

    public getWarehouse_args(
      long warehouse_id)
    {
      this();
      this.warehouse_id = warehouse_id;
      setWarehouse_idIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getWarehouse_args(getWarehouse_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.warehouse_id = other.warehouse_id;
    }

    public getWarehouse_args deepCopy() {
      return new getWarehouse_args(this);
    }

    @Deprecated
    public getWarehouse_args clone() {
      return new getWarehouse_args(this);
    }

    public long getWarehouse_id() {
      return this.warehouse_id;
    }

    public getWarehouse_args setWarehouse_id(long warehouse_id) {
      this.warehouse_id = warehouse_id;
      setWarehouse_idIsSet(true);
      return this;
    }

    public void unsetWarehouse_id() {
      __isset_bit_vector.clear(__WAREHOUSE_ID_ISSET_ID);
    }

    /** Returns true if field warehouse_id is set (has been asigned a value) and false otherwise */
    public boolean isSetWarehouse_id() {
      return __isset_bit_vector.get(__WAREHOUSE_ID_ISSET_ID);
    }

    public void setWarehouse_idIsSet(boolean value) {
      __isset_bit_vector.set(__WAREHOUSE_ID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case WAREHOUSE_ID:
        if (value == null) {
          unsetWarehouse_id();
        } else {
          setWarehouse_id((Long)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case WAREHOUSE_ID:
        return new Long(getWarehouse_id());

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case WAREHOUSE_ID:
        return isSetWarehouse_id();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getWarehouse_args)
        return this.equals((getWarehouse_args)that);
      return false;
    }

    public boolean equals(getWarehouse_args that) {
      if (that == null)
        return false;

      boolean this_present_warehouse_id = true;
      boolean that_present_warehouse_id = true;
      if (this_present_warehouse_id || that_present_warehouse_id) {
        if (!(this_present_warehouse_id && that_present_warehouse_id))
          return false;
        if (this.warehouse_id != that.warehouse_id)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getWarehouse_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getWarehouse_args typedOther = (getWarehouse_args)other;

      lastComparison = Boolean.valueOf(isSetWarehouse_id()).compareTo(isSetWarehouse_id());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(warehouse_id, typedOther.warehouse_id);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case WAREHOUSE_ID:
              if (field.type == TType.I64) {
                this.warehouse_id = iprot.readI64();
                setWarehouse_idIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(WAREHOUSE_ID_FIELD_DESC);
      oprot.writeI64(this.warehouse_id);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getWarehouse_args(");
      boolean first = true;

      sb.append("warehouse_id:");
      sb.append(this.warehouse_id);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class getWarehouse_result implements TBase<getWarehouse_result._Fields>, java.io.Serializable, Cloneable, Comparable<getWarehouse_result>   {
    private static final TStruct STRUCT_DESC = new TStruct("getWarehouse_result");

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRUCT, (short)0);
    private static final TField CEX_FIELD_DESC = new TField("cex", TType.STRUCT, (short)1);

    private Warehouse success;
    private CatalogServiceException cex;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      SUCCESS((short)0, "success"),
      CEX((short)1, "cex");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
          new StructMetaData(TType.STRUCT, Warehouse.class)));
      put(_Fields.CEX, new FieldMetaData("cex", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(getWarehouse_result.class, metaDataMap);
    }

    public getWarehouse_result() {
    }

    public getWarehouse_result(
      Warehouse success,
      CatalogServiceException cex)
    {
      this();
      this.success = success;
      this.cex = cex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getWarehouse_result(getWarehouse_result other) {
      if (other.isSetSuccess()) {
        this.success = new Warehouse(other.success);
      }
      if (other.isSetCex()) {
        this.cex = new CatalogServiceException(other.cex);
      }
    }

    public getWarehouse_result deepCopy() {
      return new getWarehouse_result(this);
    }

    @Deprecated
    public getWarehouse_result clone() {
      return new getWarehouse_result(this);
    }

    public Warehouse getSuccess() {
      return this.success;
    }

    public getWarehouse_result setSuccess(Warehouse success) {
      this.success = success;
      return this;
    }

    public void unsetSuccess() {
      this.success = null;
    }

    /** Returns true if field success is set (has been asigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return this.success != null;
    }

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public CatalogServiceException getCex() {
      return this.cex;
    }

    public getWarehouse_result setCex(CatalogServiceException cex) {
      this.cex = cex;
      return this;
    }

    public void unsetCex() {
      this.cex = null;
    }

    /** Returns true if field cex is set (has been asigned a value) and false otherwise */
    public boolean isSetCex() {
      return this.cex != null;
    }

    public void setCexIsSet(boolean value) {
      if (!value) {
        this.cex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((Warehouse)value);
        }
        break;

      case CEX:
        if (value == null) {
          unsetCex();
        } else {
          setCex((CatalogServiceException)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case CEX:
        return getCex();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case CEX:
        return isSetCex();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getWarehouse_result)
        return this.equals((getWarehouse_result)that);
      return false;
    }

    public boolean equals(getWarehouse_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      boolean this_present_cex = true && this.isSetCex();
      boolean that_present_cex = true && that.isSetCex();
      if (this_present_cex || that_present_cex) {
        if (!(this_present_cex && that_present_cex))
          return false;
        if (!this.cex.equals(that.cex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getWarehouse_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getWarehouse_result typedOther = (getWarehouse_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetCex()).compareTo(isSetCex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(cex, typedOther.cex);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case SUCCESS:
              if (field.type == TType.STRUCT) {
                this.success = new Warehouse();
                this.success.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case CEX:
              if (field.type == TType.STRUCT) {
                this.cex = new CatalogServiceException();
                this.cex.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        this.success.write(oprot);
        oprot.writeFieldEnd();
      } else if (this.isSetCex()) {
        oprot.writeFieldBegin(CEX_FIELD_DESC);
        this.cex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getWarehouse_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("cex:");
      if (this.cex == null) {
        sb.append("null");
      } else {
        sb.append(this.cex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class getAllWarehousesForItem_args implements TBase<getAllWarehousesForItem_args._Fields>, java.io.Serializable, Cloneable, Comparable<getAllWarehousesForItem_args>   {
    private static final TStruct STRUCT_DESC = new TStruct("getAllWarehousesForItem_args");

    private static final TField ITEM_ID_FIELD_DESC = new TField("item_id", TType.I64, (short)1);

    private long item_id;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      ITEM_ID((short)1, "item_id");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __ITEM_ID_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.ITEM_ID, new FieldMetaData("item_id", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(getAllWarehousesForItem_args.class, metaDataMap);
    }

    public getAllWarehousesForItem_args() {
    }

    public getAllWarehousesForItem_args(
      long item_id)
    {
      this();
      this.item_id = item_id;
      setItem_idIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getAllWarehousesForItem_args(getAllWarehousesForItem_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.item_id = other.item_id;
    }

    public getAllWarehousesForItem_args deepCopy() {
      return new getAllWarehousesForItem_args(this);
    }

    @Deprecated
    public getAllWarehousesForItem_args clone() {
      return new getAllWarehousesForItem_args(this);
    }

    public long getItem_id() {
      return this.item_id;
    }

    public getAllWarehousesForItem_args setItem_id(long item_id) {
      this.item_id = item_id;
      setItem_idIsSet(true);
      return this;
    }

    public void unsetItem_id() {
      __isset_bit_vector.clear(__ITEM_ID_ISSET_ID);
    }

    /** Returns true if field item_id is set (has been asigned a value) and false otherwise */
    public boolean isSetItem_id() {
      return __isset_bit_vector.get(__ITEM_ID_ISSET_ID);
    }

    public void setItem_idIsSet(boolean value) {
      __isset_bit_vector.set(__ITEM_ID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case ITEM_ID:
        if (value == null) {
          unsetItem_id();
        } else {
          setItem_id((Long)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case ITEM_ID:
        return new Long(getItem_id());

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case ITEM_ID:
        return isSetItem_id();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getAllWarehousesForItem_args)
        return this.equals((getAllWarehousesForItem_args)that);
      return false;
    }

    public boolean equals(getAllWarehousesForItem_args that) {
      if (that == null)
        return false;

      boolean this_present_item_id = true;
      boolean that_present_item_id = true;
      if (this_present_item_id || that_present_item_id) {
        if (!(this_present_item_id && that_present_item_id))
          return false;
        if (this.item_id != that.item_id)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getAllWarehousesForItem_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getAllWarehousesForItem_args typedOther = (getAllWarehousesForItem_args)other;

      lastComparison = Boolean.valueOf(isSetItem_id()).compareTo(isSetItem_id());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(item_id, typedOther.item_id);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case ITEM_ID:
              if (field.type == TType.I64) {
                this.item_id = iprot.readI64();
                setItem_idIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(ITEM_ID_FIELD_DESC);
      oprot.writeI64(this.item_id);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getAllWarehousesForItem_args(");
      boolean first = true;

      sb.append("item_id:");
      sb.append(this.item_id);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class getAllWarehousesForItem_result implements TBase<getAllWarehousesForItem_result._Fields>, java.io.Serializable, Cloneable, Comparable<getAllWarehousesForItem_result>   {
    private static final TStruct STRUCT_DESC = new TStruct("getAllWarehousesForItem_result");

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0);
    private static final TField CEX_FIELD_DESC = new TField("cex", TType.STRUCT, (short)1);

    private List<Warehouse> success;
    private CatalogServiceException cex;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      SUCCESS((short)0, "success"),
      CEX((short)1, "cex");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
          new ListMetaData(TType.LIST, 
              new StructMetaData(TType.STRUCT, Warehouse.class))));
      put(_Fields.CEX, new FieldMetaData("cex", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(getAllWarehousesForItem_result.class, metaDataMap);
    }

    public getAllWarehousesForItem_result() {
    }

    public getAllWarehousesForItem_result(
      List<Warehouse> success,
      CatalogServiceException cex)
    {
      this();
      this.success = success;
      this.cex = cex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getAllWarehousesForItem_result(getAllWarehousesForItem_result other) {
      if (other.isSetSuccess()) {
        List<Warehouse> __this__success = new ArrayList<Warehouse>();
        for (Warehouse other_element : other.success) {
          __this__success.add(new Warehouse(other_element));
        }
        this.success = __this__success;
      }
      if (other.isSetCex()) {
        this.cex = new CatalogServiceException(other.cex);
      }
    }

    public getAllWarehousesForItem_result deepCopy() {
      return new getAllWarehousesForItem_result(this);
    }

    @Deprecated
    public getAllWarehousesForItem_result clone() {
      return new getAllWarehousesForItem_result(this);
    }

    public int getSuccessSize() {
      return (this.success == null) ? 0 : this.success.size();
    }

    public java.util.Iterator<Warehouse> getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(Warehouse elem) {
      if (this.success == null) {
        this.success = new ArrayList<Warehouse>();
      }
      this.success.add(elem);
    }

    public List<Warehouse> getSuccess() {
      return this.success;
    }

    public getAllWarehousesForItem_result setSuccess(List<Warehouse> success) {
      this.success = success;
      return this;
    }

    public void unsetSuccess() {
      this.success = null;
    }

    /** Returns true if field success is set (has been asigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return this.success != null;
    }

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public CatalogServiceException getCex() {
      return this.cex;
    }

    public getAllWarehousesForItem_result setCex(CatalogServiceException cex) {
      this.cex = cex;
      return this;
    }

    public void unsetCex() {
      this.cex = null;
    }

    /** Returns true if field cex is set (has been asigned a value) and false otherwise */
    public boolean isSetCex() {
      return this.cex != null;
    }

    public void setCexIsSet(boolean value) {
      if (!value) {
        this.cex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((List<Warehouse>)value);
        }
        break;

      case CEX:
        if (value == null) {
          unsetCex();
        } else {
          setCex((CatalogServiceException)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case CEX:
        return getCex();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case CEX:
        return isSetCex();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getAllWarehousesForItem_result)
        return this.equals((getAllWarehousesForItem_result)that);
      return false;
    }

    public boolean equals(getAllWarehousesForItem_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      boolean this_present_cex = true && this.isSetCex();
      boolean that_present_cex = true && that.isSetCex();
      if (this_present_cex || that_present_cex) {
        if (!(this_present_cex && that_present_cex))
          return false;
        if (!this.cex.equals(that.cex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getAllWarehousesForItem_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getAllWarehousesForItem_result typedOther = (getAllWarehousesForItem_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetCex()).compareTo(isSetCex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(cex, typedOther.cex);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case SUCCESS:
              if (field.type == TType.LIST) {
                {
                  TList _list38 = iprot.readListBegin();
                  this.success = new ArrayList<Warehouse>(_list38.size);
                  for (int _i39 = 0; _i39 < _list38.size; ++_i39)
                  {
                    Warehouse _elem40;
                    _elem40 = new Warehouse();
                    _elem40.read(iprot);
                    this.success.add(_elem40);
                  }
                  iprot.readListEnd();
                }
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case CEX:
              if (field.type == TType.STRUCT) {
                this.cex = new CatalogServiceException();
                this.cex.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        {
          oprot.writeListBegin(new TList(TType.STRUCT, this.success.size()));
          for (Warehouse _iter41 : this.success)
          {
            _iter41.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      } else if (this.isSetCex()) {
        oprot.writeFieldBegin(CEX_FIELD_DESC);
        this.cex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getAllWarehousesForItem_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("cex:");
      if (this.cex == null) {
        sb.append("null");
      } else {
        sb.append(this.cex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class getAllItemsForWarehouse_args implements TBase<getAllItemsForWarehouse_args._Fields>, java.io.Serializable, Cloneable, Comparable<getAllItemsForWarehouse_args>   {
    private static final TStruct STRUCT_DESC = new TStruct("getAllItemsForWarehouse_args");

    private static final TField WAREHOUSE_ID_FIELD_DESC = new TField("warehouse_id", TType.I64, (short)1);

    private long warehouse_id;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      WAREHOUSE_ID((short)1, "warehouse_id");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __WAREHOUSE_ID_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.WAREHOUSE_ID, new FieldMetaData("warehouse_id", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(getAllItemsForWarehouse_args.class, metaDataMap);
    }

    public getAllItemsForWarehouse_args() {
    }

    public getAllItemsForWarehouse_args(
      long warehouse_id)
    {
      this();
      this.warehouse_id = warehouse_id;
      setWarehouse_idIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getAllItemsForWarehouse_args(getAllItemsForWarehouse_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.warehouse_id = other.warehouse_id;
    }

    public getAllItemsForWarehouse_args deepCopy() {
      return new getAllItemsForWarehouse_args(this);
    }

    @Deprecated
    public getAllItemsForWarehouse_args clone() {
      return new getAllItemsForWarehouse_args(this);
    }

    public long getWarehouse_id() {
      return this.warehouse_id;
    }

    public getAllItemsForWarehouse_args setWarehouse_id(long warehouse_id) {
      this.warehouse_id = warehouse_id;
      setWarehouse_idIsSet(true);
      return this;
    }

    public void unsetWarehouse_id() {
      __isset_bit_vector.clear(__WAREHOUSE_ID_ISSET_ID);
    }

    /** Returns true if field warehouse_id is set (has been asigned a value) and false otherwise */
    public boolean isSetWarehouse_id() {
      return __isset_bit_vector.get(__WAREHOUSE_ID_ISSET_ID);
    }

    public void setWarehouse_idIsSet(boolean value) {
      __isset_bit_vector.set(__WAREHOUSE_ID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case WAREHOUSE_ID:
        if (value == null) {
          unsetWarehouse_id();
        } else {
          setWarehouse_id((Long)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case WAREHOUSE_ID:
        return new Long(getWarehouse_id());

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case WAREHOUSE_ID:
        return isSetWarehouse_id();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getAllItemsForWarehouse_args)
        return this.equals((getAllItemsForWarehouse_args)that);
      return false;
    }

    public boolean equals(getAllItemsForWarehouse_args that) {
      if (that == null)
        return false;

      boolean this_present_warehouse_id = true;
      boolean that_present_warehouse_id = true;
      if (this_present_warehouse_id || that_present_warehouse_id) {
        if (!(this_present_warehouse_id && that_present_warehouse_id))
          return false;
        if (this.warehouse_id != that.warehouse_id)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getAllItemsForWarehouse_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getAllItemsForWarehouse_args typedOther = (getAllItemsForWarehouse_args)other;

      lastComparison = Boolean.valueOf(isSetWarehouse_id()).compareTo(isSetWarehouse_id());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(warehouse_id, typedOther.warehouse_id);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case WAREHOUSE_ID:
              if (field.type == TType.I64) {
                this.warehouse_id = iprot.readI64();
                setWarehouse_idIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(WAREHOUSE_ID_FIELD_DESC);
      oprot.writeI64(this.warehouse_id);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getAllItemsForWarehouse_args(");
      boolean first = true;

      sb.append("warehouse_id:");
      sb.append(this.warehouse_id);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class getAllItemsForWarehouse_result implements TBase<getAllItemsForWarehouse_result._Fields>, java.io.Serializable, Cloneable   {
    private static final TStruct STRUCT_DESC = new TStruct("getAllItemsForWarehouse_result");

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0);
    private static final TField CEX_FIELD_DESC = new TField("cex", TType.STRUCT, (short)1);

    private List<Item> success;
    private CatalogServiceException cex;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      SUCCESS((short)0, "success"),
      CEX((short)1, "cex");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
          new ListMetaData(TType.LIST, 
              new StructMetaData(TType.STRUCT, Item.class))));
      put(_Fields.CEX, new FieldMetaData("cex", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(getAllItemsForWarehouse_result.class, metaDataMap);
    }

    public getAllItemsForWarehouse_result() {
    }

    public getAllItemsForWarehouse_result(
      List<Item> success,
      CatalogServiceException cex)
    {
      this();
      this.success = success;
      this.cex = cex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getAllItemsForWarehouse_result(getAllItemsForWarehouse_result other) {
      if (other.isSetSuccess()) {
        List<Item> __this__success = new ArrayList<Item>();
        for (Item other_element : other.success) {
          __this__success.add(new Item(other_element));
        }
        this.success = __this__success;
      }
      if (other.isSetCex()) {
        this.cex = new CatalogServiceException(other.cex);
      }
    }

    public getAllItemsForWarehouse_result deepCopy() {
      return new getAllItemsForWarehouse_result(this);
    }

    @Deprecated
    public getAllItemsForWarehouse_result clone() {
      return new getAllItemsForWarehouse_result(this);
    }

    public int getSuccessSize() {
      return (this.success == null) ? 0 : this.success.size();
    }

    public java.util.Iterator<Item> getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(Item elem) {
      if (this.success == null) {
        this.success = new ArrayList<Item>();
      }
      this.success.add(elem);
    }

    public List<Item> getSuccess() {
      return this.success;
    }

    public getAllItemsForWarehouse_result setSuccess(List<Item> success) {
      this.success = success;
      return this;
    }

    public void unsetSuccess() {
      this.success = null;
    }

    /** Returns true if field success is set (has been asigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return this.success != null;
    }

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public CatalogServiceException getCex() {
      return this.cex;
    }

    public getAllItemsForWarehouse_result setCex(CatalogServiceException cex) {
      this.cex = cex;
      return this;
    }

    public void unsetCex() {
      this.cex = null;
    }

    /** Returns true if field cex is set (has been asigned a value) and false otherwise */
    public boolean isSetCex() {
      return this.cex != null;
    }

    public void setCexIsSet(boolean value) {
      if (!value) {
        this.cex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((List<Item>)value);
        }
        break;

      case CEX:
        if (value == null) {
          unsetCex();
        } else {
          setCex((CatalogServiceException)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case CEX:
        return getCex();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case CEX:
        return isSetCex();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getAllItemsForWarehouse_result)
        return this.equals((getAllItemsForWarehouse_result)that);
      return false;
    }

    public boolean equals(getAllItemsForWarehouse_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      boolean this_present_cex = true && this.isSetCex();
      boolean that_present_cex = true && that.isSetCex();
      if (this_present_cex || that_present_cex) {
        if (!(this_present_cex && that_present_cex))
          return false;
        if (!this.cex.equals(that.cex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case SUCCESS:
              if (field.type == TType.LIST) {
                {
                  TList _list42 = iprot.readListBegin();
                  this.success = new ArrayList<Item>(_list42.size);
                  for (int _i43 = 0; _i43 < _list42.size; ++_i43)
                  {
                    Item _elem44;
                    _elem44 = new Item();
                    _elem44.read(iprot);
                    this.success.add(_elem44);
                  }
                  iprot.readListEnd();
                }
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case CEX:
              if (field.type == TType.STRUCT) {
                this.cex = new CatalogServiceException();
                this.cex.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        {
          oprot.writeListBegin(new TList(TType.STRUCT, this.success.size()));
          for (Item _iter45 : this.success)
          {
            _iter45.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      } else if (this.isSetCex()) {
        oprot.writeFieldBegin(CEX_FIELD_DESC);
        this.cex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getAllItemsForWarehouse_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("cex:");
      if (this.cex == null) {
        sb.append("null");
      } else {
        sb.append(this.cex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class getVendor_args implements TBase<getVendor_args._Fields>, java.io.Serializable, Cloneable, Comparable<getVendor_args>   {
    private static final TStruct STRUCT_DESC = new TStruct("getVendor_args");

    private static final TField VENDOR_ID_FIELD_DESC = new TField("vendor_id", TType.I64, (short)1);

    private long vendor_id;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      VENDOR_ID((short)1, "vendor_id");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __VENDOR_ID_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.VENDOR_ID, new FieldMetaData("vendor_id", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(getVendor_args.class, metaDataMap);
    }

    public getVendor_args() {
    }

    public getVendor_args(
      long vendor_id)
    {
      this();
      this.vendor_id = vendor_id;
      setVendor_idIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getVendor_args(getVendor_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.vendor_id = other.vendor_id;
    }

    public getVendor_args deepCopy() {
      return new getVendor_args(this);
    }

    @Deprecated
    public getVendor_args clone() {
      return new getVendor_args(this);
    }

    public long getVendor_id() {
      return this.vendor_id;
    }

    public getVendor_args setVendor_id(long vendor_id) {
      this.vendor_id = vendor_id;
      setVendor_idIsSet(true);
      return this;
    }

    public void unsetVendor_id() {
      __isset_bit_vector.clear(__VENDOR_ID_ISSET_ID);
    }

    /** Returns true if field vendor_id is set (has been asigned a value) and false otherwise */
    public boolean isSetVendor_id() {
      return __isset_bit_vector.get(__VENDOR_ID_ISSET_ID);
    }

    public void setVendor_idIsSet(boolean value) {
      __isset_bit_vector.set(__VENDOR_ID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case VENDOR_ID:
        if (value == null) {
          unsetVendor_id();
        } else {
          setVendor_id((Long)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case VENDOR_ID:
        return new Long(getVendor_id());

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case VENDOR_ID:
        return isSetVendor_id();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getVendor_args)
        return this.equals((getVendor_args)that);
      return false;
    }

    public boolean equals(getVendor_args that) {
      if (that == null)
        return false;

      boolean this_present_vendor_id = true;
      boolean that_present_vendor_id = true;
      if (this_present_vendor_id || that_present_vendor_id) {
        if (!(this_present_vendor_id && that_present_vendor_id))
          return false;
        if (this.vendor_id != that.vendor_id)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getVendor_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getVendor_args typedOther = (getVendor_args)other;

      lastComparison = Boolean.valueOf(isSetVendor_id()).compareTo(isSetVendor_id());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(vendor_id, typedOther.vendor_id);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case VENDOR_ID:
              if (field.type == TType.I64) {
                this.vendor_id = iprot.readI64();
                setVendor_idIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(VENDOR_ID_FIELD_DESC);
      oprot.writeI64(this.vendor_id);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getVendor_args(");
      boolean first = true;

      sb.append("vendor_id:");
      sb.append(this.vendor_id);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class getVendor_result implements TBase<getVendor_result._Fields>, java.io.Serializable, Cloneable, Comparable<getVendor_result>   {
    private static final TStruct STRUCT_DESC = new TStruct("getVendor_result");

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRUCT, (short)0);
    private static final TField CEX_FIELD_DESC = new TField("cex", TType.STRUCT, (short)1);

    private Vendor success;
    private CatalogServiceException cex;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      SUCCESS((short)0, "success"),
      CEX((short)1, "cex");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
          new StructMetaData(TType.STRUCT, Vendor.class)));
      put(_Fields.CEX, new FieldMetaData("cex", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(getVendor_result.class, metaDataMap);
    }

    public getVendor_result() {
    }

    public getVendor_result(
      Vendor success,
      CatalogServiceException cex)
    {
      this();
      this.success = success;
      this.cex = cex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getVendor_result(getVendor_result other) {
      if (other.isSetSuccess()) {
        this.success = new Vendor(other.success);
      }
      if (other.isSetCex()) {
        this.cex = new CatalogServiceException(other.cex);
      }
    }

    public getVendor_result deepCopy() {
      return new getVendor_result(this);
    }

    @Deprecated
    public getVendor_result clone() {
      return new getVendor_result(this);
    }

    public Vendor getSuccess() {
      return this.success;
    }

    public getVendor_result setSuccess(Vendor success) {
      this.success = success;
      return this;
    }

    public void unsetSuccess() {
      this.success = null;
    }

    /** Returns true if field success is set (has been asigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return this.success != null;
    }

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public CatalogServiceException getCex() {
      return this.cex;
    }

    public getVendor_result setCex(CatalogServiceException cex) {
      this.cex = cex;
      return this;
    }

    public void unsetCex() {
      this.cex = null;
    }

    /** Returns true if field cex is set (has been asigned a value) and false otherwise */
    public boolean isSetCex() {
      return this.cex != null;
    }

    public void setCexIsSet(boolean value) {
      if (!value) {
        this.cex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((Vendor)value);
        }
        break;

      case CEX:
        if (value == null) {
          unsetCex();
        } else {
          setCex((CatalogServiceException)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case CEX:
        return getCex();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case CEX:
        return isSetCex();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getVendor_result)
        return this.equals((getVendor_result)that);
      return false;
    }

    public boolean equals(getVendor_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      boolean this_present_cex = true && this.isSetCex();
      boolean that_present_cex = true && that.isSetCex();
      if (this_present_cex || that_present_cex) {
        if (!(this_present_cex && that_present_cex))
          return false;
        if (!this.cex.equals(that.cex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getVendor_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getVendor_result typedOther = (getVendor_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetCex()).compareTo(isSetCex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(cex, typedOther.cex);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case SUCCESS:
              if (field.type == TType.STRUCT) {
                this.success = new Vendor();
                this.success.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case CEX:
              if (field.type == TType.STRUCT) {
                this.cex = new CatalogServiceException();
                this.cex.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        this.success.write(oprot);
        oprot.writeFieldEnd();
      } else if (this.isSetCex()) {
        oprot.writeFieldBegin(CEX_FIELD_DESC);
        this.cex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getVendor_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("cex:");
      if (this.cex == null) {
        sb.append("null");
      } else {
        sb.append(this.cex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class getAllVendors_args implements TBase<getAllVendors_args._Fields>, java.io.Serializable, Cloneable, Comparable<getAllVendors_args>   {
    private static final TStruct STRUCT_DESC = new TStruct("getAllVendors_args");

    private static final TField IS_ACTIVE_FIELD_DESC = new TField("isActive", TType.BOOL, (short)1);

    private boolean isActive;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      IS_ACTIVE((short)1, "isActive");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __ISACTIVE_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.IS_ACTIVE, new FieldMetaData("isActive", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.BOOL)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(getAllVendors_args.class, metaDataMap);
    }

    public getAllVendors_args() {
    }

    public getAllVendors_args(
      boolean isActive)
    {
      this();
      this.isActive = isActive;
      setIsActiveIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getAllVendors_args(getAllVendors_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.isActive = other.isActive;
    }

    public getAllVendors_args deepCopy() {
      return new getAllVendors_args(this);
    }

    @Deprecated
    public getAllVendors_args clone() {
      return new getAllVendors_args(this);
    }

    public boolean isIsActive() {
      return this.isActive;
    }

    public getAllVendors_args setIsActive(boolean isActive) {
      this.isActive = isActive;
      setIsActiveIsSet(true);
      return this;
    }

    public void unsetIsActive() {
      __isset_bit_vector.clear(__ISACTIVE_ISSET_ID);
    }

    /** Returns true if field isActive is set (has been asigned a value) and false otherwise */
    public boolean isSetIsActive() {
      return __isset_bit_vector.get(__ISACTIVE_ISSET_ID);
    }

    public void setIsActiveIsSet(boolean value) {
      __isset_bit_vector.set(__ISACTIVE_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case IS_ACTIVE:
        if (value == null) {
          unsetIsActive();
        } else {
          setIsActive((Boolean)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case IS_ACTIVE:
        return new Boolean(isIsActive());

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case IS_ACTIVE:
        return isSetIsActive();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getAllVendors_args)
        return this.equals((getAllVendors_args)that);
      return false;
    }

    public boolean equals(getAllVendors_args that) {
      if (that == null)
        return false;

      boolean this_present_isActive = true;
      boolean that_present_isActive = true;
      if (this_present_isActive || that_present_isActive) {
        if (!(this_present_isActive && that_present_isActive))
          return false;
        if (this.isActive != that.isActive)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getAllVendors_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getAllVendors_args typedOther = (getAllVendors_args)other;

      lastComparison = Boolean.valueOf(isSetIsActive()).compareTo(isSetIsActive());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(isActive, typedOther.isActive);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case IS_ACTIVE:
              if (field.type == TType.BOOL) {
                this.isActive = iprot.readBool();
                setIsActiveIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(IS_ACTIVE_FIELD_DESC);
      oprot.writeBool(this.isActive);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getAllVendors_args(");
      boolean first = true;

      sb.append("isActive:");
      sb.append(this.isActive);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class getAllVendors_result implements TBase<getAllVendors_result._Fields>, java.io.Serializable, Cloneable, Comparable<getAllVendors_result>   {
    private static final TStruct STRUCT_DESC = new TStruct("getAllVendors_result");

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0);
    private static final TField CEX_FIELD_DESC = new TField("cex", TType.STRUCT, (short)1);

    private List<Vendor> success;
    private CatalogServiceException cex;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      SUCCESS((short)0, "success"),
      CEX((short)1, "cex");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
          new ListMetaData(TType.LIST, 
              new StructMetaData(TType.STRUCT, Vendor.class))));
      put(_Fields.CEX, new FieldMetaData("cex", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(getAllVendors_result.class, metaDataMap);
    }

    public getAllVendors_result() {
    }

    public getAllVendors_result(
      List<Vendor> success,
      CatalogServiceException cex)
    {
      this();
      this.success = success;
      this.cex = cex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getAllVendors_result(getAllVendors_result other) {
      if (other.isSetSuccess()) {
        List<Vendor> __this__success = new ArrayList<Vendor>();
        for (Vendor other_element : other.success) {
          __this__success.add(new Vendor(other_element));
        }
        this.success = __this__success;
      }
      if (other.isSetCex()) {
        this.cex = new CatalogServiceException(other.cex);
      }
    }

    public getAllVendors_result deepCopy() {
      return new getAllVendors_result(this);
    }

    @Deprecated
    public getAllVendors_result clone() {
      return new getAllVendors_result(this);
    }

    public int getSuccessSize() {
      return (this.success == null) ? 0 : this.success.size();
    }

    public java.util.Iterator<Vendor> getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(Vendor elem) {
      if (this.success == null) {
        this.success = new ArrayList<Vendor>();
      }
      this.success.add(elem);
    }

    public List<Vendor> getSuccess() {
      return this.success;
    }

    public getAllVendors_result setSuccess(List<Vendor> success) {
      this.success = success;
      return this;
    }

    public void unsetSuccess() {
      this.success = null;
    }

    /** Returns true if field success is set (has been asigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return this.success != null;
    }

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public CatalogServiceException getCex() {
      return this.cex;
    }

    public getAllVendors_result setCex(CatalogServiceException cex) {
      this.cex = cex;
      return this;
    }

    public void unsetCex() {
      this.cex = null;
    }

    /** Returns true if field cex is set (has been asigned a value) and false otherwise */
    public boolean isSetCex() {
      return this.cex != null;
    }

    public void setCexIsSet(boolean value) {
      if (!value) {
        this.cex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((List<Vendor>)value);
        }
        break;

      case CEX:
        if (value == null) {
          unsetCex();
        } else {
          setCex((CatalogServiceException)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case CEX:
        return getCex();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case CEX:
        return isSetCex();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getAllVendors_result)
        return this.equals((getAllVendors_result)that);
      return false;
    }

    public boolean equals(getAllVendors_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      boolean this_present_cex = true && this.isSetCex();
      boolean that_present_cex = true && that.isSetCex();
      if (this_present_cex || that_present_cex) {
        if (!(this_present_cex && that_present_cex))
          return false;
        if (!this.cex.equals(that.cex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getAllVendors_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getAllVendors_result typedOther = (getAllVendors_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetCex()).compareTo(isSetCex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(cex, typedOther.cex);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case SUCCESS:
              if (field.type == TType.LIST) {
                {
                  TList _list46 = iprot.readListBegin();
                  this.success = new ArrayList<Vendor>(_list46.size);
                  for (int _i47 = 0; _i47 < _list46.size; ++_i47)
                  {
                    Vendor _elem48;
                    _elem48 = new Vendor();
                    _elem48.read(iprot);
                    this.success.add(_elem48);
                  }
                  iprot.readListEnd();
                }
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case CEX:
              if (field.type == TType.STRUCT) {
                this.cex = new CatalogServiceException();
                this.cex.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        {
          oprot.writeListBegin(new TList(TType.STRUCT, this.success.size()));
          for (Vendor _iter49 : this.success)
          {
            _iter49.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      } else if (this.isSetCex()) {
        oprot.writeFieldBegin(CEX_FIELD_DESC);
        this.cex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getAllVendors_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("cex:");
      if (this.cex == null) {
        sb.append("null");
      } else {
        sb.append(this.cex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

}