Subversion Repositories SmartDukaan

Rev

Rev 1013 | Rev 1491 | Go to most recent revision | Blame | Compare with Previous | 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.user;

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 UserContextService {

  /**
   * service
   */
  public interface Iface {

    /**
     * For closing the open session in sqlalchemy
     */
    public void closeSession() throws TException;

    public User createAnonymousUser(String jsessionId) throws UserContextException, TException;

    public User getUserById(long userId) throws UserContextException, TException;

    public User createUser(User user) throws UserContextException, TException;

    public User updateUser(User user) throws UserContextException, TException;

    public boolean deleteUser(long userId) throws UserContextException, TException;

    public UserState getUserState(long userId) throws UserContextException, TException;

    public User authenticateUser(String email, String password) throws AuthenticationException, TException;

    public boolean userExists(String email) throws UserContextException, TException;

    public long addAddressForUser(long userId, Address address, boolean setDefault) throws UserContextException, TException;

    public boolean removeAddressForUser(long userid, long addressId) throws UserContextException, TException;

    public boolean setUserAsLoggedIn(long userId, long timestamp) throws UserContextException, TException;

    public boolean setUserAsLoggedOut(long userid, long timestamp) throws UserContextException, TException;

    public boolean setDefaultAddress(long userid, long addressId) throws UserContextException, TException;

    public boolean updatePassword(long userid, String oldPassword, String newPassword) throws UserContextException, TException;

    public boolean forgotPassword(String email, String newPassword) throws UserContextException, TException;

    public List<Address> getAllAddressesForUser(long userId) throws UserContextException, TException;

    public long getDefaultAddressId(long userId) throws UserContextException, TException;

    public String getDefaultPincode(long userId) throws UserContextException, TException;

    public boolean saveUserCommunication(long userId, String replyTo, long communicationType, long orderId, String airwaybillNo, String productName, String subject, String message) throws UserCommunicationException, TException;

    public long createCart(long userId) throws ShoppingCartException, TException;

    public Cart getCurrentCart(long userId) throws ShoppingCartException, TException;

    public Cart getCart(long cartId) throws ShoppingCartException, TException;

    public List<Cart> getCartsForUser(long userId, CartStatus status) throws ShoppingCartException, TException;

    public List<Cart> getCartsByStatus(CartStatus status) throws ShoppingCartException, TException;

    public List<Cart> getCartsByTime(long from_time, long to_time, CartStatus status) throws ShoppingCartException, TException;

    public void changeCartStatus(long cartId, CartStatus status) throws ShoppingCartException, TException;

    public void addItemToCart(long cartId, long itemId, long quantity) throws ShoppingCartException, TException;

    public void deleteItemFromCart(long cartId, long itemId) throws ShoppingCartException, TException;

    public void changeQuantity(long cartId, long itemId, long quantity) throws ShoppingCartException, TException;

    public void changeItemStatus(long cartId, long itemId, LineStatus status) throws ShoppingCartException, TException;

    public void addAddressToCart(long cartId, long addressId) throws ShoppingCartException, TException;

    /**
     * Creates a transaction and multiple orders for the given cart. Returns the transaction ID created.
     * 
     * @param cartId
     */
    public long createOrders(long cartId) throws ShoppingCartException, TException;

    /**
     * Validates that:
     * 1. The checkout timestamp is greater than the updatedOn timestamp.
     * 2. None of the lines in the cart for an inactive item.
     * 3. The estimate for any of the lines in cart doesn't change.
     * Returns true only if all three hold.
     * 
     * @param cartId
     */
    public boolean validateCart(long cartId) throws ShoppingCartException, TException;

    /**
     * Merges the lines from the first cart into the second cart. Lines with duplicate items are removed.
     * 
     * @param fromCartId
     * @param toCartId
     */
    public void mergeCart(long fromCartId, long toCartId) throws TException;

    /**
     * Sets the checkedOutOn timestamp of the cart. Raises an exception if the specified cart can't be found.
     * 
     * @param cartId
     */
    public boolean checkOut(long cartId) throws ShoppingCartException, TException;

    /**
     * The second parameter is a map of item ids and their quantities which have been successfully processed.
     * This methods removes the specified quantiry of the specified item from the cart.
     * 
     * @param cartId
     * @param items
     */
    public boolean resetCart(long cartId, Map<Long,Double> items) throws ShoppingCartException, TException;

    /**
     * Widgets
     * 
     * @param userId
     */
    public Widget getMyResearch(long userId) throws WidgetException, TException;

    public boolean updateMyResearch(long userId, long itemId) throws WidgetException, TException;

    public void deleteItemFromMyResearch(long userId, long itemId) throws WidgetException, TException;

    public void updateBrowseHistory(long userId, long itemId) throws TException;

    public Widget getBrowseHistory(long userId) throws WidgetException, TException;

    public void mergeBrowseHistory(long fromUserId, long toUserId) throws 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 void closeSession() throws TException
    {
      send_closeSession();
      recv_closeSession();
    }

    public void send_closeSession() throws TException
    {
      oprot_.writeMessageBegin(new TMessage("closeSession", TMessageType.CALL, seqid_));
      closeSession_args args = new closeSession_args();
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public void recv_closeSession() throws TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      closeSession_result result = new closeSession_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      return;
    }

    public User createAnonymousUser(String jsessionId) throws UserContextException, TException
    {
      send_createAnonymousUser(jsessionId);
      return recv_createAnonymousUser();
    }

    public void send_createAnonymousUser(String jsessionId) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("createAnonymousUser", TMessageType.CALL, seqid_));
      createAnonymousUser_args args = new createAnonymousUser_args();
      args.jsessionId = jsessionId;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public User recv_createAnonymousUser() throws UserContextException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      createAnonymousUser_result result = new createAnonymousUser_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.ucex != null) {
        throw result.ucex;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "createAnonymousUser failed: unknown result");
    }

    public User getUserById(long userId) throws UserContextException, TException
    {
      send_getUserById(userId);
      return recv_getUserById();
    }

    public void send_getUserById(long userId) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("getUserById", TMessageType.CALL, seqid_));
      getUserById_args args = new getUserById_args();
      args.userId = userId;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public User recv_getUserById() throws UserContextException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      getUserById_result result = new getUserById_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.ucex != null) {
        throw result.ucex;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getUserById failed: unknown result");
    }

    public User createUser(User user) throws UserContextException, TException
    {
      send_createUser(user);
      return recv_createUser();
    }

    public void send_createUser(User user) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("createUser", TMessageType.CALL, seqid_));
      createUser_args args = new createUser_args();
      args.user = user;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public User recv_createUser() throws UserContextException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      createUser_result result = new createUser_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.ucex != null) {
        throw result.ucex;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "createUser failed: unknown result");
    }

    public User updateUser(User user) throws UserContextException, TException
    {
      send_updateUser(user);
      return recv_updateUser();
    }

    public void send_updateUser(User user) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("updateUser", TMessageType.CALL, seqid_));
      updateUser_args args = new updateUser_args();
      args.user = user;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public User recv_updateUser() throws UserContextException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      updateUser_result result = new updateUser_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.ucex != null) {
        throw result.ucex;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "updateUser failed: unknown result");
    }

    public boolean deleteUser(long userId) throws UserContextException, TException
    {
      send_deleteUser(userId);
      return recv_deleteUser();
    }

    public void send_deleteUser(long userId) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("deleteUser", TMessageType.CALL, seqid_));
      deleteUser_args args = new deleteUser_args();
      args.userId = userId;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public boolean recv_deleteUser() throws UserContextException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      deleteUser_result result = new deleteUser_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.ucex != null) {
        throw result.ucex;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "deleteUser failed: unknown result");
    }

    public UserState getUserState(long userId) throws UserContextException, TException
    {
      send_getUserState(userId);
      return recv_getUserState();
    }

    public void send_getUserState(long userId) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("getUserState", TMessageType.CALL, seqid_));
      getUserState_args args = new getUserState_args();
      args.userId = userId;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public UserState recv_getUserState() throws UserContextException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      getUserState_result result = new getUserState_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.ucex != null) {
        throw result.ucex;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getUserState failed: unknown result");
    }

    public User authenticateUser(String email, String password) throws AuthenticationException, TException
    {
      send_authenticateUser(email, password);
      return recv_authenticateUser();
    }

    public void send_authenticateUser(String email, String password) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("authenticateUser", TMessageType.CALL, seqid_));
      authenticateUser_args args = new authenticateUser_args();
      args.email = email;
      args.password = password;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public User recv_authenticateUser() throws AuthenticationException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      authenticateUser_result result = new authenticateUser_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.auex != null) {
        throw result.auex;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "authenticateUser failed: unknown result");
    }

    public boolean userExists(String email) throws UserContextException, TException
    {
      send_userExists(email);
      return recv_userExists();
    }

    public void send_userExists(String email) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("userExists", TMessageType.CALL, seqid_));
      userExists_args args = new userExists_args();
      args.email = email;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public boolean recv_userExists() throws UserContextException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      userExists_result result = new userExists_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.ucx != null) {
        throw result.ucx;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "userExists failed: unknown result");
    }

    public long addAddressForUser(long userId, Address address, boolean setDefault) throws UserContextException, TException
    {
      send_addAddressForUser(userId, address, setDefault);
      return recv_addAddressForUser();
    }

    public void send_addAddressForUser(long userId, Address address, boolean setDefault) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("addAddressForUser", TMessageType.CALL, seqid_));
      addAddressForUser_args args = new addAddressForUser_args();
      args.userId = userId;
      args.address = address;
      args.setDefault = setDefault;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public long recv_addAddressForUser() throws UserContextException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      addAddressForUser_result result = new addAddressForUser_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.ucx != null) {
        throw result.ucx;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "addAddressForUser failed: unknown result");
    }

    public boolean removeAddressForUser(long userid, long addressId) throws UserContextException, TException
    {
      send_removeAddressForUser(userid, addressId);
      return recv_removeAddressForUser();
    }

    public void send_removeAddressForUser(long userid, long addressId) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("removeAddressForUser", TMessageType.CALL, seqid_));
      removeAddressForUser_args args = new removeAddressForUser_args();
      args.userid = userid;
      args.addressId = addressId;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public boolean recv_removeAddressForUser() throws UserContextException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      removeAddressForUser_result result = new removeAddressForUser_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.ucx != null) {
        throw result.ucx;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "removeAddressForUser failed: unknown result");
    }

    public boolean setUserAsLoggedIn(long userId, long timestamp) throws UserContextException, TException
    {
      send_setUserAsLoggedIn(userId, timestamp);
      return recv_setUserAsLoggedIn();
    }

    public void send_setUserAsLoggedIn(long userId, long timestamp) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("setUserAsLoggedIn", TMessageType.CALL, seqid_));
      setUserAsLoggedIn_args args = new setUserAsLoggedIn_args();
      args.userId = userId;
      args.timestamp = timestamp;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public boolean recv_setUserAsLoggedIn() throws UserContextException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      setUserAsLoggedIn_result result = new setUserAsLoggedIn_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.ucx != null) {
        throw result.ucx;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "setUserAsLoggedIn failed: unknown result");
    }

    public boolean setUserAsLoggedOut(long userid, long timestamp) throws UserContextException, TException
    {
      send_setUserAsLoggedOut(userid, timestamp);
      return recv_setUserAsLoggedOut();
    }

    public void send_setUserAsLoggedOut(long userid, long timestamp) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("setUserAsLoggedOut", TMessageType.CALL, seqid_));
      setUserAsLoggedOut_args args = new setUserAsLoggedOut_args();
      args.userid = userid;
      args.timestamp = timestamp;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public boolean recv_setUserAsLoggedOut() throws UserContextException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      setUserAsLoggedOut_result result = new setUserAsLoggedOut_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.ucx != null) {
        throw result.ucx;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "setUserAsLoggedOut failed: unknown result");
    }

    public boolean setDefaultAddress(long userid, long addressId) throws UserContextException, TException
    {
      send_setDefaultAddress(userid, addressId);
      return recv_setDefaultAddress();
    }

    public void send_setDefaultAddress(long userid, long addressId) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("setDefaultAddress", TMessageType.CALL, seqid_));
      setDefaultAddress_args args = new setDefaultAddress_args();
      args.userid = userid;
      args.addressId = addressId;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public boolean recv_setDefaultAddress() throws UserContextException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      setDefaultAddress_result result = new setDefaultAddress_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.ucx != null) {
        throw result.ucx;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "setDefaultAddress failed: unknown result");
    }

    public boolean updatePassword(long userid, String oldPassword, String newPassword) throws UserContextException, TException
    {
      send_updatePassword(userid, oldPassword, newPassword);
      return recv_updatePassword();
    }

    public void send_updatePassword(long userid, String oldPassword, String newPassword) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("updatePassword", TMessageType.CALL, seqid_));
      updatePassword_args args = new updatePassword_args();
      args.userid = userid;
      args.oldPassword = oldPassword;
      args.newPassword = newPassword;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public boolean recv_updatePassword() throws UserContextException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      updatePassword_result result = new updatePassword_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.ucx != null) {
        throw result.ucx;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "updatePassword failed: unknown result");
    }

    public boolean forgotPassword(String email, String newPassword) throws UserContextException, TException
    {
      send_forgotPassword(email, newPassword);
      return recv_forgotPassword();
    }

    public void send_forgotPassword(String email, String newPassword) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("forgotPassword", TMessageType.CALL, seqid_));
      forgotPassword_args args = new forgotPassword_args();
      args.email = email;
      args.newPassword = newPassword;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public boolean recv_forgotPassword() throws UserContextException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      forgotPassword_result result = new forgotPassword_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.ucx != null) {
        throw result.ucx;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "forgotPassword failed: unknown result");
    }

    public List<Address> getAllAddressesForUser(long userId) throws UserContextException, TException
    {
      send_getAllAddressesForUser(userId);
      return recv_getAllAddressesForUser();
    }

    public void send_getAllAddressesForUser(long userId) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("getAllAddressesForUser", TMessageType.CALL, seqid_));
      getAllAddressesForUser_args args = new getAllAddressesForUser_args();
      args.userId = userId;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public List<Address> recv_getAllAddressesForUser() throws UserContextException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      getAllAddressesForUser_result result = new getAllAddressesForUser_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.ucx != null) {
        throw result.ucx;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getAllAddressesForUser failed: unknown result");
    }

    public long getDefaultAddressId(long userId) throws UserContextException, TException
    {
      send_getDefaultAddressId(userId);
      return recv_getDefaultAddressId();
    }

    public void send_getDefaultAddressId(long userId) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("getDefaultAddressId", TMessageType.CALL, seqid_));
      getDefaultAddressId_args args = new getDefaultAddressId_args();
      args.userId = userId;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public long recv_getDefaultAddressId() throws UserContextException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      getDefaultAddressId_result result = new getDefaultAddressId_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.ucx != null) {
        throw result.ucx;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getDefaultAddressId failed: unknown result");
    }

    public String getDefaultPincode(long userId) throws UserContextException, TException
    {
      send_getDefaultPincode(userId);
      return recv_getDefaultPincode();
    }

    public void send_getDefaultPincode(long userId) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("getDefaultPincode", TMessageType.CALL, seqid_));
      getDefaultPincode_args args = new getDefaultPincode_args();
      args.userId = userId;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public String recv_getDefaultPincode() throws UserContextException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      getDefaultPincode_result result = new getDefaultPincode_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.ucx != null) {
        throw result.ucx;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getDefaultPincode failed: unknown result");
    }

    public boolean saveUserCommunication(long userId, String replyTo, long communicationType, long orderId, String airwaybillNo, String productName, String subject, String message) throws UserCommunicationException, TException
    {
      send_saveUserCommunication(userId, replyTo, communicationType, orderId, airwaybillNo, productName, subject, message);
      return recv_saveUserCommunication();
    }

    public void send_saveUserCommunication(long userId, String replyTo, long communicationType, long orderId, String airwaybillNo, String productName, String subject, String message) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("saveUserCommunication", TMessageType.CALL, seqid_));
      saveUserCommunication_args args = new saveUserCommunication_args();
      args.userId = userId;
      args.replyTo = replyTo;
      args.communicationType = communicationType;
      args.orderId = orderId;
      args.airwaybillNo = airwaybillNo;
      args.productName = productName;
      args.subject = subject;
      args.message = message;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public boolean recv_saveUserCommunication() throws UserCommunicationException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      saveUserCommunication_result result = new saveUserCommunication_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.ucx != null) {
        throw result.ucx;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "saveUserCommunication failed: unknown result");
    }

    public long createCart(long userId) throws ShoppingCartException, TException
    {
      send_createCart(userId);
      return recv_createCart();
    }

    public void send_createCart(long userId) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("createCart", TMessageType.CALL, seqid_));
      createCart_args args = new createCart_args();
      args.userId = userId;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public long recv_createCart() throws ShoppingCartException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      createCart_result result = new createCart_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.scx != null) {
        throw result.scx;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "createCart failed: unknown result");
    }

    public Cart getCurrentCart(long userId) throws ShoppingCartException, TException
    {
      send_getCurrentCart(userId);
      return recv_getCurrentCart();
    }

    public void send_getCurrentCart(long userId) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("getCurrentCart", TMessageType.CALL, seqid_));
      getCurrentCart_args args = new getCurrentCart_args();
      args.userId = userId;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public Cart recv_getCurrentCart() throws ShoppingCartException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      getCurrentCart_result result = new getCurrentCart_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.scx != null) {
        throw result.scx;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getCurrentCart failed: unknown result");
    }

    public Cart getCart(long cartId) throws ShoppingCartException, TException
    {
      send_getCart(cartId);
      return recv_getCart();
    }

    public void send_getCart(long cartId) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("getCart", TMessageType.CALL, seqid_));
      getCart_args args = new getCart_args();
      args.cartId = cartId;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public Cart recv_getCart() throws ShoppingCartException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      getCart_result result = new getCart_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.scx != null) {
        throw result.scx;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getCart failed: unknown result");
    }

    public List<Cart> getCartsForUser(long userId, CartStatus status) throws ShoppingCartException, TException
    {
      send_getCartsForUser(userId, status);
      return recv_getCartsForUser();
    }

    public void send_getCartsForUser(long userId, CartStatus status) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("getCartsForUser", TMessageType.CALL, seqid_));
      getCartsForUser_args args = new getCartsForUser_args();
      args.userId = userId;
      args.status = status;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public List<Cart> recv_getCartsForUser() throws ShoppingCartException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      getCartsForUser_result result = new getCartsForUser_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.scx != null) {
        throw result.scx;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getCartsForUser failed: unknown result");
    }

    public List<Cart> getCartsByStatus(CartStatus status) throws ShoppingCartException, TException
    {
      send_getCartsByStatus(status);
      return recv_getCartsByStatus();
    }

    public void send_getCartsByStatus(CartStatus status) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("getCartsByStatus", TMessageType.CALL, seqid_));
      getCartsByStatus_args args = new getCartsByStatus_args();
      args.status = status;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public List<Cart> recv_getCartsByStatus() throws ShoppingCartException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      getCartsByStatus_result result = new getCartsByStatus_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.scx != null) {
        throw result.scx;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getCartsByStatus failed: unknown result");
    }

    public List<Cart> getCartsByTime(long from_time, long to_time, CartStatus status) throws ShoppingCartException, TException
    {
      send_getCartsByTime(from_time, to_time, status);
      return recv_getCartsByTime();
    }

    public void send_getCartsByTime(long from_time, long to_time, CartStatus status) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("getCartsByTime", TMessageType.CALL, seqid_));
      getCartsByTime_args args = new getCartsByTime_args();
      args.from_time = from_time;
      args.to_time = to_time;
      args.status = status;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public List<Cart> recv_getCartsByTime() throws ShoppingCartException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      getCartsByTime_result result = new getCartsByTime_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.scx != null) {
        throw result.scx;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getCartsByTime failed: unknown result");
    }

    public void changeCartStatus(long cartId, CartStatus status) throws ShoppingCartException, TException
    {
      send_changeCartStatus(cartId, status);
      recv_changeCartStatus();
    }

    public void send_changeCartStatus(long cartId, CartStatus status) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("changeCartStatus", TMessageType.CALL, seqid_));
      changeCartStatus_args args = new changeCartStatus_args();
      args.cartId = cartId;
      args.status = status;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public void recv_changeCartStatus() throws ShoppingCartException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      changeCartStatus_result result = new changeCartStatus_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.scx != null) {
        throw result.scx;
      }
      return;
    }

    public void addItemToCart(long cartId, long itemId, long quantity) throws ShoppingCartException, TException
    {
      send_addItemToCart(cartId, itemId, quantity);
      recv_addItemToCart();
    }

    public void send_addItemToCart(long cartId, long itemId, long quantity) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("addItemToCart", TMessageType.CALL, seqid_));
      addItemToCart_args args = new addItemToCart_args();
      args.cartId = cartId;
      args.itemId = itemId;
      args.quantity = quantity;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public void recv_addItemToCart() throws ShoppingCartException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      addItemToCart_result result = new addItemToCart_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.scx != null) {
        throw result.scx;
      }
      return;
    }

    public void deleteItemFromCart(long cartId, long itemId) throws ShoppingCartException, TException
    {
      send_deleteItemFromCart(cartId, itemId);
      recv_deleteItemFromCart();
    }

    public void send_deleteItemFromCart(long cartId, long itemId) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("deleteItemFromCart", TMessageType.CALL, seqid_));
      deleteItemFromCart_args args = new deleteItemFromCart_args();
      args.cartId = cartId;
      args.itemId = itemId;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public void recv_deleteItemFromCart() throws ShoppingCartException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      deleteItemFromCart_result result = new deleteItemFromCart_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.scx != null) {
        throw result.scx;
      }
      return;
    }

    public void changeQuantity(long cartId, long itemId, long quantity) throws ShoppingCartException, TException
    {
      send_changeQuantity(cartId, itemId, quantity);
      recv_changeQuantity();
    }

    public void send_changeQuantity(long cartId, long itemId, long quantity) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("changeQuantity", TMessageType.CALL, seqid_));
      changeQuantity_args args = new changeQuantity_args();
      args.cartId = cartId;
      args.itemId = itemId;
      args.quantity = quantity;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public void recv_changeQuantity() throws ShoppingCartException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      changeQuantity_result result = new changeQuantity_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.scx != null) {
        throw result.scx;
      }
      return;
    }

    public void changeItemStatus(long cartId, long itemId, LineStatus status) throws ShoppingCartException, TException
    {
      send_changeItemStatus(cartId, itemId, status);
      recv_changeItemStatus();
    }

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

    public void recv_changeItemStatus() throws ShoppingCartException, 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.scx != null) {
        throw result.scx;
      }
      return;
    }

    public void addAddressToCart(long cartId, long addressId) throws ShoppingCartException, TException
    {
      send_addAddressToCart(cartId, addressId);
      recv_addAddressToCart();
    }

    public void send_addAddressToCart(long cartId, long addressId) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("addAddressToCart", TMessageType.CALL, seqid_));
      addAddressToCart_args args = new addAddressToCart_args();
      args.cartId = cartId;
      args.addressId = addressId;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public void recv_addAddressToCart() throws ShoppingCartException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      addAddressToCart_result result = new addAddressToCart_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.scx != null) {
        throw result.scx;
      }
      return;
    }

    public long createOrders(long cartId) throws ShoppingCartException, TException
    {
      send_createOrders(cartId);
      return recv_createOrders();
    }

    public void send_createOrders(long cartId) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("createOrders", TMessageType.CALL, seqid_));
      createOrders_args args = new createOrders_args();
      args.cartId = cartId;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public long recv_createOrders() throws ShoppingCartException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      createOrders_result result = new createOrders_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.scx != null) {
        throw result.scx;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "createOrders failed: unknown result");
    }

    public boolean validateCart(long cartId) throws ShoppingCartException, TException
    {
      send_validateCart(cartId);
      return recv_validateCart();
    }

    public void send_validateCart(long cartId) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("validateCart", TMessageType.CALL, seqid_));
      validateCart_args args = new validateCart_args();
      args.cartId = cartId;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public boolean recv_validateCart() throws ShoppingCartException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      validateCart_result result = new validateCart_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.scex != null) {
        throw result.scex;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "validateCart failed: unknown result");
    }

    public void mergeCart(long fromCartId, long toCartId) throws TException
    {
      send_mergeCart(fromCartId, toCartId);
      recv_mergeCart();
    }

    public void send_mergeCart(long fromCartId, long toCartId) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("mergeCart", TMessageType.CALL, seqid_));
      mergeCart_args args = new mergeCart_args();
      args.fromCartId = fromCartId;
      args.toCartId = toCartId;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public void recv_mergeCart() throws TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      mergeCart_result result = new mergeCart_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      return;
    }

    public boolean checkOut(long cartId) throws ShoppingCartException, TException
    {
      send_checkOut(cartId);
      return recv_checkOut();
    }

    public void send_checkOut(long cartId) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("checkOut", TMessageType.CALL, seqid_));
      checkOut_args args = new checkOut_args();
      args.cartId = cartId;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public boolean recv_checkOut() throws ShoppingCartException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      checkOut_result result = new checkOut_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.scex != null) {
        throw result.scex;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "checkOut failed: unknown result");
    }

    public boolean resetCart(long cartId, Map<Long,Double> items) throws ShoppingCartException, TException
    {
      send_resetCart(cartId, items);
      return recv_resetCart();
    }

    public void send_resetCart(long cartId, Map<Long,Double> items) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("resetCart", TMessageType.CALL, seqid_));
      resetCart_args args = new resetCart_args();
      args.cartId = cartId;
      args.items = items;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public boolean recv_resetCart() throws ShoppingCartException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      resetCart_result result = new resetCart_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.scex != null) {
        throw result.scex;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "resetCart failed: unknown result");
    }

    public Widget getMyResearch(long userId) throws WidgetException, TException
    {
      send_getMyResearch(userId);
      return recv_getMyResearch();
    }

    public void send_getMyResearch(long userId) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("getMyResearch", TMessageType.CALL, seqid_));
      getMyResearch_args args = new getMyResearch_args();
      args.userId = userId;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public Widget recv_getMyResearch() throws WidgetException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      getMyResearch_result result = new getMyResearch_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.scx != null) {
        throw result.scx;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getMyResearch failed: unknown result");
    }

    public boolean updateMyResearch(long userId, long itemId) throws WidgetException, TException
    {
      send_updateMyResearch(userId, itemId);
      return recv_updateMyResearch();
    }

    public void send_updateMyResearch(long userId, long itemId) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("updateMyResearch", TMessageType.CALL, seqid_));
      updateMyResearch_args args = new updateMyResearch_args();
      args.userId = userId;
      args.itemId = itemId;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public boolean recv_updateMyResearch() throws WidgetException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      updateMyResearch_result result = new updateMyResearch_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.scx != null) {
        throw result.scx;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "updateMyResearch failed: unknown result");
    }

    public void deleteItemFromMyResearch(long userId, long itemId) throws WidgetException, TException
    {
      send_deleteItemFromMyResearch(userId, itemId);
      recv_deleteItemFromMyResearch();
    }

    public void send_deleteItemFromMyResearch(long userId, long itemId) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("deleteItemFromMyResearch", TMessageType.CALL, seqid_));
      deleteItemFromMyResearch_args args = new deleteItemFromMyResearch_args();
      args.userId = userId;
      args.itemId = itemId;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public void recv_deleteItemFromMyResearch() throws WidgetException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      deleteItemFromMyResearch_result result = new deleteItemFromMyResearch_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.scx != null) {
        throw result.scx;
      }
      return;
    }

    public void updateBrowseHistory(long userId, long itemId) throws TException
    {
      send_updateBrowseHistory(userId, itemId);
      recv_updateBrowseHistory();
    }

    public void send_updateBrowseHistory(long userId, long itemId) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("updateBrowseHistory", TMessageType.CALL, seqid_));
      updateBrowseHistory_args args = new updateBrowseHistory_args();
      args.userId = userId;
      args.itemId = itemId;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public void recv_updateBrowseHistory() throws TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      updateBrowseHistory_result result = new updateBrowseHistory_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      return;
    }

    public Widget getBrowseHistory(long userId) throws WidgetException, TException
    {
      send_getBrowseHistory(userId);
      return recv_getBrowseHistory();
    }

    public void send_getBrowseHistory(long userId) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("getBrowseHistory", TMessageType.CALL, seqid_));
      getBrowseHistory_args args = new getBrowseHistory_args();
      args.userId = userId;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public Widget recv_getBrowseHistory() throws WidgetException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      getBrowseHistory_result result = new getBrowseHistory_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.scx != null) {
        throw result.scx;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getBrowseHistory failed: unknown result");
    }

    public void mergeBrowseHistory(long fromUserId, long toUserId) throws TException
    {
      send_mergeBrowseHistory(fromUserId, toUserId);
      recv_mergeBrowseHistory();
    }

    public void send_mergeBrowseHistory(long fromUserId, long toUserId) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("mergeBrowseHistory", TMessageType.CALL, seqid_));
      mergeBrowseHistory_args args = new mergeBrowseHistory_args();
      args.fromUserId = fromUserId;
      args.toUserId = toUserId;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public void recv_mergeBrowseHistory() throws TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      mergeBrowseHistory_result result = new mergeBrowseHistory_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      return;
    }

  }
  public static class Processor implements TProcessor {
    private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName());
    public Processor(Iface iface)
    {
      iface_ = iface;
      processMap_.put("closeSession", new closeSession());
      processMap_.put("createAnonymousUser", new createAnonymousUser());
      processMap_.put("getUserById", new getUserById());
      processMap_.put("createUser", new createUser());
      processMap_.put("updateUser", new updateUser());
      processMap_.put("deleteUser", new deleteUser());
      processMap_.put("getUserState", new getUserState());
      processMap_.put("authenticateUser", new authenticateUser());
      processMap_.put("userExists", new userExists());
      processMap_.put("addAddressForUser", new addAddressForUser());
      processMap_.put("removeAddressForUser", new removeAddressForUser());
      processMap_.put("setUserAsLoggedIn", new setUserAsLoggedIn());
      processMap_.put("setUserAsLoggedOut", new setUserAsLoggedOut());
      processMap_.put("setDefaultAddress", new setDefaultAddress());
      processMap_.put("updatePassword", new updatePassword());
      processMap_.put("forgotPassword", new forgotPassword());
      processMap_.put("getAllAddressesForUser", new getAllAddressesForUser());
      processMap_.put("getDefaultAddressId", new getDefaultAddressId());
      processMap_.put("getDefaultPincode", new getDefaultPincode());
      processMap_.put("saveUserCommunication", new saveUserCommunication());
      processMap_.put("createCart", new createCart());
      processMap_.put("getCurrentCart", new getCurrentCart());
      processMap_.put("getCart", new getCart());
      processMap_.put("getCartsForUser", new getCartsForUser());
      processMap_.put("getCartsByStatus", new getCartsByStatus());
      processMap_.put("getCartsByTime", new getCartsByTime());
      processMap_.put("changeCartStatus", new changeCartStatus());
      processMap_.put("addItemToCart", new addItemToCart());
      processMap_.put("deleteItemFromCart", new deleteItemFromCart());
      processMap_.put("changeQuantity", new changeQuantity());
      processMap_.put("changeItemStatus", new changeItemStatus());
      processMap_.put("addAddressToCart", new addAddressToCart());
      processMap_.put("createOrders", new createOrders());
      processMap_.put("validateCart", new validateCart());
      processMap_.put("mergeCart", new mergeCart());
      processMap_.put("checkOut", new checkOut());
      processMap_.put("resetCart", new resetCart());
      processMap_.put("getMyResearch", new getMyResearch());
      processMap_.put("updateMyResearch", new updateMyResearch());
      processMap_.put("deleteItemFromMyResearch", new deleteItemFromMyResearch());
      processMap_.put("updateBrowseHistory", new updateBrowseHistory());
      processMap_.put("getBrowseHistory", new getBrowseHistory());
      processMap_.put("mergeBrowseHistory", new mergeBrowseHistory());
    }

    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 closeSession implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        closeSession_args args = new closeSession_args();
        args.read(iprot);
        iprot.readMessageEnd();
        closeSession_result result = new closeSession_result();
        iface_.closeSession();
        oprot.writeMessageBegin(new TMessage("closeSession", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

    private class authenticateUser implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        authenticateUser_args args = new authenticateUser_args();
        args.read(iprot);
        iprot.readMessageEnd();
        authenticateUser_result result = new authenticateUser_result();
        try {
          result.success = iface_.authenticateUser(args.email, args.password);
        } catch (AuthenticationException auex) {
          result.auex = auex;
        } catch (Throwable th) {
          LOGGER.error("Internal error processing authenticateUser", th);
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing authenticateUser");
          oprot.writeMessageBegin(new TMessage("authenticateUser", TMessageType.EXCEPTION, seqid));
          x.write(oprot);
          oprot.writeMessageEnd();
          oprot.getTransport().flush();
          return;
        }
        oprot.writeMessageBegin(new TMessage("authenticateUser", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

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

    }

    private class addAddressForUser implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        addAddressForUser_args args = new addAddressForUser_args();
        args.read(iprot);
        iprot.readMessageEnd();
        addAddressForUser_result result = new addAddressForUser_result();
        try {
          result.success = iface_.addAddressForUser(args.userId, args.address, args.setDefault);
          result.setSuccessIsSet(true);
        } catch (UserContextException ucx) {
          result.ucx = ucx;
        } catch (Throwable th) {
          LOGGER.error("Internal error processing addAddressForUser", th);
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing addAddressForUser");
          oprot.writeMessageBegin(new TMessage("addAddressForUser", TMessageType.EXCEPTION, seqid));
          x.write(oprot);
          oprot.writeMessageEnd();
          oprot.getTransport().flush();
          return;
        }
        oprot.writeMessageBegin(new TMessage("addAddressForUser", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

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

    }

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

    }

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

    }

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

    }

    private class updatePassword implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        updatePassword_args args = new updatePassword_args();
        args.read(iprot);
        iprot.readMessageEnd();
        updatePassword_result result = new updatePassword_result();
        try {
          result.success = iface_.updatePassword(args.userid, args.oldPassword, args.newPassword);
          result.setSuccessIsSet(true);
        } catch (UserContextException ucx) {
          result.ucx = ucx;
        } catch (Throwable th) {
          LOGGER.error("Internal error processing updatePassword", th);
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing updatePassword");
          oprot.writeMessageBegin(new TMessage("updatePassword", TMessageType.EXCEPTION, seqid));
          x.write(oprot);
          oprot.writeMessageEnd();
          oprot.getTransport().flush();
          return;
        }
        oprot.writeMessageBegin(new TMessage("updatePassword", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

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

    }

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

    }

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

    }

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

    }

    private class saveUserCommunication implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        saveUserCommunication_args args = new saveUserCommunication_args();
        args.read(iprot);
        iprot.readMessageEnd();
        saveUserCommunication_result result = new saveUserCommunication_result();
        try {
          result.success = iface_.saveUserCommunication(args.userId, args.replyTo, args.communicationType, args.orderId, args.airwaybillNo, args.productName, args.subject, args.message);
          result.setSuccessIsSet(true);
        } catch (UserCommunicationException ucx) {
          result.ucx = ucx;
        } catch (Throwable th) {
          LOGGER.error("Internal error processing saveUserCommunication", th);
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing saveUserCommunication");
          oprot.writeMessageBegin(new TMessage("saveUserCommunication", TMessageType.EXCEPTION, seqid));
          x.write(oprot);
          oprot.writeMessageEnd();
          oprot.getTransport().flush();
          return;
        }
        oprot.writeMessageBegin(new TMessage("saveUserCommunication", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

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

    }

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

    }

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

    }

    private class getCartsForUser implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        getCartsForUser_args args = new getCartsForUser_args();
        args.read(iprot);
        iprot.readMessageEnd();
        getCartsForUser_result result = new getCartsForUser_result();
        try {
          result.success = iface_.getCartsForUser(args.userId, args.status);
        } catch (ShoppingCartException scx) {
          result.scx = scx;
        } catch (Throwable th) {
          LOGGER.error("Internal error processing getCartsForUser", th);
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing getCartsForUser");
          oprot.writeMessageBegin(new TMessage("getCartsForUser", TMessageType.EXCEPTION, seqid));
          x.write(oprot);
          oprot.writeMessageEnd();
          oprot.getTransport().flush();
          return;
        }
        oprot.writeMessageBegin(new TMessage("getCartsForUser", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

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

    }

    private class getCartsByTime implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        getCartsByTime_args args = new getCartsByTime_args();
        args.read(iprot);
        iprot.readMessageEnd();
        getCartsByTime_result result = new getCartsByTime_result();
        try {
          result.success = iface_.getCartsByTime(args.from_time, args.to_time, args.status);
        } catch (ShoppingCartException scx) {
          result.scx = scx;
        } catch (Throwable th) {
          LOGGER.error("Internal error processing getCartsByTime", th);
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing getCartsByTime");
          oprot.writeMessageBegin(new TMessage("getCartsByTime", TMessageType.EXCEPTION, seqid));
          x.write(oprot);
          oprot.writeMessageEnd();
          oprot.getTransport().flush();
          return;
        }
        oprot.writeMessageBegin(new TMessage("getCartsByTime", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

    private class changeCartStatus implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        changeCartStatus_args args = new changeCartStatus_args();
        args.read(iprot);
        iprot.readMessageEnd();
        changeCartStatus_result result = new changeCartStatus_result();
        try {
          iface_.changeCartStatus(args.cartId, args.status);
        } catch (ShoppingCartException scx) {
          result.scx = scx;
        } catch (Throwable th) {
          LOGGER.error("Internal error processing changeCartStatus", th);
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing changeCartStatus");
          oprot.writeMessageBegin(new TMessage("changeCartStatus", TMessageType.EXCEPTION, seqid));
          x.write(oprot);
          oprot.writeMessageEnd();
          oprot.getTransport().flush();
          return;
        }
        oprot.writeMessageBegin(new TMessage("changeCartStatus", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

    private class addItemToCart implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        addItemToCart_args args = new addItemToCart_args();
        args.read(iprot);
        iprot.readMessageEnd();
        addItemToCart_result result = new addItemToCart_result();
        try {
          iface_.addItemToCart(args.cartId, args.itemId, args.quantity);
        } catch (ShoppingCartException scx) {
          result.scx = scx;
        } catch (Throwable th) {
          LOGGER.error("Internal error processing addItemToCart", th);
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing addItemToCart");
          oprot.writeMessageBegin(new TMessage("addItemToCart", TMessageType.EXCEPTION, seqid));
          x.write(oprot);
          oprot.writeMessageEnd();
          oprot.getTransport().flush();
          return;
        }
        oprot.writeMessageBegin(new TMessage("addItemToCart", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

    private class deleteItemFromCart implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        deleteItemFromCart_args args = new deleteItemFromCart_args();
        args.read(iprot);
        iprot.readMessageEnd();
        deleteItemFromCart_result result = new deleteItemFromCart_result();
        try {
          iface_.deleteItemFromCart(args.cartId, args.itemId);
        } catch (ShoppingCartException scx) {
          result.scx = scx;
        } catch (Throwable th) {
          LOGGER.error("Internal error processing deleteItemFromCart", th);
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing deleteItemFromCart");
          oprot.writeMessageBegin(new TMessage("deleteItemFromCart", TMessageType.EXCEPTION, seqid));
          x.write(oprot);
          oprot.writeMessageEnd();
          oprot.getTransport().flush();
          return;
        }
        oprot.writeMessageBegin(new TMessage("deleteItemFromCart", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

    private class changeQuantity implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        changeQuantity_args args = new changeQuantity_args();
        args.read(iprot);
        iprot.readMessageEnd();
        changeQuantity_result result = new changeQuantity_result();
        try {
          iface_.changeQuantity(args.cartId, args.itemId, args.quantity);
        } catch (ShoppingCartException scx) {
          result.scx = scx;
        } catch (Throwable th) {
          LOGGER.error("Internal error processing changeQuantity", th);
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing changeQuantity");
          oprot.writeMessageBegin(new TMessage("changeQuantity", TMessageType.EXCEPTION, seqid));
          x.write(oprot);
          oprot.writeMessageEnd();
          oprot.getTransport().flush();
          return;
        }
        oprot.writeMessageBegin(new TMessage("changeQuantity", 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.cartId, args.itemId, args.status);
        } catch (ShoppingCartException scx) {
          result.scx = scx;
        } 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 addAddressToCart implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        addAddressToCart_args args = new addAddressToCart_args();
        args.read(iprot);
        iprot.readMessageEnd();
        addAddressToCart_result result = new addAddressToCart_result();
        try {
          iface_.addAddressToCart(args.cartId, args.addressId);
        } catch (ShoppingCartException scx) {
          result.scx = scx;
        } catch (Throwable th) {
          LOGGER.error("Internal error processing addAddressToCart", th);
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing addAddressToCart");
          oprot.writeMessageBegin(new TMessage("addAddressToCart", TMessageType.EXCEPTION, seqid));
          x.write(oprot);
          oprot.writeMessageEnd();
          oprot.getTransport().flush();
          return;
        }
        oprot.writeMessageBegin(new TMessage("addAddressToCart", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

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

    }

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

    }

    private class mergeCart implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        mergeCart_args args = new mergeCart_args();
        args.read(iprot);
        iprot.readMessageEnd();
        mergeCart_result result = new mergeCart_result();
        iface_.mergeCart(args.fromCartId, args.toCartId);
        oprot.writeMessageBegin(new TMessage("mergeCart", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

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

    }

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

    }

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

    }

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

    }

    private class deleteItemFromMyResearch implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        deleteItemFromMyResearch_args args = new deleteItemFromMyResearch_args();
        args.read(iprot);
        iprot.readMessageEnd();
        deleteItemFromMyResearch_result result = new deleteItemFromMyResearch_result();
        try {
          iface_.deleteItemFromMyResearch(args.userId, args.itemId);
        } catch (WidgetException scx) {
          result.scx = scx;
        } catch (Throwable th) {
          LOGGER.error("Internal error processing deleteItemFromMyResearch", th);
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing deleteItemFromMyResearch");
          oprot.writeMessageBegin(new TMessage("deleteItemFromMyResearch", TMessageType.EXCEPTION, seqid));
          x.write(oprot);
          oprot.writeMessageEnd();
          oprot.getTransport().flush();
          return;
        }
        oprot.writeMessageBegin(new TMessage("deleteItemFromMyResearch", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

    private class updateBrowseHistory implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        updateBrowseHistory_args args = new updateBrowseHistory_args();
        args.read(iprot);
        iprot.readMessageEnd();
        updateBrowseHistory_result result = new updateBrowseHistory_result();
        iface_.updateBrowseHistory(args.userId, args.itemId);
        oprot.writeMessageBegin(new TMessage("updateBrowseHistory", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

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

    }

    private class mergeBrowseHistory implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        mergeBrowseHistory_args args = new mergeBrowseHistory_args();
        args.read(iprot);
        iprot.readMessageEnd();
        mergeBrowseHistory_result result = new mergeBrowseHistory_result();
        iface_.mergeBrowseHistory(args.fromUserId, args.toUserId);
        oprot.writeMessageBegin(new TMessage("mergeBrowseHistory", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

  }

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



    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
;

      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;
      }
    }
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
    }});

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

    public closeSession_args() {
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public closeSession_args(closeSession_args other) {
    }

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

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

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      }
    }

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

    public Object getFieldValue(_Fields field) {
      switch (field) {
      }
      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) {
      }
      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 closeSession_args)
        return this.equals((closeSession_args)that);
      return false;
    }

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

      return true;
    }

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

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

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

      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) {
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

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

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

      sb.append(")");
      return sb.toString();
    }

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

  }

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



    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
;

      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;
      }
    }
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
    }});

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

    public closeSession_result() {
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public closeSession_result(closeSession_result other) {
    }

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

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

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      }
    }

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

    public Object getFieldValue(_Fields field) {
      switch (field) {
      }
      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) {
      }
      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 closeSession_result)
        return this.equals((closeSession_result)that);
      return false;
    }

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

      return true;
    }

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

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

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

      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) {
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

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

      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

      sb.append(")");
      return sb.toString();
    }

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

  }

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

    private static final TField JSESSION_ID_FIELD_DESC = new TField("jsessionId", TType.STRING, (short)1);

    private String jsessionId;

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

      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.JSESSION_ID, new FieldMetaData("jsessionId", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRING)));
    }});

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

    public createAnonymousUser_args() {
    }

    public createAnonymousUser_args(
      String jsessionId)
    {
      this();
      this.jsessionId = jsessionId;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public createAnonymousUser_args(createAnonymousUser_args other) {
      if (other.isSetJsessionId()) {
        this.jsessionId = other.jsessionId;
      }
    }

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

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

    public String getJsessionId() {
      return this.jsessionId;
    }

    public createAnonymousUser_args setJsessionId(String jsessionId) {
      this.jsessionId = jsessionId;
      return this;
    }

    public void unsetJsessionId() {
      this.jsessionId = null;
    }

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

    public void setJsessionIdIsSet(boolean value) {
      if (!value) {
        this.jsessionId = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case JSESSION_ID:
        if (value == null) {
          unsetJsessionId();
        } else {
          setJsessionId((String)value);
        }
        break;

      }
    }

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

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case JSESSION_ID:
        return getJsessionId();

      }
      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 JSESSION_ID:
        return isSetJsessionId();
      }
      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 createAnonymousUser_args)
        return this.equals((createAnonymousUser_args)that);
      return false;
    }

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

      boolean this_present_jsessionId = true && this.isSetJsessionId();
      boolean that_present_jsessionId = true && that.isSetJsessionId();
      if (this_present_jsessionId || that_present_jsessionId) {
        if (!(this_present_jsessionId && that_present_jsessionId))
          return false;
        if (!this.jsessionId.equals(that.jsessionId))
          return false;
      }

      return true;
    }

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

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

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

      lastComparison = Boolean.valueOf(isSetJsessionId()).compareTo(isSetJsessionId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(jsessionId, typedOther.jsessionId);
      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 JSESSION_ID:
              if (field.type == TType.STRING) {
                this.jsessionId = iprot.readString();
              } 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.jsessionId != null) {
        oprot.writeFieldBegin(JSESSION_ID_FIELD_DESC);
        oprot.writeString(this.jsessionId);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

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

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

  }

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

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRUCT, (short)0);
    private static final TField UCEX_FIELD_DESC = new TField("ucex", TType.STRUCT, (short)1);

    private User success;
    private UserContextException ucex;

    /** 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"),
      UCEX((short)1, "ucex");

      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, User.class)));
      put(_Fields.UCEX, new FieldMetaData("ucex", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

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

    public createAnonymousUser_result() {
    }

    public createAnonymousUser_result(
      User success,
      UserContextException ucex)
    {
      this();
      this.success = success;
      this.ucex = ucex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public createAnonymousUser_result(createAnonymousUser_result other) {
      if (other.isSetSuccess()) {
        this.success = new User(other.success);
      }
      if (other.isSetUcex()) {
        this.ucex = new UserContextException(other.ucex);
      }
    }

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

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

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

    public createAnonymousUser_result setSuccess(User 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 UserContextException getUcex() {
      return this.ucex;
    }

    public createAnonymousUser_result setUcex(UserContextException ucex) {
      this.ucex = ucex;
      return this;
    }

    public void unsetUcex() {
      this.ucex = null;
    }

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

    public void setUcexIsSet(boolean value) {
      if (!value) {
        this.ucex = null;
      }
    }

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

      case UCEX:
        if (value == null) {
          unsetUcex();
        } else {
          setUcex((UserContextException)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 UCEX:
        return getUcex();

      }
      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 UCEX:
        return isSetUcex();
      }
      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 createAnonymousUser_result)
        return this.equals((createAnonymousUser_result)that);
      return false;
    }

    public boolean equals(createAnonymousUser_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_ucex = true && this.isSetUcex();
      boolean that_present_ucex = true && that.isSetUcex();
      if (this_present_ucex || that_present_ucex) {
        if (!(this_present_ucex && that_present_ucex))
          return false;
        if (!this.ucex.equals(that.ucex))
          return false;
      }

      return true;
    }

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

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

      int lastComparison = 0;
      createAnonymousUser_result typedOther = (createAnonymousUser_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(isSetUcex()).compareTo(isSetUcex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(ucex, typedOther.ucex);
      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 User();
                this.success.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case UCEX:
              if (field.type == TType.STRUCT) {
                this.ucex = new UserContextException();
                this.ucex.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.isSetUcex()) {
        oprot.writeFieldBegin(UCEX_FIELD_DESC);
        this.ucex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("createAnonymousUser_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("ucex:");
      if (this.ucex == null) {
        sb.append("null");
      } else {
        sb.append(this.ucex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

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

  }

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

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

    private long userId;

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

      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 __USERID_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.USER_ID, new FieldMetaData("userId", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
    }});

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

    public getUserById_args() {
    }

    public getUserById_args(
      long userId)
    {
      this();
      this.userId = userId;
      setUserIdIsSet(true);
    }

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

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

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

    public long getUserId() {
      return this.userId;
    }

    public getUserById_args setUserId(long userId) {
      this.userId = userId;
      setUserIdIsSet(true);
      return this;
    }

    public void unsetUserId() {
      __isset_bit_vector.clear(__USERID_ISSET_ID);
    }

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

    public void setUserIdIsSet(boolean value) {
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case USER_ID:
        if (value == null) {
          unsetUserId();
        } else {
          setUserId((Long)value);
        }
        break;

      }
    }

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

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case USER_ID:
        return new Long(getUserId());

      }
      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 USER_ID:
        return isSetUserId();
      }
      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 getUserById_args)
        return this.equals((getUserById_args)that);
      return false;
    }

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

      boolean this_present_userId = true;
      boolean that_present_userId = true;
      if (this_present_userId || that_present_userId) {
        if (!(this_present_userId && that_present_userId))
          return false;
        if (this.userId != that.userId)
          return false;
      }

      return true;
    }

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

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

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

      lastComparison = Boolean.valueOf(isSetUserId()).compareTo(isSetUserId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(userId, typedOther.userId);
      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 USER_ID:
              if (field.type == TType.I64) {
                this.userId = iprot.readI64();
                setUserIdIsSet(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(USER_ID_FIELD_DESC);
      oprot.writeI64(this.userId);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

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

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

  }

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

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRUCT, (short)0);
    private static final TField UCEX_FIELD_DESC = new TField("ucex", TType.STRUCT, (short)1);

    private User success;
    private UserContextException ucex;

    /** 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"),
      UCEX((short)1, "ucex");

      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, User.class)));
      put(_Fields.UCEX, new FieldMetaData("ucex", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

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

    public getUserById_result() {
    }

    public getUserById_result(
      User success,
      UserContextException ucex)
    {
      this();
      this.success = success;
      this.ucex = ucex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getUserById_result(getUserById_result other) {
      if (other.isSetSuccess()) {
        this.success = new User(other.success);
      }
      if (other.isSetUcex()) {
        this.ucex = new UserContextException(other.ucex);
      }
    }

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

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

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

    public getUserById_result setSuccess(User 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 UserContextException getUcex() {
      return this.ucex;
    }

    public getUserById_result setUcex(UserContextException ucex) {
      this.ucex = ucex;
      return this;
    }

    public void unsetUcex() {
      this.ucex = null;
    }

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

    public void setUcexIsSet(boolean value) {
      if (!value) {
        this.ucex = null;
      }
    }

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

      case UCEX:
        if (value == null) {
          unsetUcex();
        } else {
          setUcex((UserContextException)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 UCEX:
        return getUcex();

      }
      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 UCEX:
        return isSetUcex();
      }
      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 getUserById_result)
        return this.equals((getUserById_result)that);
      return false;
    }

    public boolean equals(getUserById_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_ucex = true && this.isSetUcex();
      boolean that_present_ucex = true && that.isSetUcex();
      if (this_present_ucex || that_present_ucex) {
        if (!(this_present_ucex && that_present_ucex))
          return false;
        if (!this.ucex.equals(that.ucex))
          return false;
      }

      return true;
    }

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

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

      int lastComparison = 0;
      getUserById_result typedOther = (getUserById_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(isSetUcex()).compareTo(isSetUcex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(ucex, typedOther.ucex);
      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 User();
                this.success.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case UCEX:
              if (field.type == TType.STRUCT) {
                this.ucex = new UserContextException();
                this.ucex.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.isSetUcex()) {
        oprot.writeFieldBegin(UCEX_FIELD_DESC);
        this.ucex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getUserById_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("ucex:");
      if (this.ucex == null) {
        sb.append("null");
      } else {
        sb.append(this.ucex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

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

  }

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

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

    private User user;

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

      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.USER, new FieldMetaData("user", TFieldRequirementType.DEFAULT, 
          new StructMetaData(TType.STRUCT, User.class)));
    }});

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

    public createUser_args() {
    }

    public createUser_args(
      User user)
    {
      this();
      this.user = user;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public createUser_args(createUser_args other) {
      if (other.isSetUser()) {
        this.user = new User(other.user);
      }
    }

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

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

    public User getUser() {
      return this.user;
    }

    public createUser_args setUser(User user) {
      this.user = user;
      return this;
    }

    public void unsetUser() {
      this.user = null;
    }

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

    public void setUserIsSet(boolean value) {
      if (!value) {
        this.user = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case USER:
        if (value == null) {
          unsetUser();
        } else {
          setUser((User)value);
        }
        break;

      }
    }

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

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case USER:
        return getUser();

      }
      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 USER:
        return isSetUser();
      }
      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 createUser_args)
        return this.equals((createUser_args)that);
      return false;
    }

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

      boolean this_present_user = true && this.isSetUser();
      boolean that_present_user = true && that.isSetUser();
      if (this_present_user || that_present_user) {
        if (!(this_present_user && that_present_user))
          return false;
        if (!this.user.equals(that.user))
          return false;
      }

      return true;
    }

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

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

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

      lastComparison = Boolean.valueOf(isSetUser()).compareTo(isSetUser());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(user, typedOther.user);
      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 USER:
              if (field.type == TType.STRUCT) {
                this.user = new User();
                this.user.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.user != null) {
        oprot.writeFieldBegin(USER_FIELD_DESC);
        this.user.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

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

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

  }

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

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRUCT, (short)0);
    private static final TField UCEX_FIELD_DESC = new TField("ucex", TType.STRUCT, (short)1);

    private User success;
    private UserContextException ucex;

    /** 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"),
      UCEX((short)1, "ucex");

      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, User.class)));
      put(_Fields.UCEX, new FieldMetaData("ucex", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

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

    public createUser_result() {
    }

    public createUser_result(
      User success,
      UserContextException ucex)
    {
      this();
      this.success = success;
      this.ucex = ucex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public createUser_result(createUser_result other) {
      if (other.isSetSuccess()) {
        this.success = new User(other.success);
      }
      if (other.isSetUcex()) {
        this.ucex = new UserContextException(other.ucex);
      }
    }

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

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

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

    public createUser_result setSuccess(User 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 UserContextException getUcex() {
      return this.ucex;
    }

    public createUser_result setUcex(UserContextException ucex) {
      this.ucex = ucex;
      return this;
    }

    public void unsetUcex() {
      this.ucex = null;
    }

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

    public void setUcexIsSet(boolean value) {
      if (!value) {
        this.ucex = null;
      }
    }

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

      case UCEX:
        if (value == null) {
          unsetUcex();
        } else {
          setUcex((UserContextException)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 UCEX:
        return getUcex();

      }
      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 UCEX:
        return isSetUcex();
      }
      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 createUser_result)
        return this.equals((createUser_result)that);
      return false;
    }

    public boolean equals(createUser_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_ucex = true && this.isSetUcex();
      boolean that_present_ucex = true && that.isSetUcex();
      if (this_present_ucex || that_present_ucex) {
        if (!(this_present_ucex && that_present_ucex))
          return false;
        if (!this.ucex.equals(that.ucex))
          return false;
      }

      return true;
    }

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

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

      int lastComparison = 0;
      createUser_result typedOther = (createUser_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(isSetUcex()).compareTo(isSetUcex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(ucex, typedOther.ucex);
      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 User();
                this.success.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case UCEX:
              if (field.type == TType.STRUCT) {
                this.ucex = new UserContextException();
                this.ucex.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.isSetUcex()) {
        oprot.writeFieldBegin(UCEX_FIELD_DESC);
        this.ucex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("createUser_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("ucex:");
      if (this.ucex == null) {
        sb.append("null");
      } else {
        sb.append(this.ucex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

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

  }

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

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

    private User user;

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

      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.USER, new FieldMetaData("user", TFieldRequirementType.DEFAULT, 
          new StructMetaData(TType.STRUCT, User.class)));
    }});

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

    public updateUser_args() {
    }

    public updateUser_args(
      User user)
    {
      this();
      this.user = user;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public updateUser_args(updateUser_args other) {
      if (other.isSetUser()) {
        this.user = new User(other.user);
      }
    }

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

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

    public User getUser() {
      return this.user;
    }

    public updateUser_args setUser(User user) {
      this.user = user;
      return this;
    }

    public void unsetUser() {
      this.user = null;
    }

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

    public void setUserIsSet(boolean value) {
      if (!value) {
        this.user = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case USER:
        if (value == null) {
          unsetUser();
        } else {
          setUser((User)value);
        }
        break;

      }
    }

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

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case USER:
        return getUser();

      }
      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 USER:
        return isSetUser();
      }
      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 updateUser_args)
        return this.equals((updateUser_args)that);
      return false;
    }

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

      boolean this_present_user = true && this.isSetUser();
      boolean that_present_user = true && that.isSetUser();
      if (this_present_user || that_present_user) {
        if (!(this_present_user && that_present_user))
          return false;
        if (!this.user.equals(that.user))
          return false;
      }

      return true;
    }

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

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

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

      lastComparison = Boolean.valueOf(isSetUser()).compareTo(isSetUser());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(user, typedOther.user);
      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 USER:
              if (field.type == TType.STRUCT) {
                this.user = new User();
                this.user.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.user != null) {
        oprot.writeFieldBegin(USER_FIELD_DESC);
        this.user.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

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

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

  }

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

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRUCT, (short)0);
    private static final TField UCEX_FIELD_DESC = new TField("ucex", TType.STRUCT, (short)1);

    private User success;
    private UserContextException ucex;

    /** 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"),
      UCEX((short)1, "ucex");

      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, User.class)));
      put(_Fields.UCEX, new FieldMetaData("ucex", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

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

    public updateUser_result() {
    }

    public updateUser_result(
      User success,
      UserContextException ucex)
    {
      this();
      this.success = success;
      this.ucex = ucex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public updateUser_result(updateUser_result other) {
      if (other.isSetSuccess()) {
        this.success = new User(other.success);
      }
      if (other.isSetUcex()) {
        this.ucex = new UserContextException(other.ucex);
      }
    }

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

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

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

    public updateUser_result setSuccess(User 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 UserContextException getUcex() {
      return this.ucex;
    }

    public updateUser_result setUcex(UserContextException ucex) {
      this.ucex = ucex;
      return this;
    }

    public void unsetUcex() {
      this.ucex = null;
    }

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

    public void setUcexIsSet(boolean value) {
      if (!value) {
        this.ucex = null;
      }
    }

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

      case UCEX:
        if (value == null) {
          unsetUcex();
        } else {
          setUcex((UserContextException)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 UCEX:
        return getUcex();

      }
      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 UCEX:
        return isSetUcex();
      }
      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 updateUser_result)
        return this.equals((updateUser_result)that);
      return false;
    }

    public boolean equals(updateUser_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_ucex = true && this.isSetUcex();
      boolean that_present_ucex = true && that.isSetUcex();
      if (this_present_ucex || that_present_ucex) {
        if (!(this_present_ucex && that_present_ucex))
          return false;
        if (!this.ucex.equals(that.ucex))
          return false;
      }

      return true;
    }

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

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

      int lastComparison = 0;
      updateUser_result typedOther = (updateUser_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(isSetUcex()).compareTo(isSetUcex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(ucex, typedOther.ucex);
      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 User();
                this.success.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case UCEX:
              if (field.type == TType.STRUCT) {
                this.ucex = new UserContextException();
                this.ucex.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.isSetUcex()) {
        oprot.writeFieldBegin(UCEX_FIELD_DESC);
        this.ucex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("updateUser_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("ucex:");
      if (this.ucex == null) {
        sb.append("null");
      } else {
        sb.append(this.ucex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

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

  }

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

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

    private long userId;

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

      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 __USERID_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.USER_ID, new FieldMetaData("userId", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
    }});

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

    public deleteUser_args() {
    }

    public deleteUser_args(
      long userId)
    {
      this();
      this.userId = userId;
      setUserIdIsSet(true);
    }

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

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

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

    public long getUserId() {
      return this.userId;
    }

    public deleteUser_args setUserId(long userId) {
      this.userId = userId;
      setUserIdIsSet(true);
      return this;
    }

    public void unsetUserId() {
      __isset_bit_vector.clear(__USERID_ISSET_ID);
    }

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

    public void setUserIdIsSet(boolean value) {
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case USER_ID:
        if (value == null) {
          unsetUserId();
        } else {
          setUserId((Long)value);
        }
        break;

      }
    }

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

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case USER_ID:
        return new Long(getUserId());

      }
      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 USER_ID:
        return isSetUserId();
      }
      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 deleteUser_args)
        return this.equals((deleteUser_args)that);
      return false;
    }

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

      boolean this_present_userId = true;
      boolean that_present_userId = true;
      if (this_present_userId || that_present_userId) {
        if (!(this_present_userId && that_present_userId))
          return false;
        if (this.userId != that.userId)
          return false;
      }

      return true;
    }

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

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

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

      lastComparison = Boolean.valueOf(isSetUserId()).compareTo(isSetUserId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(userId, typedOther.userId);
      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 USER_ID:
              if (field.type == TType.I64) {
                this.userId = iprot.readI64();
                setUserIdIsSet(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(USER_ID_FIELD_DESC);
      oprot.writeI64(this.userId);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

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

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

  }

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

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.BOOL, (short)0);
    private static final TField UCEX_FIELD_DESC = new TField("ucex", TType.STRUCT, (short)1);

    private boolean success;
    private UserContextException ucex;

    /** 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"),
      UCEX((short)1, "ucex");

      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.BOOL)));
      put(_Fields.UCEX, new FieldMetaData("ucex", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

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

    public deleteUser_result() {
    }

    public deleteUser_result(
      boolean success,
      UserContextException ucex)
    {
      this();
      this.success = success;
      setSuccessIsSet(true);
      this.ucex = ucex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public deleteUser_result(deleteUser_result other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.success = other.success;
      if (other.isSetUcex()) {
        this.ucex = new UserContextException(other.ucex);
      }
    }

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

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

    public boolean isSuccess() {
      return this.success;
    }

    public deleteUser_result setSuccess(boolean 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 UserContextException getUcex() {
      return this.ucex;
    }

    public deleteUser_result setUcex(UserContextException ucex) {
      this.ucex = ucex;
      return this;
    }

    public void unsetUcex() {
      this.ucex = null;
    }

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

    public void setUcexIsSet(boolean value) {
      if (!value) {
        this.ucex = null;
      }
    }

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

      case UCEX:
        if (value == null) {
          unsetUcex();
        } else {
          setUcex((UserContextException)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 Boolean(isSuccess());

      case UCEX:
        return getUcex();

      }
      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 UCEX:
        return isSetUcex();
      }
      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 deleteUser_result)
        return this.equals((deleteUser_result)that);
      return false;
    }

    public boolean equals(deleteUser_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_ucex = true && this.isSetUcex();
      boolean that_present_ucex = true && that.isSetUcex();
      if (this_present_ucex || that_present_ucex) {
        if (!(this_present_ucex && that_present_ucex))
          return false;
        if (!this.ucex.equals(that.ucex))
          return false;
      }

      return true;
    }

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

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

      int lastComparison = 0;
      deleteUser_result typedOther = (deleteUser_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(isSetUcex()).compareTo(isSetUcex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(ucex, typedOther.ucex);
      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.BOOL) {
                this.success = iprot.readBool();
                setSuccessIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case UCEX:
              if (field.type == TType.STRUCT) {
                this.ucex = new UserContextException();
                this.ucex.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.writeBool(this.success);
        oprot.writeFieldEnd();
      } else if (this.isSetUcex()) {
        oprot.writeFieldBegin(UCEX_FIELD_DESC);
        this.ucex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

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

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

  }

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

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

    private long userId;

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

      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 __USERID_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.USER_ID, new FieldMetaData("userId", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
    }});

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

    public getUserState_args() {
    }

    public getUserState_args(
      long userId)
    {
      this();
      this.userId = userId;
      setUserIdIsSet(true);
    }

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

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

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

    public long getUserId() {
      return this.userId;
    }

    public getUserState_args setUserId(long userId) {
      this.userId = userId;
      setUserIdIsSet(true);
      return this;
    }

    public void unsetUserId() {
      __isset_bit_vector.clear(__USERID_ISSET_ID);
    }

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

    public void setUserIdIsSet(boolean value) {
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case USER_ID:
        if (value == null) {
          unsetUserId();
        } else {
          setUserId((Long)value);
        }
        break;

      }
    }

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

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case USER_ID:
        return new Long(getUserId());

      }
      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 USER_ID:
        return isSetUserId();
      }
      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 getUserState_args)
        return this.equals((getUserState_args)that);
      return false;
    }

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

      boolean this_present_userId = true;
      boolean that_present_userId = true;
      if (this_present_userId || that_present_userId) {
        if (!(this_present_userId && that_present_userId))
          return false;
        if (this.userId != that.userId)
          return false;
      }

      return true;
    }

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

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

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

      lastComparison = Boolean.valueOf(isSetUserId()).compareTo(isSetUserId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(userId, typedOther.userId);
      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 USER_ID:
              if (field.type == TType.I64) {
                this.userId = iprot.readI64();
                setUserIdIsSet(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(USER_ID_FIELD_DESC);
      oprot.writeI64(this.userId);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

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

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

  }

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

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRUCT, (short)0);
    private static final TField UCEX_FIELD_DESC = new TField("ucex", TType.STRUCT, (short)1);

    private UserState success;
    private UserContextException ucex;

    /** 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"),
      UCEX((short)1, "ucex");

      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, UserState.class)));
      put(_Fields.UCEX, new FieldMetaData("ucex", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

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

    public getUserState_result() {
    }

    public getUserState_result(
      UserState success,
      UserContextException ucex)
    {
      this();
      this.success = success;
      this.ucex = ucex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getUserState_result(getUserState_result other) {
      if (other.isSetSuccess()) {
        this.success = new UserState(other.success);
      }
      if (other.isSetUcex()) {
        this.ucex = new UserContextException(other.ucex);
      }
    }

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

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

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

    public getUserState_result setSuccess(UserState 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 UserContextException getUcex() {
      return this.ucex;
    }

    public getUserState_result setUcex(UserContextException ucex) {
      this.ucex = ucex;
      return this;
    }

    public void unsetUcex() {
      this.ucex = null;
    }

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

    public void setUcexIsSet(boolean value) {
      if (!value) {
        this.ucex = null;
      }
    }

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

      case UCEX:
        if (value == null) {
          unsetUcex();
        } else {
          setUcex((UserContextException)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 UCEX:
        return getUcex();

      }
      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 UCEX:
        return isSetUcex();
      }
      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 getUserState_result)
        return this.equals((getUserState_result)that);
      return false;
    }

    public boolean equals(getUserState_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_ucex = true && this.isSetUcex();
      boolean that_present_ucex = true && that.isSetUcex();
      if (this_present_ucex || that_present_ucex) {
        if (!(this_present_ucex && that_present_ucex))
          return false;
        if (!this.ucex.equals(that.ucex))
          return false;
      }

      return true;
    }

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

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

      int lastComparison = 0;
      getUserState_result typedOther = (getUserState_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(isSetUcex()).compareTo(isSetUcex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(ucex, typedOther.ucex);
      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 UserState();
                this.success.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case UCEX:
              if (field.type == TType.STRUCT) {
                this.ucex = new UserContextException();
                this.ucex.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.isSetUcex()) {
        oprot.writeFieldBegin(UCEX_FIELD_DESC);
        this.ucex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getUserState_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("ucex:");
      if (this.ucex == null) {
        sb.append("null");
      } else {
        sb.append(this.ucex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

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

  }

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

    private static final TField EMAIL_FIELD_DESC = new TField("email", TType.STRING, (short)1);
    private static final TField PASSWORD_FIELD_DESC = new TField("password", TType.STRING, (short)2);

    private String email;
    private String password;

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

      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.EMAIL, new FieldMetaData("email", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRING)));
      put(_Fields.PASSWORD, new FieldMetaData("password", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRING)));
    }});

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

    public authenticateUser_args() {
    }

    public authenticateUser_args(
      String email,
      String password)
    {
      this();
      this.email = email;
      this.password = password;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public authenticateUser_args(authenticateUser_args other) {
      if (other.isSetEmail()) {
        this.email = other.email;
      }
      if (other.isSetPassword()) {
        this.password = other.password;
      }
    }

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

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

    public String getEmail() {
      return this.email;
    }

    public authenticateUser_args setEmail(String email) {
      this.email = email;
      return this;
    }

    public void unsetEmail() {
      this.email = null;
    }

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

    public void setEmailIsSet(boolean value) {
      if (!value) {
        this.email = null;
      }
    }

    public String getPassword() {
      return this.password;
    }

    public authenticateUser_args setPassword(String password) {
      this.password = password;
      return this;
    }

    public void unsetPassword() {
      this.password = null;
    }

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

    public void setPasswordIsSet(boolean value) {
      if (!value) {
        this.password = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case EMAIL:
        if (value == null) {
          unsetEmail();
        } else {
          setEmail((String)value);
        }
        break;

      case PASSWORD:
        if (value == null) {
          unsetPassword();
        } else {
          setPassword((String)value);
        }
        break;

      }
    }

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

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case EMAIL:
        return getEmail();

      case PASSWORD:
        return getPassword();

      }
      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 EMAIL:
        return isSetEmail();
      case PASSWORD:
        return isSetPassword();
      }
      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 authenticateUser_args)
        return this.equals((authenticateUser_args)that);
      return false;
    }

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

      boolean this_present_email = true && this.isSetEmail();
      boolean that_present_email = true && that.isSetEmail();
      if (this_present_email || that_present_email) {
        if (!(this_present_email && that_present_email))
          return false;
        if (!this.email.equals(that.email))
          return false;
      }

      boolean this_present_password = true && this.isSetPassword();
      boolean that_present_password = true && that.isSetPassword();
      if (this_present_password || that_present_password) {
        if (!(this_present_password && that_present_password))
          return false;
        if (!this.password.equals(that.password))
          return false;
      }

      return true;
    }

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

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

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

      lastComparison = Boolean.valueOf(isSetEmail()).compareTo(isSetEmail());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(email, typedOther.email);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetPassword()).compareTo(isSetPassword());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(password, typedOther.password);
      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 EMAIL:
              if (field.type == TType.STRING) {
                this.email = iprot.readString();
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case PASSWORD:
              if (field.type == TType.STRING) {
                this.password = iprot.readString();
              } 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.email != null) {
        oprot.writeFieldBegin(EMAIL_FIELD_DESC);
        oprot.writeString(this.email);
        oprot.writeFieldEnd();
      }
      if (this.password != null) {
        oprot.writeFieldBegin(PASSWORD_FIELD_DESC);
        oprot.writeString(this.password);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

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

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

  }

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

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRUCT, (short)0);
    private static final TField AUEX_FIELD_DESC = new TField("auex", TType.STRUCT, (short)1);

    private User success;
    private AuthenticationException auex;

    /** 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"),
      AUEX((short)1, "auex");

      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, User.class)));
      put(_Fields.AUEX, new FieldMetaData("auex", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

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

    public authenticateUser_result() {
    }

    public authenticateUser_result(
      User success,
      AuthenticationException auex)
    {
      this();
      this.success = success;
      this.auex = auex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public authenticateUser_result(authenticateUser_result other) {
      if (other.isSetSuccess()) {
        this.success = new User(other.success);
      }
      if (other.isSetAuex()) {
        this.auex = new AuthenticationException(other.auex);
      }
    }

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

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

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

    public authenticateUser_result setSuccess(User 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 AuthenticationException getAuex() {
      return this.auex;
    }

    public authenticateUser_result setAuex(AuthenticationException auex) {
      this.auex = auex;
      return this;
    }

    public void unsetAuex() {
      this.auex = null;
    }

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

    public void setAuexIsSet(boolean value) {
      if (!value) {
        this.auex = null;
      }
    }

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

      case AUEX:
        if (value == null) {
          unsetAuex();
        } else {
          setAuex((AuthenticationException)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 AUEX:
        return getAuex();

      }
      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 AUEX:
        return isSetAuex();
      }
      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 authenticateUser_result)
        return this.equals((authenticateUser_result)that);
      return false;
    }

    public boolean equals(authenticateUser_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_auex = true && this.isSetAuex();
      boolean that_present_auex = true && that.isSetAuex();
      if (this_present_auex || that_present_auex) {
        if (!(this_present_auex && that_present_auex))
          return false;
        if (!this.auex.equals(that.auex))
          return false;
      }

      return true;
    }

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

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

      int lastComparison = 0;
      authenticateUser_result typedOther = (authenticateUser_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(isSetAuex()).compareTo(isSetAuex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(auex, typedOther.auex);
      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 User();
                this.success.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case AUEX:
              if (field.type == TType.STRUCT) {
                this.auex = new AuthenticationException();
                this.auex.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.isSetAuex()) {
        oprot.writeFieldBegin(AUEX_FIELD_DESC);
        this.auex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("authenticateUser_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("auex:");
      if (this.auex == null) {
        sb.append("null");
      } else {
        sb.append(this.auex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

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

  }

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

    private static final TField EMAIL_FIELD_DESC = new TField("email", TType.STRING, (short)1);

    private String email;

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

      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.EMAIL, new FieldMetaData("email", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRING)));
    }});

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

    public userExists_args() {
    }

    public userExists_args(
      String email)
    {
      this();
      this.email = email;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public userExists_args(userExists_args other) {
      if (other.isSetEmail()) {
        this.email = other.email;
      }
    }

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

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

    public String getEmail() {
      return this.email;
    }

    public userExists_args setEmail(String email) {
      this.email = email;
      return this;
    }

    public void unsetEmail() {
      this.email = null;
    }

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

    public void setEmailIsSet(boolean value) {
      if (!value) {
        this.email = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case EMAIL:
        if (value == null) {
          unsetEmail();
        } else {
          setEmail((String)value);
        }
        break;

      }
    }

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

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case EMAIL:
        return getEmail();

      }
      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 EMAIL:
        return isSetEmail();
      }
      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 userExists_args)
        return this.equals((userExists_args)that);
      return false;
    }

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

      boolean this_present_email = true && this.isSetEmail();
      boolean that_present_email = true && that.isSetEmail();
      if (this_present_email || that_present_email) {
        if (!(this_present_email && that_present_email))
          return false;
        if (!this.email.equals(that.email))
          return false;
      }

      return true;
    }

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

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

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

      lastComparison = Boolean.valueOf(isSetEmail()).compareTo(isSetEmail());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(email, typedOther.email);
      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 EMAIL:
              if (field.type == TType.STRING) {
                this.email = iprot.readString();
              } 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.email != null) {
        oprot.writeFieldBegin(EMAIL_FIELD_DESC);
        oprot.writeString(this.email);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

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

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

  }

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

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.BOOL, (short)0);
    private static final TField UCX_FIELD_DESC = new TField("ucx", TType.STRUCT, (short)1);

    private boolean success;
    private UserContextException ucx;

    /** 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"),
      UCX((short)1, "ucx");

      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.BOOL)));
      put(_Fields.UCX, new FieldMetaData("ucx", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

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

    public userExists_result() {
    }

    public userExists_result(
      boolean success,
      UserContextException ucx)
    {
      this();
      this.success = success;
      setSuccessIsSet(true);
      this.ucx = ucx;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public userExists_result(userExists_result other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.success = other.success;
      if (other.isSetUcx()) {
        this.ucx = new UserContextException(other.ucx);
      }
    }

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

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

    public boolean isSuccess() {
      return this.success;
    }

    public userExists_result setSuccess(boolean 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 UserContextException getUcx() {
      return this.ucx;
    }

    public userExists_result setUcx(UserContextException ucx) {
      this.ucx = ucx;
      return this;
    }

    public void unsetUcx() {
      this.ucx = null;
    }

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

    public void setUcxIsSet(boolean value) {
      if (!value) {
        this.ucx = null;
      }
    }

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

      case UCX:
        if (value == null) {
          unsetUcx();
        } else {
          setUcx((UserContextException)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 Boolean(isSuccess());

      case UCX:
        return getUcx();

      }
      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 UCX:
        return isSetUcx();
      }
      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 userExists_result)
        return this.equals((userExists_result)that);
      return false;
    }

    public boolean equals(userExists_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_ucx = true && this.isSetUcx();
      boolean that_present_ucx = true && that.isSetUcx();
      if (this_present_ucx || that_present_ucx) {
        if (!(this_present_ucx && that_present_ucx))
          return false;
        if (!this.ucx.equals(that.ucx))
          return false;
      }

      return true;
    }

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

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

      int lastComparison = 0;
      userExists_result typedOther = (userExists_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(isSetUcx()).compareTo(isSetUcx());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(ucx, typedOther.ucx);
      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.BOOL) {
                this.success = iprot.readBool();
                setSuccessIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case UCX:
              if (field.type == TType.STRUCT) {
                this.ucx = new UserContextException();
                this.ucx.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.writeBool(this.success);
        oprot.writeFieldEnd();
      } else if (this.isSetUcx()) {
        oprot.writeFieldBegin(UCX_FIELD_DESC);
        this.ucx.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

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

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

  }

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

    private static final TField USER_ID_FIELD_DESC = new TField("userId", TType.I64, (short)1);
    private static final TField ADDRESS_FIELD_DESC = new TField("address", TType.STRUCT, (short)2);
    private static final TField SET_DEFAULT_FIELD_DESC = new TField("setDefault", TType.BOOL, (short)3);

    private long userId;
    private Address address;
    private boolean setDefault;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      USER_ID((short)1, "userId"),
      ADDRESS((short)2, "address"),
      SET_DEFAULT((short)3, "setDefault");

      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 __USERID_ISSET_ID = 0;
    private static final int __SETDEFAULT_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.USER_ID, new FieldMetaData("userId", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
      put(_Fields.ADDRESS, new FieldMetaData("address", TFieldRequirementType.DEFAULT, 
          new StructMetaData(TType.STRUCT, Address.class)));
      put(_Fields.SET_DEFAULT, new FieldMetaData("setDefault", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.BOOL)));
    }});

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

    public addAddressForUser_args() {
    }

    public addAddressForUser_args(
      long userId,
      Address address,
      boolean setDefault)
    {
      this();
      this.userId = userId;
      setUserIdIsSet(true);
      this.address = address;
      this.setDefault = setDefault;
      setSetDefaultIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public addAddressForUser_args(addAddressForUser_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.userId = other.userId;
      if (other.isSetAddress()) {
        this.address = new Address(other.address);
      }
      this.setDefault = other.setDefault;
    }

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

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

    public long getUserId() {
      return this.userId;
    }

    public addAddressForUser_args setUserId(long userId) {
      this.userId = userId;
      setUserIdIsSet(true);
      return this;
    }

    public void unsetUserId() {
      __isset_bit_vector.clear(__USERID_ISSET_ID);
    }

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

    public void setUserIdIsSet(boolean value) {
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
    }

    public Address getAddress() {
      return this.address;
    }

    public addAddressForUser_args setAddress(Address address) {
      this.address = address;
      return this;
    }

    public void unsetAddress() {
      this.address = null;
    }

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

    public void setAddressIsSet(boolean value) {
      if (!value) {
        this.address = null;
      }
    }

    public boolean isSetDefault() {
      return this.setDefault;
    }

    public addAddressForUser_args setSetDefault(boolean setDefault) {
      this.setDefault = setDefault;
      setSetDefaultIsSet(true);
      return this;
    }

    public void unsetSetDefault() {
      __isset_bit_vector.clear(__SETDEFAULT_ISSET_ID);
    }

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

    public void setSetDefaultIsSet(boolean value) {
      __isset_bit_vector.set(__SETDEFAULT_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case USER_ID:
        if (value == null) {
          unsetUserId();
        } else {
          setUserId((Long)value);
        }
        break;

      case ADDRESS:
        if (value == null) {
          unsetAddress();
        } else {
          setAddress((Address)value);
        }
        break;

      case SET_DEFAULT:
        if (value == null) {
          unsetSetDefault();
        } else {
          setSetDefault((Boolean)value);
        }
        break;

      }
    }

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

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case USER_ID:
        return new Long(getUserId());

      case ADDRESS:
        return getAddress();

      case SET_DEFAULT:
        return new Boolean(isSetDefault());

      }
      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 USER_ID:
        return isSetUserId();
      case ADDRESS:
        return isSetAddress();
      case SET_DEFAULT:
        return isSetSetDefault();
      }
      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 addAddressForUser_args)
        return this.equals((addAddressForUser_args)that);
      return false;
    }

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

      boolean this_present_userId = true;
      boolean that_present_userId = true;
      if (this_present_userId || that_present_userId) {
        if (!(this_present_userId && that_present_userId))
          return false;
        if (this.userId != that.userId)
          return false;
      }

      boolean this_present_address = true && this.isSetAddress();
      boolean that_present_address = true && that.isSetAddress();
      if (this_present_address || that_present_address) {
        if (!(this_present_address && that_present_address))
          return false;
        if (!this.address.equals(that.address))
          return false;
      }

      boolean this_present_setDefault = true;
      boolean that_present_setDefault = true;
      if (this_present_setDefault || that_present_setDefault) {
        if (!(this_present_setDefault && that_present_setDefault))
          return false;
        if (this.setDefault != that.setDefault)
          return false;
      }

      return true;
    }

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

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

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

      lastComparison = Boolean.valueOf(isSetUserId()).compareTo(isSetUserId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(userId, typedOther.userId);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetAddress()).compareTo(isSetAddress());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(address, typedOther.address);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetSetDefault()).compareTo(isSetSetDefault());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(setDefault, typedOther.setDefault);
      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 USER_ID:
              if (field.type == TType.I64) {
                this.userId = iprot.readI64();
                setUserIdIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case ADDRESS:
              if (field.type == TType.STRUCT) {
                this.address = new Address();
                this.address.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case SET_DEFAULT:
              if (field.type == TType.BOOL) {
                this.setDefault = iprot.readBool();
                setSetDefaultIsSet(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(USER_ID_FIELD_DESC);
      oprot.writeI64(this.userId);
      oprot.writeFieldEnd();
      if (this.address != null) {
        oprot.writeFieldBegin(ADDRESS_FIELD_DESC);
        this.address.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldBegin(SET_DEFAULT_FIELD_DESC);
      oprot.writeBool(this.setDefault);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

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

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

  }

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

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

    private long success;
    private UserContextException ucx;

    /** 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"),
      UCX((short)1, "ucx");

      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.UCX, new FieldMetaData("ucx", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

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

    public addAddressForUser_result() {
    }

    public addAddressForUser_result(
      long success,
      UserContextException ucx)
    {
      this();
      this.success = success;
      setSuccessIsSet(true);
      this.ucx = ucx;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public addAddressForUser_result(addAddressForUser_result other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.success = other.success;
      if (other.isSetUcx()) {
        this.ucx = new UserContextException(other.ucx);
      }
    }

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

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

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

    public addAddressForUser_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 UserContextException getUcx() {
      return this.ucx;
    }

    public addAddressForUser_result setUcx(UserContextException ucx) {
      this.ucx = ucx;
      return this;
    }

    public void unsetUcx() {
      this.ucx = null;
    }

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

    public void setUcxIsSet(boolean value) {
      if (!value) {
        this.ucx = null;
      }
    }

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

      case UCX:
        if (value == null) {
          unsetUcx();
        } else {
          setUcx((UserContextException)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 UCX:
        return getUcx();

      }
      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 UCX:
        return isSetUcx();
      }
      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 addAddressForUser_result)
        return this.equals((addAddressForUser_result)that);
      return false;
    }

    public boolean equals(addAddressForUser_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_ucx = true && this.isSetUcx();
      boolean that_present_ucx = true && that.isSetUcx();
      if (this_present_ucx || that_present_ucx) {
        if (!(this_present_ucx && that_present_ucx))
          return false;
        if (!this.ucx.equals(that.ucx))
          return false;
      }

      return true;
    }

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

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

      int lastComparison = 0;
      addAddressForUser_result typedOther = (addAddressForUser_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(isSetUcx()).compareTo(isSetUcx());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(ucx, typedOther.ucx);
      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 UCX:
              if (field.type == TType.STRUCT) {
                this.ucx = new UserContextException();
                this.ucx.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.isSetUcx()) {
        oprot.writeFieldBegin(UCX_FIELD_DESC);
        this.ucx.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

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

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

  }

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

    private static final TField USERID_FIELD_DESC = new TField("userid", TType.I64, (short)1);
    private static final TField ADDRESS_ID_FIELD_DESC = new TField("addressId", TType.I64, (short)2);

    private long userid;
    private long addressId;

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

      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 __USERID_ISSET_ID = 0;
    private static final int __ADDRESSID_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.USERID, new FieldMetaData("userid", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
      put(_Fields.ADDRESS_ID, new FieldMetaData("addressId", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
    }});

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

    public removeAddressForUser_args() {
    }

    public removeAddressForUser_args(
      long userid,
      long addressId)
    {
      this();
      this.userid = userid;
      setUseridIsSet(true);
      this.addressId = addressId;
      setAddressIdIsSet(true);
    }

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

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

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

    public long getUserid() {
      return this.userid;
    }

    public removeAddressForUser_args setUserid(long userid) {
      this.userid = userid;
      setUseridIsSet(true);
      return this;
    }

    public void unsetUserid() {
      __isset_bit_vector.clear(__USERID_ISSET_ID);
    }

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

    public void setUseridIsSet(boolean value) {
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
    }

    public long getAddressId() {
      return this.addressId;
    }

    public removeAddressForUser_args setAddressId(long addressId) {
      this.addressId = addressId;
      setAddressIdIsSet(true);
      return this;
    }

    public void unsetAddressId() {
      __isset_bit_vector.clear(__ADDRESSID_ISSET_ID);
    }

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

    public void setAddressIdIsSet(boolean value) {
      __isset_bit_vector.set(__ADDRESSID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case USERID:
        if (value == null) {
          unsetUserid();
        } else {
          setUserid((Long)value);
        }
        break;

      case ADDRESS_ID:
        if (value == null) {
          unsetAddressId();
        } else {
          setAddressId((Long)value);
        }
        break;

      }
    }

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

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case USERID:
        return new Long(getUserid());

      case ADDRESS_ID:
        return new Long(getAddressId());

      }
      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 USERID:
        return isSetUserid();
      case ADDRESS_ID:
        return isSetAddressId();
      }
      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 removeAddressForUser_args)
        return this.equals((removeAddressForUser_args)that);
      return false;
    }

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

      boolean this_present_userid = true;
      boolean that_present_userid = true;
      if (this_present_userid || that_present_userid) {
        if (!(this_present_userid && that_present_userid))
          return false;
        if (this.userid != that.userid)
          return false;
      }

      boolean this_present_addressId = true;
      boolean that_present_addressId = true;
      if (this_present_addressId || that_present_addressId) {
        if (!(this_present_addressId && that_present_addressId))
          return false;
        if (this.addressId != that.addressId)
          return false;
      }

      return true;
    }

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

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

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

      lastComparison = Boolean.valueOf(isSetUserid()).compareTo(isSetUserid());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(userid, typedOther.userid);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetAddressId()).compareTo(isSetAddressId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(addressId, typedOther.addressId);
      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 USERID:
              if (field.type == TType.I64) {
                this.userid = iprot.readI64();
                setUseridIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case ADDRESS_ID:
              if (field.type == TType.I64) {
                this.addressId = iprot.readI64();
                setAddressIdIsSet(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(USERID_FIELD_DESC);
      oprot.writeI64(this.userid);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(ADDRESS_ID_FIELD_DESC);
      oprot.writeI64(this.addressId);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

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

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

  }

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

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.BOOL, (short)0);
    private static final TField UCX_FIELD_DESC = new TField("ucx", TType.STRUCT, (short)1);

    private boolean success;
    private UserContextException ucx;

    /** 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"),
      UCX((short)1, "ucx");

      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.BOOL)));
      put(_Fields.UCX, new FieldMetaData("ucx", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

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

    public removeAddressForUser_result() {
    }

    public removeAddressForUser_result(
      boolean success,
      UserContextException ucx)
    {
      this();
      this.success = success;
      setSuccessIsSet(true);
      this.ucx = ucx;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public removeAddressForUser_result(removeAddressForUser_result other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.success = other.success;
      if (other.isSetUcx()) {
        this.ucx = new UserContextException(other.ucx);
      }
    }

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

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

    public boolean isSuccess() {
      return this.success;
    }

    public removeAddressForUser_result setSuccess(boolean 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 UserContextException getUcx() {
      return this.ucx;
    }

    public removeAddressForUser_result setUcx(UserContextException ucx) {
      this.ucx = ucx;
      return this;
    }

    public void unsetUcx() {
      this.ucx = null;
    }

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

    public void setUcxIsSet(boolean value) {
      if (!value) {
        this.ucx = null;
      }
    }

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

      case UCX:
        if (value == null) {
          unsetUcx();
        } else {
          setUcx((UserContextException)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 Boolean(isSuccess());

      case UCX:
        return getUcx();

      }
      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 UCX:
        return isSetUcx();
      }
      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 removeAddressForUser_result)
        return this.equals((removeAddressForUser_result)that);
      return false;
    }

    public boolean equals(removeAddressForUser_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_ucx = true && this.isSetUcx();
      boolean that_present_ucx = true && that.isSetUcx();
      if (this_present_ucx || that_present_ucx) {
        if (!(this_present_ucx && that_present_ucx))
          return false;
        if (!this.ucx.equals(that.ucx))
          return false;
      }

      return true;
    }

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

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

      int lastComparison = 0;
      removeAddressForUser_result typedOther = (removeAddressForUser_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(isSetUcx()).compareTo(isSetUcx());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(ucx, typedOther.ucx);
      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.BOOL) {
                this.success = iprot.readBool();
                setSuccessIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case UCX:
              if (field.type == TType.STRUCT) {
                this.ucx = new UserContextException();
                this.ucx.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.writeBool(this.success);
        oprot.writeFieldEnd();
      } else if (this.isSetUcx()) {
        oprot.writeFieldBegin(UCX_FIELD_DESC);
        this.ucx.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

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

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

  }

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

    private static final TField USER_ID_FIELD_DESC = new TField("userId", TType.I64, (short)1);
    private static final TField TIMESTAMP_FIELD_DESC = new TField("timestamp", TType.I64, (short)2);

    private long userId;
    private long timestamp;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      USER_ID((short)1, "userId"),
      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 __USERID_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.USER_ID, new FieldMetaData("userId", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
      put(_Fields.TIMESTAMP, new FieldMetaData("timestamp", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
    }});

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

    public setUserAsLoggedIn_args() {
    }

    public setUserAsLoggedIn_args(
      long userId,
      long timestamp)
    {
      this();
      this.userId = userId;
      setUserIdIsSet(true);
      this.timestamp = timestamp;
      setTimestampIsSet(true);
    }

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

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

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

    public long getUserId() {
      return this.userId;
    }

    public setUserAsLoggedIn_args setUserId(long userId) {
      this.userId = userId;
      setUserIdIsSet(true);
      return this;
    }

    public void unsetUserId() {
      __isset_bit_vector.clear(__USERID_ISSET_ID);
    }

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

    public void setUserIdIsSet(boolean value) {
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
    }

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

    public setUserAsLoggedIn_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 USER_ID:
        if (value == null) {
          unsetUserId();
        } else {
          setUserId((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 USER_ID:
        return new Long(getUserId());

      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 USER_ID:
        return isSetUserId();
      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 setUserAsLoggedIn_args)
        return this.equals((setUserAsLoggedIn_args)that);
      return false;
    }

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

      boolean this_present_userId = true;
      boolean that_present_userId = true;
      if (this_present_userId || that_present_userId) {
        if (!(this_present_userId && that_present_userId))
          return false;
        if (this.userId != that.userId)
          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(setUserAsLoggedIn_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

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

      lastComparison = Boolean.valueOf(isSetUserId()).compareTo(isSetUserId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(userId, typedOther.userId);
      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 USER_ID:
              if (field.type == TType.I64) {
                this.userId = iprot.readI64();
                setUserIdIsSet(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(USER_ID_FIELD_DESC);
      oprot.writeI64(this.userId);
      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("setUserAsLoggedIn_args(");
      boolean first = true;

      sb.append("userId:");
      sb.append(this.userId);
      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 setUserAsLoggedIn_result implements TBase<setUserAsLoggedIn_result._Fields>, java.io.Serializable, Cloneable, Comparable<setUserAsLoggedIn_result>   {
    private static final TStruct STRUCT_DESC = new TStruct("setUserAsLoggedIn_result");

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.BOOL, (short)0);
    private static final TField UCX_FIELD_DESC = new TField("ucx", TType.STRUCT, (short)1);

    private boolean success;
    private UserContextException ucx;

    /** 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"),
      UCX((short)1, "ucx");

      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.BOOL)));
      put(_Fields.UCX, new FieldMetaData("ucx", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

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

    public setUserAsLoggedIn_result() {
    }

    public setUserAsLoggedIn_result(
      boolean success,
      UserContextException ucx)
    {
      this();
      this.success = success;
      setSuccessIsSet(true);
      this.ucx = ucx;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public setUserAsLoggedIn_result(setUserAsLoggedIn_result other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.success = other.success;
      if (other.isSetUcx()) {
        this.ucx = new UserContextException(other.ucx);
      }
    }

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

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

    public boolean isSuccess() {
      return this.success;
    }

    public setUserAsLoggedIn_result setSuccess(boolean 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 UserContextException getUcx() {
      return this.ucx;
    }

    public setUserAsLoggedIn_result setUcx(UserContextException ucx) {
      this.ucx = ucx;
      return this;
    }

    public void unsetUcx() {
      this.ucx = null;
    }

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

    public void setUcxIsSet(boolean value) {
      if (!value) {
        this.ucx = null;
      }
    }

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

      case UCX:
        if (value == null) {
          unsetUcx();
        } else {
          setUcx((UserContextException)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 Boolean(isSuccess());

      case UCX:
        return getUcx();

      }
      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 UCX:
        return isSetUcx();
      }
      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 setUserAsLoggedIn_result)
        return this.equals((setUserAsLoggedIn_result)that);
      return false;
    }

    public boolean equals(setUserAsLoggedIn_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_ucx = true && this.isSetUcx();
      boolean that_present_ucx = true && that.isSetUcx();
      if (this_present_ucx || that_present_ucx) {
        if (!(this_present_ucx && that_present_ucx))
          return false;
        if (!this.ucx.equals(that.ucx))
          return false;
      }

      return true;
    }

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

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

      int lastComparison = 0;
      setUserAsLoggedIn_result typedOther = (setUserAsLoggedIn_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(isSetUcx()).compareTo(isSetUcx());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(ucx, typedOther.ucx);
      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.BOOL) {
                this.success = iprot.readBool();
                setSuccessIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case UCX:
              if (field.type == TType.STRUCT) {
                this.ucx = new UserContextException();
                this.ucx.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.writeBool(this.success);
        oprot.writeFieldEnd();
      } else if (this.isSetUcx()) {
        oprot.writeFieldBegin(UCX_FIELD_DESC);
        this.ucx.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

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

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

  }

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

    private static final TField USERID_FIELD_DESC = new TField("userid", TType.I64, (short)1);
    private static final TField TIMESTAMP_FIELD_DESC = new TField("timestamp", TType.I64, (short)2);

    private long userid;
    private long timestamp;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      USERID((short)1, "userid"),
      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 __USERID_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.USERID, new FieldMetaData("userid", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
      put(_Fields.TIMESTAMP, new FieldMetaData("timestamp", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
    }});

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

    public setUserAsLoggedOut_args() {
    }

    public setUserAsLoggedOut_args(
      long userid,
      long timestamp)
    {
      this();
      this.userid = userid;
      setUseridIsSet(true);
      this.timestamp = timestamp;
      setTimestampIsSet(true);
    }

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

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

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

    public long getUserid() {
      return this.userid;
    }

    public setUserAsLoggedOut_args setUserid(long userid) {
      this.userid = userid;
      setUseridIsSet(true);
      return this;
    }

    public void unsetUserid() {
      __isset_bit_vector.clear(__USERID_ISSET_ID);
    }

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

    public void setUseridIsSet(boolean value) {
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
    }

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

    public setUserAsLoggedOut_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 USERID:
        if (value == null) {
          unsetUserid();
        } else {
          setUserid((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 USERID:
        return new Long(getUserid());

      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 USERID:
        return isSetUserid();
      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 setUserAsLoggedOut_args)
        return this.equals((setUserAsLoggedOut_args)that);
      return false;
    }

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

      boolean this_present_userid = true;
      boolean that_present_userid = true;
      if (this_present_userid || that_present_userid) {
        if (!(this_present_userid && that_present_userid))
          return false;
        if (this.userid != that.userid)
          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(setUserAsLoggedOut_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

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

      lastComparison = Boolean.valueOf(isSetUserid()).compareTo(isSetUserid());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(userid, typedOther.userid);
      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 USERID:
              if (field.type == TType.I64) {
                this.userid = iprot.readI64();
                setUseridIsSet(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(USERID_FIELD_DESC);
      oprot.writeI64(this.userid);
      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("setUserAsLoggedOut_args(");
      boolean first = true;

      sb.append("userid:");
      sb.append(this.userid);
      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 setUserAsLoggedOut_result implements TBase<setUserAsLoggedOut_result._Fields>, java.io.Serializable, Cloneable, Comparable<setUserAsLoggedOut_result>   {
    private static final TStruct STRUCT_DESC = new TStruct("setUserAsLoggedOut_result");

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.BOOL, (short)0);
    private static final TField UCX_FIELD_DESC = new TField("ucx", TType.STRUCT, (short)1);

    private boolean success;
    private UserContextException ucx;

    /** 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"),
      UCX((short)1, "ucx");

      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.BOOL)));
      put(_Fields.UCX, new FieldMetaData("ucx", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

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

    public setUserAsLoggedOut_result() {
    }

    public setUserAsLoggedOut_result(
      boolean success,
      UserContextException ucx)
    {
      this();
      this.success = success;
      setSuccessIsSet(true);
      this.ucx = ucx;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public setUserAsLoggedOut_result(setUserAsLoggedOut_result other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.success = other.success;
      if (other.isSetUcx()) {
        this.ucx = new UserContextException(other.ucx);
      }
    }

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

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

    public boolean isSuccess() {
      return this.success;
    }

    public setUserAsLoggedOut_result setSuccess(boolean 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 UserContextException getUcx() {
      return this.ucx;
    }

    public setUserAsLoggedOut_result setUcx(UserContextException ucx) {
      this.ucx = ucx;
      return this;
    }

    public void unsetUcx() {
      this.ucx = null;
    }

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

    public void setUcxIsSet(boolean value) {
      if (!value) {
        this.ucx = null;
      }
    }

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

      case UCX:
        if (value == null) {
          unsetUcx();
        } else {
          setUcx((UserContextException)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 Boolean(isSuccess());

      case UCX:
        return getUcx();

      }
      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 UCX:
        return isSetUcx();
      }
      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 setUserAsLoggedOut_result)
        return this.equals((setUserAsLoggedOut_result)that);
      return false;
    }

    public boolean equals(setUserAsLoggedOut_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_ucx = true && this.isSetUcx();
      boolean that_present_ucx = true && that.isSetUcx();
      if (this_present_ucx || that_present_ucx) {
        if (!(this_present_ucx && that_present_ucx))
          return false;
        if (!this.ucx.equals(that.ucx))
          return false;
      }

      return true;
    }

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

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

      int lastComparison = 0;
      setUserAsLoggedOut_result typedOther = (setUserAsLoggedOut_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(isSetUcx()).compareTo(isSetUcx());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(ucx, typedOther.ucx);
      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.BOOL) {
                this.success = iprot.readBool();
                setSuccessIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case UCX:
              if (field.type == TType.STRUCT) {
                this.ucx = new UserContextException();
                this.ucx.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.writeBool(this.success);
        oprot.writeFieldEnd();
      } else if (this.isSetUcx()) {
        oprot.writeFieldBegin(UCX_FIELD_DESC);
        this.ucx.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

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

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

  }

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

    private static final TField USERID_FIELD_DESC = new TField("userid", TType.I64, (short)1);
    private static final TField ADDRESS_ID_FIELD_DESC = new TField("addressId", TType.I64, (short)2);

    private long userid;
    private long addressId;

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

      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 __USERID_ISSET_ID = 0;
    private static final int __ADDRESSID_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.USERID, new FieldMetaData("userid", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
      put(_Fields.ADDRESS_ID, new FieldMetaData("addressId", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
    }});

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

    public setDefaultAddress_args() {
    }

    public setDefaultAddress_args(
      long userid,
      long addressId)
    {
      this();
      this.userid = userid;
      setUseridIsSet(true);
      this.addressId = addressId;
      setAddressIdIsSet(true);
    }

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

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

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

    public long getUserid() {
      return this.userid;
    }

    public setDefaultAddress_args setUserid(long userid) {
      this.userid = userid;
      setUseridIsSet(true);
      return this;
    }

    public void unsetUserid() {
      __isset_bit_vector.clear(__USERID_ISSET_ID);
    }

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

    public void setUseridIsSet(boolean value) {
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
    }

    public long getAddressId() {
      return this.addressId;
    }

    public setDefaultAddress_args setAddressId(long addressId) {
      this.addressId = addressId;
      setAddressIdIsSet(true);
      return this;
    }

    public void unsetAddressId() {
      __isset_bit_vector.clear(__ADDRESSID_ISSET_ID);
    }

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

    public void setAddressIdIsSet(boolean value) {
      __isset_bit_vector.set(__ADDRESSID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case USERID:
        if (value == null) {
          unsetUserid();
        } else {
          setUserid((Long)value);
        }
        break;

      case ADDRESS_ID:
        if (value == null) {
          unsetAddressId();
        } else {
          setAddressId((Long)value);
        }
        break;

      }
    }

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

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case USERID:
        return new Long(getUserid());

      case ADDRESS_ID:
        return new Long(getAddressId());

      }
      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 USERID:
        return isSetUserid();
      case ADDRESS_ID:
        return isSetAddressId();
      }
      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 setDefaultAddress_args)
        return this.equals((setDefaultAddress_args)that);
      return false;
    }

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

      boolean this_present_userid = true;
      boolean that_present_userid = true;
      if (this_present_userid || that_present_userid) {
        if (!(this_present_userid && that_present_userid))
          return false;
        if (this.userid != that.userid)
          return false;
      }

      boolean this_present_addressId = true;
      boolean that_present_addressId = true;
      if (this_present_addressId || that_present_addressId) {
        if (!(this_present_addressId && that_present_addressId))
          return false;
        if (this.addressId != that.addressId)
          return false;
      }

      return true;
    }

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

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

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

      lastComparison = Boolean.valueOf(isSetUserid()).compareTo(isSetUserid());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(userid, typedOther.userid);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetAddressId()).compareTo(isSetAddressId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(addressId, typedOther.addressId);
      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 USERID:
              if (field.type == TType.I64) {
                this.userid = iprot.readI64();
                setUseridIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case ADDRESS_ID:
              if (field.type == TType.I64) {
                this.addressId = iprot.readI64();
                setAddressIdIsSet(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(USERID_FIELD_DESC);
      oprot.writeI64(this.userid);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(ADDRESS_ID_FIELD_DESC);
      oprot.writeI64(this.addressId);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

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

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

  }

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

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.BOOL, (short)0);
    private static final TField UCX_FIELD_DESC = new TField("ucx", TType.STRUCT, (short)1);

    private boolean success;
    private UserContextException ucx;

    /** 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"),
      UCX((short)1, "ucx");

      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.BOOL)));
      put(_Fields.UCX, new FieldMetaData("ucx", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

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

    public setDefaultAddress_result() {
    }

    public setDefaultAddress_result(
      boolean success,
      UserContextException ucx)
    {
      this();
      this.success = success;
      setSuccessIsSet(true);
      this.ucx = ucx;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public setDefaultAddress_result(setDefaultAddress_result other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.success = other.success;
      if (other.isSetUcx()) {
        this.ucx = new UserContextException(other.ucx);
      }
    }

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

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

    public boolean isSuccess() {
      return this.success;
    }

    public setDefaultAddress_result setSuccess(boolean 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 UserContextException getUcx() {
      return this.ucx;
    }

    public setDefaultAddress_result setUcx(UserContextException ucx) {
      this.ucx = ucx;
      return this;
    }

    public void unsetUcx() {
      this.ucx = null;
    }

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

    public void setUcxIsSet(boolean value) {
      if (!value) {
        this.ucx = null;
      }
    }

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

      case UCX:
        if (value == null) {
          unsetUcx();
        } else {
          setUcx((UserContextException)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 Boolean(isSuccess());

      case UCX:
        return getUcx();

      }
      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 UCX:
        return isSetUcx();
      }
      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 setDefaultAddress_result)
        return this.equals((setDefaultAddress_result)that);
      return false;
    }

    public boolean equals(setDefaultAddress_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_ucx = true && this.isSetUcx();
      boolean that_present_ucx = true && that.isSetUcx();
      if (this_present_ucx || that_present_ucx) {
        if (!(this_present_ucx && that_present_ucx))
          return false;
        if (!this.ucx.equals(that.ucx))
          return false;
      }

      return true;
    }

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

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

      int lastComparison = 0;
      setDefaultAddress_result typedOther = (setDefaultAddress_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(isSetUcx()).compareTo(isSetUcx());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(ucx, typedOther.ucx);
      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.BOOL) {
                this.success = iprot.readBool();
                setSuccessIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case UCX:
              if (field.type == TType.STRUCT) {
                this.ucx = new UserContextException();
                this.ucx.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.writeBool(this.success);
        oprot.writeFieldEnd();
      } else if (this.isSetUcx()) {
        oprot.writeFieldBegin(UCX_FIELD_DESC);
        this.ucx.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

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

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

  }

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

    private static final TField USERID_FIELD_DESC = new TField("userid", TType.I64, (short)1);
    private static final TField OLD_PASSWORD_FIELD_DESC = new TField("oldPassword", TType.STRING, (short)2);
    private static final TField NEW_PASSWORD_FIELD_DESC = new TField("newPassword", TType.STRING, (short)3);

    private long userid;
    private String oldPassword;
    private String newPassword;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      USERID((short)1, "userid"),
      OLD_PASSWORD((short)2, "oldPassword"),
      NEW_PASSWORD((short)3, "newPassword");

      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 __USERID_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.USERID, new FieldMetaData("userid", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
      put(_Fields.OLD_PASSWORD, new FieldMetaData("oldPassword", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRING)));
      put(_Fields.NEW_PASSWORD, new FieldMetaData("newPassword", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRING)));
    }});

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

    public updatePassword_args() {
    }

    public updatePassword_args(
      long userid,
      String oldPassword,
      String newPassword)
    {
      this();
      this.userid = userid;
      setUseridIsSet(true);
      this.oldPassword = oldPassword;
      this.newPassword = newPassword;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public updatePassword_args(updatePassword_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.userid = other.userid;
      if (other.isSetOldPassword()) {
        this.oldPassword = other.oldPassword;
      }
      if (other.isSetNewPassword()) {
        this.newPassword = other.newPassword;
      }
    }

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

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

    public long getUserid() {
      return this.userid;
    }

    public updatePassword_args setUserid(long userid) {
      this.userid = userid;
      setUseridIsSet(true);
      return this;
    }

    public void unsetUserid() {
      __isset_bit_vector.clear(__USERID_ISSET_ID);
    }

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

    public void setUseridIsSet(boolean value) {
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
    }

    public String getOldPassword() {
      return this.oldPassword;
    }

    public updatePassword_args setOldPassword(String oldPassword) {
      this.oldPassword = oldPassword;
      return this;
    }

    public void unsetOldPassword() {
      this.oldPassword = null;
    }

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

    public void setOldPasswordIsSet(boolean value) {
      if (!value) {
        this.oldPassword = null;
      }
    }

    public String getNewPassword() {
      return this.newPassword;
    }

    public updatePassword_args setNewPassword(String newPassword) {
      this.newPassword = newPassword;
      return this;
    }

    public void unsetNewPassword() {
      this.newPassword = null;
    }

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

    public void setNewPasswordIsSet(boolean value) {
      if (!value) {
        this.newPassword = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case USERID:
        if (value == null) {
          unsetUserid();
        } else {
          setUserid((Long)value);
        }
        break;

      case OLD_PASSWORD:
        if (value == null) {
          unsetOldPassword();
        } else {
          setOldPassword((String)value);
        }
        break;

      case NEW_PASSWORD:
        if (value == null) {
          unsetNewPassword();
        } else {
          setNewPassword((String)value);
        }
        break;

      }
    }

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

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case USERID:
        return new Long(getUserid());

      case OLD_PASSWORD:
        return getOldPassword();

      case NEW_PASSWORD:
        return getNewPassword();

      }
      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 USERID:
        return isSetUserid();
      case OLD_PASSWORD:
        return isSetOldPassword();
      case NEW_PASSWORD:
        return isSetNewPassword();
      }
      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 updatePassword_args)
        return this.equals((updatePassword_args)that);
      return false;
    }

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

      boolean this_present_userid = true;
      boolean that_present_userid = true;
      if (this_present_userid || that_present_userid) {
        if (!(this_present_userid && that_present_userid))
          return false;
        if (this.userid != that.userid)
          return false;
      }

      boolean this_present_oldPassword = true && this.isSetOldPassword();
      boolean that_present_oldPassword = true && that.isSetOldPassword();
      if (this_present_oldPassword || that_present_oldPassword) {
        if (!(this_present_oldPassword && that_present_oldPassword))
          return false;
        if (!this.oldPassword.equals(that.oldPassword))
          return false;
      }

      boolean this_present_newPassword = true && this.isSetNewPassword();
      boolean that_present_newPassword = true && that.isSetNewPassword();
      if (this_present_newPassword || that_present_newPassword) {
        if (!(this_present_newPassword && that_present_newPassword))
          return false;
        if (!this.newPassword.equals(that.newPassword))
          return false;
      }

      return true;
    }

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

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

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

      lastComparison = Boolean.valueOf(isSetUserid()).compareTo(isSetUserid());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(userid, typedOther.userid);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetOldPassword()).compareTo(isSetOldPassword());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(oldPassword, typedOther.oldPassword);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetNewPassword()).compareTo(isSetNewPassword());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(newPassword, typedOther.newPassword);
      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 USERID:
              if (field.type == TType.I64) {
                this.userid = iprot.readI64();
                setUseridIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case OLD_PASSWORD:
              if (field.type == TType.STRING) {
                this.oldPassword = iprot.readString();
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case NEW_PASSWORD:
              if (field.type == TType.STRING) {
                this.newPassword = iprot.readString();
              } 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(USERID_FIELD_DESC);
      oprot.writeI64(this.userid);
      oprot.writeFieldEnd();
      if (this.oldPassword != null) {
        oprot.writeFieldBegin(OLD_PASSWORD_FIELD_DESC);
        oprot.writeString(this.oldPassword);
        oprot.writeFieldEnd();
      }
      if (this.newPassword != null) {
        oprot.writeFieldBegin(NEW_PASSWORD_FIELD_DESC);
        oprot.writeString(this.newPassword);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

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

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

  }

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

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.BOOL, (short)0);
    private static final TField UCX_FIELD_DESC = new TField("ucx", TType.STRUCT, (short)1);

    private boolean success;
    private UserContextException ucx;

    /** 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"),
      UCX((short)1, "ucx");

      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.BOOL)));
      put(_Fields.UCX, new FieldMetaData("ucx", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

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

    public updatePassword_result() {
    }

    public updatePassword_result(
      boolean success,
      UserContextException ucx)
    {
      this();
      this.success = success;
      setSuccessIsSet(true);
      this.ucx = ucx;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public updatePassword_result(updatePassword_result other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.success = other.success;
      if (other.isSetUcx()) {
        this.ucx = new UserContextException(other.ucx);
      }
    }

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

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

    public boolean isSuccess() {
      return this.success;
    }

    public updatePassword_result setSuccess(boolean 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 UserContextException getUcx() {
      return this.ucx;
    }

    public updatePassword_result setUcx(UserContextException ucx) {
      this.ucx = ucx;
      return this;
    }

    public void unsetUcx() {
      this.ucx = null;
    }

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

    public void setUcxIsSet(boolean value) {
      if (!value) {
        this.ucx = null;
      }
    }

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

      case UCX:
        if (value == null) {
          unsetUcx();
        } else {
          setUcx((UserContextException)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 Boolean(isSuccess());

      case UCX:
        return getUcx();

      }
      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 UCX:
        return isSetUcx();
      }
      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 updatePassword_result)
        return this.equals((updatePassword_result)that);
      return false;
    }

    public boolean equals(updatePassword_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_ucx = true && this.isSetUcx();
      boolean that_present_ucx = true && that.isSetUcx();
      if (this_present_ucx || that_present_ucx) {
        if (!(this_present_ucx && that_present_ucx))
          return false;
        if (!this.ucx.equals(that.ucx))
          return false;
      }

      return true;
    }

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

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

      int lastComparison = 0;
      updatePassword_result typedOther = (updatePassword_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(isSetUcx()).compareTo(isSetUcx());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(ucx, typedOther.ucx);
      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.BOOL) {
                this.success = iprot.readBool();
                setSuccessIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case UCX:
              if (field.type == TType.STRUCT) {
                this.ucx = new UserContextException();
                this.ucx.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.writeBool(this.success);
        oprot.writeFieldEnd();
      } else if (this.isSetUcx()) {
        oprot.writeFieldBegin(UCX_FIELD_DESC);
        this.ucx.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

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

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

  }

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

    private static final TField EMAIL_FIELD_DESC = new TField("email", TType.STRING, (short)1);
    private static final TField NEW_PASSWORD_FIELD_DESC = new TField("newPassword", TType.STRING, (short)2);

    private String email;
    private String newPassword;

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

      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.EMAIL, new FieldMetaData("email", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRING)));
      put(_Fields.NEW_PASSWORD, new FieldMetaData("newPassword", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRING)));
    }});

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

    public forgotPassword_args() {
    }

    public forgotPassword_args(
      String email,
      String newPassword)
    {
      this();
      this.email = email;
      this.newPassword = newPassword;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public forgotPassword_args(forgotPassword_args other) {
      if (other.isSetEmail()) {
        this.email = other.email;
      }
      if (other.isSetNewPassword()) {
        this.newPassword = other.newPassword;
      }
    }

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

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

    public String getEmail() {
      return this.email;
    }

    public forgotPassword_args setEmail(String email) {
      this.email = email;
      return this;
    }

    public void unsetEmail() {
      this.email = null;
    }

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

    public void setEmailIsSet(boolean value) {
      if (!value) {
        this.email = null;
      }
    }

    public String getNewPassword() {
      return this.newPassword;
    }

    public forgotPassword_args setNewPassword(String newPassword) {
      this.newPassword = newPassword;
      return this;
    }

    public void unsetNewPassword() {
      this.newPassword = null;
    }

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

    public void setNewPasswordIsSet(boolean value) {
      if (!value) {
        this.newPassword = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case EMAIL:
        if (value == null) {
          unsetEmail();
        } else {
          setEmail((String)value);
        }
        break;

      case NEW_PASSWORD:
        if (value == null) {
          unsetNewPassword();
        } else {
          setNewPassword((String)value);
        }
        break;

      }
    }

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

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case EMAIL:
        return getEmail();

      case NEW_PASSWORD:
        return getNewPassword();

      }
      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 EMAIL:
        return isSetEmail();
      case NEW_PASSWORD:
        return isSetNewPassword();
      }
      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 forgotPassword_args)
        return this.equals((forgotPassword_args)that);
      return false;
    }

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

      boolean this_present_email = true && this.isSetEmail();
      boolean that_present_email = true && that.isSetEmail();
      if (this_present_email || that_present_email) {
        if (!(this_present_email && that_present_email))
          return false;
        if (!this.email.equals(that.email))
          return false;
      }

      boolean this_present_newPassword = true && this.isSetNewPassword();
      boolean that_present_newPassword = true && that.isSetNewPassword();
      if (this_present_newPassword || that_present_newPassword) {
        if (!(this_present_newPassword && that_present_newPassword))
          return false;
        if (!this.newPassword.equals(that.newPassword))
          return false;
      }

      return true;
    }

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

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

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

      lastComparison = Boolean.valueOf(isSetEmail()).compareTo(isSetEmail());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(email, typedOther.email);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetNewPassword()).compareTo(isSetNewPassword());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(newPassword, typedOther.newPassword);
      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 EMAIL:
              if (field.type == TType.STRING) {
                this.email = iprot.readString();
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case NEW_PASSWORD:
              if (field.type == TType.STRING) {
                this.newPassword = iprot.readString();
              } 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.email != null) {
        oprot.writeFieldBegin(EMAIL_FIELD_DESC);
        oprot.writeString(this.email);
        oprot.writeFieldEnd();
      }
      if (this.newPassword != null) {
        oprot.writeFieldBegin(NEW_PASSWORD_FIELD_DESC);
        oprot.writeString(this.newPassword);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

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

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

  }

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

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.BOOL, (short)0);
    private static final TField UCX_FIELD_DESC = new TField("ucx", TType.STRUCT, (short)1);

    private boolean success;
    private UserContextException ucx;

    /** 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"),
      UCX((short)1, "ucx");

      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.BOOL)));
      put(_Fields.UCX, new FieldMetaData("ucx", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

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

    public forgotPassword_result() {
    }

    public forgotPassword_result(
      boolean success,
      UserContextException ucx)
    {
      this();
      this.success = success;
      setSuccessIsSet(true);
      this.ucx = ucx;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public forgotPassword_result(forgotPassword_result other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.success = other.success;
      if (other.isSetUcx()) {
        this.ucx = new UserContextException(other.ucx);
      }
    }

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

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

    public boolean isSuccess() {
      return this.success;
    }

    public forgotPassword_result setSuccess(boolean 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 UserContextException getUcx() {
      return this.ucx;
    }

    public forgotPassword_result setUcx(UserContextException ucx) {
      this.ucx = ucx;
      return this;
    }

    public void unsetUcx() {
      this.ucx = null;
    }

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

    public void setUcxIsSet(boolean value) {
      if (!value) {
        this.ucx = null;
      }
    }

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

      case UCX:
        if (value == null) {
          unsetUcx();
        } else {
          setUcx((UserContextException)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 Boolean(isSuccess());

      case UCX:
        return getUcx();

      }
      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 UCX:
        return isSetUcx();
      }
      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 forgotPassword_result)
        return this.equals((forgotPassword_result)that);
      return false;
    }

    public boolean equals(forgotPassword_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_ucx = true && this.isSetUcx();
      boolean that_present_ucx = true && that.isSetUcx();
      if (this_present_ucx || that_present_ucx) {
        if (!(this_present_ucx && that_present_ucx))
          return false;
        if (!this.ucx.equals(that.ucx))
          return false;
      }

      return true;
    }

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

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

      int lastComparison = 0;
      forgotPassword_result typedOther = (forgotPassword_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(isSetUcx()).compareTo(isSetUcx());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(ucx, typedOther.ucx);
      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.BOOL) {
                this.success = iprot.readBool();
                setSuccessIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case UCX:
              if (field.type == TType.STRUCT) {
                this.ucx = new UserContextException();
                this.ucx.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.writeBool(this.success);
        oprot.writeFieldEnd();
      } else if (this.isSetUcx()) {
        oprot.writeFieldBegin(UCX_FIELD_DESC);
        this.ucx.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

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

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

  }

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

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

    private long userId;

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

      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 __USERID_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.USER_ID, new FieldMetaData("userId", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
    }});

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

    public getAllAddressesForUser_args() {
    }

    public getAllAddressesForUser_args(
      long userId)
    {
      this();
      this.userId = userId;
      setUserIdIsSet(true);
    }

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

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

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

    public long getUserId() {
      return this.userId;
    }

    public getAllAddressesForUser_args setUserId(long userId) {
      this.userId = userId;
      setUserIdIsSet(true);
      return this;
    }

    public void unsetUserId() {
      __isset_bit_vector.clear(__USERID_ISSET_ID);
    }

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

    public void setUserIdIsSet(boolean value) {
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case USER_ID:
        if (value == null) {
          unsetUserId();
        } else {
          setUserId((Long)value);
        }
        break;

      }
    }

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

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case USER_ID:
        return new Long(getUserId());

      }
      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 USER_ID:
        return isSetUserId();
      }
      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 getAllAddressesForUser_args)
        return this.equals((getAllAddressesForUser_args)that);
      return false;
    }

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

      boolean this_present_userId = true;
      boolean that_present_userId = true;
      if (this_present_userId || that_present_userId) {
        if (!(this_present_userId && that_present_userId))
          return false;
        if (this.userId != that.userId)
          return false;
      }

      return true;
    }

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

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

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

      lastComparison = Boolean.valueOf(isSetUserId()).compareTo(isSetUserId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(userId, typedOther.userId);
      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 USER_ID:
              if (field.type == TType.I64) {
                this.userId = iprot.readI64();
                setUserIdIsSet(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(USER_ID_FIELD_DESC);
      oprot.writeI64(this.userId);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

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

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

  }

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

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0);
    private static final TField UCX_FIELD_DESC = new TField("ucx", TType.STRUCT, (short)1);

    private List<Address> success;
    private UserContextException ucx;

    /** 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"),
      UCX((short)1, "ucx");

      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, Address.class))));
      put(_Fields.UCX, new FieldMetaData("ucx", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

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

    public getAllAddressesForUser_result() {
    }

    public getAllAddressesForUser_result(
      List<Address> success,
      UserContextException ucx)
    {
      this();
      this.success = success;
      this.ucx = ucx;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getAllAddressesForUser_result(getAllAddressesForUser_result other) {
      if (other.isSetSuccess()) {
        List<Address> __this__success = new ArrayList<Address>();
        for (Address other_element : other.success) {
          __this__success.add(new Address(other_element));
        }
        this.success = __this__success;
      }
      if (other.isSetUcx()) {
        this.ucx = new UserContextException(other.ucx);
      }
    }

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

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

    public int getSuccessSize() {
      return (this.success == null) ? 0 : this.success.size();
    }

    public java.util.Iterator<Address> getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(Address elem) {
      if (this.success == null) {
        this.success = new ArrayList<Address>();
      }
      this.success.add(elem);
    }

    public List<Address> getSuccess() {
      return this.success;
    }

    public getAllAddressesForUser_result setSuccess(List<Address> 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 UserContextException getUcx() {
      return this.ucx;
    }

    public getAllAddressesForUser_result setUcx(UserContextException ucx) {
      this.ucx = ucx;
      return this;
    }

    public void unsetUcx() {
      this.ucx = null;
    }

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

    public void setUcxIsSet(boolean value) {
      if (!value) {
        this.ucx = null;
      }
    }

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

      case UCX:
        if (value == null) {
          unsetUcx();
        } else {
          setUcx((UserContextException)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 UCX:
        return getUcx();

      }
      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 UCX:
        return isSetUcx();
      }
      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 getAllAddressesForUser_result)
        return this.equals((getAllAddressesForUser_result)that);
      return false;
    }

    public boolean equals(getAllAddressesForUser_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_ucx = true && this.isSetUcx();
      boolean that_present_ucx = true && that.isSetUcx();
      if (this_present_ucx || that_present_ucx) {
        if (!(this_present_ucx && that_present_ucx))
          return false;
        if (!this.ucx.equals(that.ucx))
          return false;
      }

      return true;
    }

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

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

      int lastComparison = 0;
      getAllAddressesForUser_result typedOther = (getAllAddressesForUser_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(isSetUcx()).compareTo(isSetUcx());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(ucx, typedOther.ucx);
      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 _list16 = iprot.readListBegin();
                  this.success = new ArrayList<Address>(_list16.size);
                  for (int _i17 = 0; _i17 < _list16.size; ++_i17)
                  {
                    Address _elem18;
                    _elem18 = new Address();
                    _elem18.read(iprot);
                    this.success.add(_elem18);
                  }
                  iprot.readListEnd();
                }
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case UCX:
              if (field.type == TType.STRUCT) {
                this.ucx = new UserContextException();
                this.ucx.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 (Address _iter19 : this.success)
          {
            _iter19.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      } else if (this.isSetUcx()) {
        oprot.writeFieldBegin(UCX_FIELD_DESC);
        this.ucx.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getAllAddressesForUser_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("ucx:");
      if (this.ucx == null) {
        sb.append("null");
      } else {
        sb.append(this.ucx);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

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

  }

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

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

    private long userId;

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

      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 __USERID_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.USER_ID, new FieldMetaData("userId", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
    }});

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

    public getDefaultAddressId_args() {
    }

    public getDefaultAddressId_args(
      long userId)
    {
      this();
      this.userId = userId;
      setUserIdIsSet(true);
    }

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

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

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

    public long getUserId() {
      return this.userId;
    }

    public getDefaultAddressId_args setUserId(long userId) {
      this.userId = userId;
      setUserIdIsSet(true);
      return this;
    }

    public void unsetUserId() {
      __isset_bit_vector.clear(__USERID_ISSET_ID);
    }

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

    public void setUserIdIsSet(boolean value) {
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case USER_ID:
        if (value == null) {
          unsetUserId();
        } else {
          setUserId((Long)value);
        }
        break;

      }
    }

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

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case USER_ID:
        return new Long(getUserId());

      }
      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 USER_ID:
        return isSetUserId();
      }
      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 getDefaultAddressId_args)
        return this.equals((getDefaultAddressId_args)that);
      return false;
    }

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

      boolean this_present_userId = true;
      boolean that_present_userId = true;
      if (this_present_userId || that_present_userId) {
        if (!(this_present_userId && that_present_userId))
          return false;
        if (this.userId != that.userId)
          return false;
      }

      return true;
    }

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

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

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

      lastComparison = Boolean.valueOf(isSetUserId()).compareTo(isSetUserId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(userId, typedOther.userId);
      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 USER_ID:
              if (field.type == TType.I64) {
                this.userId = iprot.readI64();
                setUserIdIsSet(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(USER_ID_FIELD_DESC);
      oprot.writeI64(this.userId);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

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

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

  }

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

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

    private long success;
    private UserContextException ucx;

    /** 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"),
      UCX((short)1, "ucx");

      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.UCX, new FieldMetaData("ucx", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

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

    public getDefaultAddressId_result() {
    }

    public getDefaultAddressId_result(
      long success,
      UserContextException ucx)
    {
      this();
      this.success = success;
      setSuccessIsSet(true);
      this.ucx = ucx;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getDefaultAddressId_result(getDefaultAddressId_result other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.success = other.success;
      if (other.isSetUcx()) {
        this.ucx = new UserContextException(other.ucx);
      }
    }

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

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

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

    public getDefaultAddressId_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 UserContextException getUcx() {
      return this.ucx;
    }

    public getDefaultAddressId_result setUcx(UserContextException ucx) {
      this.ucx = ucx;
      return this;
    }

    public void unsetUcx() {
      this.ucx = null;
    }

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

    public void setUcxIsSet(boolean value) {
      if (!value) {
        this.ucx = null;
      }
    }

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

      case UCX:
        if (value == null) {
          unsetUcx();
        } else {
          setUcx((UserContextException)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 UCX:
        return getUcx();

      }
      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 UCX:
        return isSetUcx();
      }
      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 getDefaultAddressId_result)
        return this.equals((getDefaultAddressId_result)that);
      return false;
    }

    public boolean equals(getDefaultAddressId_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_ucx = true && this.isSetUcx();
      boolean that_present_ucx = true && that.isSetUcx();
      if (this_present_ucx || that_present_ucx) {
        if (!(this_present_ucx && that_present_ucx))
          return false;
        if (!this.ucx.equals(that.ucx))
          return false;
      }

      return true;
    }

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

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

      int lastComparison = 0;
      getDefaultAddressId_result typedOther = (getDefaultAddressId_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(isSetUcx()).compareTo(isSetUcx());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(ucx, typedOther.ucx);
      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 UCX:
              if (field.type == TType.STRUCT) {
                this.ucx = new UserContextException();
                this.ucx.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.isSetUcx()) {
        oprot.writeFieldBegin(UCX_FIELD_DESC);
        this.ucx.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

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

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

  }

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

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

    private long userId;

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

      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 __USERID_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.USER_ID, new FieldMetaData("userId", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
    }});

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

    public getDefaultPincode_args() {
    }

    public getDefaultPincode_args(
      long userId)
    {
      this();
      this.userId = userId;
      setUserIdIsSet(true);
    }

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

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

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

    public long getUserId() {
      return this.userId;
    }

    public getDefaultPincode_args setUserId(long userId) {
      this.userId = userId;
      setUserIdIsSet(true);
      return this;
    }

    public void unsetUserId() {
      __isset_bit_vector.clear(__USERID_ISSET_ID);
    }

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

    public void setUserIdIsSet(boolean value) {
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case USER_ID:
        if (value == null) {
          unsetUserId();
        } else {
          setUserId((Long)value);
        }
        break;

      }
    }

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

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case USER_ID:
        return new Long(getUserId());

      }
      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 USER_ID:
        return isSetUserId();
      }
      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 getDefaultPincode_args)
        return this.equals((getDefaultPincode_args)that);
      return false;
    }

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

      boolean this_present_userId = true;
      boolean that_present_userId = true;
      if (this_present_userId || that_present_userId) {
        if (!(this_present_userId && that_present_userId))
          return false;
        if (this.userId != that.userId)
          return false;
      }

      return true;
    }

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

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

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

      lastComparison = Boolean.valueOf(isSetUserId()).compareTo(isSetUserId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(userId, typedOther.userId);
      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 USER_ID:
              if (field.type == TType.I64) {
                this.userId = iprot.readI64();
                setUserIdIsSet(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(USER_ID_FIELD_DESC);
      oprot.writeI64(this.userId);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

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

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

  }

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

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRING, (short)0);
    private static final TField UCX_FIELD_DESC = new TField("ucx", TType.STRUCT, (short)1);

    private String success;
    private UserContextException ucx;

    /** 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"),
      UCX((short)1, "ucx");

      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 FieldValueMetaData(TType.STRING)));
      put(_Fields.UCX, new FieldMetaData("ucx", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

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

    public getDefaultPincode_result() {
    }

    public getDefaultPincode_result(
      String success,
      UserContextException ucx)
    {
      this();
      this.success = success;
      this.ucx = ucx;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getDefaultPincode_result(getDefaultPincode_result other) {
      if (other.isSetSuccess()) {
        this.success = other.success;
      }
      if (other.isSetUcx()) {
        this.ucx = new UserContextException(other.ucx);
      }
    }

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

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

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

    public getDefaultPincode_result setSuccess(String 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 UserContextException getUcx() {
      return this.ucx;
    }

    public getDefaultPincode_result setUcx(UserContextException ucx) {
      this.ucx = ucx;
      return this;
    }

    public void unsetUcx() {
      this.ucx = null;
    }

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

    public void setUcxIsSet(boolean value) {
      if (!value) {
        this.ucx = null;
      }
    }

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

      case UCX:
        if (value == null) {
          unsetUcx();
        } else {
          setUcx((UserContextException)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 UCX:
        return getUcx();

      }
      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 UCX:
        return isSetUcx();
      }
      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 getDefaultPincode_result)
        return this.equals((getDefaultPincode_result)that);
      return false;
    }

    public boolean equals(getDefaultPincode_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_ucx = true && this.isSetUcx();
      boolean that_present_ucx = true && that.isSetUcx();
      if (this_present_ucx || that_present_ucx) {
        if (!(this_present_ucx && that_present_ucx))
          return false;
        if (!this.ucx.equals(that.ucx))
          return false;
      }

      return true;
    }

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

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

      int lastComparison = 0;
      getDefaultPincode_result typedOther = (getDefaultPincode_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(isSetUcx()).compareTo(isSetUcx());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(ucx, typedOther.ucx);
      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.STRING) {
                this.success = iprot.readString();
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case UCX:
              if (field.type == TType.STRUCT) {
                this.ucx = new UserContextException();
                this.ucx.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.writeString(this.success);
        oprot.writeFieldEnd();
      } else if (this.isSetUcx()) {
        oprot.writeFieldBegin(UCX_FIELD_DESC);
        this.ucx.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getDefaultPincode_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("ucx:");
      if (this.ucx == null) {
        sb.append("null");
      } else {
        sb.append(this.ucx);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

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

  }

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

    private static final TField USER_ID_FIELD_DESC = new TField("userId", TType.I64, (short)1);
    private static final TField REPLY_TO_FIELD_DESC = new TField("replyTo", TType.STRING, (short)2);
    private static final TField COMMUNICATION_TYPE_FIELD_DESC = new TField("communicationType", TType.I64, (short)3);
    private static final TField ORDER_ID_FIELD_DESC = new TField("orderId", TType.I64, (short)4);
    private static final TField AIRWAYBILL_NO_FIELD_DESC = new TField("airwaybillNo", TType.STRING, (short)5);
    private static final TField PRODUCT_NAME_FIELD_DESC = new TField("productName", TType.STRING, (short)6);
    private static final TField SUBJECT_FIELD_DESC = new TField("subject", TType.STRING, (short)7);
    private static final TField MESSAGE_FIELD_DESC = new TField("message", TType.STRING, (short)8);

    private long userId;
    private String replyTo;
    private long communicationType;
    private long orderId;
    private String airwaybillNo;
    private String productName;
    private String subject;
    private String message;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      USER_ID((short)1, "userId"),
      REPLY_TO((short)2, "replyTo"),
      COMMUNICATION_TYPE((short)3, "communicationType"),
      ORDER_ID((short)4, "orderId"),
      AIRWAYBILL_NO((short)5, "airwaybillNo"),
      PRODUCT_NAME((short)6, "productName"),
      SUBJECT((short)7, "subject"),
      MESSAGE((short)8, "message");

      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 __USERID_ISSET_ID = 0;
    private static final int __COMMUNICATIONTYPE_ISSET_ID = 1;
    private static final int __ORDERID_ISSET_ID = 2;
    private BitSet __isset_bit_vector = new BitSet(3);

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.USER_ID, new FieldMetaData("userId", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
      put(_Fields.REPLY_TO, new FieldMetaData("replyTo", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRING)));
      put(_Fields.COMMUNICATION_TYPE, new FieldMetaData("communicationType", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
      put(_Fields.ORDER_ID, new FieldMetaData("orderId", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
      put(_Fields.AIRWAYBILL_NO, new FieldMetaData("airwaybillNo", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRING)));
      put(_Fields.PRODUCT_NAME, new FieldMetaData("productName", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRING)));
      put(_Fields.SUBJECT, new FieldMetaData("subject", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRING)));
      put(_Fields.MESSAGE, new FieldMetaData("message", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRING)));
    }});

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

    public saveUserCommunication_args() {
    }

    public saveUserCommunication_args(
      long userId,
      String replyTo,
      long communicationType,
      long orderId,
      String airwaybillNo,
      String productName,
      String subject,
      String message)
    {
      this();
      this.userId = userId;
      setUserIdIsSet(true);
      this.replyTo = replyTo;
      this.communicationType = communicationType;
      setCommunicationTypeIsSet(true);
      this.orderId = orderId;
      setOrderIdIsSet(true);
      this.airwaybillNo = airwaybillNo;
      this.productName = productName;
      this.subject = subject;
      this.message = message;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public saveUserCommunication_args(saveUserCommunication_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.userId = other.userId;
      if (other.isSetReplyTo()) {
        this.replyTo = other.replyTo;
      }
      this.communicationType = other.communicationType;
      this.orderId = other.orderId;
      if (other.isSetAirwaybillNo()) {
        this.airwaybillNo = other.airwaybillNo;
      }
      if (other.isSetProductName()) {
        this.productName = other.productName;
      }
      if (other.isSetSubject()) {
        this.subject = other.subject;
      }
      if (other.isSetMessage()) {
        this.message = other.message;
      }
    }

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

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

    public long getUserId() {
      return this.userId;
    }

    public saveUserCommunication_args setUserId(long userId) {
      this.userId = userId;
      setUserIdIsSet(true);
      return this;
    }

    public void unsetUserId() {
      __isset_bit_vector.clear(__USERID_ISSET_ID);
    }

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

    public void setUserIdIsSet(boolean value) {
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
    }

    public String getReplyTo() {
      return this.replyTo;
    }

    public saveUserCommunication_args setReplyTo(String replyTo) {
      this.replyTo = replyTo;
      return this;
    }

    public void unsetReplyTo() {
      this.replyTo = null;
    }

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

    public void setReplyToIsSet(boolean value) {
      if (!value) {
        this.replyTo = null;
      }
    }

    public long getCommunicationType() {
      return this.communicationType;
    }

    public saveUserCommunication_args setCommunicationType(long communicationType) {
      this.communicationType = communicationType;
      setCommunicationTypeIsSet(true);
      return this;
    }

    public void unsetCommunicationType() {
      __isset_bit_vector.clear(__COMMUNICATIONTYPE_ISSET_ID);
    }

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

    public void setCommunicationTypeIsSet(boolean value) {
      __isset_bit_vector.set(__COMMUNICATIONTYPE_ISSET_ID, value);
    }

    public long getOrderId() {
      return this.orderId;
    }

    public saveUserCommunication_args setOrderId(long orderId) {
      this.orderId = orderId;
      setOrderIdIsSet(true);
      return this;
    }

    public void unsetOrderId() {
      __isset_bit_vector.clear(__ORDERID_ISSET_ID);
    }

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

    public void setOrderIdIsSet(boolean value) {
      __isset_bit_vector.set(__ORDERID_ISSET_ID, value);
    }

    public String getAirwaybillNo() {
      return this.airwaybillNo;
    }

    public saveUserCommunication_args setAirwaybillNo(String airwaybillNo) {
      this.airwaybillNo = airwaybillNo;
      return this;
    }

    public void unsetAirwaybillNo() {
      this.airwaybillNo = null;
    }

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

    public void setAirwaybillNoIsSet(boolean value) {
      if (!value) {
        this.airwaybillNo = null;
      }
    }

    public String getProductName() {
      return this.productName;
    }

    public saveUserCommunication_args setProductName(String productName) {
      this.productName = productName;
      return this;
    }

    public void unsetProductName() {
      this.productName = null;
    }

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

    public void setProductNameIsSet(boolean value) {
      if (!value) {
        this.productName = null;
      }
    }

    public String getSubject() {
      return this.subject;
    }

    public saveUserCommunication_args setSubject(String subject) {
      this.subject = subject;
      return this;
    }

    public void unsetSubject() {
      this.subject = null;
    }

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

    public void setSubjectIsSet(boolean value) {
      if (!value) {
        this.subject = null;
      }
    }

    public String getMessage() {
      return this.message;
    }

    public saveUserCommunication_args setMessage(String message) {
      this.message = message;
      return this;
    }

    public void unsetMessage() {
      this.message = null;
    }

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

    public void setMessageIsSet(boolean value) {
      if (!value) {
        this.message = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case USER_ID:
        if (value == null) {
          unsetUserId();
        } else {
          setUserId((Long)value);
        }
        break;

      case REPLY_TO:
        if (value == null) {
          unsetReplyTo();
        } else {
          setReplyTo((String)value);
        }
        break;

      case COMMUNICATION_TYPE:
        if (value == null) {
          unsetCommunicationType();
        } else {
          setCommunicationType((Long)value);
        }
        break;

      case ORDER_ID:
        if (value == null) {
          unsetOrderId();
        } else {
          setOrderId((Long)value);
        }
        break;

      case AIRWAYBILL_NO:
        if (value == null) {
          unsetAirwaybillNo();
        } else {
          setAirwaybillNo((String)value);
        }
        break;

      case PRODUCT_NAME:
        if (value == null) {
          unsetProductName();
        } else {
          setProductName((String)value);
        }
        break;

      case SUBJECT:
        if (value == null) {
          unsetSubject();
        } else {
          setSubject((String)value);
        }
        break;

      case MESSAGE:
        if (value == null) {
          unsetMessage();
        } else {
          setMessage((String)value);
        }
        break;

      }
    }

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

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case USER_ID:
        return new Long(getUserId());

      case REPLY_TO:
        return getReplyTo();

      case COMMUNICATION_TYPE:
        return new Long(getCommunicationType());

      case ORDER_ID:
        return new Long(getOrderId());

      case AIRWAYBILL_NO:
        return getAirwaybillNo();

      case PRODUCT_NAME:
        return getProductName();

      case SUBJECT:
        return getSubject();

      case MESSAGE:
        return getMessage();

      }
      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 USER_ID:
        return isSetUserId();
      case REPLY_TO:
        return isSetReplyTo();
      case COMMUNICATION_TYPE:
        return isSetCommunicationType();
      case ORDER_ID:
        return isSetOrderId();
      case AIRWAYBILL_NO:
        return isSetAirwaybillNo();
      case PRODUCT_NAME:
        return isSetProductName();
      case SUBJECT:
        return isSetSubject();
      case MESSAGE:
        return isSetMessage();
      }
      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 saveUserCommunication_args)
        return this.equals((saveUserCommunication_args)that);
      return false;
    }

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

      boolean this_present_userId = true;
      boolean that_present_userId = true;
      if (this_present_userId || that_present_userId) {
        if (!(this_present_userId && that_present_userId))
          return false;
        if (this.userId != that.userId)
          return false;
      }

      boolean this_present_replyTo = true && this.isSetReplyTo();
      boolean that_present_replyTo = true && that.isSetReplyTo();
      if (this_present_replyTo || that_present_replyTo) {
        if (!(this_present_replyTo && that_present_replyTo))
          return false;
        if (!this.replyTo.equals(that.replyTo))
          return false;
      }

      boolean this_present_communicationType = true;
      boolean that_present_communicationType = true;
      if (this_present_communicationType || that_present_communicationType) {
        if (!(this_present_communicationType && that_present_communicationType))
          return false;
        if (this.communicationType != that.communicationType)
          return false;
      }

      boolean this_present_orderId = true;
      boolean that_present_orderId = true;
      if (this_present_orderId || that_present_orderId) {
        if (!(this_present_orderId && that_present_orderId))
          return false;
        if (this.orderId != that.orderId)
          return false;
      }

      boolean this_present_airwaybillNo = true && this.isSetAirwaybillNo();
      boolean that_present_airwaybillNo = true && that.isSetAirwaybillNo();
      if (this_present_airwaybillNo || that_present_airwaybillNo) {
        if (!(this_present_airwaybillNo && that_present_airwaybillNo))
          return false;
        if (!this.airwaybillNo.equals(that.airwaybillNo))
          return false;
      }

      boolean this_present_productName = true && this.isSetProductName();
      boolean that_present_productName = true && that.isSetProductName();
      if (this_present_productName || that_present_productName) {
        if (!(this_present_productName && that_present_productName))
          return false;
        if (!this.productName.equals(that.productName))
          return false;
      }

      boolean this_present_subject = true && this.isSetSubject();
      boolean that_present_subject = true && that.isSetSubject();
      if (this_present_subject || that_present_subject) {
        if (!(this_present_subject && that_present_subject))
          return false;
        if (!this.subject.equals(that.subject))
          return false;
      }

      boolean this_present_message = true && this.isSetMessage();
      boolean that_present_message = true && that.isSetMessage();
      if (this_present_message || that_present_message) {
        if (!(this_present_message && that_present_message))
          return false;
        if (!this.message.equals(that.message))
          return false;
      }

      return true;
    }

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

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

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

      lastComparison = Boolean.valueOf(isSetUserId()).compareTo(isSetUserId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(userId, typedOther.userId);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetReplyTo()).compareTo(isSetReplyTo());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(replyTo, typedOther.replyTo);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetCommunicationType()).compareTo(isSetCommunicationType());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(communicationType, typedOther.communicationType);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetOrderId()).compareTo(isSetOrderId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(orderId, typedOther.orderId);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetAirwaybillNo()).compareTo(isSetAirwaybillNo());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(airwaybillNo, typedOther.airwaybillNo);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetProductName()).compareTo(isSetProductName());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(productName, typedOther.productName);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetSubject()).compareTo(isSetSubject());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(subject, typedOther.subject);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetMessage()).compareTo(isSetMessage());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(message, typedOther.message);
      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 USER_ID:
              if (field.type == TType.I64) {
                this.userId = iprot.readI64();
                setUserIdIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case REPLY_TO:
              if (field.type == TType.STRING) {
                this.replyTo = iprot.readString();
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case COMMUNICATION_TYPE:
              if (field.type == TType.I64) {
                this.communicationType = iprot.readI64();
                setCommunicationTypeIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case ORDER_ID:
              if (field.type == TType.I64) {
                this.orderId = iprot.readI64();
                setOrderIdIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case AIRWAYBILL_NO:
              if (field.type == TType.STRING) {
                this.airwaybillNo = iprot.readString();
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case PRODUCT_NAME:
              if (field.type == TType.STRING) {
                this.productName = iprot.readString();
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case SUBJECT:
              if (field.type == TType.STRING) {
                this.subject = iprot.readString();
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case MESSAGE:
              if (field.type == TType.STRING) {
                this.message = iprot.readString();
              } 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(USER_ID_FIELD_DESC);
      oprot.writeI64(this.userId);
      oprot.writeFieldEnd();
      if (this.replyTo != null) {
        oprot.writeFieldBegin(REPLY_TO_FIELD_DESC);
        oprot.writeString(this.replyTo);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldBegin(COMMUNICATION_TYPE_FIELD_DESC);
      oprot.writeI64(this.communicationType);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(ORDER_ID_FIELD_DESC);
      oprot.writeI64(this.orderId);
      oprot.writeFieldEnd();
      if (this.airwaybillNo != null) {
        oprot.writeFieldBegin(AIRWAYBILL_NO_FIELD_DESC);
        oprot.writeString(this.airwaybillNo);
        oprot.writeFieldEnd();
      }
      if (this.productName != null) {
        oprot.writeFieldBegin(PRODUCT_NAME_FIELD_DESC);
        oprot.writeString(this.productName);
        oprot.writeFieldEnd();
      }
      if (this.subject != null) {
        oprot.writeFieldBegin(SUBJECT_FIELD_DESC);
        oprot.writeString(this.subject);
        oprot.writeFieldEnd();
      }
      if (this.message != null) {
        oprot.writeFieldBegin(MESSAGE_FIELD_DESC);
        oprot.writeString(this.message);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

      sb.append("userId:");
      sb.append(this.userId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("replyTo:");
      if (this.replyTo == null) {
        sb.append("null");
      } else {
        sb.append(this.replyTo);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("communicationType:");
      sb.append(this.communicationType);
      first = false;
      if (!first) sb.append(", ");
      sb.append("orderId:");
      sb.append(this.orderId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("airwaybillNo:");
      if (this.airwaybillNo == null) {
        sb.append("null");
      } else {
        sb.append(this.airwaybillNo);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("productName:");
      if (this.productName == null) {
        sb.append("null");
      } else {
        sb.append(this.productName);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("subject:");
      if (this.subject == null) {
        sb.append("null");
      } else {
        sb.append(this.subject);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("message:");
      if (this.message == null) {
        sb.append("null");
      } else {
        sb.append(this.message);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

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

  }

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

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.BOOL, (short)0);
    private static final TField UCX_FIELD_DESC = new TField("ucx", TType.STRUCT, (short)1);

    private boolean success;
    private UserCommunicationException ucx;

    /** 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"),
      UCX((short)1, "ucx");

      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.BOOL)));
      put(_Fields.UCX, new FieldMetaData("ucx", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

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

    public saveUserCommunication_result() {
    }

    public saveUserCommunication_result(
      boolean success,
      UserCommunicationException ucx)
    {
      this();
      this.success = success;
      setSuccessIsSet(true);
      this.ucx = ucx;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public saveUserCommunication_result(saveUserCommunication_result other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.success = other.success;
      if (other.isSetUcx()) {
        this.ucx = new UserCommunicationException(other.ucx);
      }
    }

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

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

    public boolean isSuccess() {
      return this.success;
    }

    public saveUserCommunication_result setSuccess(boolean 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 UserCommunicationException getUcx() {
      return this.ucx;
    }

    public saveUserCommunication_result setUcx(UserCommunicationException ucx) {
      this.ucx = ucx;
      return this;
    }

    public void unsetUcx() {
      this.ucx = null;
    }

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

    public void setUcxIsSet(boolean value) {
      if (!value) {
        this.ucx = null;
      }
    }

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

      case UCX:
        if (value == null) {
          unsetUcx();
        } else {
          setUcx((UserCommunicationException)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 Boolean(isSuccess());

      case UCX:
        return getUcx();

      }
      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 UCX:
        return isSetUcx();
      }
      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 saveUserCommunication_result)
        return this.equals((saveUserCommunication_result)that);
      return false;
    }

    public boolean equals(saveUserCommunication_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_ucx = true && this.isSetUcx();
      boolean that_present_ucx = true && that.isSetUcx();
      if (this_present_ucx || that_present_ucx) {
        if (!(this_present_ucx && that_present_ucx))
          return false;
        if (!this.ucx.equals(that.ucx))
          return false;
      }

      return true;
    }

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

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

      int lastComparison = 0;
      saveUserCommunication_result typedOther = (saveUserCommunication_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(isSetUcx()).compareTo(isSetUcx());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(ucx, typedOther.ucx);
      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.BOOL) {
                this.success = iprot.readBool();
                setSuccessIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case UCX:
              if (field.type == TType.STRUCT) {
                this.ucx = new UserCommunicationException();
                this.ucx.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.writeBool(this.success);
        oprot.writeFieldEnd();
      } else if (this.isSetUcx()) {
        oprot.writeFieldBegin(UCX_FIELD_DESC);
        this.ucx.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

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

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

  }

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

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

    private long userId;

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

      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 __USERID_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.USER_ID, new FieldMetaData("userId", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
    }});

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

    public createCart_args() {
    }

    public createCart_args(
      long userId)
    {
      this();
      this.userId = userId;
      setUserIdIsSet(true);
    }

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

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

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

    public long getUserId() {
      return this.userId;
    }

    public createCart_args setUserId(long userId) {
      this.userId = userId;
      setUserIdIsSet(true);
      return this;
    }

    public void unsetUserId() {
      __isset_bit_vector.clear(__USERID_ISSET_ID);
    }

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

    public void setUserIdIsSet(boolean value) {
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case USER_ID:
        if (value == null) {
          unsetUserId();
        } else {
          setUserId((Long)value);
        }
        break;

      }
    }

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

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case USER_ID:
        return new Long(getUserId());

      }
      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 USER_ID:
        return isSetUserId();
      }
      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 createCart_args)
        return this.equals((createCart_args)that);
      return false;
    }

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

      boolean this_present_userId = true;
      boolean that_present_userId = true;
      if (this_present_userId || that_present_userId) {
        if (!(this_present_userId && that_present_userId))
          return false;
        if (this.userId != that.userId)
          return false;
      }

      return true;
    }

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

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

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

      lastComparison = Boolean.valueOf(isSetUserId()).compareTo(isSetUserId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(userId, typedOther.userId);
      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 USER_ID:
              if (field.type == TType.I64) {
                this.userId = iprot.readI64();
                setUserIdIsSet(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(USER_ID_FIELD_DESC);
      oprot.writeI64(this.userId);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

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

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

  }

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

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

    private long success;
    private ShoppingCartException scx;

    /** 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"),
      SCX((short)1, "scx");

      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.SCX, new FieldMetaData("scx", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

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

    public createCart_result() {
    }

    public createCart_result(
      long success,
      ShoppingCartException scx)
    {
      this();
      this.success = success;
      setSuccessIsSet(true);
      this.scx = scx;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public createCart_result(createCart_result other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.success = other.success;
      if (other.isSetScx()) {
        this.scx = new ShoppingCartException(other.scx);
      }
    }

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

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

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

    public createCart_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 ShoppingCartException getScx() {
      return this.scx;
    }

    public createCart_result setScx(ShoppingCartException scx) {
      this.scx = scx;
      return this;
    }

    public void unsetScx() {
      this.scx = null;
    }

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

    public void setScxIsSet(boolean value) {
      if (!value) {
        this.scx = null;
      }
    }

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

      case SCX:
        if (value == null) {
          unsetScx();
        } else {
          setScx((ShoppingCartException)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 SCX:
        return getScx();

      }
      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 SCX:
        return isSetScx();
      }
      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 createCart_result)
        return this.equals((createCart_result)that);
      return false;
    }

    public boolean equals(createCart_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_scx = true && this.isSetScx();
      boolean that_present_scx = true && that.isSetScx();
      if (this_present_scx || that_present_scx) {
        if (!(this_present_scx && that_present_scx))
          return false;
        if (!this.scx.equals(that.scx))
          return false;
      }

      return true;
    }

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

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

      int lastComparison = 0;
      createCart_result typedOther = (createCart_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(isSetScx()).compareTo(isSetScx());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(scx, typedOther.scx);
      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 SCX:
              if (field.type == TType.STRUCT) {
                this.scx = new ShoppingCartException();
                this.scx.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.isSetScx()) {
        oprot.writeFieldBegin(SCX_FIELD_DESC);
        this.scx.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

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

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

  }

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

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

    private long userId;

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

      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 __USERID_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.USER_ID, new FieldMetaData("userId", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
    }});

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

    public getCurrentCart_args() {
    }

    public getCurrentCart_args(
      long userId)
    {
      this();
      this.userId = userId;
      setUserIdIsSet(true);
    }

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

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

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

    public long getUserId() {
      return this.userId;
    }

    public getCurrentCart_args setUserId(long userId) {
      this.userId = userId;
      setUserIdIsSet(true);
      return this;
    }

    public void unsetUserId() {
      __isset_bit_vector.clear(__USERID_ISSET_ID);
    }

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

    public void setUserIdIsSet(boolean value) {
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case USER_ID:
        if (value == null) {
          unsetUserId();
        } else {
          setUserId((Long)value);
        }
        break;

      }
    }

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

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case USER_ID:
        return new Long(getUserId());

      }
      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 USER_ID:
        return isSetUserId();
      }
      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 getCurrentCart_args)
        return this.equals((getCurrentCart_args)that);
      return false;
    }

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

      boolean this_present_userId = true;
      boolean that_present_userId = true;
      if (this_present_userId || that_present_userId) {
        if (!(this_present_userId && that_present_userId))
          return false;
        if (this.userId != that.userId)
          return false;
      }

      return true;
    }

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

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

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

      lastComparison = Boolean.valueOf(isSetUserId()).compareTo(isSetUserId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(userId, typedOther.userId);
      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 USER_ID:
              if (field.type == TType.I64) {
                this.userId = iprot.readI64();
                setUserIdIsSet(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(USER_ID_FIELD_DESC);
      oprot.writeI64(this.userId);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

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

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

  }

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

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRUCT, (short)0);
    private static final TField SCX_FIELD_DESC = new TField("scx", TType.STRUCT, (short)1);

    private Cart success;
    private ShoppingCartException scx;

    /** 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"),
      SCX((short)1, "scx");

      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, Cart.class)));
      put(_Fields.SCX, new FieldMetaData("scx", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

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

    public getCurrentCart_result() {
    }

    public getCurrentCart_result(
      Cart success,
      ShoppingCartException scx)
    {
      this();
      this.success = success;
      this.scx = scx;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getCurrentCart_result(getCurrentCart_result other) {
      if (other.isSetSuccess()) {
        this.success = new Cart(other.success);
      }
      if (other.isSetScx()) {
        this.scx = new ShoppingCartException(other.scx);
      }
    }

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

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

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

    public getCurrentCart_result setSuccess(Cart 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 ShoppingCartException getScx() {
      return this.scx;
    }

    public getCurrentCart_result setScx(ShoppingCartException scx) {
      this.scx = scx;
      return this;
    }

    public void unsetScx() {
      this.scx = null;
    }

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

    public void setScxIsSet(boolean value) {
      if (!value) {
        this.scx = null;
      }
    }

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

      case SCX:
        if (value == null) {
          unsetScx();
        } else {
          setScx((ShoppingCartException)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 SCX:
        return getScx();

      }
      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 SCX:
        return isSetScx();
      }
      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 getCurrentCart_result)
        return this.equals((getCurrentCart_result)that);
      return false;
    }

    public boolean equals(getCurrentCart_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_scx = true && this.isSetScx();
      boolean that_present_scx = true && that.isSetScx();
      if (this_present_scx || that_present_scx) {
        if (!(this_present_scx && that_present_scx))
          return false;
        if (!this.scx.equals(that.scx))
          return false;
      }

      return true;
    }

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

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

      int lastComparison = 0;
      getCurrentCart_result typedOther = (getCurrentCart_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(isSetScx()).compareTo(isSetScx());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(scx, typedOther.scx);
      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 Cart();
                this.success.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case SCX:
              if (field.type == TType.STRUCT) {
                this.scx = new ShoppingCartException();
                this.scx.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.isSetScx()) {
        oprot.writeFieldBegin(SCX_FIELD_DESC);
        this.scx.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getCurrentCart_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("scx:");
      if (this.scx == null) {
        sb.append("null");
      } else {
        sb.append(this.scx);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

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

  }

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

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

    private long cartId;

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

      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 __CARTID_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.CART_ID, new FieldMetaData("cartId", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
    }});

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

    public getCart_args() {
    }

    public getCart_args(
      long cartId)
    {
      this();
      this.cartId = cartId;
      setCartIdIsSet(true);
    }

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

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

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

    public long getCartId() {
      return this.cartId;
    }

    public getCart_args setCartId(long cartId) {
      this.cartId = cartId;
      setCartIdIsSet(true);
      return this;
    }

    public void unsetCartId() {
      __isset_bit_vector.clear(__CARTID_ISSET_ID);
    }

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

    public void setCartIdIsSet(boolean value) {
      __isset_bit_vector.set(__CARTID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case CART_ID:
        if (value == null) {
          unsetCartId();
        } else {
          setCartId((Long)value);
        }
        break;

      }
    }

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

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case CART_ID:
        return new Long(getCartId());

      }
      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 CART_ID:
        return isSetCartId();
      }
      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 getCart_args)
        return this.equals((getCart_args)that);
      return false;
    }

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

      boolean this_present_cartId = true;
      boolean that_present_cartId = true;
      if (this_present_cartId || that_present_cartId) {
        if (!(this_present_cartId && that_present_cartId))
          return false;
        if (this.cartId != that.cartId)
          return false;
      }

      return true;
    }

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

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

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

      lastComparison = Boolean.valueOf(isSetCartId()).compareTo(isSetCartId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(cartId, typedOther.cartId);
      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 CART_ID:
              if (field.type == TType.I64) {
                this.cartId = iprot.readI64();
                setCartIdIsSet(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(CART_ID_FIELD_DESC);
      oprot.writeI64(this.cartId);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

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

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

  }

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

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRUCT, (short)0);
    private static final TField SCX_FIELD_DESC = new TField("scx", TType.STRUCT, (short)1);

    private Cart success;
    private ShoppingCartException scx;

    /** 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"),
      SCX((short)1, "scx");

      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, Cart.class)));
      put(_Fields.SCX, new FieldMetaData("scx", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

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

    public getCart_result() {
    }

    public getCart_result(
      Cart success,
      ShoppingCartException scx)
    {
      this();
      this.success = success;
      this.scx = scx;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getCart_result(getCart_result other) {
      if (other.isSetSuccess()) {
        this.success = new Cart(other.success);
      }
      if (other.isSetScx()) {
        this.scx = new ShoppingCartException(other.scx);
      }
    }

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

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

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

    public getCart_result setSuccess(Cart 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 ShoppingCartException getScx() {
      return this.scx;
    }

    public getCart_result setScx(ShoppingCartException scx) {
      this.scx = scx;
      return this;
    }

    public void unsetScx() {
      this.scx = null;
    }

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

    public void setScxIsSet(boolean value) {
      if (!value) {
        this.scx = null;
      }
    }

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

      case SCX:
        if (value == null) {
          unsetScx();
        } else {
          setScx((ShoppingCartException)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 SCX:
        return getScx();

      }
      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 SCX:
        return isSetScx();
      }
      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 getCart_result)
        return this.equals((getCart_result)that);
      return false;
    }

    public boolean equals(getCart_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_scx = true && this.isSetScx();
      boolean that_present_scx = true && that.isSetScx();
      if (this_present_scx || that_present_scx) {
        if (!(this_present_scx && that_present_scx))
          return false;
        if (!this.scx.equals(that.scx))
          return false;
      }

      return true;
    }

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

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

      int lastComparison = 0;
      getCart_result typedOther = (getCart_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(isSetScx()).compareTo(isSetScx());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(scx, typedOther.scx);
      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 Cart();
                this.success.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case SCX:
              if (field.type == TType.STRUCT) {
                this.scx = new ShoppingCartException();
                this.scx.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.isSetScx()) {
        oprot.writeFieldBegin(SCX_FIELD_DESC);
        this.scx.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getCart_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("scx:");
      if (this.scx == null) {
        sb.append("null");
      } else {
        sb.append(this.scx);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

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

  }

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

    private static final TField USER_ID_FIELD_DESC = new TField("userId", TType.I64, (short)1);
    private static final TField STATUS_FIELD_DESC = new TField("status", TType.I32, (short)2);

    private long userId;
    private CartStatus status;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      USER_ID((short)1, "userId"),
      /**
       * 
       * @see CartStatus
       */
      STATUS((short)2, "status");

      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 __USERID_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.USER_ID, new FieldMetaData("userId", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
      put(_Fields.STATUS, new FieldMetaData("status", TFieldRequirementType.DEFAULT, 
          new EnumMetaData(TType.ENUM, CartStatus.class)));
    }});

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

    public getCartsForUser_args() {
    }

    public getCartsForUser_args(
      long userId,
      CartStatus status)
    {
      this();
      this.userId = userId;
      setUserIdIsSet(true);
      this.status = status;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getCartsForUser_args(getCartsForUser_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.userId = other.userId;
      if (other.isSetStatus()) {
        this.status = other.status;
      }
    }

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

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

    public long getUserId() {
      return this.userId;
    }

    public getCartsForUser_args setUserId(long userId) {
      this.userId = userId;
      setUserIdIsSet(true);
      return this;
    }

    public void unsetUserId() {
      __isset_bit_vector.clear(__USERID_ISSET_ID);
    }

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

    public void setUserIdIsSet(boolean value) {
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
    }

    /**
     * 
     * @see CartStatus
     */
    public CartStatus getStatus() {
      return this.status;
    }

    /**
     * 
     * @see CartStatus
     */
    public getCartsForUser_args setStatus(CartStatus status) {
      this.status = status;
      return this;
    }

    public void unsetStatus() {
      this.status = null;
    }

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

    public void setStatusIsSet(boolean value) {
      if (!value) {
        this.status = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case USER_ID:
        if (value == null) {
          unsetUserId();
        } else {
          setUserId((Long)value);
        }
        break;

      case STATUS:
        if (value == null) {
          unsetStatus();
        } else {
          setStatus((CartStatus)value);
        }
        break;

      }
    }

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

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case USER_ID:
        return new Long(getUserId());

      case STATUS:
        return getStatus();

      }
      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 USER_ID:
        return isSetUserId();
      case STATUS:
        return isSetStatus();
      }
      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 getCartsForUser_args)
        return this.equals((getCartsForUser_args)that);
      return false;
    }

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

      boolean this_present_userId = true;
      boolean that_present_userId = true;
      if (this_present_userId || that_present_userId) {
        if (!(this_present_userId && that_present_userId))
          return false;
        if (this.userId != that.userId)
          return false;
      }

      boolean this_present_status = true && this.isSetStatus();
      boolean that_present_status = true && that.isSetStatus();
      if (this_present_status || that_present_status) {
        if (!(this_present_status && that_present_status))
          return false;
        if (!this.status.equals(that.status))
          return false;
      }

      return true;
    }

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

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

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

      lastComparison = Boolean.valueOf(isSetUserId()).compareTo(isSetUserId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(userId, typedOther.userId);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetStatus()).compareTo(isSetStatus());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(status, typedOther.status);
      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 USER_ID:
              if (field.type == TType.I64) {
                this.userId = iprot.readI64();
                setUserIdIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case STATUS:
              if (field.type == TType.I32) {
                this.status = CartStatus.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(USER_ID_FIELD_DESC);
      oprot.writeI64(this.userId);
      oprot.writeFieldEnd();
      if (this.status != null) {
        oprot.writeFieldBegin(STATUS_FIELD_DESC);
        oprot.writeI32(this.status.getValue());
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

      sb.append("userId:");
      sb.append(this.userId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("status:");
      if (this.status == null) {
        sb.append("null");
      } else {
        String status_name = status.name();
        if (status_name != null) {
          sb.append(status_name);
          sb.append(" (");
        }
        sb.append(this.status);
        if (status_name != null) {
          sb.append(")");
        }
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

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

  }

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

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0);
    private static final TField SCX_FIELD_DESC = new TField("scx", TType.STRUCT, (short)1);

    private List<Cart> success;
    private ShoppingCartException scx;

    /** 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"),
      SCX((short)1, "scx");

      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, Cart.class))));
      put(_Fields.SCX, new FieldMetaData("scx", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

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

    public getCartsForUser_result() {
    }

    public getCartsForUser_result(
      List<Cart> success,
      ShoppingCartException scx)
    {
      this();
      this.success = success;
      this.scx = scx;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getCartsForUser_result(getCartsForUser_result other) {
      if (other.isSetSuccess()) {
        List<Cart> __this__success = new ArrayList<Cart>();
        for (Cart other_element : other.success) {
          __this__success.add(new Cart(other_element));
        }
        this.success = __this__success;
      }
      if (other.isSetScx()) {
        this.scx = new ShoppingCartException(other.scx);
      }
    }

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

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

    public int getSuccessSize() {
      return (this.success == null) ? 0 : this.success.size();
    }

    public java.util.Iterator<Cart> getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(Cart elem) {
      if (this.success == null) {
        this.success = new ArrayList<Cart>();
      }
      this.success.add(elem);
    }

    public List<Cart> getSuccess() {
      return this.success;
    }

    public getCartsForUser_result setSuccess(List<Cart> 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 ShoppingCartException getScx() {
      return this.scx;
    }

    public getCartsForUser_result setScx(ShoppingCartException scx) {
      this.scx = scx;
      return this;
    }

    public void unsetScx() {
      this.scx = null;
    }

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

    public void setScxIsSet(boolean value) {
      if (!value) {
        this.scx = null;
      }
    }

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

      case SCX:
        if (value == null) {
          unsetScx();
        } else {
          setScx((ShoppingCartException)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 SCX:
        return getScx();

      }
      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 SCX:
        return isSetScx();
      }
      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 getCartsForUser_result)
        return this.equals((getCartsForUser_result)that);
      return false;
    }

    public boolean equals(getCartsForUser_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_scx = true && this.isSetScx();
      boolean that_present_scx = true && that.isSetScx();
      if (this_present_scx || that_present_scx) {
        if (!(this_present_scx && that_present_scx))
          return false;
        if (!this.scx.equals(that.scx))
          return false;
      }

      return true;
    }

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

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

      int lastComparison = 0;
      getCartsForUser_result typedOther = (getCartsForUser_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(isSetScx()).compareTo(isSetScx());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(scx, typedOther.scx);
      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 _list20 = iprot.readListBegin();
                  this.success = new ArrayList<Cart>(_list20.size);
                  for (int _i21 = 0; _i21 < _list20.size; ++_i21)
                  {
                    Cart _elem22;
                    _elem22 = new Cart();
                    _elem22.read(iprot);
                    this.success.add(_elem22);
                  }
                  iprot.readListEnd();
                }
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case SCX:
              if (field.type == TType.STRUCT) {
                this.scx = new ShoppingCartException();
                this.scx.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 (Cart _iter23 : this.success)
          {
            _iter23.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      } else if (this.isSetScx()) {
        oprot.writeFieldBegin(SCX_FIELD_DESC);
        this.scx.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getCartsForUser_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("scx:");
      if (this.scx == null) {
        sb.append("null");
      } else {
        sb.append(this.scx);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

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

  }

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

    private static final TField STATUS_FIELD_DESC = new TField("status", TType.I32, (short)1);

    private CartStatus status;

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

      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.STATUS, new FieldMetaData("status", TFieldRequirementType.DEFAULT, 
          new EnumMetaData(TType.ENUM, CartStatus.class)));
    }});

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

    public getCartsByStatus_args() {
    }

    public getCartsByStatus_args(
      CartStatus status)
    {
      this();
      this.status = status;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getCartsByStatus_args(getCartsByStatus_args other) {
      if (other.isSetStatus()) {
        this.status = other.status;
      }
    }

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

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

    /**
     * 
     * @see CartStatus
     */
    public CartStatus getStatus() {
      return this.status;
    }

    /**
     * 
     * @see CartStatus
     */
    public getCartsByStatus_args setStatus(CartStatus status) {
      this.status = status;
      return this;
    }

    public void unsetStatus() {
      this.status = null;
    }

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

    public void setStatusIsSet(boolean value) {
      if (!value) {
        this.status = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case STATUS:
        if (value == null) {
          unsetStatus();
        } else {
          setStatus((CartStatus)value);
        }
        break;

      }
    }

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

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case STATUS:
        return getStatus();

      }
      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 STATUS:
        return isSetStatus();
      }
      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 getCartsByStatus_args)
        return this.equals((getCartsByStatus_args)that);
      return false;
    }

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

      boolean this_present_status = true && this.isSetStatus();
      boolean that_present_status = true && that.isSetStatus();
      if (this_present_status || that_present_status) {
        if (!(this_present_status && that_present_status))
          return false;
        if (!this.status.equals(that.status))
          return false;
      }

      return true;
    }

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

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

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

      lastComparison = Boolean.valueOf(isSetStatus()).compareTo(isSetStatus());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(status, typedOther.status);
      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 STATUS:
              if (field.type == TType.I32) {
                this.status = CartStatus.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.status != null) {
        oprot.writeFieldBegin(STATUS_FIELD_DESC);
        oprot.writeI32(this.status.getValue());
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

      sb.append("status:");
      if (this.status == null) {
        sb.append("null");
      } else {
        String status_name = status.name();
        if (status_name != null) {
          sb.append(status_name);
          sb.append(" (");
        }
        sb.append(this.status);
        if (status_name != null) {
          sb.append(")");
        }
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

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

  }

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

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0);
    private static final TField SCX_FIELD_DESC = new TField("scx", TType.STRUCT, (short)1);

    private List<Cart> success;
    private ShoppingCartException scx;

    /** 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"),
      SCX((short)1, "scx");

      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, Cart.class))));
      put(_Fields.SCX, new FieldMetaData("scx", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

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

    public getCartsByStatus_result() {
    }

    public getCartsByStatus_result(
      List<Cart> success,
      ShoppingCartException scx)
    {
      this();
      this.success = success;
      this.scx = scx;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getCartsByStatus_result(getCartsByStatus_result other) {
      if (other.isSetSuccess()) {
        List<Cart> __this__success = new ArrayList<Cart>();
        for (Cart other_element : other.success) {
          __this__success.add(new Cart(other_element));
        }
        this.success = __this__success;
      }
      if (other.isSetScx()) {
        this.scx = new ShoppingCartException(other.scx);
      }
    }

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

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

    public int getSuccessSize() {
      return (this.success == null) ? 0 : this.success.size();
    }

    public java.util.Iterator<Cart> getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(Cart elem) {
      if (this.success == null) {
        this.success = new ArrayList<Cart>();
      }
      this.success.add(elem);
    }

    public List<Cart> getSuccess() {
      return this.success;
    }

    public getCartsByStatus_result setSuccess(List<Cart> 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 ShoppingCartException getScx() {
      return this.scx;
    }

    public getCartsByStatus_result setScx(ShoppingCartException scx) {
      this.scx = scx;
      return this;
    }

    public void unsetScx() {
      this.scx = null;
    }

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

    public void setScxIsSet(boolean value) {
      if (!value) {
        this.scx = null;
      }
    }

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

      case SCX:
        if (value == null) {
          unsetScx();
        } else {
          setScx((ShoppingCartException)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 SCX:
        return getScx();

      }
      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 SCX:
        return isSetScx();
      }
      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 getCartsByStatus_result)
        return this.equals((getCartsByStatus_result)that);
      return false;
    }

    public boolean equals(getCartsByStatus_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_scx = true && this.isSetScx();
      boolean that_present_scx = true && that.isSetScx();
      if (this_present_scx || that_present_scx) {
        if (!(this_present_scx && that_present_scx))
          return false;
        if (!this.scx.equals(that.scx))
          return false;
      }

      return true;
    }

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

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

      int lastComparison = 0;
      getCartsByStatus_result typedOther = (getCartsByStatus_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(isSetScx()).compareTo(isSetScx());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(scx, typedOther.scx);
      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 _list24 = iprot.readListBegin();
                  this.success = new ArrayList<Cart>(_list24.size);
                  for (int _i25 = 0; _i25 < _list24.size; ++_i25)
                  {
                    Cart _elem26;
                    _elem26 = new Cart();
                    _elem26.read(iprot);
                    this.success.add(_elem26);
                  }
                  iprot.readListEnd();
                }
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case SCX:
              if (field.type == TType.STRUCT) {
                this.scx = new ShoppingCartException();
                this.scx.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 (Cart _iter27 : this.success)
          {
            _iter27.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      } else if (this.isSetScx()) {
        oprot.writeFieldBegin(SCX_FIELD_DESC);
        this.scx.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getCartsByStatus_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("scx:");
      if (this.scx == null) {
        sb.append("null");
      } else {
        sb.append(this.scx);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

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

  }

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

    private static final TField FROM_TIME_FIELD_DESC = new TField("from_time", TType.I64, (short)1);
    private static final TField TO_TIME_FIELD_DESC = new TField("to_time", TType.I64, (short)2);
    private static final TField STATUS_FIELD_DESC = new TField("status", TType.I32, (short)3);

    private long from_time;
    private long to_time;
    private CartStatus status;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      FROM_TIME((short)1, "from_time"),
      TO_TIME((short)2, "to_time"),
      /**
       * 
       * @see CartStatus
       */
      STATUS((short)3, "status");

      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 __FROM_TIME_ISSET_ID = 0;
    private static final int __TO_TIME_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.FROM_TIME, new FieldMetaData("from_time", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
      put(_Fields.TO_TIME, new FieldMetaData("to_time", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
      put(_Fields.STATUS, new FieldMetaData("status", TFieldRequirementType.DEFAULT, 
          new EnumMetaData(TType.ENUM, CartStatus.class)));
    }});

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

    public getCartsByTime_args() {
    }

    public getCartsByTime_args(
      long from_time,
      long to_time,
      CartStatus status)
    {
      this();
      this.from_time = from_time;
      setFrom_timeIsSet(true);
      this.to_time = to_time;
      setTo_timeIsSet(true);
      this.status = status;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getCartsByTime_args(getCartsByTime_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.from_time = other.from_time;
      this.to_time = other.to_time;
      if (other.isSetStatus()) {
        this.status = other.status;
      }
    }

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

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

    public long getFrom_time() {
      return this.from_time;
    }

    public getCartsByTime_args setFrom_time(long from_time) {
      this.from_time = from_time;
      setFrom_timeIsSet(true);
      return this;
    }

    public void unsetFrom_time() {
      __isset_bit_vector.clear(__FROM_TIME_ISSET_ID);
    }

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

    public void setFrom_timeIsSet(boolean value) {
      __isset_bit_vector.set(__FROM_TIME_ISSET_ID, value);
    }

    public long getTo_time() {
      return this.to_time;
    }

    public getCartsByTime_args setTo_time(long to_time) {
      this.to_time = to_time;
      setTo_timeIsSet(true);
      return this;
    }

    public void unsetTo_time() {
      __isset_bit_vector.clear(__TO_TIME_ISSET_ID);
    }

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

    public void setTo_timeIsSet(boolean value) {
      __isset_bit_vector.set(__TO_TIME_ISSET_ID, value);
    }

    /**
     * 
     * @see CartStatus
     */
    public CartStatus getStatus() {
      return this.status;
    }

    /**
     * 
     * @see CartStatus
     */
    public getCartsByTime_args setStatus(CartStatus status) {
      this.status = status;
      return this;
    }

    public void unsetStatus() {
      this.status = null;
    }

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

    public void setStatusIsSet(boolean value) {
      if (!value) {
        this.status = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case FROM_TIME:
        if (value == null) {
          unsetFrom_time();
        } else {
          setFrom_time((Long)value);
        }
        break;

      case TO_TIME:
        if (value == null) {
          unsetTo_time();
        } else {
          setTo_time((Long)value);
        }
        break;

      case STATUS:
        if (value == null) {
          unsetStatus();
        } else {
          setStatus((CartStatus)value);
        }
        break;

      }
    }

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

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case FROM_TIME:
        return new Long(getFrom_time());

      case TO_TIME:
        return new Long(getTo_time());

      case STATUS:
        return getStatus();

      }
      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 FROM_TIME:
        return isSetFrom_time();
      case TO_TIME:
        return isSetTo_time();
      case STATUS:
        return isSetStatus();
      }
      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 getCartsByTime_args)
        return this.equals((getCartsByTime_args)that);
      return false;
    }

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

      boolean this_present_from_time = true;
      boolean that_present_from_time = true;
      if (this_present_from_time || that_present_from_time) {
        if (!(this_present_from_time && that_present_from_time))
          return false;
        if (this.from_time != that.from_time)
          return false;
      }

      boolean this_present_to_time = true;
      boolean that_present_to_time = true;
      if (this_present_to_time || that_present_to_time) {
        if (!(this_present_to_time && that_present_to_time))
          return false;
        if (this.to_time != that.to_time)
          return false;
      }

      boolean this_present_status = true && this.isSetStatus();
      boolean that_present_status = true && that.isSetStatus();
      if (this_present_status || that_present_status) {
        if (!(this_present_status && that_present_status))
          return false;
        if (!this.status.equals(that.status))
          return false;
      }

      return true;
    }

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

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

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

      lastComparison = Boolean.valueOf(isSetFrom_time()).compareTo(isSetFrom_time());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(from_time, typedOther.from_time);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetTo_time()).compareTo(isSetTo_time());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(to_time, typedOther.to_time);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetStatus()).compareTo(isSetStatus());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(status, typedOther.status);
      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 FROM_TIME:
              if (field.type == TType.I64) {
                this.from_time = iprot.readI64();
                setFrom_timeIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case TO_TIME:
              if (field.type == TType.I64) {
                this.to_time = iprot.readI64();
                setTo_timeIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case STATUS:
              if (field.type == TType.I32) {
                this.status = CartStatus.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(FROM_TIME_FIELD_DESC);
      oprot.writeI64(this.from_time);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(TO_TIME_FIELD_DESC);
      oprot.writeI64(this.to_time);
      oprot.writeFieldEnd();
      if (this.status != null) {
        oprot.writeFieldBegin(STATUS_FIELD_DESC);
        oprot.writeI32(this.status.getValue());
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

      sb.append("from_time:");
      sb.append(this.from_time);
      first = false;
      if (!first) sb.append(", ");
      sb.append("to_time:");
      sb.append(this.to_time);
      first = false;
      if (!first) sb.append(", ");
      sb.append("status:");
      if (this.status == null) {
        sb.append("null");
      } else {
        String status_name = status.name();
        if (status_name != null) {
          sb.append(status_name);
          sb.append(" (");
        }
        sb.append(this.status);
        if (status_name != null) {
          sb.append(")");
        }
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

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

  }

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

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0);
    private static final TField SCX_FIELD_DESC = new TField("scx", TType.STRUCT, (short)1);

    private List<Cart> success;
    private ShoppingCartException scx;

    /** 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"),
      SCX((short)1, "scx");

      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, Cart.class))));
      put(_Fields.SCX, new FieldMetaData("scx", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

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

    public getCartsByTime_result() {
    }

    public getCartsByTime_result(
      List<Cart> success,
      ShoppingCartException scx)
    {
      this();
      this.success = success;
      this.scx = scx;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getCartsByTime_result(getCartsByTime_result other) {
      if (other.isSetSuccess()) {
        List<Cart> __this__success = new ArrayList<Cart>();
        for (Cart other_element : other.success) {
          __this__success.add(new Cart(other_element));
        }
        this.success = __this__success;
      }
      if (other.isSetScx()) {
        this.scx = new ShoppingCartException(other.scx);
      }
    }

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

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

    public int getSuccessSize() {
      return (this.success == null) ? 0 : this.success.size();
    }

    public java.util.Iterator<Cart> getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(Cart elem) {
      if (this.success == null) {
        this.success = new ArrayList<Cart>();
      }
      this.success.add(elem);
    }

    public List<Cart> getSuccess() {
      return this.success;
    }

    public getCartsByTime_result setSuccess(List<Cart> 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 ShoppingCartException getScx() {
      return this.scx;
    }

    public getCartsByTime_result setScx(ShoppingCartException scx) {
      this.scx = scx;
      return this;
    }

    public void unsetScx() {
      this.scx = null;
    }

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

    public void setScxIsSet(boolean value) {
      if (!value) {
        this.scx = null;
      }
    }

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

      case SCX:
        if (value == null) {
          unsetScx();
        } else {
          setScx((ShoppingCartException)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 SCX:
        return getScx();

      }
      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 SCX:
        return isSetScx();
      }
      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 getCartsByTime_result)
        return this.equals((getCartsByTime_result)that);
      return false;
    }

    public boolean equals(getCartsByTime_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_scx = true && this.isSetScx();
      boolean that_present_scx = true && that.isSetScx();
      if (this_present_scx || that_present_scx) {
        if (!(this_present_scx && that_present_scx))
          return false;
        if (!this.scx.equals(that.scx))
          return false;
      }

      return true;
    }

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

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

      int lastComparison = 0;
      getCartsByTime_result typedOther = (getCartsByTime_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(isSetScx()).compareTo(isSetScx());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(scx, typedOther.scx);
      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 _list28 = iprot.readListBegin();
                  this.success = new ArrayList<Cart>(_list28.size);
                  for (int _i29 = 0; _i29 < _list28.size; ++_i29)
                  {
                    Cart _elem30;
                    _elem30 = new Cart();
                    _elem30.read(iprot);
                    this.success.add(_elem30);
                  }
                  iprot.readListEnd();
                }
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case SCX:
              if (field.type == TType.STRUCT) {
                this.scx = new ShoppingCartException();
                this.scx.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 (Cart _iter31 : this.success)
          {
            _iter31.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      } else if (this.isSetScx()) {
        oprot.writeFieldBegin(SCX_FIELD_DESC);
        this.scx.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getCartsByTime_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("scx:");
      if (this.scx == null) {
        sb.append("null");
      } else {
        sb.append(this.scx);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

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

  }

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

    private static final TField CART_ID_FIELD_DESC = new TField("cartId", TType.I64, (short)1);
    private static final TField STATUS_FIELD_DESC = new TField("status", TType.I32, (short)2);

    private long cartId;
    private CartStatus status;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      CART_ID((short)1, "cartId"),
      /**
       * 
       * @see CartStatus
       */
      STATUS((short)2, "status");

      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 __CARTID_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.CART_ID, new FieldMetaData("cartId", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
      put(_Fields.STATUS, new FieldMetaData("status", TFieldRequirementType.DEFAULT, 
          new EnumMetaData(TType.ENUM, CartStatus.class)));
    }});

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

    public changeCartStatus_args() {
    }

    public changeCartStatus_args(
      long cartId,
      CartStatus status)
    {
      this();
      this.cartId = cartId;
      setCartIdIsSet(true);
      this.status = status;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public changeCartStatus_args(changeCartStatus_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.cartId = other.cartId;
      if (other.isSetStatus()) {
        this.status = other.status;
      }
    }

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

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

    public long getCartId() {
      return this.cartId;
    }

    public changeCartStatus_args setCartId(long cartId) {
      this.cartId = cartId;
      setCartIdIsSet(true);
      return this;
    }

    public void unsetCartId() {
      __isset_bit_vector.clear(__CARTID_ISSET_ID);
    }

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

    public void setCartIdIsSet(boolean value) {
      __isset_bit_vector.set(__CARTID_ISSET_ID, value);
    }

    /**
     * 
     * @see CartStatus
     */
    public CartStatus getStatus() {
      return this.status;
    }

    /**
     * 
     * @see CartStatus
     */
    public changeCartStatus_args setStatus(CartStatus status) {
      this.status = status;
      return this;
    }

    public void unsetStatus() {
      this.status = null;
    }

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

    public void setStatusIsSet(boolean value) {
      if (!value) {
        this.status = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case CART_ID:
        if (value == null) {
          unsetCartId();
        } else {
          setCartId((Long)value);
        }
        break;

      case STATUS:
        if (value == null) {
          unsetStatus();
        } else {
          setStatus((CartStatus)value);
        }
        break;

      }
    }

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

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case CART_ID:
        return new Long(getCartId());

      case STATUS:
        return getStatus();

      }
      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 CART_ID:
        return isSetCartId();
      case STATUS:
        return isSetStatus();
      }
      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 changeCartStatus_args)
        return this.equals((changeCartStatus_args)that);
      return false;
    }

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

      boolean this_present_cartId = true;
      boolean that_present_cartId = true;
      if (this_present_cartId || that_present_cartId) {
        if (!(this_present_cartId && that_present_cartId))
          return false;
        if (this.cartId != that.cartId)
          return false;
      }

      boolean this_present_status = true && this.isSetStatus();
      boolean that_present_status = true && that.isSetStatus();
      if (this_present_status || that_present_status) {
        if (!(this_present_status && that_present_status))
          return false;
        if (!this.status.equals(that.status))
          return false;
      }

      return true;
    }

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

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

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

      lastComparison = Boolean.valueOf(isSetCartId()).compareTo(isSetCartId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(cartId, typedOther.cartId);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetStatus()).compareTo(isSetStatus());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(status, typedOther.status);
      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 CART_ID:
              if (field.type == TType.I64) {
                this.cartId = iprot.readI64();
                setCartIdIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case STATUS:
              if (field.type == TType.I32) {
                this.status = CartStatus.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(CART_ID_FIELD_DESC);
      oprot.writeI64(this.cartId);
      oprot.writeFieldEnd();
      if (this.status != null) {
        oprot.writeFieldBegin(STATUS_FIELD_DESC);
        oprot.writeI32(this.status.getValue());
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

      sb.append("cartId:");
      sb.append(this.cartId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("status:");
      if (this.status == null) {
        sb.append("null");
      } else {
        String status_name = status.name();
        if (status_name != null) {
          sb.append(status_name);
          sb.append(" (");
        }
        sb.append(this.status);
        if (status_name != null) {
          sb.append(")");
        }
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

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

  }

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

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

    private ShoppingCartException scx;

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

      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.SCX, new FieldMetaData("scx", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

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

    public changeCartStatus_result() {
    }

    public changeCartStatus_result(
      ShoppingCartException scx)
    {
      this();
      this.scx = scx;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public changeCartStatus_result(changeCartStatus_result other) {
      if (other.isSetScx()) {
        this.scx = new ShoppingCartException(other.scx);
      }
    }

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

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

    public ShoppingCartException getScx() {
      return this.scx;
    }

    public changeCartStatus_result setScx(ShoppingCartException scx) {
      this.scx = scx;
      return this;
    }

    public void unsetScx() {
      this.scx = null;
    }

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

    public void setScxIsSet(boolean value) {
      if (!value) {
        this.scx = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SCX:
        if (value == null) {
          unsetScx();
        } else {
          setScx((ShoppingCartException)value);
        }
        break;

      }
    }

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

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SCX:
        return getScx();

      }
      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 SCX:
        return isSetScx();
      }
      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 changeCartStatus_result)
        return this.equals((changeCartStatus_result)that);
      return false;
    }

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

      boolean this_present_scx = true && this.isSetScx();
      boolean that_present_scx = true && that.isSetScx();
      if (this_present_scx || that_present_scx) {
        if (!(this_present_scx && that_present_scx))
          return false;
        if (!this.scx.equals(that.scx))
          return false;
      }

      return true;
    }

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

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

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

      lastComparison = Boolean.valueOf(isSetScx()).compareTo(isSetScx());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(scx, typedOther.scx);
      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 SCX:
              if (field.type == TType.STRUCT) {
                this.scx = new ShoppingCartException();
                this.scx.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.isSetScx()) {
        oprot.writeFieldBegin(SCX_FIELD_DESC);
        this.scx.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

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

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

  }

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

    private static final TField CART_ID_FIELD_DESC = new TField("cartId", TType.I64, (short)1);
    private static final TField ITEM_ID_FIELD_DESC = new TField("itemId", TType.I64, (short)2);
    private static final TField QUANTITY_FIELD_DESC = new TField("quantity", TType.I64, (short)3);

    private long cartId;
    private long itemId;
    private long quantity;

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

      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 __CARTID_ISSET_ID = 0;
    private static final int __ITEMID_ISSET_ID = 1;
    private static final int __QUANTITY_ISSET_ID = 2;
    private BitSet __isset_bit_vector = new BitSet(3);

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

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

    public addItemToCart_args() {
    }

    public addItemToCart_args(
      long cartId,
      long itemId,
      long quantity)
    {
      this();
      this.cartId = cartId;
      setCartIdIsSet(true);
      this.itemId = itemId;
      setItemIdIsSet(true);
      this.quantity = quantity;
      setQuantityIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public addItemToCart_args(addItemToCart_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.cartId = other.cartId;
      this.itemId = other.itemId;
      this.quantity = other.quantity;
    }

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

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

    public long getCartId() {
      return this.cartId;
    }

    public addItemToCart_args setCartId(long cartId) {
      this.cartId = cartId;
      setCartIdIsSet(true);
      return this;
    }

    public void unsetCartId() {
      __isset_bit_vector.clear(__CARTID_ISSET_ID);
    }

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

    public void setCartIdIsSet(boolean value) {
      __isset_bit_vector.set(__CARTID_ISSET_ID, value);
    }

    public long getItemId() {
      return this.itemId;
    }

    public addItemToCart_args setItemId(long itemId) {
      this.itemId = itemId;
      setItemIdIsSet(true);
      return this;
    }

    public void unsetItemId() {
      __isset_bit_vector.clear(__ITEMID_ISSET_ID);
    }

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

    public void setItemIdIsSet(boolean value) {
      __isset_bit_vector.set(__ITEMID_ISSET_ID, value);
    }

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

    public addItemToCart_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 void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case CART_ID:
        if (value == null) {
          unsetCartId();
        } else {
          setCartId((Long)value);
        }
        break;

      case ITEM_ID:
        if (value == null) {
          unsetItemId();
        } else {
          setItemId((Long)value);
        }
        break;

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

      }
    }

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

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case CART_ID:
        return new Long(getCartId());

      case ITEM_ID:
        return new Long(getItemId());

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

      }
      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 CART_ID:
        return isSetCartId();
      case ITEM_ID:
        return isSetItemId();
      case QUANTITY:
        return isSetQuantity();
      }
      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 addItemToCart_args)
        return this.equals((addItemToCart_args)that);
      return false;
    }

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

      boolean this_present_cartId = true;
      boolean that_present_cartId = true;
      if (this_present_cartId || that_present_cartId) {
        if (!(this_present_cartId && that_present_cartId))
          return false;
        if (this.cartId != that.cartId)
          return false;
      }

      boolean this_present_itemId = true;
      boolean that_present_itemId = true;
      if (this_present_itemId || that_present_itemId) {
        if (!(this_present_itemId && that_present_itemId))
          return false;
        if (this.itemId != that.itemId)
          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;
      }

      return true;
    }

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

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

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

      lastComparison = Boolean.valueOf(isSetCartId()).compareTo(isSetCartId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(cartId, typedOther.cartId);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetItemId()).compareTo(isSetItemId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(itemId, typedOther.itemId);
      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;
      }
      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 CART_ID:
              if (field.type == TType.I64) {
                this.cartId = iprot.readI64();
                setCartIdIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case ITEM_ID:
              if (field.type == TType.I64) {
                this.itemId = iprot.readI64();
                setItemIdIsSet(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;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

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

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(CART_ID_FIELD_DESC);
      oprot.writeI64(this.cartId);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(ITEM_ID_FIELD_DESC);
      oprot.writeI64(this.itemId);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(QUANTITY_FIELD_DESC);
      oprot.writeI64(this.quantity);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

      sb.append("cartId:");
      sb.append(this.cartId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("itemId:");
      sb.append(this.itemId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("quantity:");
      sb.append(this.quantity);
      first = false;
      sb.append(")");
      return sb.toString();
    }

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

  }

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

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

    private ShoppingCartException scx;

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

      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.SCX, new FieldMetaData("scx", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

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

    public addItemToCart_result() {
    }

    public addItemToCart_result(
      ShoppingCartException scx)
    {
      this();
      this.scx = scx;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public addItemToCart_result(addItemToCart_result other) {
      if (other.isSetScx()) {
        this.scx = new ShoppingCartException(other.scx);
      }
    }

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

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

    public ShoppingCartException getScx() {
      return this.scx;
    }

    public addItemToCart_result setScx(ShoppingCartException scx) {
      this.scx = scx;
      return this;
    }

    public void unsetScx() {
      this.scx = null;
    }

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

    public void setScxIsSet(boolean value) {
      if (!value) {
        this.scx = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SCX:
        if (value == null) {
          unsetScx();
        } else {
          setScx((ShoppingCartException)value);
        }
        break;

      }
    }

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

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SCX:
        return getScx();

      }
      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 SCX:
        return isSetScx();
      }
      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 addItemToCart_result)
        return this.equals((addItemToCart_result)that);
      return false;
    }

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

      boolean this_present_scx = true && this.isSetScx();
      boolean that_present_scx = true && that.isSetScx();
      if (this_present_scx || that_present_scx) {
        if (!(this_present_scx && that_present_scx))
          return false;
        if (!this.scx.equals(that.scx))
          return false;
      }

      return true;
    }

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

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

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

      lastComparison = Boolean.valueOf(isSetScx()).compareTo(isSetScx());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(scx, typedOther.scx);
      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 SCX:
              if (field.type == TType.STRUCT) {
                this.scx = new ShoppingCartException();
                this.scx.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.isSetScx()) {
        oprot.writeFieldBegin(SCX_FIELD_DESC);
        this.scx.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

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

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

  }

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

    private static final TField CART_ID_FIELD_DESC = new TField("cartId", TType.I64, (short)1);
    private static final TField ITEM_ID_FIELD_DESC = new TField("itemId", TType.I64, (short)2);

    private long cartId;
    private long itemId;

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

      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 __CARTID_ISSET_ID = 0;
    private static final int __ITEMID_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.CART_ID, new FieldMetaData("cartId", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
      put(_Fields.ITEM_ID, new FieldMetaData("itemId", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
    }});

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

    public deleteItemFromCart_args() {
    }

    public deleteItemFromCart_args(
      long cartId,
      long itemId)
    {
      this();
      this.cartId = cartId;
      setCartIdIsSet(true);
      this.itemId = itemId;
      setItemIdIsSet(true);
    }

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

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

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

    public long getCartId() {
      return this.cartId;
    }

    public deleteItemFromCart_args setCartId(long cartId) {
      this.cartId = cartId;
      setCartIdIsSet(true);
      return this;
    }

    public void unsetCartId() {
      __isset_bit_vector.clear(__CARTID_ISSET_ID);
    }

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

    public void setCartIdIsSet(boolean value) {
      __isset_bit_vector.set(__CARTID_ISSET_ID, value);
    }

    public long getItemId() {
      return this.itemId;
    }

    public deleteItemFromCart_args setItemId(long itemId) {
      this.itemId = itemId;
      setItemIdIsSet(true);
      return this;
    }

    public void unsetItemId() {
      __isset_bit_vector.clear(__ITEMID_ISSET_ID);
    }

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

    public void setItemIdIsSet(boolean value) {
      __isset_bit_vector.set(__ITEMID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case CART_ID:
        if (value == null) {
          unsetCartId();
        } else {
          setCartId((Long)value);
        }
        break;

      case ITEM_ID:
        if (value == null) {
          unsetItemId();
        } else {
          setItemId((Long)value);
        }
        break;

      }
    }

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

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case CART_ID:
        return new Long(getCartId());

      case ITEM_ID:
        return new Long(getItemId());

      }
      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 CART_ID:
        return isSetCartId();
      case ITEM_ID:
        return isSetItemId();
      }
      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 deleteItemFromCart_args)
        return this.equals((deleteItemFromCart_args)that);
      return false;
    }

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

      boolean this_present_cartId = true;
      boolean that_present_cartId = true;
      if (this_present_cartId || that_present_cartId) {
        if (!(this_present_cartId && that_present_cartId))
          return false;
        if (this.cartId != that.cartId)
          return false;
      }

      boolean this_present_itemId = true;
      boolean that_present_itemId = true;
      if (this_present_itemId || that_present_itemId) {
        if (!(this_present_itemId && that_present_itemId))
          return false;
        if (this.itemId != that.itemId)
          return false;
      }

      return true;
    }

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

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

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

      lastComparison = Boolean.valueOf(isSetCartId()).compareTo(isSetCartId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(cartId, typedOther.cartId);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetItemId()).compareTo(isSetItemId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(itemId, typedOther.itemId);
      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 CART_ID:
              if (field.type == TType.I64) {
                this.cartId = iprot.readI64();
                setCartIdIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case ITEM_ID:
              if (field.type == TType.I64) {
                this.itemId = iprot.readI64();
                setItemIdIsSet(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(CART_ID_FIELD_DESC);
      oprot.writeI64(this.cartId);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(ITEM_ID_FIELD_DESC);
      oprot.writeI64(this.itemId);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

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

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

  }

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

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

    private ShoppingCartException scx;

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

      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.SCX, new FieldMetaData("scx", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

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

    public deleteItemFromCart_result() {
    }

    public deleteItemFromCart_result(
      ShoppingCartException scx)
    {
      this();
      this.scx = scx;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public deleteItemFromCart_result(deleteItemFromCart_result other) {
      if (other.isSetScx()) {
        this.scx = new ShoppingCartException(other.scx);
      }
    }

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

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

    public ShoppingCartException getScx() {
      return this.scx;
    }

    public deleteItemFromCart_result setScx(ShoppingCartException scx) {
      this.scx = scx;
      return this;
    }

    public void unsetScx() {
      this.scx = null;
    }

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

    public void setScxIsSet(boolean value) {
      if (!value) {
        this.scx = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SCX:
        if (value == null) {
          unsetScx();
        } else {
          setScx((ShoppingCartException)value);
        }
        break;

      }
    }

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

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SCX:
        return getScx();

      }
      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 SCX:
        return isSetScx();
      }
      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 deleteItemFromCart_result)
        return this.equals((deleteItemFromCart_result)that);
      return false;
    }

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

      boolean this_present_scx = true && this.isSetScx();
      boolean that_present_scx = true && that.isSetScx();
      if (this_present_scx || that_present_scx) {
        if (!(this_present_scx && that_present_scx))
          return false;
        if (!this.scx.equals(that.scx))
          return false;
      }

      return true;
    }

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

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

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

      lastComparison = Boolean.valueOf(isSetScx()).compareTo(isSetScx());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(scx, typedOther.scx);
      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 SCX:
              if (field.type == TType.STRUCT) {
                this.scx = new ShoppingCartException();
                this.scx.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.isSetScx()) {
        oprot.writeFieldBegin(SCX_FIELD_DESC);
        this.scx.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

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

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

  }

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

    private static final TField CART_ID_FIELD_DESC = new TField("cartId", TType.I64, (short)1);
    private static final TField ITEM_ID_FIELD_DESC = new TField("itemId", TType.I64, (short)2);
    private static final TField QUANTITY_FIELD_DESC = new TField("quantity", TType.I64, (short)3);

    private long cartId;
    private long itemId;
    private long quantity;

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

      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 __CARTID_ISSET_ID = 0;
    private static final int __ITEMID_ISSET_ID = 1;
    private static final int __QUANTITY_ISSET_ID = 2;
    private BitSet __isset_bit_vector = new BitSet(3);

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

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

    public changeQuantity_args() {
    }

    public changeQuantity_args(
      long cartId,
      long itemId,
      long quantity)
    {
      this();
      this.cartId = cartId;
      setCartIdIsSet(true);
      this.itemId = itemId;
      setItemIdIsSet(true);
      this.quantity = quantity;
      setQuantityIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public changeQuantity_args(changeQuantity_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.cartId = other.cartId;
      this.itemId = other.itemId;
      this.quantity = other.quantity;
    }

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

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

    public long getCartId() {
      return this.cartId;
    }

    public changeQuantity_args setCartId(long cartId) {
      this.cartId = cartId;
      setCartIdIsSet(true);
      return this;
    }

    public void unsetCartId() {
      __isset_bit_vector.clear(__CARTID_ISSET_ID);
    }

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

    public void setCartIdIsSet(boolean value) {
      __isset_bit_vector.set(__CARTID_ISSET_ID, value);
    }

    public long getItemId() {
      return this.itemId;
    }

    public changeQuantity_args setItemId(long itemId) {
      this.itemId = itemId;
      setItemIdIsSet(true);
      return this;
    }

    public void unsetItemId() {
      __isset_bit_vector.clear(__ITEMID_ISSET_ID);
    }

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

    public void setItemIdIsSet(boolean value) {
      __isset_bit_vector.set(__ITEMID_ISSET_ID, value);
    }

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

    public changeQuantity_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 void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case CART_ID:
        if (value == null) {
          unsetCartId();
        } else {
          setCartId((Long)value);
        }
        break;

      case ITEM_ID:
        if (value == null) {
          unsetItemId();
        } else {
          setItemId((Long)value);
        }
        break;

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

      }
    }

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

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case CART_ID:
        return new Long(getCartId());

      case ITEM_ID:
        return new Long(getItemId());

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

      }
      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 CART_ID:
        return isSetCartId();
      case ITEM_ID:
        return isSetItemId();
      case QUANTITY:
        return isSetQuantity();
      }
      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 changeQuantity_args)
        return this.equals((changeQuantity_args)that);
      return false;
    }

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

      boolean this_present_cartId = true;
      boolean that_present_cartId = true;
      if (this_present_cartId || that_present_cartId) {
        if (!(this_present_cartId && that_present_cartId))
          return false;
        if (this.cartId != that.cartId)
          return false;
      }

      boolean this_present_itemId = true;
      boolean that_present_itemId = true;
      if (this_present_itemId || that_present_itemId) {
        if (!(this_present_itemId && that_present_itemId))
          return false;
        if (this.itemId != that.itemId)
          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;
      }

      return true;
    }

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

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

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

      lastComparison = Boolean.valueOf(isSetCartId()).compareTo(isSetCartId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(cartId, typedOther.cartId);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetItemId()).compareTo(isSetItemId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(itemId, typedOther.itemId);
      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;
      }
      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 CART_ID:
              if (field.type == TType.I64) {
                this.cartId = iprot.readI64();
                setCartIdIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case ITEM_ID:
              if (field.type == TType.I64) {
                this.itemId = iprot.readI64();
                setItemIdIsSet(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;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

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

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(CART_ID_FIELD_DESC);
      oprot.writeI64(this.cartId);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(ITEM_ID_FIELD_DESC);
      oprot.writeI64(this.itemId);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(QUANTITY_FIELD_DESC);
      oprot.writeI64(this.quantity);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

      sb.append("cartId:");
      sb.append(this.cartId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("itemId:");
      sb.append(this.itemId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("quantity:");
      sb.append(this.quantity);
      first = false;
      sb.append(")");
      return sb.toString();
    }

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

  }

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

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

    private ShoppingCartException scx;

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

      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.SCX, new FieldMetaData("scx", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

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

    public changeQuantity_result() {
    }

    public changeQuantity_result(
      ShoppingCartException scx)
    {
      this();
      this.scx = scx;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public changeQuantity_result(changeQuantity_result other) {
      if (other.isSetScx()) {
        this.scx = new ShoppingCartException(other.scx);
      }
    }

    public changeQuantity_result deepCopy() {
      return new changeQuantity_result(this);
    }

    @Deprecated
    public changeQuantity_result clone() {
      return new changeQuantity_result(this);
    }

    public ShoppingCartException getScx() {
      return this.scx;
    }

    public changeQuantity_result setScx(ShoppingCartException scx) {
      this.scx = scx;
      return this;
    }

    public void unsetScx() {
      this.scx = null;
    }

    /** Returns true if field scx is set (has been asigned a value) and false otherwise */
    public boolean isSetScx() {
      return this.scx != null;
    }

    public void setScxIsSet(boolean value) {
      if (!value) {
        this.scx = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SCX:
        if (value == null) {
          unsetScx();
        } else {
          setScx((ShoppingCartException)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SCX:
        return getScx();

      }
      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 SCX:
        return isSetScx();
      }
      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 changeQuantity_result)
        return this.equals((changeQuantity_result)that);
      return false;
    }

    public boolean equals(changeQuantity_result that) {
      if (that == null)
        return false;

      boolean this_present_scx = true && this.isSetScx();
      boolean that_present_scx = true && that.isSetScx();
      if (this_present_scx || that_present_scx) {
        if (!(this_present_scx && that_present_scx))
          return false;
        if (!this.scx.equals(that.scx))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(changeQuantity_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      changeQuantity_result typedOther = (changeQuantity_result)other;

      lastComparison = Boolean.valueOf(isSetScx()).compareTo(isSetScx());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(scx, typedOther.scx);
      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 SCX:
              if (field.type == TType.STRUCT) {
                this.scx = new ShoppingCartException();
                this.scx.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.isSetScx()) {
        oprot.writeFieldBegin(SCX_FIELD_DESC);
        this.scx.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("changeQuantity_result(");
      boolean first = true;

      sb.append("scx:");
      if (this.scx == null) {
        sb.append("null");
      } else {
        sb.append(this.scx);
      }
      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 CART_ID_FIELD_DESC = new TField("cartId", TType.I64, (short)1);
    private static final TField ITEM_ID_FIELD_DESC = new TField("itemId", TType.I64, (short)2);
    private static final TField STATUS_FIELD_DESC = new TField("status", TType.I32, (short)3);

    private long cartId;
    private long itemId;
    private LineStatus status;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      CART_ID((short)1, "cartId"),
      ITEM_ID((short)2, "itemId"),
      /**
       * 
       * @see LineStatus
       */
      STATUS((short)3, "status");

      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 __CARTID_ISSET_ID = 0;
    private static final int __ITEMID_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.CART_ID, new FieldMetaData("cartId", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
      put(_Fields.ITEM_ID, new FieldMetaData("itemId", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
      put(_Fields.STATUS, new FieldMetaData("status", TFieldRequirementType.DEFAULT, 
          new EnumMetaData(TType.ENUM, LineStatus.class)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(changeItemStatus_args.class, metaDataMap);
    }

    public changeItemStatus_args() {
    }

    public changeItemStatus_args(
      long cartId,
      long itemId,
      LineStatus status)
    {
      this();
      this.cartId = cartId;
      setCartIdIsSet(true);
      this.itemId = itemId;
      setItemIdIsSet(true);
      this.status = status;
    }

    /**
     * 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.cartId = other.cartId;
      this.itemId = other.itemId;
      if (other.isSetStatus()) {
        this.status = other.status;
      }
    }

    public changeItemStatus_args deepCopy() {
      return new changeItemStatus_args(this);
    }

    @Deprecated
    public changeItemStatus_args clone() {
      return new changeItemStatus_args(this);
    }

    public long getCartId() {
      return this.cartId;
    }

    public changeItemStatus_args setCartId(long cartId) {
      this.cartId = cartId;
      setCartIdIsSet(true);
      return this;
    }

    public void unsetCartId() {
      __isset_bit_vector.clear(__CARTID_ISSET_ID);
    }

    /** Returns true if field cartId is set (has been asigned a value) and false otherwise */
    public boolean isSetCartId() {
      return __isset_bit_vector.get(__CARTID_ISSET_ID);
    }

    public void setCartIdIsSet(boolean value) {
      __isset_bit_vector.set(__CARTID_ISSET_ID, value);
    }

    public long getItemId() {
      return this.itemId;
    }

    public changeItemStatus_args setItemId(long itemId) {
      this.itemId = itemId;
      setItemIdIsSet(true);
      return this;
    }

    public void unsetItemId() {
      __isset_bit_vector.clear(__ITEMID_ISSET_ID);
    }

    /** Returns true if field itemId is set (has been asigned a value) and false otherwise */
    public boolean isSetItemId() {
      return __isset_bit_vector.get(__ITEMID_ISSET_ID);
    }

    public void setItemIdIsSet(boolean value) {
      __isset_bit_vector.set(__ITEMID_ISSET_ID, value);
    }

    /**
     * 
     * @see LineStatus
     */
    public LineStatus getStatus() {
      return this.status;
    }

    /**
     * 
     * @see LineStatus
     */
    public changeItemStatus_args setStatus(LineStatus status) {
      this.status = status;
      return this;
    }

    public void unsetStatus() {
      this.status = null;
    }

    /** Returns true if field status is set (has been asigned a value) and false otherwise */
    public boolean isSetStatus() {
      return this.status != null;
    }

    public void setStatusIsSet(boolean value) {
      if (!value) {
        this.status = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case CART_ID:
        if (value == null) {
          unsetCartId();
        } else {
          setCartId((Long)value);
        }
        break;

      case ITEM_ID:
        if (value == null) {
          unsetItemId();
        } else {
          setItemId((Long)value);
        }
        break;

      case STATUS:
        if (value == null) {
          unsetStatus();
        } else {
          setStatus((LineStatus)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case CART_ID:
        return new Long(getCartId());

      case ITEM_ID:
        return new Long(getItemId());

      case STATUS:
        return getStatus();

      }
      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 CART_ID:
        return isSetCartId();
      case ITEM_ID:
        return isSetItemId();
      case STATUS:
        return isSetStatus();
      }
      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_cartId = true;
      boolean that_present_cartId = true;
      if (this_present_cartId || that_present_cartId) {
        if (!(this_present_cartId && that_present_cartId))
          return false;
        if (this.cartId != that.cartId)
          return false;
      }

      boolean this_present_itemId = true;
      boolean that_present_itemId = true;
      if (this_present_itemId || that_present_itemId) {
        if (!(this_present_itemId && that_present_itemId))
          return false;
        if (this.itemId != that.itemId)
          return false;
      }

      boolean this_present_status = true && this.isSetStatus();
      boolean that_present_status = true && that.isSetStatus();
      if (this_present_status || that_present_status) {
        if (!(this_present_status && that_present_status))
          return false;
        if (!this.status.equals(that.status))
          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(isSetCartId()).compareTo(isSetCartId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(cartId, typedOther.cartId);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetItemId()).compareTo(isSetItemId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(itemId, typedOther.itemId);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetStatus()).compareTo(isSetStatus());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(status, typedOther.status);
      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 CART_ID:
              if (field.type == TType.I64) {
                this.cartId = iprot.readI64();
                setCartIdIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case ITEM_ID:
              if (field.type == TType.I64) {
                this.itemId = iprot.readI64();
                setItemIdIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case STATUS:
              if (field.type == TType.I32) {
                this.status = LineStatus.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(CART_ID_FIELD_DESC);
      oprot.writeI64(this.cartId);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(ITEM_ID_FIELD_DESC);
      oprot.writeI64(this.itemId);
      oprot.writeFieldEnd();
      if (this.status != null) {
        oprot.writeFieldBegin(STATUS_FIELD_DESC);
        oprot.writeI32(this.status.getValue());
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("changeItemStatus_args(");
      boolean first = true;

      sb.append("cartId:");
      sb.append(this.cartId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("itemId:");
      sb.append(this.itemId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("status:");
      if (this.status == null) {
        sb.append("null");
      } else {
        String status_name = status.name();
        if (status_name != null) {
          sb.append(status_name);
          sb.append(" (");
        }
        sb.append(this.status);
        if (status_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 SCX_FIELD_DESC = new TField("scx", TType.STRUCT, (short)1);

    private ShoppingCartException scx;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      SCX((short)1, "scx");

      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.SCX, new FieldMetaData("scx", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(changeItemStatus_result.class, metaDataMap);
    }

    public changeItemStatus_result() {
    }

    public changeItemStatus_result(
      ShoppingCartException scx)
    {
      this();
      this.scx = scx;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public changeItemStatus_result(changeItemStatus_result other) {
      if (other.isSetScx()) {
        this.scx = new ShoppingCartException(other.scx);
      }
    }

    public changeItemStatus_result deepCopy() {
      return new changeItemStatus_result(this);
    }

    @Deprecated
    public changeItemStatus_result clone() {
      return new changeItemStatus_result(this);
    }

    public ShoppingCartException getScx() {
      return this.scx;
    }

    public changeItemStatus_result setScx(ShoppingCartException scx) {
      this.scx = scx;
      return this;
    }

    public void unsetScx() {
      this.scx = null;
    }

    /** Returns true if field scx is set (has been asigned a value) and false otherwise */
    public boolean isSetScx() {
      return this.scx != null;
    }

    public void setScxIsSet(boolean value) {
      if (!value) {
        this.scx = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SCX:
        if (value == null) {
          unsetScx();
        } else {
          setScx((ShoppingCartException)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SCX:
        return getScx();

      }
      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 SCX:
        return isSetScx();
      }
      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_scx = true && this.isSetScx();
      boolean that_present_scx = true && that.isSetScx();
      if (this_present_scx || that_present_scx) {
        if (!(this_present_scx && that_present_scx))
          return false;
        if (!this.scx.equals(that.scx))
          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(isSetScx()).compareTo(isSetScx());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(scx, typedOther.scx);
      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 SCX:
              if (field.type == TType.STRUCT) {
                this.scx = new ShoppingCartException();
                this.scx.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.isSetScx()) {
        oprot.writeFieldBegin(SCX_FIELD_DESC);
        this.scx.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("changeItemStatus_result(");
      boolean first = true;

      sb.append("scx:");
      if (this.scx == null) {
        sb.append("null");
      } else {
        sb.append(this.scx);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class addAddressToCart_args implements TBase<addAddressToCart_args._Fields>, java.io.Serializable, Cloneable, Comparable<addAddressToCart_args>   {
    private static final TStruct STRUCT_DESC = new TStruct("addAddressToCart_args");

    private static final TField CART_ID_FIELD_DESC = new TField("cartId", TType.I64, (short)1);
    private static final TField ADDRESS_ID_FIELD_DESC = new TField("addressId", TType.I64, (short)2);

    private long cartId;
    private long addressId;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      CART_ID((short)1, "cartId"),
      ADDRESS_ID((short)2, "addressId");

      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 __CARTID_ISSET_ID = 0;
    private static final int __ADDRESSID_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.CART_ID, new FieldMetaData("cartId", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
      put(_Fields.ADDRESS_ID, new FieldMetaData("addressId", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(addAddressToCart_args.class, metaDataMap);
    }

    public addAddressToCart_args() {
    }

    public addAddressToCart_args(
      long cartId,
      long addressId)
    {
      this();
      this.cartId = cartId;
      setCartIdIsSet(true);
      this.addressId = addressId;
      setAddressIdIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public addAddressToCart_args(addAddressToCart_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.cartId = other.cartId;
      this.addressId = other.addressId;
    }

    public addAddressToCart_args deepCopy() {
      return new addAddressToCart_args(this);
    }

    @Deprecated
    public addAddressToCart_args clone() {
      return new addAddressToCart_args(this);
    }

    public long getCartId() {
      return this.cartId;
    }

    public addAddressToCart_args setCartId(long cartId) {
      this.cartId = cartId;
      setCartIdIsSet(true);
      return this;
    }

    public void unsetCartId() {
      __isset_bit_vector.clear(__CARTID_ISSET_ID);
    }

    /** Returns true if field cartId is set (has been asigned a value) and false otherwise */
    public boolean isSetCartId() {
      return __isset_bit_vector.get(__CARTID_ISSET_ID);
    }

    public void setCartIdIsSet(boolean value) {
      __isset_bit_vector.set(__CARTID_ISSET_ID, value);
    }

    public long getAddressId() {
      return this.addressId;
    }

    public addAddressToCart_args setAddressId(long addressId) {
      this.addressId = addressId;
      setAddressIdIsSet(true);
      return this;
    }

    public void unsetAddressId() {
      __isset_bit_vector.clear(__ADDRESSID_ISSET_ID);
    }

    /** Returns true if field addressId is set (has been asigned a value) and false otherwise */
    public boolean isSetAddressId() {
      return __isset_bit_vector.get(__ADDRESSID_ISSET_ID);
    }

    public void setAddressIdIsSet(boolean value) {
      __isset_bit_vector.set(__ADDRESSID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case CART_ID:
        if (value == null) {
          unsetCartId();
        } else {
          setCartId((Long)value);
        }
        break;

      case ADDRESS_ID:
        if (value == null) {
          unsetAddressId();
        } else {
          setAddressId((Long)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case CART_ID:
        return new Long(getCartId());

      case ADDRESS_ID:
        return new Long(getAddressId());

      }
      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 CART_ID:
        return isSetCartId();
      case ADDRESS_ID:
        return isSetAddressId();
      }
      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 addAddressToCart_args)
        return this.equals((addAddressToCart_args)that);
      return false;
    }

    public boolean equals(addAddressToCart_args that) {
      if (that == null)
        return false;

      boolean this_present_cartId = true;
      boolean that_present_cartId = true;
      if (this_present_cartId || that_present_cartId) {
        if (!(this_present_cartId && that_present_cartId))
          return false;
        if (this.cartId != that.cartId)
          return false;
      }

      boolean this_present_addressId = true;
      boolean that_present_addressId = true;
      if (this_present_addressId || that_present_addressId) {
        if (!(this_present_addressId && that_present_addressId))
          return false;
        if (this.addressId != that.addressId)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(addAddressToCart_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      addAddressToCart_args typedOther = (addAddressToCart_args)other;

      lastComparison = Boolean.valueOf(isSetCartId()).compareTo(isSetCartId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(cartId, typedOther.cartId);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetAddressId()).compareTo(isSetAddressId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(addressId, typedOther.addressId);
      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 CART_ID:
              if (field.type == TType.I64) {
                this.cartId = iprot.readI64();
                setCartIdIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case ADDRESS_ID:
              if (field.type == TType.I64) {
                this.addressId = iprot.readI64();
                setAddressIdIsSet(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(CART_ID_FIELD_DESC);
      oprot.writeI64(this.cartId);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(ADDRESS_ID_FIELD_DESC);
      oprot.writeI64(this.addressId);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("addAddressToCart_args(");
      boolean first = true;

      sb.append("cartId:");
      sb.append(this.cartId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("addressId:");
      sb.append(this.addressId);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class addAddressToCart_result implements TBase<addAddressToCart_result._Fields>, java.io.Serializable, Cloneable, Comparable<addAddressToCart_result>   {
    private static final TStruct STRUCT_DESC = new TStruct("addAddressToCart_result");

    private static final TField SCX_FIELD_DESC = new TField("scx", TType.STRUCT, (short)1);

    private ShoppingCartException scx;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      SCX((short)1, "scx");

      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.SCX, new FieldMetaData("scx", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(addAddressToCart_result.class, metaDataMap);
    }

    public addAddressToCart_result() {
    }

    public addAddressToCart_result(
      ShoppingCartException scx)
    {
      this();
      this.scx = scx;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public addAddressToCart_result(addAddressToCart_result other) {
      if (other.isSetScx()) {
        this.scx = new ShoppingCartException(other.scx);
      }
    }

    public addAddressToCart_result deepCopy() {
      return new addAddressToCart_result(this);
    }

    @Deprecated
    public addAddressToCart_result clone() {
      return new addAddressToCart_result(this);
    }

    public ShoppingCartException getScx() {
      return this.scx;
    }

    public addAddressToCart_result setScx(ShoppingCartException scx) {
      this.scx = scx;
      return this;
    }

    public void unsetScx() {
      this.scx = null;
    }

    /** Returns true if field scx is set (has been asigned a value) and false otherwise */
    public boolean isSetScx() {
      return this.scx != null;
    }

    public void setScxIsSet(boolean value) {
      if (!value) {
        this.scx = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SCX:
        if (value == null) {
          unsetScx();
        } else {
          setScx((ShoppingCartException)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SCX:
        return getScx();

      }
      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 SCX:
        return isSetScx();
      }
      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 addAddressToCart_result)
        return this.equals((addAddressToCart_result)that);
      return false;
    }

    public boolean equals(addAddressToCart_result that) {
      if (that == null)
        return false;

      boolean this_present_scx = true && this.isSetScx();
      boolean that_present_scx = true && that.isSetScx();
      if (this_present_scx || that_present_scx) {
        if (!(this_present_scx && that_present_scx))
          return false;
        if (!this.scx.equals(that.scx))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(addAddressToCart_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      addAddressToCart_result typedOther = (addAddressToCart_result)other;

      lastComparison = Boolean.valueOf(isSetScx()).compareTo(isSetScx());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(scx, typedOther.scx);
      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 SCX:
              if (field.type == TType.STRUCT) {
                this.scx = new ShoppingCartException();
                this.scx.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.isSetScx()) {
        oprot.writeFieldBegin(SCX_FIELD_DESC);
        this.scx.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("addAddressToCart_result(");
      boolean first = true;

      sb.append("scx:");
      if (this.scx == null) {
        sb.append("null");
      } else {
        sb.append(this.scx);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class createOrders_args implements TBase<createOrders_args._Fields>, java.io.Serializable, Cloneable, Comparable<createOrders_args>   {
    private static final TStruct STRUCT_DESC = new TStruct("createOrders_args");

    private static final TField CART_ID_FIELD_DESC = new TField("cartId", TType.I64, (short)1);

    private long cartId;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      CART_ID((short)1, "cartId");

      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 __CARTID_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.CART_ID, new FieldMetaData("cartId", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(createOrders_args.class, metaDataMap);
    }

    public createOrders_args() {
    }

    public createOrders_args(
      long cartId)
    {
      this();
      this.cartId = cartId;
      setCartIdIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public createOrders_args(createOrders_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.cartId = other.cartId;
    }

    public createOrders_args deepCopy() {
      return new createOrders_args(this);
    }

    @Deprecated
    public createOrders_args clone() {
      return new createOrders_args(this);
    }

    public long getCartId() {
      return this.cartId;
    }

    public createOrders_args setCartId(long cartId) {
      this.cartId = cartId;
      setCartIdIsSet(true);
      return this;
    }

    public void unsetCartId() {
      __isset_bit_vector.clear(__CARTID_ISSET_ID);
    }

    /** Returns true if field cartId is set (has been asigned a value) and false otherwise */
    public boolean isSetCartId() {
      return __isset_bit_vector.get(__CARTID_ISSET_ID);
    }

    public void setCartIdIsSet(boolean value) {
      __isset_bit_vector.set(__CARTID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case CART_ID:
        if (value == null) {
          unsetCartId();
        } else {
          setCartId((Long)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case CART_ID:
        return new Long(getCartId());

      }
      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 CART_ID:
        return isSetCartId();
      }
      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 createOrders_args)
        return this.equals((createOrders_args)that);
      return false;
    }

    public boolean equals(createOrders_args that) {
      if (that == null)
        return false;

      boolean this_present_cartId = true;
      boolean that_present_cartId = true;
      if (this_present_cartId || that_present_cartId) {
        if (!(this_present_cartId && that_present_cartId))
          return false;
        if (this.cartId != that.cartId)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(createOrders_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      createOrders_args typedOther = (createOrders_args)other;

      lastComparison = Boolean.valueOf(isSetCartId()).compareTo(isSetCartId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(cartId, typedOther.cartId);
      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 CART_ID:
              if (field.type == TType.I64) {
                this.cartId = iprot.readI64();
                setCartIdIsSet(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(CART_ID_FIELD_DESC);
      oprot.writeI64(this.cartId);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("createOrders_args(");
      boolean first = true;

      sb.append("cartId:");
      sb.append(this.cartId);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class createOrders_result implements TBase<createOrders_result._Fields>, java.io.Serializable, Cloneable, Comparable<createOrders_result>   {
    private static final TStruct STRUCT_DESC = new TStruct("createOrders_result");

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.I64, (short)0);
    private static final TField SCX_FIELD_DESC = new TField("scx", TType.STRUCT, (short)1);

    private long success;
    private ShoppingCartException scx;

    /** 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"),
      SCX((short)1, "scx");

      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.SCX, new FieldMetaData("scx", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(createOrders_result.class, metaDataMap);
    }

    public createOrders_result() {
    }

    public createOrders_result(
      long success,
      ShoppingCartException scx)
    {
      this();
      this.success = success;
      setSuccessIsSet(true);
      this.scx = scx;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public createOrders_result(createOrders_result other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.success = other.success;
      if (other.isSetScx()) {
        this.scx = new ShoppingCartException(other.scx);
      }
    }

    public createOrders_result deepCopy() {
      return new createOrders_result(this);
    }

    @Deprecated
    public createOrders_result clone() {
      return new createOrders_result(this);
    }

    public long getSuccess() {
      return this.success;
    }

    public createOrders_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 ShoppingCartException getScx() {
      return this.scx;
    }

    public createOrders_result setScx(ShoppingCartException scx) {
      this.scx = scx;
      return this;
    }

    public void unsetScx() {
      this.scx = null;
    }

    /** Returns true if field scx is set (has been asigned a value) and false otherwise */
    public boolean isSetScx() {
      return this.scx != null;
    }

    public void setScxIsSet(boolean value) {
      if (!value) {
        this.scx = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((Long)value);
        }
        break;

      case SCX:
        if (value == null) {
          unsetScx();
        } else {
          setScx((ShoppingCartException)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 SCX:
        return getScx();

      }
      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 SCX:
        return isSetScx();
      }
      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 createOrders_result)
        return this.equals((createOrders_result)that);
      return false;
    }

    public boolean equals(createOrders_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_scx = true && this.isSetScx();
      boolean that_present_scx = true && that.isSetScx();
      if (this_present_scx || that_present_scx) {
        if (!(this_present_scx && that_present_scx))
          return false;
        if (!this.scx.equals(that.scx))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(createOrders_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      createOrders_result typedOther = (createOrders_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(isSetScx()).compareTo(isSetScx());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(scx, typedOther.scx);
      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 SCX:
              if (field.type == TType.STRUCT) {
                this.scx = new ShoppingCartException();
                this.scx.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.isSetScx()) {
        oprot.writeFieldBegin(SCX_FIELD_DESC);
        this.scx.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("createOrders_result(");
      boolean first = true;

      sb.append("success:");
      sb.append(this.success);
      first = false;
      if (!first) sb.append(", ");
      sb.append("scx:");
      if (this.scx == null) {
        sb.append("null");
      } else {
        sb.append(this.scx);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class validateCart_args implements TBase<validateCart_args._Fields>, java.io.Serializable, Cloneable, Comparable<validateCart_args>   {
    private static final TStruct STRUCT_DESC = new TStruct("validateCart_args");

    private static final TField CART_ID_FIELD_DESC = new TField("cartId", TType.I64, (short)1);

    private long cartId;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      CART_ID((short)1, "cartId");

      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 __CARTID_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.CART_ID, new FieldMetaData("cartId", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(validateCart_args.class, metaDataMap);
    }

    public validateCart_args() {
    }

    public validateCart_args(
      long cartId)
    {
      this();
      this.cartId = cartId;
      setCartIdIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public validateCart_args(validateCart_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.cartId = other.cartId;
    }

    public validateCart_args deepCopy() {
      return new validateCart_args(this);
    }

    @Deprecated
    public validateCart_args clone() {
      return new validateCart_args(this);
    }

    public long getCartId() {
      return this.cartId;
    }

    public validateCart_args setCartId(long cartId) {
      this.cartId = cartId;
      setCartIdIsSet(true);
      return this;
    }

    public void unsetCartId() {
      __isset_bit_vector.clear(__CARTID_ISSET_ID);
    }

    /** Returns true if field cartId is set (has been asigned a value) and false otherwise */
    public boolean isSetCartId() {
      return __isset_bit_vector.get(__CARTID_ISSET_ID);
    }

    public void setCartIdIsSet(boolean value) {
      __isset_bit_vector.set(__CARTID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case CART_ID:
        if (value == null) {
          unsetCartId();
        } else {
          setCartId((Long)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case CART_ID:
        return new Long(getCartId());

      }
      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 CART_ID:
        return isSetCartId();
      }
      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 validateCart_args)
        return this.equals((validateCart_args)that);
      return false;
    }

    public boolean equals(validateCart_args that) {
      if (that == null)
        return false;

      boolean this_present_cartId = true;
      boolean that_present_cartId = true;
      if (this_present_cartId || that_present_cartId) {
        if (!(this_present_cartId && that_present_cartId))
          return false;
        if (this.cartId != that.cartId)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(validateCart_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      validateCart_args typedOther = (validateCart_args)other;

      lastComparison = Boolean.valueOf(isSetCartId()).compareTo(isSetCartId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(cartId, typedOther.cartId);
      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 CART_ID:
              if (field.type == TType.I64) {
                this.cartId = iprot.readI64();
                setCartIdIsSet(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(CART_ID_FIELD_DESC);
      oprot.writeI64(this.cartId);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("validateCart_args(");
      boolean first = true;

      sb.append("cartId:");
      sb.append(this.cartId);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class validateCart_result implements TBase<validateCart_result._Fields>, java.io.Serializable, Cloneable, Comparable<validateCart_result>   {
    private static final TStruct STRUCT_DESC = new TStruct("validateCart_result");

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.BOOL, (short)0);
    private static final TField SCEX_FIELD_DESC = new TField("scex", TType.STRUCT, (short)1);

    private boolean success;
    private ShoppingCartException scex;

    /** 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"),
      SCEX((short)1, "scex");

      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.BOOL)));
      put(_Fields.SCEX, new FieldMetaData("scex", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(validateCart_result.class, metaDataMap);
    }

    public validateCart_result() {
    }

    public validateCart_result(
      boolean success,
      ShoppingCartException scex)
    {
      this();
      this.success = success;
      setSuccessIsSet(true);
      this.scex = scex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public validateCart_result(validateCart_result other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.success = other.success;
      if (other.isSetScex()) {
        this.scex = new ShoppingCartException(other.scex);
      }
    }

    public validateCart_result deepCopy() {
      return new validateCart_result(this);
    }

    @Deprecated
    public validateCart_result clone() {
      return new validateCart_result(this);
    }

    public boolean isSuccess() {
      return this.success;
    }

    public validateCart_result setSuccess(boolean 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 ShoppingCartException getScex() {
      return this.scex;
    }

    public validateCart_result setScex(ShoppingCartException scex) {
      this.scex = scex;
      return this;
    }

    public void unsetScex() {
      this.scex = null;
    }

    /** Returns true if field scex is set (has been asigned a value) and false otherwise */
    public boolean isSetScex() {
      return this.scex != null;
    }

    public void setScexIsSet(boolean value) {
      if (!value) {
        this.scex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((Boolean)value);
        }
        break;

      case SCEX:
        if (value == null) {
          unsetScex();
        } else {
          setScex((ShoppingCartException)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 Boolean(isSuccess());

      case SCEX:
        return getScex();

      }
      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 SCEX:
        return isSetScex();
      }
      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 validateCart_result)
        return this.equals((validateCart_result)that);
      return false;
    }

    public boolean equals(validateCart_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_scex = true && this.isSetScex();
      boolean that_present_scex = true && that.isSetScex();
      if (this_present_scex || that_present_scex) {
        if (!(this_present_scex && that_present_scex))
          return false;
        if (!this.scex.equals(that.scex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(validateCart_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      validateCart_result typedOther = (validateCart_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(isSetScex()).compareTo(isSetScex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(scex, typedOther.scex);
      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.BOOL) {
                this.success = iprot.readBool();
                setSuccessIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case SCEX:
              if (field.type == TType.STRUCT) {
                this.scex = new ShoppingCartException();
                this.scex.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.writeBool(this.success);
        oprot.writeFieldEnd();
      } else if (this.isSetScex()) {
        oprot.writeFieldBegin(SCEX_FIELD_DESC);
        this.scex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("validateCart_result(");
      boolean first = true;

      sb.append("success:");
      sb.append(this.success);
      first = false;
      if (!first) sb.append(", ");
      sb.append("scex:");
      if (this.scex == null) {
        sb.append("null");
      } else {
        sb.append(this.scex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class mergeCart_args implements TBase<mergeCart_args._Fields>, java.io.Serializable, Cloneable, Comparable<mergeCart_args>   {
    private static final TStruct STRUCT_DESC = new TStruct("mergeCart_args");

    private static final TField FROM_CART_ID_FIELD_DESC = new TField("fromCartId", TType.I64, (short)1);
    private static final TField TO_CART_ID_FIELD_DESC = new TField("toCartId", TType.I64, (short)2);

    private long fromCartId;
    private long toCartId;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      FROM_CART_ID((short)1, "fromCartId"),
      TO_CART_ID((short)2, "toCartId");

      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 __FROMCARTID_ISSET_ID = 0;
    private static final int __TOCARTID_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.FROM_CART_ID, new FieldMetaData("fromCartId", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
      put(_Fields.TO_CART_ID, new FieldMetaData("toCartId", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(mergeCart_args.class, metaDataMap);
    }

    public mergeCart_args() {
    }

    public mergeCart_args(
      long fromCartId,
      long toCartId)
    {
      this();
      this.fromCartId = fromCartId;
      setFromCartIdIsSet(true);
      this.toCartId = toCartId;
      setToCartIdIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public mergeCart_args(mergeCart_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.fromCartId = other.fromCartId;
      this.toCartId = other.toCartId;
    }

    public mergeCart_args deepCopy() {
      return new mergeCart_args(this);
    }

    @Deprecated
    public mergeCart_args clone() {
      return new mergeCart_args(this);
    }

    public long getFromCartId() {
      return this.fromCartId;
    }

    public mergeCart_args setFromCartId(long fromCartId) {
      this.fromCartId = fromCartId;
      setFromCartIdIsSet(true);
      return this;
    }

    public void unsetFromCartId() {
      __isset_bit_vector.clear(__FROMCARTID_ISSET_ID);
    }

    /** Returns true if field fromCartId is set (has been asigned a value) and false otherwise */
    public boolean isSetFromCartId() {
      return __isset_bit_vector.get(__FROMCARTID_ISSET_ID);
    }

    public void setFromCartIdIsSet(boolean value) {
      __isset_bit_vector.set(__FROMCARTID_ISSET_ID, value);
    }

    public long getToCartId() {
      return this.toCartId;
    }

    public mergeCart_args setToCartId(long toCartId) {
      this.toCartId = toCartId;
      setToCartIdIsSet(true);
      return this;
    }

    public void unsetToCartId() {
      __isset_bit_vector.clear(__TOCARTID_ISSET_ID);
    }

    /** Returns true if field toCartId is set (has been asigned a value) and false otherwise */
    public boolean isSetToCartId() {
      return __isset_bit_vector.get(__TOCARTID_ISSET_ID);
    }

    public void setToCartIdIsSet(boolean value) {
      __isset_bit_vector.set(__TOCARTID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case FROM_CART_ID:
        if (value == null) {
          unsetFromCartId();
        } else {
          setFromCartId((Long)value);
        }
        break;

      case TO_CART_ID:
        if (value == null) {
          unsetToCartId();
        } else {
          setToCartId((Long)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case FROM_CART_ID:
        return new Long(getFromCartId());

      case TO_CART_ID:
        return new Long(getToCartId());

      }
      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 FROM_CART_ID:
        return isSetFromCartId();
      case TO_CART_ID:
        return isSetToCartId();
      }
      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 mergeCart_args)
        return this.equals((mergeCart_args)that);
      return false;
    }

    public boolean equals(mergeCart_args that) {
      if (that == null)
        return false;

      boolean this_present_fromCartId = true;
      boolean that_present_fromCartId = true;
      if (this_present_fromCartId || that_present_fromCartId) {
        if (!(this_present_fromCartId && that_present_fromCartId))
          return false;
        if (this.fromCartId != that.fromCartId)
          return false;
      }

      boolean this_present_toCartId = true;
      boolean that_present_toCartId = true;
      if (this_present_toCartId || that_present_toCartId) {
        if (!(this_present_toCartId && that_present_toCartId))
          return false;
        if (this.toCartId != that.toCartId)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(mergeCart_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      mergeCart_args typedOther = (mergeCart_args)other;

      lastComparison = Boolean.valueOf(isSetFromCartId()).compareTo(isSetFromCartId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(fromCartId, typedOther.fromCartId);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetToCartId()).compareTo(isSetToCartId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(toCartId, typedOther.toCartId);
      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 FROM_CART_ID:
              if (field.type == TType.I64) {
                this.fromCartId = iprot.readI64();
                setFromCartIdIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case TO_CART_ID:
              if (field.type == TType.I64) {
                this.toCartId = iprot.readI64();
                setToCartIdIsSet(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(FROM_CART_ID_FIELD_DESC);
      oprot.writeI64(this.fromCartId);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(TO_CART_ID_FIELD_DESC);
      oprot.writeI64(this.toCartId);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("mergeCart_args(");
      boolean first = true;

      sb.append("fromCartId:");
      sb.append(this.fromCartId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("toCartId:");
      sb.append(this.toCartId);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class mergeCart_result implements TBase<mergeCart_result._Fields>, java.io.Serializable, Cloneable, Comparable<mergeCart_result>   {
    private static final TStruct STRUCT_DESC = new TStruct("mergeCart_result");



    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
;

      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;
      }
    }
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
    }});

    static {
      FieldMetaData.addStructMetaDataMap(mergeCart_result.class, metaDataMap);
    }

    public mergeCart_result() {
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public mergeCart_result(mergeCart_result other) {
    }

    public mergeCart_result deepCopy() {
      return new mergeCart_result(this);
    }

    @Deprecated
    public mergeCart_result clone() {
      return new mergeCart_result(this);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      }
      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) {
      }
      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 mergeCart_result)
        return this.equals((mergeCart_result)that);
      return false;
    }

    public boolean equals(mergeCart_result that) {
      if (that == null)
        return false;

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(mergeCart_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      mergeCart_result typedOther = (mergeCart_result)other;

      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) {
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      oprot.writeStructBegin(STRUCT_DESC);

      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("mergeCart_result(");
      boolean first = true;

      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class checkOut_args implements TBase<checkOut_args._Fields>, java.io.Serializable, Cloneable, Comparable<checkOut_args>   {
    private static final TStruct STRUCT_DESC = new TStruct("checkOut_args");

    private static final TField CART_ID_FIELD_DESC = new TField("cartId", TType.I64, (short)1);

    private long cartId;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      CART_ID((short)1, "cartId");

      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 __CARTID_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.CART_ID, new FieldMetaData("cartId", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(checkOut_args.class, metaDataMap);
    }

    public checkOut_args() {
    }

    public checkOut_args(
      long cartId)
    {
      this();
      this.cartId = cartId;
      setCartIdIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public checkOut_args(checkOut_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.cartId = other.cartId;
    }

    public checkOut_args deepCopy() {
      return new checkOut_args(this);
    }

    @Deprecated
    public checkOut_args clone() {
      return new checkOut_args(this);
    }

    public long getCartId() {
      return this.cartId;
    }

    public checkOut_args setCartId(long cartId) {
      this.cartId = cartId;
      setCartIdIsSet(true);
      return this;
    }

    public void unsetCartId() {
      __isset_bit_vector.clear(__CARTID_ISSET_ID);
    }

    /** Returns true if field cartId is set (has been asigned a value) and false otherwise */
    public boolean isSetCartId() {
      return __isset_bit_vector.get(__CARTID_ISSET_ID);
    }

    public void setCartIdIsSet(boolean value) {
      __isset_bit_vector.set(__CARTID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case CART_ID:
        if (value == null) {
          unsetCartId();
        } else {
          setCartId((Long)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case CART_ID:
        return new Long(getCartId());

      }
      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 CART_ID:
        return isSetCartId();
      }
      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 checkOut_args)
        return this.equals((checkOut_args)that);
      return false;
    }

    public boolean equals(checkOut_args that) {
      if (that == null)
        return false;

      boolean this_present_cartId = true;
      boolean that_present_cartId = true;
      if (this_present_cartId || that_present_cartId) {
        if (!(this_present_cartId && that_present_cartId))
          return false;
        if (this.cartId != that.cartId)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(checkOut_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      checkOut_args typedOther = (checkOut_args)other;

      lastComparison = Boolean.valueOf(isSetCartId()).compareTo(isSetCartId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(cartId, typedOther.cartId);
      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 CART_ID:
              if (field.type == TType.I64) {
                this.cartId = iprot.readI64();
                setCartIdIsSet(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(CART_ID_FIELD_DESC);
      oprot.writeI64(this.cartId);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("checkOut_args(");
      boolean first = true;

      sb.append("cartId:");
      sb.append(this.cartId);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class checkOut_result implements TBase<checkOut_result._Fields>, java.io.Serializable, Cloneable, Comparable<checkOut_result>   {
    private static final TStruct STRUCT_DESC = new TStruct("checkOut_result");

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.BOOL, (short)0);
    private static final TField SCEX_FIELD_DESC = new TField("scex", TType.STRUCT, (short)1);

    private boolean success;
    private ShoppingCartException scex;

    /** 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"),
      SCEX((short)1, "scex");

      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.BOOL)));
      put(_Fields.SCEX, new FieldMetaData("scex", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(checkOut_result.class, metaDataMap);
    }

    public checkOut_result() {
    }

    public checkOut_result(
      boolean success,
      ShoppingCartException scex)
    {
      this();
      this.success = success;
      setSuccessIsSet(true);
      this.scex = scex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public checkOut_result(checkOut_result other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.success = other.success;
      if (other.isSetScex()) {
        this.scex = new ShoppingCartException(other.scex);
      }
    }

    public checkOut_result deepCopy() {
      return new checkOut_result(this);
    }

    @Deprecated
    public checkOut_result clone() {
      return new checkOut_result(this);
    }

    public boolean isSuccess() {
      return this.success;
    }

    public checkOut_result setSuccess(boolean 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 ShoppingCartException getScex() {
      return this.scex;
    }

    public checkOut_result setScex(ShoppingCartException scex) {
      this.scex = scex;
      return this;
    }

    public void unsetScex() {
      this.scex = null;
    }

    /** Returns true if field scex is set (has been asigned a value) and false otherwise */
    public boolean isSetScex() {
      return this.scex != null;
    }

    public void setScexIsSet(boolean value) {
      if (!value) {
        this.scex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((Boolean)value);
        }
        break;

      case SCEX:
        if (value == null) {
          unsetScex();
        } else {
          setScex((ShoppingCartException)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 Boolean(isSuccess());

      case SCEX:
        return getScex();

      }
      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 SCEX:
        return isSetScex();
      }
      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 checkOut_result)
        return this.equals((checkOut_result)that);
      return false;
    }

    public boolean equals(checkOut_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_scex = true && this.isSetScex();
      boolean that_present_scex = true && that.isSetScex();
      if (this_present_scex || that_present_scex) {
        if (!(this_present_scex && that_present_scex))
          return false;
        if (!this.scex.equals(that.scex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(checkOut_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      checkOut_result typedOther = (checkOut_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(isSetScex()).compareTo(isSetScex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(scex, typedOther.scex);
      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.BOOL) {
                this.success = iprot.readBool();
                setSuccessIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case SCEX:
              if (field.type == TType.STRUCT) {
                this.scex = new ShoppingCartException();
                this.scex.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.writeBool(this.success);
        oprot.writeFieldEnd();
      } else if (this.isSetScex()) {
        oprot.writeFieldBegin(SCEX_FIELD_DESC);
        this.scex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("checkOut_result(");
      boolean first = true;

      sb.append("success:");
      sb.append(this.success);
      first = false;
      if (!first) sb.append(", ");
      sb.append("scex:");
      if (this.scex == null) {
        sb.append("null");
      } else {
        sb.append(this.scex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class resetCart_args implements TBase<resetCart_args._Fields>, java.io.Serializable, Cloneable   {
    private static final TStruct STRUCT_DESC = new TStruct("resetCart_args");

    private static final TField CART_ID_FIELD_DESC = new TField("cartId", TType.I64, (short)1);
    private static final TField ITEMS_FIELD_DESC = new TField("items", TType.MAP, (short)2);

    private long cartId;
    private Map<Long,Double> items;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      CART_ID((short)1, "cartId"),
      ITEMS((short)2, "items");

      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 __CARTID_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.CART_ID, new FieldMetaData("cartId", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
      put(_Fields.ITEMS, new FieldMetaData("items", TFieldRequirementType.DEFAULT, 
          new MapMetaData(TType.MAP, 
              new FieldValueMetaData(TType.I64), 
              new FieldValueMetaData(TType.DOUBLE))));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(resetCart_args.class, metaDataMap);
    }

    public resetCart_args() {
    }

    public resetCart_args(
      long cartId,
      Map<Long,Double> items)
    {
      this();
      this.cartId = cartId;
      setCartIdIsSet(true);
      this.items = items;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public resetCart_args(resetCart_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.cartId = other.cartId;
      if (other.isSetItems()) {
        Map<Long,Double> __this__items = new HashMap<Long,Double>();
        for (Map.Entry<Long, Double> other_element : other.items.entrySet()) {

          Long other_element_key = other_element.getKey();
          Double other_element_value = other_element.getValue();

          Long __this__items_copy_key = other_element_key;

          Double __this__items_copy_value = other_element_value;

          __this__items.put(__this__items_copy_key, __this__items_copy_value);
        }
        this.items = __this__items;
      }
    }

    public resetCart_args deepCopy() {
      return new resetCart_args(this);
    }

    @Deprecated
    public resetCart_args clone() {
      return new resetCart_args(this);
    }

    public long getCartId() {
      return this.cartId;
    }

    public resetCart_args setCartId(long cartId) {
      this.cartId = cartId;
      setCartIdIsSet(true);
      return this;
    }

    public void unsetCartId() {
      __isset_bit_vector.clear(__CARTID_ISSET_ID);
    }

    /** Returns true if field cartId is set (has been asigned a value) and false otherwise */
    public boolean isSetCartId() {
      return __isset_bit_vector.get(__CARTID_ISSET_ID);
    }

    public void setCartIdIsSet(boolean value) {
      __isset_bit_vector.set(__CARTID_ISSET_ID, value);
    }

    public int getItemsSize() {
      return (this.items == null) ? 0 : this.items.size();
    }

    public void putToItems(long key, double val) {
      if (this.items == null) {
        this.items = new HashMap<Long,Double>();
      }
      this.items.put(key, val);
    }

    public Map<Long,Double> getItems() {
      return this.items;
    }

    public resetCart_args setItems(Map<Long,Double> items) {
      this.items = items;
      return this;
    }

    public void unsetItems() {
      this.items = null;
    }

    /** Returns true if field items is set (has been asigned a value) and false otherwise */
    public boolean isSetItems() {
      return this.items != null;
    }

    public void setItemsIsSet(boolean value) {
      if (!value) {
        this.items = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case CART_ID:
        if (value == null) {
          unsetCartId();
        } else {
          setCartId((Long)value);
        }
        break;

      case ITEMS:
        if (value == null) {
          unsetItems();
        } else {
          setItems((Map<Long,Double>)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case CART_ID:
        return new Long(getCartId());

      case ITEMS:
        return getItems();

      }
      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 CART_ID:
        return isSetCartId();
      case ITEMS:
        return isSetItems();
      }
      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 resetCart_args)
        return this.equals((resetCart_args)that);
      return false;
    }

    public boolean equals(resetCart_args that) {
      if (that == null)
        return false;

      boolean this_present_cartId = true;
      boolean that_present_cartId = true;
      if (this_present_cartId || that_present_cartId) {
        if (!(this_present_cartId && that_present_cartId))
          return false;
        if (this.cartId != that.cartId)
          return false;
      }

      boolean this_present_items = true && this.isSetItems();
      boolean that_present_items = true && that.isSetItems();
      if (this_present_items || that_present_items) {
        if (!(this_present_items && that_present_items))
          return false;
        if (!this.items.equals(that.items))
          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 CART_ID:
              if (field.type == TType.I64) {
                this.cartId = iprot.readI64();
                setCartIdIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case ITEMS:
              if (field.type == TType.MAP) {
                {
                  TMap _map32 = iprot.readMapBegin();
                  this.items = new HashMap<Long,Double>(2*_map32.size);
                  for (int _i33 = 0; _i33 < _map32.size; ++_i33)
                  {
                    long _key34;
                    double _val35;
                    _key34 = iprot.readI64();
                    _val35 = iprot.readDouble();
                    this.items.put(_key34, _val35);
                  }
                  iprot.readMapEnd();
                }
              } 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(CART_ID_FIELD_DESC);
      oprot.writeI64(this.cartId);
      oprot.writeFieldEnd();
      if (this.items != null) {
        oprot.writeFieldBegin(ITEMS_FIELD_DESC);
        {
          oprot.writeMapBegin(new TMap(TType.I64, TType.DOUBLE, this.items.size()));
          for (Map.Entry<Long, Double> _iter36 : this.items.entrySet())
          {
            oprot.writeI64(_iter36.getKey());
            oprot.writeDouble(_iter36.getValue());
          }
          oprot.writeMapEnd();
        }
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("resetCart_args(");
      boolean first = true;

      sb.append("cartId:");
      sb.append(this.cartId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("items:");
      if (this.items == null) {
        sb.append("null");
      } else {
        sb.append(this.items);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class resetCart_result implements TBase<resetCart_result._Fields>, java.io.Serializable, Cloneable, Comparable<resetCart_result>   {
    private static final TStruct STRUCT_DESC = new TStruct("resetCart_result");

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.BOOL, (short)0);
    private static final TField SCEX_FIELD_DESC = new TField("scex", TType.STRUCT, (short)1);

    private boolean success;
    private ShoppingCartException scex;

    /** 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"),
      SCEX((short)1, "scex");

      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.BOOL)));
      put(_Fields.SCEX, new FieldMetaData("scex", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(resetCart_result.class, metaDataMap);
    }

    public resetCart_result() {
    }

    public resetCart_result(
      boolean success,
      ShoppingCartException scex)
    {
      this();
      this.success = success;
      setSuccessIsSet(true);
      this.scex = scex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public resetCart_result(resetCart_result other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.success = other.success;
      if (other.isSetScex()) {
        this.scex = new ShoppingCartException(other.scex);
      }
    }

    public resetCart_result deepCopy() {
      return new resetCart_result(this);
    }

    @Deprecated
    public resetCart_result clone() {
      return new resetCart_result(this);
    }

    public boolean isSuccess() {
      return this.success;
    }

    public resetCart_result setSuccess(boolean 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 ShoppingCartException getScex() {
      return this.scex;
    }

    public resetCart_result setScex(ShoppingCartException scex) {
      this.scex = scex;
      return this;
    }

    public void unsetScex() {
      this.scex = null;
    }

    /** Returns true if field scex is set (has been asigned a value) and false otherwise */
    public boolean isSetScex() {
      return this.scex != null;
    }

    public void setScexIsSet(boolean value) {
      if (!value) {
        this.scex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((Boolean)value);
        }
        break;

      case SCEX:
        if (value == null) {
          unsetScex();
        } else {
          setScex((ShoppingCartException)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 Boolean(isSuccess());

      case SCEX:
        return getScex();

      }
      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 SCEX:
        return isSetScex();
      }
      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 resetCart_result)
        return this.equals((resetCart_result)that);
      return false;
    }

    public boolean equals(resetCart_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_scex = true && this.isSetScex();
      boolean that_present_scex = true && that.isSetScex();
      if (this_present_scex || that_present_scex) {
        if (!(this_present_scex && that_present_scex))
          return false;
        if (!this.scex.equals(that.scex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(resetCart_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      resetCart_result typedOther = (resetCart_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(isSetScex()).compareTo(isSetScex());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(scex, typedOther.scex);
      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.BOOL) {
                this.success = iprot.readBool();
                setSuccessIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case SCEX:
              if (field.type == TType.STRUCT) {
                this.scex = new ShoppingCartException();
                this.scex.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.writeBool(this.success);
        oprot.writeFieldEnd();
      } else if (this.isSetScex()) {
        oprot.writeFieldBegin(SCEX_FIELD_DESC);
        this.scex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("resetCart_result(");
      boolean first = true;

      sb.append("success:");
      sb.append(this.success);
      first = false;
      if (!first) sb.append(", ");
      sb.append("scex:");
      if (this.scex == null) {
        sb.append("null");
      } else {
        sb.append(this.scex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class getMyResearch_args implements TBase<getMyResearch_args._Fields>, java.io.Serializable, Cloneable, Comparable<getMyResearch_args>   {
    private static final TStruct STRUCT_DESC = new TStruct("getMyResearch_args");

    private static final TField USER_ID_FIELD_DESC = new TField("userId", TType.I64, (short)1);

    private long userId;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      USER_ID((short)1, "userId");

      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 __USERID_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.USER_ID, new FieldMetaData("userId", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(getMyResearch_args.class, metaDataMap);
    }

    public getMyResearch_args() {
    }

    public getMyResearch_args(
      long userId)
    {
      this();
      this.userId = userId;
      setUserIdIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getMyResearch_args(getMyResearch_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.userId = other.userId;
    }

    public getMyResearch_args deepCopy() {
      return new getMyResearch_args(this);
    }

    @Deprecated
    public getMyResearch_args clone() {
      return new getMyResearch_args(this);
    }

    public long getUserId() {
      return this.userId;
    }

    public getMyResearch_args setUserId(long userId) {
      this.userId = userId;
      setUserIdIsSet(true);
      return this;
    }

    public void unsetUserId() {
      __isset_bit_vector.clear(__USERID_ISSET_ID);
    }

    /** Returns true if field userId is set (has been asigned a value) and false otherwise */
    public boolean isSetUserId() {
      return __isset_bit_vector.get(__USERID_ISSET_ID);
    }

    public void setUserIdIsSet(boolean value) {
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case USER_ID:
        if (value == null) {
          unsetUserId();
        } else {
          setUserId((Long)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case USER_ID:
        return new Long(getUserId());

      }
      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 USER_ID:
        return isSetUserId();
      }
      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 getMyResearch_args)
        return this.equals((getMyResearch_args)that);
      return false;
    }

    public boolean equals(getMyResearch_args that) {
      if (that == null)
        return false;

      boolean this_present_userId = true;
      boolean that_present_userId = true;
      if (this_present_userId || that_present_userId) {
        if (!(this_present_userId && that_present_userId))
          return false;
        if (this.userId != that.userId)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getMyResearch_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getMyResearch_args typedOther = (getMyResearch_args)other;

      lastComparison = Boolean.valueOf(isSetUserId()).compareTo(isSetUserId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(userId, typedOther.userId);
      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 USER_ID:
              if (field.type == TType.I64) {
                this.userId = iprot.readI64();
                setUserIdIsSet(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(USER_ID_FIELD_DESC);
      oprot.writeI64(this.userId);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getMyResearch_args(");
      boolean first = true;

      sb.append("userId:");
      sb.append(this.userId);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class getMyResearch_result implements TBase<getMyResearch_result._Fields>, java.io.Serializable, Cloneable, Comparable<getMyResearch_result>   {
    private static final TStruct STRUCT_DESC = new TStruct("getMyResearch_result");

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRUCT, (short)0);
    private static final TField SCX_FIELD_DESC = new TField("scx", TType.STRUCT, (short)1);

    private Widget success;
    private WidgetException scx;

    /** 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"),
      SCX((short)1, "scx");

      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, Widget.class)));
      put(_Fields.SCX, new FieldMetaData("scx", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(getMyResearch_result.class, metaDataMap);
    }

    public getMyResearch_result() {
    }

    public getMyResearch_result(
      Widget success,
      WidgetException scx)
    {
      this();
      this.success = success;
      this.scx = scx;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getMyResearch_result(getMyResearch_result other) {
      if (other.isSetSuccess()) {
        this.success = new Widget(other.success);
      }
      if (other.isSetScx()) {
        this.scx = new WidgetException(other.scx);
      }
    }

    public getMyResearch_result deepCopy() {
      return new getMyResearch_result(this);
    }

    @Deprecated
    public getMyResearch_result clone() {
      return new getMyResearch_result(this);
    }

    public Widget getSuccess() {
      return this.success;
    }

    public getMyResearch_result setSuccess(Widget 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 WidgetException getScx() {
      return this.scx;
    }

    public getMyResearch_result setScx(WidgetException scx) {
      this.scx = scx;
      return this;
    }

    public void unsetScx() {
      this.scx = null;
    }

    /** Returns true if field scx is set (has been asigned a value) and false otherwise */
    public boolean isSetScx() {
      return this.scx != null;
    }

    public void setScxIsSet(boolean value) {
      if (!value) {
        this.scx = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((Widget)value);
        }
        break;

      case SCX:
        if (value == null) {
          unsetScx();
        } else {
          setScx((WidgetException)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 SCX:
        return getScx();

      }
      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 SCX:
        return isSetScx();
      }
      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 getMyResearch_result)
        return this.equals((getMyResearch_result)that);
      return false;
    }

    public boolean equals(getMyResearch_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_scx = true && this.isSetScx();
      boolean that_present_scx = true && that.isSetScx();
      if (this_present_scx || that_present_scx) {
        if (!(this_present_scx && that_present_scx))
          return false;
        if (!this.scx.equals(that.scx))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getMyResearch_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getMyResearch_result typedOther = (getMyResearch_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(isSetScx()).compareTo(isSetScx());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(scx, typedOther.scx);
      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 Widget();
                this.success.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case SCX:
              if (field.type == TType.STRUCT) {
                this.scx = new WidgetException();
                this.scx.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.isSetScx()) {
        oprot.writeFieldBegin(SCX_FIELD_DESC);
        this.scx.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getMyResearch_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("scx:");
      if (this.scx == null) {
        sb.append("null");
      } else {
        sb.append(this.scx);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class updateMyResearch_args implements TBase<updateMyResearch_args._Fields>, java.io.Serializable, Cloneable, Comparable<updateMyResearch_args>   {
    private static final TStruct STRUCT_DESC = new TStruct("updateMyResearch_args");

    private static final TField USER_ID_FIELD_DESC = new TField("userId", TType.I64, (short)1);
    private static final TField ITEM_ID_FIELD_DESC = new TField("itemId", TType.I64, (short)2);

    private long userId;
    private long itemId;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      USER_ID((short)1, "userId"),
      ITEM_ID((short)2, "itemId");

      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 __USERID_ISSET_ID = 0;
    private static final int __ITEMID_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.USER_ID, new FieldMetaData("userId", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
      put(_Fields.ITEM_ID, new FieldMetaData("itemId", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(updateMyResearch_args.class, metaDataMap);
    }

    public updateMyResearch_args() {
    }

    public updateMyResearch_args(
      long userId,
      long itemId)
    {
      this();
      this.userId = userId;
      setUserIdIsSet(true);
      this.itemId = itemId;
      setItemIdIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public updateMyResearch_args(updateMyResearch_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.userId = other.userId;
      this.itemId = other.itemId;
    }

    public updateMyResearch_args deepCopy() {
      return new updateMyResearch_args(this);
    }

    @Deprecated
    public updateMyResearch_args clone() {
      return new updateMyResearch_args(this);
    }

    public long getUserId() {
      return this.userId;
    }

    public updateMyResearch_args setUserId(long userId) {
      this.userId = userId;
      setUserIdIsSet(true);
      return this;
    }

    public void unsetUserId() {
      __isset_bit_vector.clear(__USERID_ISSET_ID);
    }

    /** Returns true if field userId is set (has been asigned a value) and false otherwise */
    public boolean isSetUserId() {
      return __isset_bit_vector.get(__USERID_ISSET_ID);
    }

    public void setUserIdIsSet(boolean value) {
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
    }

    public long getItemId() {
      return this.itemId;
    }

    public updateMyResearch_args setItemId(long itemId) {
      this.itemId = itemId;
      setItemIdIsSet(true);
      return this;
    }

    public void unsetItemId() {
      __isset_bit_vector.clear(__ITEMID_ISSET_ID);
    }

    /** Returns true if field itemId is set (has been asigned a value) and false otherwise */
    public boolean isSetItemId() {
      return __isset_bit_vector.get(__ITEMID_ISSET_ID);
    }

    public void setItemIdIsSet(boolean value) {
      __isset_bit_vector.set(__ITEMID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case USER_ID:
        if (value == null) {
          unsetUserId();
        } else {
          setUserId((Long)value);
        }
        break;

      case ITEM_ID:
        if (value == null) {
          unsetItemId();
        } else {
          setItemId((Long)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case USER_ID:
        return new Long(getUserId());

      case ITEM_ID:
        return new Long(getItemId());

      }
      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 USER_ID:
        return isSetUserId();
      case ITEM_ID:
        return isSetItemId();
      }
      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 updateMyResearch_args)
        return this.equals((updateMyResearch_args)that);
      return false;
    }

    public boolean equals(updateMyResearch_args that) {
      if (that == null)
        return false;

      boolean this_present_userId = true;
      boolean that_present_userId = true;
      if (this_present_userId || that_present_userId) {
        if (!(this_present_userId && that_present_userId))
          return false;
        if (this.userId != that.userId)
          return false;
      }

      boolean this_present_itemId = true;
      boolean that_present_itemId = true;
      if (this_present_itemId || that_present_itemId) {
        if (!(this_present_itemId && that_present_itemId))
          return false;
        if (this.itemId != that.itemId)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(updateMyResearch_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      updateMyResearch_args typedOther = (updateMyResearch_args)other;

      lastComparison = Boolean.valueOf(isSetUserId()).compareTo(isSetUserId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(userId, typedOther.userId);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetItemId()).compareTo(isSetItemId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(itemId, typedOther.itemId);
      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 USER_ID:
              if (field.type == TType.I64) {
                this.userId = iprot.readI64();
                setUserIdIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case ITEM_ID:
              if (field.type == TType.I64) {
                this.itemId = iprot.readI64();
                setItemIdIsSet(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(USER_ID_FIELD_DESC);
      oprot.writeI64(this.userId);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(ITEM_ID_FIELD_DESC);
      oprot.writeI64(this.itemId);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("updateMyResearch_args(");
      boolean first = true;

      sb.append("userId:");
      sb.append(this.userId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("itemId:");
      sb.append(this.itemId);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class updateMyResearch_result implements TBase<updateMyResearch_result._Fields>, java.io.Serializable, Cloneable, Comparable<updateMyResearch_result>   {
    private static final TStruct STRUCT_DESC = new TStruct("updateMyResearch_result");

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.BOOL, (short)0);
    private static final TField SCX_FIELD_DESC = new TField("scx", TType.STRUCT, (short)1);

    private boolean success;
    private WidgetException scx;

    /** 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"),
      SCX((short)1, "scx");

      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.BOOL)));
      put(_Fields.SCX, new FieldMetaData("scx", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(updateMyResearch_result.class, metaDataMap);
    }

    public updateMyResearch_result() {
    }

    public updateMyResearch_result(
      boolean success,
      WidgetException scx)
    {
      this();
      this.success = success;
      setSuccessIsSet(true);
      this.scx = scx;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public updateMyResearch_result(updateMyResearch_result other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.success = other.success;
      if (other.isSetScx()) {
        this.scx = new WidgetException(other.scx);
      }
    }

    public updateMyResearch_result deepCopy() {
      return new updateMyResearch_result(this);
    }

    @Deprecated
    public updateMyResearch_result clone() {
      return new updateMyResearch_result(this);
    }

    public boolean isSuccess() {
      return this.success;
    }

    public updateMyResearch_result setSuccess(boolean 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 WidgetException getScx() {
      return this.scx;
    }

    public updateMyResearch_result setScx(WidgetException scx) {
      this.scx = scx;
      return this;
    }

    public void unsetScx() {
      this.scx = null;
    }

    /** Returns true if field scx is set (has been asigned a value) and false otherwise */
    public boolean isSetScx() {
      return this.scx != null;
    }

    public void setScxIsSet(boolean value) {
      if (!value) {
        this.scx = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((Boolean)value);
        }
        break;

      case SCX:
        if (value == null) {
          unsetScx();
        } else {
          setScx((WidgetException)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 Boolean(isSuccess());

      case SCX:
        return getScx();

      }
      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 SCX:
        return isSetScx();
      }
      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 updateMyResearch_result)
        return this.equals((updateMyResearch_result)that);
      return false;
    }

    public boolean equals(updateMyResearch_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_scx = true && this.isSetScx();
      boolean that_present_scx = true && that.isSetScx();
      if (this_present_scx || that_present_scx) {
        if (!(this_present_scx && that_present_scx))
          return false;
        if (!this.scx.equals(that.scx))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(updateMyResearch_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      updateMyResearch_result typedOther = (updateMyResearch_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(isSetScx()).compareTo(isSetScx());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(scx, typedOther.scx);
      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.BOOL) {
                this.success = iprot.readBool();
                setSuccessIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case SCX:
              if (field.type == TType.STRUCT) {
                this.scx = new WidgetException();
                this.scx.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.writeBool(this.success);
        oprot.writeFieldEnd();
      } else if (this.isSetScx()) {
        oprot.writeFieldBegin(SCX_FIELD_DESC);
        this.scx.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("updateMyResearch_result(");
      boolean first = true;

      sb.append("success:");
      sb.append(this.success);
      first = false;
      if (!first) sb.append(", ");
      sb.append("scx:");
      if (this.scx == null) {
        sb.append("null");
      } else {
        sb.append(this.scx);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class deleteItemFromMyResearch_args implements TBase<deleteItemFromMyResearch_args._Fields>, java.io.Serializable, Cloneable, Comparable<deleteItemFromMyResearch_args>   {
    private static final TStruct STRUCT_DESC = new TStruct("deleteItemFromMyResearch_args");

    private static final TField USER_ID_FIELD_DESC = new TField("userId", TType.I64, (short)1);
    private static final TField ITEM_ID_FIELD_DESC = new TField("itemId", TType.I64, (short)2);

    private long userId;
    private long itemId;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      USER_ID((short)1, "userId"),
      ITEM_ID((short)2, "itemId");

      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 __USERID_ISSET_ID = 0;
    private static final int __ITEMID_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.USER_ID, new FieldMetaData("userId", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
      put(_Fields.ITEM_ID, new FieldMetaData("itemId", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(deleteItemFromMyResearch_args.class, metaDataMap);
    }

    public deleteItemFromMyResearch_args() {
    }

    public deleteItemFromMyResearch_args(
      long userId,
      long itemId)
    {
      this();
      this.userId = userId;
      setUserIdIsSet(true);
      this.itemId = itemId;
      setItemIdIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public deleteItemFromMyResearch_args(deleteItemFromMyResearch_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.userId = other.userId;
      this.itemId = other.itemId;
    }

    public deleteItemFromMyResearch_args deepCopy() {
      return new deleteItemFromMyResearch_args(this);
    }

    @Deprecated
    public deleteItemFromMyResearch_args clone() {
      return new deleteItemFromMyResearch_args(this);
    }

    public long getUserId() {
      return this.userId;
    }

    public deleteItemFromMyResearch_args setUserId(long userId) {
      this.userId = userId;
      setUserIdIsSet(true);
      return this;
    }

    public void unsetUserId() {
      __isset_bit_vector.clear(__USERID_ISSET_ID);
    }

    /** Returns true if field userId is set (has been asigned a value) and false otherwise */
    public boolean isSetUserId() {
      return __isset_bit_vector.get(__USERID_ISSET_ID);
    }

    public void setUserIdIsSet(boolean value) {
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
    }

    public long getItemId() {
      return this.itemId;
    }

    public deleteItemFromMyResearch_args setItemId(long itemId) {
      this.itemId = itemId;
      setItemIdIsSet(true);
      return this;
    }

    public void unsetItemId() {
      __isset_bit_vector.clear(__ITEMID_ISSET_ID);
    }

    /** Returns true if field itemId is set (has been asigned a value) and false otherwise */
    public boolean isSetItemId() {
      return __isset_bit_vector.get(__ITEMID_ISSET_ID);
    }

    public void setItemIdIsSet(boolean value) {
      __isset_bit_vector.set(__ITEMID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case USER_ID:
        if (value == null) {
          unsetUserId();
        } else {
          setUserId((Long)value);
        }
        break;

      case ITEM_ID:
        if (value == null) {
          unsetItemId();
        } else {
          setItemId((Long)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case USER_ID:
        return new Long(getUserId());

      case ITEM_ID:
        return new Long(getItemId());

      }
      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 USER_ID:
        return isSetUserId();
      case ITEM_ID:
        return isSetItemId();
      }
      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 deleteItemFromMyResearch_args)
        return this.equals((deleteItemFromMyResearch_args)that);
      return false;
    }

    public boolean equals(deleteItemFromMyResearch_args that) {
      if (that == null)
        return false;

      boolean this_present_userId = true;
      boolean that_present_userId = true;
      if (this_present_userId || that_present_userId) {
        if (!(this_present_userId && that_present_userId))
          return false;
        if (this.userId != that.userId)
          return false;
      }

      boolean this_present_itemId = true;
      boolean that_present_itemId = true;
      if (this_present_itemId || that_present_itemId) {
        if (!(this_present_itemId && that_present_itemId))
          return false;
        if (this.itemId != that.itemId)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(deleteItemFromMyResearch_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      deleteItemFromMyResearch_args typedOther = (deleteItemFromMyResearch_args)other;

      lastComparison = Boolean.valueOf(isSetUserId()).compareTo(isSetUserId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(userId, typedOther.userId);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetItemId()).compareTo(isSetItemId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(itemId, typedOther.itemId);
      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 USER_ID:
              if (field.type == TType.I64) {
                this.userId = iprot.readI64();
                setUserIdIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case ITEM_ID:
              if (field.type == TType.I64) {
                this.itemId = iprot.readI64();
                setItemIdIsSet(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(USER_ID_FIELD_DESC);
      oprot.writeI64(this.userId);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(ITEM_ID_FIELD_DESC);
      oprot.writeI64(this.itemId);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("deleteItemFromMyResearch_args(");
      boolean first = true;

      sb.append("userId:");
      sb.append(this.userId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("itemId:");
      sb.append(this.itemId);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class deleteItemFromMyResearch_result implements TBase<deleteItemFromMyResearch_result._Fields>, java.io.Serializable, Cloneable, Comparable<deleteItemFromMyResearch_result>   {
    private static final TStruct STRUCT_DESC = new TStruct("deleteItemFromMyResearch_result");

    private static final TField SCX_FIELD_DESC = new TField("scx", TType.STRUCT, (short)1);

    private WidgetException scx;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      SCX((short)1, "scx");

      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.SCX, new FieldMetaData("scx", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(deleteItemFromMyResearch_result.class, metaDataMap);
    }

    public deleteItemFromMyResearch_result() {
    }

    public deleteItemFromMyResearch_result(
      WidgetException scx)
    {
      this();
      this.scx = scx;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public deleteItemFromMyResearch_result(deleteItemFromMyResearch_result other) {
      if (other.isSetScx()) {
        this.scx = new WidgetException(other.scx);
      }
    }

    public deleteItemFromMyResearch_result deepCopy() {
      return new deleteItemFromMyResearch_result(this);
    }

    @Deprecated
    public deleteItemFromMyResearch_result clone() {
      return new deleteItemFromMyResearch_result(this);
    }

    public WidgetException getScx() {
      return this.scx;
    }

    public deleteItemFromMyResearch_result setScx(WidgetException scx) {
      this.scx = scx;
      return this;
    }

    public void unsetScx() {
      this.scx = null;
    }

    /** Returns true if field scx is set (has been asigned a value) and false otherwise */
    public boolean isSetScx() {
      return this.scx != null;
    }

    public void setScxIsSet(boolean value) {
      if (!value) {
        this.scx = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SCX:
        if (value == null) {
          unsetScx();
        } else {
          setScx((WidgetException)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SCX:
        return getScx();

      }
      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 SCX:
        return isSetScx();
      }
      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 deleteItemFromMyResearch_result)
        return this.equals((deleteItemFromMyResearch_result)that);
      return false;
    }

    public boolean equals(deleteItemFromMyResearch_result that) {
      if (that == null)
        return false;

      boolean this_present_scx = true && this.isSetScx();
      boolean that_present_scx = true && that.isSetScx();
      if (this_present_scx || that_present_scx) {
        if (!(this_present_scx && that_present_scx))
          return false;
        if (!this.scx.equals(that.scx))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(deleteItemFromMyResearch_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      deleteItemFromMyResearch_result typedOther = (deleteItemFromMyResearch_result)other;

      lastComparison = Boolean.valueOf(isSetScx()).compareTo(isSetScx());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(scx, typedOther.scx);
      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 SCX:
              if (field.type == TType.STRUCT) {
                this.scx = new WidgetException();
                this.scx.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.isSetScx()) {
        oprot.writeFieldBegin(SCX_FIELD_DESC);
        this.scx.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("deleteItemFromMyResearch_result(");
      boolean first = true;

      sb.append("scx:");
      if (this.scx == null) {
        sb.append("null");
      } else {
        sb.append(this.scx);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class updateBrowseHistory_args implements TBase<updateBrowseHistory_args._Fields>, java.io.Serializable, Cloneable, Comparable<updateBrowseHistory_args>   {
    private static final TStruct STRUCT_DESC = new TStruct("updateBrowseHistory_args");

    private static final TField USER_ID_FIELD_DESC = new TField("userId", TType.I64, (short)1);
    private static final TField ITEM_ID_FIELD_DESC = new TField("itemId", TType.I64, (short)2);

    private long userId;
    private long itemId;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      USER_ID((short)1, "userId"),
      ITEM_ID((short)2, "itemId");

      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 __USERID_ISSET_ID = 0;
    private static final int __ITEMID_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.USER_ID, new FieldMetaData("userId", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
      put(_Fields.ITEM_ID, new FieldMetaData("itemId", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(updateBrowseHistory_args.class, metaDataMap);
    }

    public updateBrowseHistory_args() {
    }

    public updateBrowseHistory_args(
      long userId,
      long itemId)
    {
      this();
      this.userId = userId;
      setUserIdIsSet(true);
      this.itemId = itemId;
      setItemIdIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public updateBrowseHistory_args(updateBrowseHistory_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.userId = other.userId;
      this.itemId = other.itemId;
    }

    public updateBrowseHistory_args deepCopy() {
      return new updateBrowseHistory_args(this);
    }

    @Deprecated
    public updateBrowseHistory_args clone() {
      return new updateBrowseHistory_args(this);
    }

    public long getUserId() {
      return this.userId;
    }

    public updateBrowseHistory_args setUserId(long userId) {
      this.userId = userId;
      setUserIdIsSet(true);
      return this;
    }

    public void unsetUserId() {
      __isset_bit_vector.clear(__USERID_ISSET_ID);
    }

    /** Returns true if field userId is set (has been asigned a value) and false otherwise */
    public boolean isSetUserId() {
      return __isset_bit_vector.get(__USERID_ISSET_ID);
    }

    public void setUserIdIsSet(boolean value) {
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
    }

    public long getItemId() {
      return this.itemId;
    }

    public updateBrowseHistory_args setItemId(long itemId) {
      this.itemId = itemId;
      setItemIdIsSet(true);
      return this;
    }

    public void unsetItemId() {
      __isset_bit_vector.clear(__ITEMID_ISSET_ID);
    }

    /** Returns true if field itemId is set (has been asigned a value) and false otherwise */
    public boolean isSetItemId() {
      return __isset_bit_vector.get(__ITEMID_ISSET_ID);
    }

    public void setItemIdIsSet(boolean value) {
      __isset_bit_vector.set(__ITEMID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case USER_ID:
        if (value == null) {
          unsetUserId();
        } else {
          setUserId((Long)value);
        }
        break;

      case ITEM_ID:
        if (value == null) {
          unsetItemId();
        } else {
          setItemId((Long)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case USER_ID:
        return new Long(getUserId());

      case ITEM_ID:
        return new Long(getItemId());

      }
      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 USER_ID:
        return isSetUserId();
      case ITEM_ID:
        return isSetItemId();
      }
      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 updateBrowseHistory_args)
        return this.equals((updateBrowseHistory_args)that);
      return false;
    }

    public boolean equals(updateBrowseHistory_args that) {
      if (that == null)
        return false;

      boolean this_present_userId = true;
      boolean that_present_userId = true;
      if (this_present_userId || that_present_userId) {
        if (!(this_present_userId && that_present_userId))
          return false;
        if (this.userId != that.userId)
          return false;
      }

      boolean this_present_itemId = true;
      boolean that_present_itemId = true;
      if (this_present_itemId || that_present_itemId) {
        if (!(this_present_itemId && that_present_itemId))
          return false;
        if (this.itemId != that.itemId)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(updateBrowseHistory_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      updateBrowseHistory_args typedOther = (updateBrowseHistory_args)other;

      lastComparison = Boolean.valueOf(isSetUserId()).compareTo(isSetUserId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(userId, typedOther.userId);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetItemId()).compareTo(isSetItemId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(itemId, typedOther.itemId);
      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 USER_ID:
              if (field.type == TType.I64) {
                this.userId = iprot.readI64();
                setUserIdIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case ITEM_ID:
              if (field.type == TType.I64) {
                this.itemId = iprot.readI64();
                setItemIdIsSet(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(USER_ID_FIELD_DESC);
      oprot.writeI64(this.userId);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(ITEM_ID_FIELD_DESC);
      oprot.writeI64(this.itemId);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("updateBrowseHistory_args(");
      boolean first = true;

      sb.append("userId:");
      sb.append(this.userId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("itemId:");
      sb.append(this.itemId);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class updateBrowseHistory_result implements TBase<updateBrowseHistory_result._Fields>, java.io.Serializable, Cloneable, Comparable<updateBrowseHistory_result>   {
    private static final TStruct STRUCT_DESC = new TStruct("updateBrowseHistory_result");



    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
;

      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;
      }
    }
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
    }});

    static {
      FieldMetaData.addStructMetaDataMap(updateBrowseHistory_result.class, metaDataMap);
    }

    public updateBrowseHistory_result() {
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public updateBrowseHistory_result(updateBrowseHistory_result other) {
    }

    public updateBrowseHistory_result deepCopy() {
      return new updateBrowseHistory_result(this);
    }

    @Deprecated
    public updateBrowseHistory_result clone() {
      return new updateBrowseHistory_result(this);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      }
      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) {
      }
      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 updateBrowseHistory_result)
        return this.equals((updateBrowseHistory_result)that);
      return false;
    }

    public boolean equals(updateBrowseHistory_result that) {
      if (that == null)
        return false;

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(updateBrowseHistory_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      updateBrowseHistory_result typedOther = (updateBrowseHistory_result)other;

      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) {
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      oprot.writeStructBegin(STRUCT_DESC);

      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("updateBrowseHistory_result(");
      boolean first = true;

      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class getBrowseHistory_args implements TBase<getBrowseHistory_args._Fields>, java.io.Serializable, Cloneable, Comparable<getBrowseHistory_args>   {
    private static final TStruct STRUCT_DESC = new TStruct("getBrowseHistory_args");

    private static final TField USER_ID_FIELD_DESC = new TField("userId", TType.I64, (short)1);

    private long userId;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      USER_ID((short)1, "userId");

      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 __USERID_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.USER_ID, new FieldMetaData("userId", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(getBrowseHistory_args.class, metaDataMap);
    }

    public getBrowseHistory_args() {
    }

    public getBrowseHistory_args(
      long userId)
    {
      this();
      this.userId = userId;
      setUserIdIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getBrowseHistory_args(getBrowseHistory_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.userId = other.userId;
    }

    public getBrowseHistory_args deepCopy() {
      return new getBrowseHistory_args(this);
    }

    @Deprecated
    public getBrowseHistory_args clone() {
      return new getBrowseHistory_args(this);
    }

    public long getUserId() {
      return this.userId;
    }

    public getBrowseHistory_args setUserId(long userId) {
      this.userId = userId;
      setUserIdIsSet(true);
      return this;
    }

    public void unsetUserId() {
      __isset_bit_vector.clear(__USERID_ISSET_ID);
    }

    /** Returns true if field userId is set (has been asigned a value) and false otherwise */
    public boolean isSetUserId() {
      return __isset_bit_vector.get(__USERID_ISSET_ID);
    }

    public void setUserIdIsSet(boolean value) {
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case USER_ID:
        if (value == null) {
          unsetUserId();
        } else {
          setUserId((Long)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case USER_ID:
        return new Long(getUserId());

      }
      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 USER_ID:
        return isSetUserId();
      }
      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 getBrowseHistory_args)
        return this.equals((getBrowseHistory_args)that);
      return false;
    }

    public boolean equals(getBrowseHistory_args that) {
      if (that == null)
        return false;

      boolean this_present_userId = true;
      boolean that_present_userId = true;
      if (this_present_userId || that_present_userId) {
        if (!(this_present_userId && that_present_userId))
          return false;
        if (this.userId != that.userId)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getBrowseHistory_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getBrowseHistory_args typedOther = (getBrowseHistory_args)other;

      lastComparison = Boolean.valueOf(isSetUserId()).compareTo(isSetUserId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(userId, typedOther.userId);
      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 USER_ID:
              if (field.type == TType.I64) {
                this.userId = iprot.readI64();
                setUserIdIsSet(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(USER_ID_FIELD_DESC);
      oprot.writeI64(this.userId);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getBrowseHistory_args(");
      boolean first = true;

      sb.append("userId:");
      sb.append(this.userId);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class getBrowseHistory_result implements TBase<getBrowseHistory_result._Fields>, java.io.Serializable, Cloneable, Comparable<getBrowseHistory_result>   {
    private static final TStruct STRUCT_DESC = new TStruct("getBrowseHistory_result");

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRUCT, (short)0);
    private static final TField SCX_FIELD_DESC = new TField("scx", TType.STRUCT, (short)1);

    private Widget success;
    private WidgetException scx;

    /** 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"),
      SCX((short)1, "scx");

      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, Widget.class)));
      put(_Fields.SCX, new FieldMetaData("scx", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(getBrowseHistory_result.class, metaDataMap);
    }

    public getBrowseHistory_result() {
    }

    public getBrowseHistory_result(
      Widget success,
      WidgetException scx)
    {
      this();
      this.success = success;
      this.scx = scx;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getBrowseHistory_result(getBrowseHistory_result other) {
      if (other.isSetSuccess()) {
        this.success = new Widget(other.success);
      }
      if (other.isSetScx()) {
        this.scx = new WidgetException(other.scx);
      }
    }

    public getBrowseHistory_result deepCopy() {
      return new getBrowseHistory_result(this);
    }

    @Deprecated
    public getBrowseHistory_result clone() {
      return new getBrowseHistory_result(this);
    }

    public Widget getSuccess() {
      return this.success;
    }

    public getBrowseHistory_result setSuccess(Widget 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 WidgetException getScx() {
      return this.scx;
    }

    public getBrowseHistory_result setScx(WidgetException scx) {
      this.scx = scx;
      return this;
    }

    public void unsetScx() {
      this.scx = null;
    }

    /** Returns true if field scx is set (has been asigned a value) and false otherwise */
    public boolean isSetScx() {
      return this.scx != null;
    }

    public void setScxIsSet(boolean value) {
      if (!value) {
        this.scx = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((Widget)value);
        }
        break;

      case SCX:
        if (value == null) {
          unsetScx();
        } else {
          setScx((WidgetException)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 SCX:
        return getScx();

      }
      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 SCX:
        return isSetScx();
      }
      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 getBrowseHistory_result)
        return this.equals((getBrowseHistory_result)that);
      return false;
    }

    public boolean equals(getBrowseHistory_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_scx = true && this.isSetScx();
      boolean that_present_scx = true && that.isSetScx();
      if (this_present_scx || that_present_scx) {
        if (!(this_present_scx && that_present_scx))
          return false;
        if (!this.scx.equals(that.scx))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getBrowseHistory_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getBrowseHistory_result typedOther = (getBrowseHistory_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(isSetScx()).compareTo(isSetScx());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(scx, typedOther.scx);
      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 Widget();
                this.success.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case SCX:
              if (field.type == TType.STRUCT) {
                this.scx = new WidgetException();
                this.scx.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.isSetScx()) {
        oprot.writeFieldBegin(SCX_FIELD_DESC);
        this.scx.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getBrowseHistory_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("scx:");
      if (this.scx == null) {
        sb.append("null");
      } else {
        sb.append(this.scx);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class mergeBrowseHistory_args implements TBase<mergeBrowseHistory_args._Fields>, java.io.Serializable, Cloneable, Comparable<mergeBrowseHistory_args>   {
    private static final TStruct STRUCT_DESC = new TStruct("mergeBrowseHistory_args");

    private static final TField FROM_USER_ID_FIELD_DESC = new TField("fromUserId", TType.I64, (short)1);
    private static final TField TO_USER_ID_FIELD_DESC = new TField("toUserId", TType.I64, (short)2);

    private long fromUserId;
    private long toUserId;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      FROM_USER_ID((short)1, "fromUserId"),
      TO_USER_ID((short)2, "toUserId");

      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 __FROMUSERID_ISSET_ID = 0;
    private static final int __TOUSERID_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.FROM_USER_ID, new FieldMetaData("fromUserId", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
      put(_Fields.TO_USER_ID, new FieldMetaData("toUserId", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(mergeBrowseHistory_args.class, metaDataMap);
    }

    public mergeBrowseHistory_args() {
    }

    public mergeBrowseHistory_args(
      long fromUserId,
      long toUserId)
    {
      this();
      this.fromUserId = fromUserId;
      setFromUserIdIsSet(true);
      this.toUserId = toUserId;
      setToUserIdIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public mergeBrowseHistory_args(mergeBrowseHistory_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.fromUserId = other.fromUserId;
      this.toUserId = other.toUserId;
    }

    public mergeBrowseHistory_args deepCopy() {
      return new mergeBrowseHistory_args(this);
    }

    @Deprecated
    public mergeBrowseHistory_args clone() {
      return new mergeBrowseHistory_args(this);
    }

    public long getFromUserId() {
      return this.fromUserId;
    }

    public mergeBrowseHistory_args setFromUserId(long fromUserId) {
      this.fromUserId = fromUserId;
      setFromUserIdIsSet(true);
      return this;
    }

    public void unsetFromUserId() {
      __isset_bit_vector.clear(__FROMUSERID_ISSET_ID);
    }

    /** Returns true if field fromUserId is set (has been asigned a value) and false otherwise */
    public boolean isSetFromUserId() {
      return __isset_bit_vector.get(__FROMUSERID_ISSET_ID);
    }

    public void setFromUserIdIsSet(boolean value) {
      __isset_bit_vector.set(__FROMUSERID_ISSET_ID, value);
    }

    public long getToUserId() {
      return this.toUserId;
    }

    public mergeBrowseHistory_args setToUserId(long toUserId) {
      this.toUserId = toUserId;
      setToUserIdIsSet(true);
      return this;
    }

    public void unsetToUserId() {
      __isset_bit_vector.clear(__TOUSERID_ISSET_ID);
    }

    /** Returns true if field toUserId is set (has been asigned a value) and false otherwise */
    public boolean isSetToUserId() {
      return __isset_bit_vector.get(__TOUSERID_ISSET_ID);
    }

    public void setToUserIdIsSet(boolean value) {
      __isset_bit_vector.set(__TOUSERID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case FROM_USER_ID:
        if (value == null) {
          unsetFromUserId();
        } else {
          setFromUserId((Long)value);
        }
        break;

      case TO_USER_ID:
        if (value == null) {
          unsetToUserId();
        } else {
          setToUserId((Long)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case FROM_USER_ID:
        return new Long(getFromUserId());

      case TO_USER_ID:
        return new Long(getToUserId());

      }
      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 FROM_USER_ID:
        return isSetFromUserId();
      case TO_USER_ID:
        return isSetToUserId();
      }
      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 mergeBrowseHistory_args)
        return this.equals((mergeBrowseHistory_args)that);
      return false;
    }

    public boolean equals(mergeBrowseHistory_args that) {
      if (that == null)
        return false;

      boolean this_present_fromUserId = true;
      boolean that_present_fromUserId = true;
      if (this_present_fromUserId || that_present_fromUserId) {
        if (!(this_present_fromUserId && that_present_fromUserId))
          return false;
        if (this.fromUserId != that.fromUserId)
          return false;
      }

      boolean this_present_toUserId = true;
      boolean that_present_toUserId = true;
      if (this_present_toUserId || that_present_toUserId) {
        if (!(this_present_toUserId && that_present_toUserId))
          return false;
        if (this.toUserId != that.toUserId)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(mergeBrowseHistory_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      mergeBrowseHistory_args typedOther = (mergeBrowseHistory_args)other;

      lastComparison = Boolean.valueOf(isSetFromUserId()).compareTo(isSetFromUserId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(fromUserId, typedOther.fromUserId);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetToUserId()).compareTo(isSetToUserId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(toUserId, typedOther.toUserId);
      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 FROM_USER_ID:
              if (field.type == TType.I64) {
                this.fromUserId = iprot.readI64();
                setFromUserIdIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case TO_USER_ID:
              if (field.type == TType.I64) {
                this.toUserId = iprot.readI64();
                setToUserIdIsSet(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(FROM_USER_ID_FIELD_DESC);
      oprot.writeI64(this.fromUserId);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(TO_USER_ID_FIELD_DESC);
      oprot.writeI64(this.toUserId);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("mergeBrowseHistory_args(");
      boolean first = true;

      sb.append("fromUserId:");
      sb.append(this.fromUserId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("toUserId:");
      sb.append(this.toUserId);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class mergeBrowseHistory_result implements TBase<mergeBrowseHistory_result._Fields>, java.io.Serializable, Cloneable, Comparable<mergeBrowseHistory_result>   {
    private static final TStruct STRUCT_DESC = new TStruct("mergeBrowseHistory_result");



    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
;

      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;
      }
    }
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
    }});

    static {
      FieldMetaData.addStructMetaDataMap(mergeBrowseHistory_result.class, metaDataMap);
    }

    public mergeBrowseHistory_result() {
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public mergeBrowseHistory_result(mergeBrowseHistory_result other) {
    }

    public mergeBrowseHistory_result deepCopy() {
      return new mergeBrowseHistory_result(this);
    }

    @Deprecated
    public mergeBrowseHistory_result clone() {
      return new mergeBrowseHistory_result(this);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      }
      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) {
      }
      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 mergeBrowseHistory_result)
        return this.equals((mergeBrowseHistory_result)that);
      return false;
    }

    public boolean equals(mergeBrowseHistory_result that) {
      if (that == null)
        return false;

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(mergeBrowseHistory_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      mergeBrowseHistory_result typedOther = (mergeBrowseHistory_result)other;

      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) {
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      oprot.writeStructBegin(STRUCT_DESC);

      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("mergeBrowseHistory_result(");
      boolean first = true;

      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

}