Subversion Repositories SmartDukaan

Rev

Rev 513 | Rev 571 | 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 {

    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 boolean addAddressForUser(long userId, Address address, long timestamp, 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 password) throws UserContextException, 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 TException;

    public boolean commitCart(long cartId) throws ShoppingCartException, TException;

    public boolean validateCart(long cartId) throws TException;

    public void mergeCart(long fromCartId, long toCartId) throws TException;

    public void addWidget(Widget widget) throws WidgetException, TException;

    public void addItemToWidget(long widget_id, List<Long> items) throws WidgetException, TException;

    public void deleteItemFromWidget(long widget_id, long item_id) throws WidgetException, TException;

    public void updateWidget(long widgetId, boolean enable) throws WidgetException, TException;

    public void updateWidgetItem(long widgetId, boolean enable) throws WidgetException, TException;

    public Widget getWidget(WidgetType type, long userId, boolean onlyEnabled) throws WidgetException, TException;

    public Widget getMyResearch(long user_id) throws WidgetException, TException;

    public boolean updateMyResearch(long user_id, long item_id) throws WidgetException, TException;

    public void deleteItemFromMyResearch(long user_id, long item_id) throws WidgetException, TException;

    public void updateRatings(long item_id, RatingType type, double rating, long user_id) throws TException;

    public RatingsWidget getRatings(long item_id, long user_id) throws WidgetException, TException;

    public void updateBrowseHistory(long user_id, long item_id, boolean isSessionId) throws TException;

    public Widget getBrowseHistory(long userId, boolean isSessionId) throws WidgetException, 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 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 boolean addAddressForUser(long userId, Address address, long timestamp, boolean setDefault) throws UserContextException, TException
    {
      send_addAddressForUser(userId, address, timestamp, setDefault);
      return recv_addAddressForUser();
    }

    public void send_addAddressForUser(long userId, Address address, long timestamp, 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.timestamp = timestamp;
      args.setDefault = setDefault;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public boolean 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 password) throws UserContextException, TException
    {
      send_updatePassword(userid, password);
      return recv_updatePassword();
    }

    public void send_updatePassword(long userid, String password) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("updatePassword", TMessageType.CALL, seqid_));
      updatePassword_args args = new updatePassword_args();
      args.userid = userid;
      args.password = password;
      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 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 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 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();
      return;
    }

    public boolean commitCart(long cartId) throws ShoppingCartException, TException
    {
      send_commitCart(cartId);
      return recv_commitCart();
    }

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

    public boolean recv_commitCart() throws ShoppingCartException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      commitCart_result result = new commitCart_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, "commitCart failed: unknown result");
    }

    public boolean validateCart(long cartId) throws 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 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;
      }
      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 void addWidget(Widget widget) throws WidgetException, TException
    {
      send_addWidget(widget);
      recv_addWidget();
    }

    public void send_addWidget(Widget widget) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("addWidget", TMessageType.CALL, seqid_));
      addWidget_args args = new addWidget_args();
      args.widget = widget;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

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

    public void addItemToWidget(long widget_id, List<Long> items) throws WidgetException, TException
    {
      send_addItemToWidget(widget_id, items);
      recv_addItemToWidget();
    }

    public void send_addItemToWidget(long widget_id, List<Long> items) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("addItemToWidget", TMessageType.CALL, seqid_));
      addItemToWidget_args args = new addItemToWidget_args();
      args.widget_id = widget_id;
      args.items = items;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

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

    public void deleteItemFromWidget(long widget_id, long item_id) throws WidgetException, TException
    {
      send_deleteItemFromWidget(widget_id, item_id);
      recv_deleteItemFromWidget();
    }

    public void send_deleteItemFromWidget(long widget_id, long item_id) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("deleteItemFromWidget", TMessageType.CALL, seqid_));
      deleteItemFromWidget_args args = new deleteItemFromWidget_args();
      args.widget_id = widget_id;
      args.item_id = item_id;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

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

    public void updateWidget(long widgetId, boolean enable) throws WidgetException, TException
    {
      send_updateWidget(widgetId, enable);
      recv_updateWidget();
    }

    public void send_updateWidget(long widgetId, boolean enable) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("updateWidget", TMessageType.CALL, seqid_));
      updateWidget_args args = new updateWidget_args();
      args.widgetId = widgetId;
      args.enable = enable;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

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

    public void updateWidgetItem(long widgetId, boolean enable) throws WidgetException, TException
    {
      send_updateWidgetItem(widgetId, enable);
      recv_updateWidgetItem();
    }

    public void send_updateWidgetItem(long widgetId, boolean enable) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("updateWidgetItem", TMessageType.CALL, seqid_));
      updateWidgetItem_args args = new updateWidgetItem_args();
      args.widgetId = widgetId;
      args.enable = enable;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

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

    public Widget getWidget(WidgetType type, long userId, boolean onlyEnabled) throws WidgetException, TException
    {
      send_getWidget(type, userId, onlyEnabled);
      return recv_getWidget();
    }

    public void send_getWidget(WidgetType type, long userId, boolean onlyEnabled) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("getWidget", TMessageType.CALL, seqid_));
      getWidget_args args = new getWidget_args();
      args.type = type;
      args.userId = userId;
      args.onlyEnabled = onlyEnabled;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public Widget recv_getWidget() throws WidgetException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      getWidget_result result = new getWidget_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, "getWidget failed: unknown result");
    }

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

    public void send_getMyResearch(long user_id) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("getMyResearch", TMessageType.CALL, seqid_));
      getMyResearch_args args = new getMyResearch_args();
      args.user_id = user_id;
      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 user_id, long item_id) throws WidgetException, TException
    {
      send_updateMyResearch(user_id, item_id);
      return recv_updateMyResearch();
    }

    public void send_updateMyResearch(long user_id, long item_id) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("updateMyResearch", TMessageType.CALL, seqid_));
      updateMyResearch_args args = new updateMyResearch_args();
      args.user_id = user_id;
      args.item_id = item_id;
      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 user_id, long item_id) throws WidgetException, TException
    {
      send_deleteItemFromMyResearch(user_id, item_id);
      recv_deleteItemFromMyResearch();
    }

    public void send_deleteItemFromMyResearch(long user_id, long item_id) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("deleteItemFromMyResearch", TMessageType.CALL, seqid_));
      deleteItemFromMyResearch_args args = new deleteItemFromMyResearch_args();
      args.user_id = user_id;
      args.item_id = item_id;
      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 updateRatings(long item_id, RatingType type, double rating, long user_id) throws TException
    {
      send_updateRatings(item_id, type, rating, user_id);
      recv_updateRatings();
    }

    public void send_updateRatings(long item_id, RatingType type, double rating, long user_id) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("updateRatings", TMessageType.CALL, seqid_));
      updateRatings_args args = new updateRatings_args();
      args.item_id = item_id;
      args.type = type;
      args.rating = rating;
      args.user_id = user_id;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

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

    public RatingsWidget getRatings(long item_id, long user_id) throws WidgetException, TException
    {
      send_getRatings(item_id, user_id);
      return recv_getRatings();
    }

    public void send_getRatings(long item_id, long user_id) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("getRatings", TMessageType.CALL, seqid_));
      getRatings_args args = new getRatings_args();
      args.item_id = item_id;
      args.user_id = user_id;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public RatingsWidget recv_getRatings() throws WidgetException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      getRatings_result result = new getRatings_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, "getRatings failed: unknown result");
    }

    public void updateBrowseHistory(long user_id, long item_id, boolean isSessionId) throws TException
    {
      send_updateBrowseHistory(user_id, item_id, isSessionId);
      recv_updateBrowseHistory();
    }

    public void send_updateBrowseHistory(long user_id, long item_id, boolean isSessionId) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("updateBrowseHistory", TMessageType.CALL, seqid_));
      updateBrowseHistory_args args = new updateBrowseHistory_args();
      args.user_id = user_id;
      args.item_id = item_id;
      args.isSessionId = isSessionId;
      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, boolean isSessionId) throws WidgetException, TException
    {
      send_getBrowseHistory(userId, isSessionId);
      return recv_getBrowseHistory();
    }

    public void send_getBrowseHistory(long userId, boolean isSessionId) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("getBrowseHistory", TMessageType.CALL, seqid_));
      getBrowseHistory_args args = new getBrowseHistory_args();
      args.userId = userId;
      args.isSessionId = isSessionId;
      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 static class Processor implements TProcessor {
    private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName());
    public Processor(Iface iface)
    {
      iface_ = iface;
      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("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("commitCart", new commitCart());
      processMap_.put("validateCart", new validateCart());
      processMap_.put("mergeCart", new mergeCart());
      processMap_.put("addWidget", new addWidget());
      processMap_.put("addItemToWidget", new addItemToWidget());
      processMap_.put("deleteItemFromWidget", new deleteItemFromWidget());
      processMap_.put("updateWidget", new updateWidget());
      processMap_.put("updateWidgetItem", new updateWidgetItem());
      processMap_.put("getWidget", new getWidget());
      processMap_.put("getMyResearch", new getMyResearch());
      processMap_.put("updateMyResearch", new updateMyResearch());
      processMap_.put("deleteItemFromMyResearch", new deleteItemFromMyResearch());
      processMap_.put("updateRatings", new updateRatings());
      processMap_.put("getRatings", new getRatings());
      processMap_.put("updateBrowseHistory", new updateBrowseHistory());
      processMap_.put("getBrowseHistory", new getBrowseHistory());
    }

    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 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.timestamp, 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.password);
          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 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();
        iface_.addAddressToCart(args.cartId, args.addressId);
        oprot.writeMessageBegin(new TMessage("addAddressToCart", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

    private class commitCart implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        commitCart_args args = new commitCart_args();
        args.read(iprot);
        iprot.readMessageEnd();
        commitCart_result result = new commitCart_result();
        try {
          result.success = iface_.commitCart(args.cartId);
          result.setSuccessIsSet(true);
        } catch (ShoppingCartException scx) {
          result.scx = scx;
        } catch (Throwable th) {
          LOGGER.error("Internal error processing commitCart", th);
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing commitCart");
          oprot.writeMessageBegin(new TMessage("commitCart", TMessageType.EXCEPTION, seqid));
          x.write(oprot);
          oprot.writeMessageEnd();
          oprot.getTransport().flush();
          return;
        }
        oprot.writeMessageBegin(new TMessage("commitCart", 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();
        result.success = iface_.validateCart(args.cartId);
        result.setSuccessIsSet(true);
        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 addWidget implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        addWidget_args args = new addWidget_args();
        args.read(iprot);
        iprot.readMessageEnd();
        addWidget_result result = new addWidget_result();
        try {
          iface_.addWidget(args.widget);
        } catch (WidgetException scx) {
          result.scx = scx;
        } catch (Throwable th) {
          LOGGER.error("Internal error processing addWidget", th);
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing addWidget");
          oprot.writeMessageBegin(new TMessage("addWidget", TMessageType.EXCEPTION, seqid));
          x.write(oprot);
          oprot.writeMessageEnd();
          oprot.getTransport().flush();
          return;
        }
        oprot.writeMessageBegin(new TMessage("addWidget", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

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

    }

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

    }

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

    }

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

    }

    private class getWidget implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        getWidget_args args = new getWidget_args();
        args.read(iprot);
        iprot.readMessageEnd();
        getWidget_result result = new getWidget_result();
        try {
          result.success = iface_.getWidget(args.type, args.userId, args.onlyEnabled);
        } catch (WidgetException scx) {
          result.scx = scx;
        } catch (Throwable th) {
          LOGGER.error("Internal error processing getWidget", th);
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing getWidget");
          oprot.writeMessageBegin(new TMessage("getWidget", TMessageType.EXCEPTION, seqid));
          x.write(oprot);
          oprot.writeMessageEnd();
          oprot.getTransport().flush();
          return;
        }
        oprot.writeMessageBegin(new TMessage("getWidget", 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.user_id);
        } 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.user_id, args.item_id);
          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.user_id, args.item_id);
        } 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 updateRatings implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        updateRatings_args args = new updateRatings_args();
        args.read(iprot);
        iprot.readMessageEnd();
        updateRatings_result result = new updateRatings_result();
        iface_.updateRatings(args.item_id, args.type, args.rating, args.user_id);
        oprot.writeMessageBegin(new TMessage("updateRatings", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

    private class getRatings implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        getRatings_args args = new getRatings_args();
        args.read(iprot);
        iprot.readMessageEnd();
        getRatings_result result = new getRatings_result();
        try {
          result.success = iface_.getRatings(args.item_id, args.user_id);
        } catch (WidgetException scx) {
          result.scx = scx;
        } catch (Throwable th) {
          LOGGER.error("Internal error processing getRatings", th);
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing getRatings");
          oprot.writeMessageBegin(new TMessage("getRatings", TMessageType.EXCEPTION, seqid));
          x.write(oprot);
          oprot.writeMessageEnd();
          oprot.getTransport().flush();
          return;
        }
        oprot.writeMessageBegin(new TMessage("getRatings", 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.user_id, args.item_id, args.isSessionId);
        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, args.isSessionId);
        } 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();
      }

    }

  }

  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   {
    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 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   {
    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 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   {
    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 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   {
    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 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   {
    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 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   {
    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 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   {
    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 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 TIMESTAMP_FIELD_DESC = new TField("timestamp", TType.I64, (short)3);
    private static final TField SET_DEFAULT_FIELD_DESC = new TField("setDefault", TType.BOOL, (short)4);

    private long userId;
    private Address address;
    private long timestamp;
    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"),
      TIMESTAMP((short)3, "timestamp"),
      SET_DEFAULT((short)4, "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 __TIMESTAMP_ISSET_ID = 1;
    private static final int __SETDEFAULT_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.ADDRESS, new FieldMetaData("address", TFieldRequirementType.DEFAULT, 
          new StructMetaData(TType.STRUCT, Address.class)));
      put(_Fields.TIMESTAMP, new FieldMetaData("timestamp", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
      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,
      long timestamp,
      boolean setDefault)
    {
      this();
      this.userId = userId;
      setUserIdIsSet(true);
      this.address = address;
      this.timestamp = timestamp;
      setTimestampIsSet(true);
      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.timestamp = other.timestamp;
      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 long getTimestamp() {
      return this.timestamp;
    }

    public addAddressForUser_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 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 TIMESTAMP:
        if (value == null) {
          unsetTimestamp();
        } else {
          setTimestamp((Long)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 TIMESTAMP:
        return new Long(getTimestamp());

      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 TIMESTAMP:
        return isSetTimestamp();
      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_timestamp = true;
      boolean that_present_timestamp = true;
      if (this_present_timestamp || that_present_timestamp) {
        if (!(this_present_timestamp && that_present_timestamp))
          return false;
        if (this.timestamp != that.timestamp)
          return false;
      }

      boolean this_present_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(isSetTimestamp()).compareTo(isSetTimestamp());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(timestamp, typedOther.timestamp);
      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 TIMESTAMP:
              if (field.type == TType.I64) {
                this.timestamp = iprot.readI64();
                setTimestampIsSet(true);
              } 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(TIMESTAMP_FIELD_DESC);
      oprot.writeI64(this.timestamp);
      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("timestamp:");
      sb.append(this.timestamp);
      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.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(addAddressForUser_result.class, metaDataMap);
    }

    public addAddressForUser_result() {
    }

    public addAddressForUser_result(
      boolean 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 boolean isSuccess() {
      return this.success;
    }

    public addAddressForUser_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 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((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 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.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("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 PASSWORD_FIELD_DESC = new TField("password", TType.STRING, (short)2);

    private long userid;
    private String password;

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

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

    public updatePassword_args() {
    }

    public updatePassword_args(
      long userid,
      String password)
    {
      this();
      this.userid = userid;
      setUseridIsSet(true);
      this.password = password;
    }

    /**
     * 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.isSetPassword()) {
        this.password = other.password;
      }
    }

    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 getPassword() {
      return this.password;
    }

    public updatePassword_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 USERID:
        if (value == null) {
          unsetUserid();
        } else {
          setUserid((Long)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 USERID:
        return new Long(getUserid());

      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 USERID:
        return isSetUserid();
      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 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_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(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(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 USERID:
              if (field.type == TType.I64) {
                this.userid = iprot.readI64();
                setUseridIsSet(true);
              } 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);
      oprot.writeFieldBegin(USERID_FIELD_DESC);
      oprot.writeI64(this.userid);
      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("updatePassword_args(");
      boolean first = true;

      sb.append("userid:");
      sb.append(this.userid);
      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 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 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 _list25 = iprot.readListBegin();
                  this.success = new ArrayList<Cart>(_list25.size);
                  for (int _i26 = 0; _i26 < _list25.size; ++_i26)
                  {
                    Cart _elem27;
                    _elem27 = new Cart();
                    _elem27.read(iprot);
                    this.success.add(_elem27);
                  }
                  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 _iter28 : this.success)
          {
            _iter28.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 _list29 = iprot.readListBegin();
                  this.success = new ArrayList<Cart>(_list29.size);
                  for (int _i30 = 0; _i30 < _list29.size; ++_i30)
                  {
                    Cart _elem31;
                    _elem31 = new Cart();
                    _elem31.read(iprot);
                    this.success.add(_elem31);
                  }
                  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 _iter32 : this.success)
          {
            _iter32.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 _list33 = iprot.readListBegin();
                  this.success = new ArrayList<Cart>(_list33.size);
                  for (int _i34 = 0; _i34 < _list33.size; ++_i34)
                  {
                    Cart _elem35;
                    _elem35 = new Cart();
                    _elem35.read(iprot);
                    this.success.add(_elem35);
                  }
                  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 _iter36 : this.success)
          {
            _iter36.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");



    /** 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(addAddressToCart_result.class, metaDataMap);
    }

    public addAddressToCart_result() {
    }

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

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

    @Deprecated
    public addAddressToCart_result clone() {
      return new addAddressToCart_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 addAddressToCart_result)
        return this.equals((addAddressToCart_result)that);
      return false;
    }

    public boolean equals(addAddressToCart_result that) {
      if (that == null)
        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;

      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("addAddressToCart_result(");
      boolean first = true;

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

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

  }

  public static class commitCart_args implements TBase<commitCart_args._Fields>, java.io.Serializable, Cloneable, Comparable<commitCart_args>   {
    private static final TStruct STRUCT_DESC = new TStruct("commitCart_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(commitCart_args.class, metaDataMap);
    }

    public commitCart_args() {
    }

    public commitCart_args(
      long cartId)
    {
      this();
      this.cartId = cartId;
      setCartIdIsSet(true);
    }

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

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

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

    public long getCartId() {
      return this.cartId;
    }

    public commitCart_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 commitCart_args)
        return this.equals((commitCart_args)that);
      return false;
    }

    public boolean equals(commitCart_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(commitCart_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      commitCart_args typedOther = (commitCart_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("commitCart_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 commitCart_result implements TBase<commitCart_result._Fields>, java.io.Serializable, Cloneable, Comparable<commitCart_result>   {
    private static final TStruct STRUCT_DESC = new TStruct("commitCart_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 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.BOOL)));
      put(_Fields.SCX, new FieldMetaData("scx", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

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

    public commitCart_result() {
    }

    public commitCart_result(
      boolean success,
      ShoppingCartException scx)
    {
      this();
      this.success = success;
      setSuccessIsSet(true);
      this.scx = scx;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public commitCart_result(commitCart_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 commitCart_result deepCopy() {
      return new commitCart_result(this);
    }

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

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

    public commitCart_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 getScx() {
      return this.scx;
    }

    public commitCart_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((Boolean)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 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 commitCart_result)
        return this.equals((commitCart_result)that);
      return false;
    }

    public boolean equals(commitCart_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(commitCart_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      commitCart_result typedOther = (commitCart_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 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.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("commitCart_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 boolean success;

    /** 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");

      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)));
    }});

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

    public validateCart_result() {
    }

    public validateCart_result(
      boolean success)
    {
      this();
      this.success = success;
      setSuccessIsSet(true);
    }

    /**
     * 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;
    }

    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 void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((Boolean)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());

      }
      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();
      }
      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;
      }

      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;
      }
      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;
          }
          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();
      }
      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;
      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 addWidget_args implements TBase<addWidget_args._Fields>, java.io.Serializable, Cloneable, Comparable<addWidget_args>   {
    private static final TStruct STRUCT_DESC = new TStruct("addWidget_args");

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

    private Widget widget;

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

      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.WIDGET, new FieldMetaData("widget", TFieldRequirementType.DEFAULT, 
          new StructMetaData(TType.STRUCT, Widget.class)));
    }});

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

    public addWidget_args() {
    }

    public addWidget_args(
      Widget widget)
    {
      this();
      this.widget = widget;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public addWidget_args(addWidget_args other) {
      if (other.isSetWidget()) {
        this.widget = new Widget(other.widget);
      }
    }

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

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

    public Widget getWidget() {
      return this.widget;
    }

    public addWidget_args setWidget(Widget widget) {
      this.widget = widget;
      return this;
    }

    public void unsetWidget() {
      this.widget = null;
    }

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

    public void setWidgetIsSet(boolean value) {
      if (!value) {
        this.widget = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case WIDGET:
        if (value == null) {
          unsetWidget();
        } else {
          setWidget((Widget)value);
        }
        break;

      }
    }

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

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case WIDGET:
        return getWidget();

      }
      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 WIDGET:
        return isSetWidget();
      }
      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 addWidget_args)
        return this.equals((addWidget_args)that);
      return false;
    }

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

      boolean this_present_widget = true && this.isSetWidget();
      boolean that_present_widget = true && that.isSetWidget();
      if (this_present_widget || that_present_widget) {
        if (!(this_present_widget && that_present_widget))
          return false;
        if (!this.widget.equals(that.widget))
          return false;
      }

      return true;
    }

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

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

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

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

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

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

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

  }

  public static class addWidget_result implements TBase<addWidget_result._Fields>, java.io.Serializable, Cloneable, Comparable<addWidget_result>   {
    private static final TStruct STRUCT_DESC = new TStruct("addWidget_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(addWidget_result.class, metaDataMap);
    }

    public addWidget_result() {
    }

    public addWidget_result(
      WidgetException scx)
    {
      this();
      this.scx = scx;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public addWidget_result(addWidget_result other) {
      if (other.isSetScx()) {
        this.scx = new WidgetException(other.scx);
      }
    }

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

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

    public WidgetException getScx() {
      return this.scx;
    }

    public addWidget_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 addWidget_result)
        return this.equals((addWidget_result)that);
      return false;
    }

    public boolean equals(addWidget_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(addWidget_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      addWidget_result typedOther = (addWidget_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("addWidget_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 addItemToWidget_args implements TBase<addItemToWidget_args._Fields>, java.io.Serializable, Cloneable, Comparable<addItemToWidget_args>   {
    private static final TStruct STRUCT_DESC = new TStruct("addItemToWidget_args");

    private static final TField WIDGET_ID_FIELD_DESC = new TField("widget_id", TType.I64, (short)1);
    private static final TField ITEMS_FIELD_DESC = new TField("items", TType.LIST, (short)2);

    private long widget_id;
    private List<Long> items;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      WIDGET_ID((short)1, "widget_id"),
      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 __WIDGET_ID_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.WIDGET_ID, new FieldMetaData("widget_id", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
      put(_Fields.ITEMS, new FieldMetaData("items", TFieldRequirementType.DEFAULT, 
          new ListMetaData(TType.LIST, 
              new FieldValueMetaData(TType.I64))));
    }});

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

    public addItemToWidget_args() {
    }

    public addItemToWidget_args(
      long widget_id,
      List<Long> items)
    {
      this();
      this.widget_id = widget_id;
      setWidget_idIsSet(true);
      this.items = items;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public addItemToWidget_args(addItemToWidget_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.widget_id = other.widget_id;
      if (other.isSetItems()) {
        List<Long> __this__items = new ArrayList<Long>();
        for (Long other_element : other.items) {
          __this__items.add(other_element);
        }
        this.items = __this__items;
      }
    }

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

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

    public long getWidget_id() {
      return this.widget_id;
    }

    public addItemToWidget_args setWidget_id(long widget_id) {
      this.widget_id = widget_id;
      setWidget_idIsSet(true);
      return this;
    }

    public void unsetWidget_id() {
      __isset_bit_vector.clear(__WIDGET_ID_ISSET_ID);
    }

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

    public void setWidget_idIsSet(boolean value) {
      __isset_bit_vector.set(__WIDGET_ID_ISSET_ID, value);
    }

    public int getItemsSize() {
      return (this.items == null) ? 0 : this.items.size();
    }

    public java.util.Iterator<Long> getItemsIterator() {
      return (this.items == null) ? null : this.items.iterator();
    }

    public void addToItems(long elem) {
      if (this.items == null) {
        this.items = new ArrayList<Long>();
      }
      this.items.add(elem);
    }

    public List<Long> getItems() {
      return this.items;
    }

    public addItemToWidget_args setItems(List<Long> 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 WIDGET_ID:
        if (value == null) {
          unsetWidget_id();
        } else {
          setWidget_id((Long)value);
        }
        break;

      case ITEMS:
        if (value == null) {
          unsetItems();
        } else {
          setItems((List<Long>)value);
        }
        break;

      }
    }

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

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case WIDGET_ID:
        return new Long(getWidget_id());

      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 WIDGET_ID:
        return isSetWidget_id();
      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 addItemToWidget_args)
        return this.equals((addItemToWidget_args)that);
      return false;
    }

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

      boolean this_present_widget_id = true;
      boolean that_present_widget_id = true;
      if (this_present_widget_id || that_present_widget_id) {
        if (!(this_present_widget_id && that_present_widget_id))
          return false;
        if (this.widget_id != that.widget_id)
          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 int compareTo(addItemToWidget_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

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

      lastComparison = Boolean.valueOf(isSetWidget_id()).compareTo(isSetWidget_id());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(widget_id, typedOther.widget_id);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetItems()).compareTo(isSetItems());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(items, typedOther.items);
      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 WIDGET_ID:
              if (field.type == TType.I64) {
                this.widget_id = iprot.readI64();
                setWidget_idIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case ITEMS:
              if (field.type == TType.LIST) {
                {
                  TList _list37 = iprot.readListBegin();
                  this.items = new ArrayList<Long>(_list37.size);
                  for (int _i38 = 0; _i38 < _list37.size; ++_i38)
                  {
                    long _elem39;
                    _elem39 = iprot.readI64();
                    this.items.add(_elem39);
                  }
                  iprot.readListEnd();
                }
              } 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(WIDGET_ID_FIELD_DESC);
      oprot.writeI64(this.widget_id);
      oprot.writeFieldEnd();
      if (this.items != null) {
        oprot.writeFieldBegin(ITEMS_FIELD_DESC);
        {
          oprot.writeListBegin(new TList(TType.I64, this.items.size()));
          for (long _iter40 : this.items)
          {
            oprot.writeI64(_iter40);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

      sb.append("widget_id:");
      sb.append(this.widget_id);
      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 addItemToWidget_result implements TBase<addItemToWidget_result._Fields>, java.io.Serializable, Cloneable, Comparable<addItemToWidget_result>   {
    private static final TStruct STRUCT_DESC = new TStruct("addItemToWidget_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(addItemToWidget_result.class, metaDataMap);
    }

    public addItemToWidget_result() {
    }

    public addItemToWidget_result(
      WidgetException scx)
    {
      this();
      this.scx = scx;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public addItemToWidget_result(addItemToWidget_result other) {
      if (other.isSetScx()) {
        this.scx = new WidgetException(other.scx);
      }
    }

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

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

    public WidgetException getScx() {
      return this.scx;
    }

    public addItemToWidget_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 addItemToWidget_result)
        return this.equals((addItemToWidget_result)that);
      return false;
    }

    public boolean equals(addItemToWidget_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(addItemToWidget_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      addItemToWidget_result typedOther = (addItemToWidget_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("addItemToWidget_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 deleteItemFromWidget_args implements TBase<deleteItemFromWidget_args._Fields>, java.io.Serializable, Cloneable, Comparable<deleteItemFromWidget_args>   {
    private static final TStruct STRUCT_DESC = new TStruct("deleteItemFromWidget_args");

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

    private long widget_id;
    private long item_id;

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

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

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

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

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

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

      private final short _thriftId;
      private final String _fieldName;

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

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

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

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

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

    public deleteItemFromWidget_args() {
    }

    public deleteItemFromWidget_args(
      long widget_id,
      long item_id)
    {
      this();
      this.widget_id = widget_id;
      setWidget_idIsSet(true);
      this.item_id = item_id;
      setItem_idIsSet(true);
    }

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

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

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

    public long getWidget_id() {
      return this.widget_id;
    }

    public deleteItemFromWidget_args setWidget_id(long widget_id) {
      this.widget_id = widget_id;
      setWidget_idIsSet(true);
      return this;
    }

    public void unsetWidget_id() {
      __isset_bit_vector.clear(__WIDGET_ID_ISSET_ID);
    }

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

    public void setWidget_idIsSet(boolean value) {
      __isset_bit_vector.set(__WIDGET_ID_ISSET_ID, value);
    }

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

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

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

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

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

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case WIDGET_ID:
        if (value == null) {
          unsetWidget_id();
        } else {
          setWidget_id((Long)value);
        }
        break;

      case ITEM_ID:
        if (value == null) {
          unsetItem_id();
        } else {
          setItem_id((Long)value);
        }
        break;

      }
    }

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

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case WIDGET_ID:
        return new Long(getWidget_id());

      case ITEM_ID:
        return new Long(getItem_id());

      }
      throw new IllegalStateException();
    }

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

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

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

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

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

      boolean this_present_widget_id = true;
      boolean that_present_widget_id = true;
      if (this_present_widget_id || that_present_widget_id) {
        if (!(this_present_widget_id && that_present_widget_id))
          return false;
        if (this.widget_id != that.widget_id)
          return false;
      }

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

      return true;
    }

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

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

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

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

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

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

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

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

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

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

  }

  public static class deleteItemFromWidget_result implements TBase<deleteItemFromWidget_result._Fields>, java.io.Serializable, Cloneable, Comparable<deleteItemFromWidget_result>   {
    private static final TStruct STRUCT_DESC = new TStruct("deleteItemFromWidget_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(deleteItemFromWidget_result.class, metaDataMap);
    }

    public deleteItemFromWidget_result() {
    }

    public deleteItemFromWidget_result(
      WidgetException scx)
    {
      this();
      this.scx = scx;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public deleteItemFromWidget_result(deleteItemFromWidget_result other) {
      if (other.isSetScx()) {
        this.scx = new WidgetException(other.scx);
      }
    }

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

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

    public WidgetException getScx() {
      return this.scx;
    }

    public deleteItemFromWidget_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 deleteItemFromWidget_result)
        return this.equals((deleteItemFromWidget_result)that);
      return false;
    }

    public boolean equals(deleteItemFromWidget_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(deleteItemFromWidget_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      deleteItemFromWidget_result typedOther = (deleteItemFromWidget_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("deleteItemFromWidget_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 updateWidget_args implements TBase<updateWidget_args._Fields>, java.io.Serializable, Cloneable, Comparable<updateWidget_args>   {
    private static final TStruct STRUCT_DESC = new TStruct("updateWidget_args");

    private static final TField WIDGET_ID_FIELD_DESC = new TField("widgetId", TType.I64, (short)1);
    private static final TField ENABLE_FIELD_DESC = new TField("enable", TType.BOOL, (short)2);

    private long widgetId;
    private boolean enable;

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

      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 __WIDGETID_ISSET_ID = 0;
    private static final int __ENABLE_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.WIDGET_ID, new FieldMetaData("widgetId", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
      put(_Fields.ENABLE, new FieldMetaData("enable", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.BOOL)));
    }});

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

    public updateWidget_args() {
    }

    public updateWidget_args(
      long widgetId,
      boolean enable)
    {
      this();
      this.widgetId = widgetId;
      setWidgetIdIsSet(true);
      this.enable = enable;
      setEnableIsSet(true);
    }

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

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

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

    public long getWidgetId() {
      return this.widgetId;
    }

    public updateWidget_args setWidgetId(long widgetId) {
      this.widgetId = widgetId;
      setWidgetIdIsSet(true);
      return this;
    }

    public void unsetWidgetId() {
      __isset_bit_vector.clear(__WIDGETID_ISSET_ID);
    }

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

    public void setWidgetIdIsSet(boolean value) {
      __isset_bit_vector.set(__WIDGETID_ISSET_ID, value);
    }

    public boolean isEnable() {
      return this.enable;
    }

    public updateWidget_args setEnable(boolean enable) {
      this.enable = enable;
      setEnableIsSet(true);
      return this;
    }

    public void unsetEnable() {
      __isset_bit_vector.clear(__ENABLE_ISSET_ID);
    }

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

    public void setEnableIsSet(boolean value) {
      __isset_bit_vector.set(__ENABLE_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case WIDGET_ID:
        if (value == null) {
          unsetWidgetId();
        } else {
          setWidgetId((Long)value);
        }
        break;

      case ENABLE:
        if (value == null) {
          unsetEnable();
        } else {
          setEnable((Boolean)value);
        }
        break;

      }
    }

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

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case WIDGET_ID:
        return new Long(getWidgetId());

      case ENABLE:
        return new Boolean(isEnable());

      }
      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 WIDGET_ID:
        return isSetWidgetId();
      case ENABLE:
        return isSetEnable();
      }
      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 updateWidget_args)
        return this.equals((updateWidget_args)that);
      return false;
    }

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

      boolean this_present_widgetId = true;
      boolean that_present_widgetId = true;
      if (this_present_widgetId || that_present_widgetId) {
        if (!(this_present_widgetId && that_present_widgetId))
          return false;
        if (this.widgetId != that.widgetId)
          return false;
      }

      boolean this_present_enable = true;
      boolean that_present_enable = true;
      if (this_present_enable || that_present_enable) {
        if (!(this_present_enable && that_present_enable))
          return false;
        if (this.enable != that.enable)
          return false;
      }

      return true;
    }

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

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

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

      lastComparison = Boolean.valueOf(isSetWidgetId()).compareTo(isSetWidgetId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(widgetId, typedOther.widgetId);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetEnable()).compareTo(isSetEnable());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(enable, typedOther.enable);
      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 WIDGET_ID:
              if (field.type == TType.I64) {
                this.widgetId = iprot.readI64();
                setWidgetIdIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case ENABLE:
              if (field.type == TType.BOOL) {
                this.enable = iprot.readBool();
                setEnableIsSet(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(WIDGET_ID_FIELD_DESC);
      oprot.writeI64(this.widgetId);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(ENABLE_FIELD_DESC);
      oprot.writeBool(this.enable);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

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

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

  }

  public static class updateWidget_result implements TBase<updateWidget_result._Fields>, java.io.Serializable, Cloneable, Comparable<updateWidget_result>   {
    private static final TStruct STRUCT_DESC = new TStruct("updateWidget_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(updateWidget_result.class, metaDataMap);
    }

    public updateWidget_result() {
    }

    public updateWidget_result(
      WidgetException scx)
    {
      this();
      this.scx = scx;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public updateWidget_result(updateWidget_result other) {
      if (other.isSetScx()) {
        this.scx = new WidgetException(other.scx);
      }
    }

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

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

    public WidgetException getScx() {
      return this.scx;
    }

    public updateWidget_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 updateWidget_result)
        return this.equals((updateWidget_result)that);
      return false;
    }

    public boolean equals(updateWidget_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(updateWidget_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      updateWidget_result typedOther = (updateWidget_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("updateWidget_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 updateWidgetItem_args implements TBase<updateWidgetItem_args._Fields>, java.io.Serializable, Cloneable, Comparable<updateWidgetItem_args>   {
    private static final TStruct STRUCT_DESC = new TStruct("updateWidgetItem_args");

    private static final TField WIDGET_ID_FIELD_DESC = new TField("widgetId", TType.I64, (short)1);
    private static final TField ENABLE_FIELD_DESC = new TField("enable", TType.BOOL, (short)2);

    private long widgetId;
    private boolean enable;

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

      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 __WIDGETID_ISSET_ID = 0;
    private static final int __ENABLE_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.WIDGET_ID, new FieldMetaData("widgetId", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
      put(_Fields.ENABLE, new FieldMetaData("enable", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.BOOL)));
    }});

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

    public updateWidgetItem_args() {
    }

    public updateWidgetItem_args(
      long widgetId,
      boolean enable)
    {
      this();
      this.widgetId = widgetId;
      setWidgetIdIsSet(true);
      this.enable = enable;
      setEnableIsSet(true);
    }

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

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

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

    public long getWidgetId() {
      return this.widgetId;
    }

    public updateWidgetItem_args setWidgetId(long widgetId) {
      this.widgetId = widgetId;
      setWidgetIdIsSet(true);
      return this;
    }

    public void unsetWidgetId() {
      __isset_bit_vector.clear(__WIDGETID_ISSET_ID);
    }

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

    public void setWidgetIdIsSet(boolean value) {
      __isset_bit_vector.set(__WIDGETID_ISSET_ID, value);
    }

    public boolean isEnable() {
      return this.enable;
    }

    public updateWidgetItem_args setEnable(boolean enable) {
      this.enable = enable;
      setEnableIsSet(true);
      return this;
    }

    public void unsetEnable() {
      __isset_bit_vector.clear(__ENABLE_ISSET_ID);
    }

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

    public void setEnableIsSet(boolean value) {
      __isset_bit_vector.set(__ENABLE_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case WIDGET_ID:
        if (value == null) {
          unsetWidgetId();
        } else {
          setWidgetId((Long)value);
        }
        break;

      case ENABLE:
        if (value == null) {
          unsetEnable();
        } else {
          setEnable((Boolean)value);
        }
        break;

      }
    }

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

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case WIDGET_ID:
        return new Long(getWidgetId());

      case ENABLE:
        return new Boolean(isEnable());

      }
      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 WIDGET_ID:
        return isSetWidgetId();
      case ENABLE:
        return isSetEnable();
      }
      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 updateWidgetItem_args)
        return this.equals((updateWidgetItem_args)that);
      return false;
    }

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

      boolean this_present_widgetId = true;
      boolean that_present_widgetId = true;
      if (this_present_widgetId || that_present_widgetId) {
        if (!(this_present_widgetId && that_present_widgetId))
          return false;
        if (this.widgetId != that.widgetId)
          return false;
      }

      boolean this_present_enable = true;
      boolean that_present_enable = true;
      if (this_present_enable || that_present_enable) {
        if (!(this_present_enable && that_present_enable))
          return false;
        if (this.enable != that.enable)
          return false;
      }

      return true;
    }

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

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

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

      lastComparison = Boolean.valueOf(isSetWidgetId()).compareTo(isSetWidgetId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(widgetId, typedOther.widgetId);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetEnable()).compareTo(isSetEnable());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(enable, typedOther.enable);
      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 WIDGET_ID:
              if (field.type == TType.I64) {
                this.widgetId = iprot.readI64();
                setWidgetIdIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case ENABLE:
              if (field.type == TType.BOOL) {
                this.enable = iprot.readBool();
                setEnableIsSet(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(WIDGET_ID_FIELD_DESC);
      oprot.writeI64(this.widgetId);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(ENABLE_FIELD_DESC);
      oprot.writeBool(this.enable);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

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

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

  }

  public static class updateWidgetItem_result implements TBase<updateWidgetItem_result._Fields>, java.io.Serializable, Cloneable, Comparable<updateWidgetItem_result>   {
    private static final TStruct STRUCT_DESC = new TStruct("updateWidgetItem_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(updateWidgetItem_result.class, metaDataMap);
    }

    public updateWidgetItem_result() {
    }

    public updateWidgetItem_result(
      WidgetException scx)
    {
      this();
      this.scx = scx;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public updateWidgetItem_result(updateWidgetItem_result other) {
      if (other.isSetScx()) {
        this.scx = new WidgetException(other.scx);
      }
    }

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

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

    public WidgetException getScx() {
      return this.scx;
    }

    public updateWidgetItem_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 updateWidgetItem_result)
        return this.equals((updateWidgetItem_result)that);
      return false;
    }

    public boolean equals(updateWidgetItem_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(updateWidgetItem_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      updateWidgetItem_result typedOther = (updateWidgetItem_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("updateWidgetItem_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 getWidget_args implements TBase<getWidget_args._Fields>, java.io.Serializable, Cloneable, Comparable<getWidget_args>   {
    private static final TStruct STRUCT_DESC = new TStruct("getWidget_args");

    private static final TField TYPE_FIELD_DESC = new TField("type", TType.I32, (short)1);
    private static final TField USER_ID_FIELD_DESC = new TField("userId", TType.I64, (short)2);
    private static final TField ONLY_ENABLED_FIELD_DESC = new TField("onlyEnabled", TType.BOOL, (short)3);

    private WidgetType type;
    private long userId;
    private boolean onlyEnabled;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      /**
       * 
       * @see WidgetType
       */
      TYPE((short)1, "type"),
      USER_ID((short)2, "userId"),
      ONLY_ENABLED((short)3, "onlyEnabled");

      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 __ONLYENABLED_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.TYPE, new FieldMetaData("type", TFieldRequirementType.DEFAULT, 
          new EnumMetaData(TType.ENUM, WidgetType.class)));
      put(_Fields.USER_ID, new FieldMetaData("userId", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
      put(_Fields.ONLY_ENABLED, new FieldMetaData("onlyEnabled", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.BOOL)));
    }});

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

    public getWidget_args() {
    }

    public getWidget_args(
      WidgetType type,
      long userId,
      boolean onlyEnabled)
    {
      this();
      this.type = type;
      this.userId = userId;
      setUserIdIsSet(true);
      this.onlyEnabled = onlyEnabled;
      setOnlyEnabledIsSet(true);
    }

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

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

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

    /**
     * 
     * @see WidgetType
     */
    public WidgetType getType() {
      return this.type;
    }

    /**
     * 
     * @see WidgetType
     */
    public getWidget_args setType(WidgetType type) {
      this.type = type;
      return this;
    }

    public void unsetType() {
      this.type = null;
    }

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

    public void setTypeIsSet(boolean value) {
      if (!value) {
        this.type = null;
      }
    }

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

    public getWidget_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 boolean isOnlyEnabled() {
      return this.onlyEnabled;
    }

    public getWidget_args setOnlyEnabled(boolean onlyEnabled) {
      this.onlyEnabled = onlyEnabled;
      setOnlyEnabledIsSet(true);
      return this;
    }

    public void unsetOnlyEnabled() {
      __isset_bit_vector.clear(__ONLYENABLED_ISSET_ID);
    }

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

    public void setOnlyEnabledIsSet(boolean value) {
      __isset_bit_vector.set(__ONLYENABLED_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case TYPE:
        if (value == null) {
          unsetType();
        } else {
          setType((WidgetType)value);
        }
        break;

      case USER_ID:
        if (value == null) {
          unsetUserId();
        } else {
          setUserId((Long)value);
        }
        break;

      case ONLY_ENABLED:
        if (value == null) {
          unsetOnlyEnabled();
        } else {
          setOnlyEnabled((Boolean)value);
        }
        break;

      }
    }

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

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case TYPE:
        return getType();

      case USER_ID:
        return new Long(getUserId());

      case ONLY_ENABLED:
        return new Boolean(isOnlyEnabled());

      }
      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 TYPE:
        return isSetType();
      case USER_ID:
        return isSetUserId();
      case ONLY_ENABLED:
        return isSetOnlyEnabled();
      }
      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 getWidget_args)
        return this.equals((getWidget_args)that);
      return false;
    }

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

      boolean this_present_type = true && this.isSetType();
      boolean that_present_type = true && that.isSetType();
      if (this_present_type || that_present_type) {
        if (!(this_present_type && that_present_type))
          return false;
        if (!this.type.equals(that.type))
          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_onlyEnabled = true;
      boolean that_present_onlyEnabled = true;
      if (this_present_onlyEnabled || that_present_onlyEnabled) {
        if (!(this_present_onlyEnabled && that_present_onlyEnabled))
          return false;
        if (this.onlyEnabled != that.onlyEnabled)
          return false;
      }

      return true;
    }

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

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

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

      lastComparison = Boolean.valueOf(isSetType()).compareTo(isSetType());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(type, typedOther.type);
      if (lastComparison != 0) {
        return lastComparison;
      }
      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(isSetOnlyEnabled()).compareTo(isSetOnlyEnabled());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(onlyEnabled, typedOther.onlyEnabled);
      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 TYPE:
              if (field.type == TType.I32) {
                this.type = WidgetType.findByValue(iprot.readI32());
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case USER_ID:
              if (field.type == TType.I64) {
                this.userId = iprot.readI64();
                setUserIdIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case ONLY_ENABLED:
              if (field.type == TType.BOOL) {
                this.onlyEnabled = iprot.readBool();
                setOnlyEnabledIsSet(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);
      if (this.type != null) {
        oprot.writeFieldBegin(TYPE_FIELD_DESC);
        oprot.writeI32(this.type.getValue());
        oprot.writeFieldEnd();
      }
      oprot.writeFieldBegin(USER_ID_FIELD_DESC);
      oprot.writeI64(this.userId);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(ONLY_ENABLED_FIELD_DESC);
      oprot.writeBool(this.onlyEnabled);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

      sb.append("type:");
      if (this.type == null) {
        sb.append("null");
      } else {
        String type_name = type.name();
        if (type_name != null) {
          sb.append(type_name);
          sb.append(" (");
        }
        sb.append(this.type);
        if (type_name != null) {
          sb.append(")");
        }
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("userId:");
      sb.append(this.userId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("onlyEnabled:");
      sb.append(this.onlyEnabled);
      first = false;
      sb.append(")");
      return sb.toString();
    }

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

  }

  public static class getWidget_result implements TBase<getWidget_result._Fields>, java.io.Serializable, Cloneable, Comparable<getWidget_result>   {
    private static final TStruct STRUCT_DESC = new TStruct("getWidget_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(getWidget_result.class, metaDataMap);
    }

    public getWidget_result() {
    }

    public getWidget_result(
      Widget success,
      WidgetException scx)
    {
      this();
      this.success = success;
      this.scx = scx;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getWidget_result(getWidget_result other) {
      if (other.isSetSuccess()) {
        this.success = new Widget(other.success);
      }
      if (other.isSetScx()) {
        this.scx = new WidgetException(other.scx);
      }
    }

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

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

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

    public getWidget_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 getWidget_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 getWidget_result)
        return this.equals((getWidget_result)that);
      return false;
    }

    public boolean equals(getWidget_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(getWidget_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getWidget_result typedOther = (getWidget_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("getWidget_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 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("user_id", TType.I64, (short)1);

    private long user_id;

    /** 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, "user_id");

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

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

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

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

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

      private final short _thriftId;
      private final String _fieldName;

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

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

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

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

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

    public getMyResearch_args() {
    }

    public getMyResearch_args(
      long user_id)
    {
      this();
      this.user_id = user_id;
      setUser_idIsSet(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.user_id = other.user_id;
    }

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

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

    public long getUser_id() {
      return this.user_id;
    }

    public getMyResearch_args setUser_id(long user_id) {
      this.user_id = user_id;
      setUser_idIsSet(true);
      return this;
    }

    public void unsetUser_id() {
      __isset_bit_vector.clear(__USER_ID_ISSET_ID);
    }

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

    public void setUser_idIsSet(boolean value) {
      __isset_bit_vector.set(__USER_ID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case USER_ID:
        if (value == null) {
          unsetUser_id();
        } else {
          setUser_id((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(getUser_id());

      }
      throw new IllegalStateException();
    }

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

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

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

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

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

      boolean this_present_user_id = true;
      boolean that_present_user_id = true;
      if (this_present_user_id || that_present_user_id) {
        if (!(this_present_user_id && that_present_user_id))
          return false;
        if (this.user_id != that.user_id)
          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(isSetUser_id()).compareTo(isSetUser_id());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(user_id, typedOther.user_id);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

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

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

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(USER_ID_FIELD_DESC);
      oprot.writeI64(this.user_id);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

      sb.append("user_id:");
      sb.append(this.user_id);
      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("user_id", TType.I64, (short)1);
    private static final TField ITEM_ID_FIELD_DESC = new TField("item_id", TType.I64, (short)2);

    private long user_id;
    private long item_id;

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

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

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

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

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

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

      private final short _thriftId;
      private final String _fieldName;

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

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

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

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

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

    public updateMyResearch_args() {
    }

    public updateMyResearch_args(
      long user_id,
      long item_id)
    {
      this();
      this.user_id = user_id;
      setUser_idIsSet(true);
      this.item_id = item_id;
      setItem_idIsSet(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.user_id = other.user_id;
      this.item_id = other.item_id;
    }

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

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

    public long getUser_id() {
      return this.user_id;
    }

    public updateMyResearch_args setUser_id(long user_id) {
      this.user_id = user_id;
      setUser_idIsSet(true);
      return this;
    }

    public void unsetUser_id() {
      __isset_bit_vector.clear(__USER_ID_ISSET_ID);
    }

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

    public void setUser_idIsSet(boolean value) {
      __isset_bit_vector.set(__USER_ID_ISSET_ID, value);
    }

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

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

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

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

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

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

      case ITEM_ID:
        if (value == null) {
          unsetItem_id();
        } else {
          setItem_id((Long)value);
        }
        break;

      }
    }

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

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

      case ITEM_ID:
        return new Long(getItem_id());

      }
      throw new IllegalStateException();
    }

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

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

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

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

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

      boolean this_present_user_id = true;
      boolean that_present_user_id = true;
      if (this_present_user_id || that_present_user_id) {
        if (!(this_present_user_id && that_present_user_id))
          return false;
        if (this.user_id != that.user_id)
          return false;
      }

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

      return true;
    }

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

    public int compareTo(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(isSetUser_id()).compareTo(isSetUser_id());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(user_id, typedOther.user_id);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetItem_id()).compareTo(isSetItem_id());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(item_id, typedOther.item_id);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

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

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

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

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

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

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

  }

  public static class 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("user_id", TType.I64, (short)1);
    private static final TField ITEM_ID_FIELD_DESC = new TField("item_id", TType.I64, (short)2);

    private long user_id;
    private long item_id;

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

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

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

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

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

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

      private final short _thriftId;
      private final String _fieldName;

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

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

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

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

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

    public deleteItemFromMyResearch_args() {
    }

    public deleteItemFromMyResearch_args(
      long user_id,
      long item_id)
    {
      this();
      this.user_id = user_id;
      setUser_idIsSet(true);
      this.item_id = item_id;
      setItem_idIsSet(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.user_id = other.user_id;
      this.item_id = other.item_id;
    }

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

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

    public long getUser_id() {
      return this.user_id;
    }

    public deleteItemFromMyResearch_args setUser_id(long user_id) {
      this.user_id = user_id;
      setUser_idIsSet(true);
      return this;
    }

    public void unsetUser_id() {
      __isset_bit_vector.clear(__USER_ID_ISSET_ID);
    }

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

    public void setUser_idIsSet(boolean value) {
      __isset_bit_vector.set(__USER_ID_ISSET_ID, value);
    }

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

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

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

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

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

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

      case ITEM_ID:
        if (value == null) {
          unsetItem_id();
        } else {
          setItem_id((Long)value);
        }
        break;

      }
    }

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

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

      case ITEM_ID:
        return new Long(getItem_id());

      }
      throw new IllegalStateException();
    }

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

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

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

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

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

      boolean this_present_user_id = true;
      boolean that_present_user_id = true;
      if (this_present_user_id || that_present_user_id) {
        if (!(this_present_user_id && that_present_user_id))
          return false;
        if (this.user_id != that.user_id)
          return false;
      }

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

      return true;
    }

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

    public int compareTo(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(isSetUser_id()).compareTo(isSetUser_id());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(user_id, typedOther.user_id);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetItem_id()).compareTo(isSetItem_id());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(item_id, typedOther.item_id);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

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

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

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

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

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

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

  }

  public static class 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 updateRatings_args implements TBase<updateRatings_args._Fields>, java.io.Serializable, Cloneable, Comparable<updateRatings_args>   {
    private static final TStruct STRUCT_DESC = new TStruct("updateRatings_args");

    private static final TField ITEM_ID_FIELD_DESC = new TField("item_id", TType.I64, (short)1);
    private static final TField TYPE_FIELD_DESC = new TField("type", TType.I32, (short)2);
    private static final TField RATING_FIELD_DESC = new TField("rating", TType.DOUBLE, (short)3);
    private static final TField USER_ID_FIELD_DESC = new TField("user_id", TType.I64, (short)4);

    private long item_id;
    private RatingType type;
    private double rating;
    private long user_id;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      ITEM_ID((short)1, "item_id"),
      /**
       * 
       * @see RatingType
       */
      TYPE((short)2, "type"),
      RATING((short)3, "rating"),
      USER_ID((short)4, "user_id");

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

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

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

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

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

      private final short _thriftId;
      private final String _fieldName;

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

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __ITEM_ID_ISSET_ID = 0;
    private static final int __RATING_ISSET_ID = 1;
    private static final int __USER_ID_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.ITEM_ID, new FieldMetaData("item_id", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
      put(_Fields.TYPE, new FieldMetaData("type", TFieldRequirementType.DEFAULT, 
          new EnumMetaData(TType.ENUM, RatingType.class)));
      put(_Fields.RATING, new FieldMetaData("rating", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.DOUBLE)));
      put(_Fields.USER_ID, new FieldMetaData("user_id", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
    }});

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

    public updateRatings_args() {
    }

    public updateRatings_args(
      long item_id,
      RatingType type,
      double rating,
      long user_id)
    {
      this();
      this.item_id = item_id;
      setItem_idIsSet(true);
      this.type = type;
      this.rating = rating;
      setRatingIsSet(true);
      this.user_id = user_id;
      setUser_idIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public updateRatings_args(updateRatings_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.item_id = other.item_id;
      if (other.isSetType()) {
        this.type = other.type;
      }
      this.rating = other.rating;
      this.user_id = other.user_id;
    }

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

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

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

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

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

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

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

    /**
     * 
     * @see RatingType
     */
    public RatingType getType() {
      return this.type;
    }

    /**
     * 
     * @see RatingType
     */
    public updateRatings_args setType(RatingType type) {
      this.type = type;
      return this;
    }

    public void unsetType() {
      this.type = null;
    }

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

    public void setTypeIsSet(boolean value) {
      if (!value) {
        this.type = null;
      }
    }

    public double getRating() {
      return this.rating;
    }

    public updateRatings_args setRating(double rating) {
      this.rating = rating;
      setRatingIsSet(true);
      return this;
    }

    public void unsetRating() {
      __isset_bit_vector.clear(__RATING_ISSET_ID);
    }

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

    public void setRatingIsSet(boolean value) {
      __isset_bit_vector.set(__RATING_ISSET_ID, value);
    }

    public long getUser_id() {
      return this.user_id;
    }

    public updateRatings_args setUser_id(long user_id) {
      this.user_id = user_id;
      setUser_idIsSet(true);
      return this;
    }

    public void unsetUser_id() {
      __isset_bit_vector.clear(__USER_ID_ISSET_ID);
    }

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

    public void setUser_idIsSet(boolean value) {
      __isset_bit_vector.set(__USER_ID_ISSET_ID, value);
    }

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

      case TYPE:
        if (value == null) {
          unsetType();
        } else {
          setType((RatingType)value);
        }
        break;

      case RATING:
        if (value == null) {
          unsetRating();
        } else {
          setRating((Double)value);
        }
        break;

      case USER_ID:
        if (value == null) {
          unsetUser_id();
        } else {
          setUser_id((Long)value);
        }
        break;

      }
    }

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

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

      case TYPE:
        return getType();

      case RATING:
        return new Double(getRating());

      case USER_ID:
        return new Long(getUser_id());

      }
      throw new IllegalStateException();
    }

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

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

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

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

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

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

      boolean this_present_type = true && this.isSetType();
      boolean that_present_type = true && that.isSetType();
      if (this_present_type || that_present_type) {
        if (!(this_present_type && that_present_type))
          return false;
        if (!this.type.equals(that.type))
          return false;
      }

      boolean this_present_rating = true;
      boolean that_present_rating = true;
      if (this_present_rating || that_present_rating) {
        if (!(this_present_rating && that_present_rating))
          return false;
        if (this.rating != that.rating)
          return false;
      }

      boolean this_present_user_id = true;
      boolean that_present_user_id = true;
      if (this_present_user_id || that_present_user_id) {
        if (!(this_present_user_id && that_present_user_id))
          return false;
        if (this.user_id != that.user_id)
          return false;
      }

      return true;
    }

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

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

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

      lastComparison = Boolean.valueOf(isSetItem_id()).compareTo(isSetItem_id());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(item_id, typedOther.item_id);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetType()).compareTo(isSetType());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(type, typedOther.type);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetRating()).compareTo(isSetRating());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(rating, typedOther.rating);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetUser_id()).compareTo(isSetUser_id());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(user_id, typedOther.user_id);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case ITEM_ID:
              if (field.type == TType.I64) {
                this.item_id = iprot.readI64();
                setItem_idIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case TYPE:
              if (field.type == TType.I32) {
                this.type = RatingType.findByValue(iprot.readI32());
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case RATING:
              if (field.type == TType.DOUBLE) {
                this.rating = iprot.readDouble();
                setRatingIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case USER_ID:
              if (field.type == TType.I64) {
                this.user_id = iprot.readI64();
                setUser_idIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

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

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(ITEM_ID_FIELD_DESC);
      oprot.writeI64(this.item_id);
      oprot.writeFieldEnd();
      if (this.type != null) {
        oprot.writeFieldBegin(TYPE_FIELD_DESC);
        oprot.writeI32(this.type.getValue());
        oprot.writeFieldEnd();
      }
      oprot.writeFieldBegin(RATING_FIELD_DESC);
      oprot.writeDouble(this.rating);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(USER_ID_FIELD_DESC);
      oprot.writeI64(this.user_id);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

      sb.append("item_id:");
      sb.append(this.item_id);
      first = false;
      if (!first) sb.append(", ");
      sb.append("type:");
      if (this.type == null) {
        sb.append("null");
      } else {
        String type_name = type.name();
        if (type_name != null) {
          sb.append(type_name);
          sb.append(" (");
        }
        sb.append(this.type);
        if (type_name != null) {
          sb.append(")");
        }
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("rating:");
      sb.append(this.rating);
      first = false;
      if (!first) sb.append(", ");
      sb.append("user_id:");
      sb.append(this.user_id);
      first = false;
      sb.append(")");
      return sb.toString();
    }

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

  }

  public static class updateRatings_result implements TBase<updateRatings_result._Fields>, java.io.Serializable, Cloneable, Comparable<updateRatings_result>   {
    private static final TStruct STRUCT_DESC = new TStruct("updateRatings_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(updateRatings_result.class, metaDataMap);
    }

    public updateRatings_result() {
    }

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

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

    @Deprecated
    public updateRatings_result clone() {
      return new updateRatings_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 updateRatings_result)
        return this.equals((updateRatings_result)that);
      return false;
    }

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

      return true;
    }

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

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

      int lastComparison = 0;
      updateRatings_result typedOther = (updateRatings_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("updateRatings_result(");
      boolean first = true;

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

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

  }

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

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

    private long item_id;
    private long user_id;

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

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

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

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

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

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

      private final short _thriftId;
      private final String _fieldName;

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

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

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

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

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

    public getRatings_args() {
    }

    public getRatings_args(
      long item_id,
      long user_id)
    {
      this();
      this.item_id = item_id;
      setItem_idIsSet(true);
      this.user_id = user_id;
      setUser_idIsSet(true);
    }

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

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

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

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

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

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

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

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

    public long getUser_id() {
      return this.user_id;
    }

    public getRatings_args setUser_id(long user_id) {
      this.user_id = user_id;
      setUser_idIsSet(true);
      return this;
    }

    public void unsetUser_id() {
      __isset_bit_vector.clear(__USER_ID_ISSET_ID);
    }

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

    public void setUser_idIsSet(boolean value) {
      __isset_bit_vector.set(__USER_ID_ISSET_ID, value);
    }

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

      case USER_ID:
        if (value == null) {
          unsetUser_id();
        } else {
          setUser_id((Long)value);
        }
        break;

      }
    }

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

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

      case USER_ID:
        return new Long(getUser_id());

      }
      throw new IllegalStateException();
    }

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

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

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

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

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

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

      boolean this_present_user_id = true;
      boolean that_present_user_id = true;
      if (this_present_user_id || that_present_user_id) {
        if (!(this_present_user_id && that_present_user_id))
          return false;
        if (this.user_id != that.user_id)
          return false;
      }

      return true;
    }

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

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

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

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

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

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

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

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

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

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

  }

  public static class getRatings_result implements TBase<getRatings_result._Fields>, java.io.Serializable, Cloneable   {
    private static final TStruct STRUCT_DESC = new TStruct("getRatings_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 RatingsWidget 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, RatingsWidget.class)));
      put(_Fields.SCX, new FieldMetaData("scx", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

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

    public getRatings_result() {
    }

    public getRatings_result(
      RatingsWidget success,
      WidgetException scx)
    {
      this();
      this.success = success;
      this.scx = scx;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getRatings_result(getRatings_result other) {
      if (other.isSetSuccess()) {
        this.success = new RatingsWidget(other.success);
      }
      if (other.isSetScx()) {
        this.scx = new WidgetException(other.scx);
      }
    }

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

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

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

    public getRatings_result setSuccess(RatingsWidget 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 getRatings_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((RatingsWidget)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 getRatings_result)
        return this.equals((getRatings_result)that);
      return false;
    }

    public boolean equals(getRatings_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 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 RatingsWidget();
                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("getRatings_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 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("user_id", TType.I64, (short)1);
    private static final TField ITEM_ID_FIELD_DESC = new TField("item_id", TType.I64, (short)2);
    private static final TField IS_SESSION_ID_FIELD_DESC = new TField("isSessionId", TType.BOOL, (short)3);

    private long user_id;
    private long item_id;
    private boolean isSessionId;

    /** 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, "user_id"),
      ITEM_ID((short)2, "item_id"),
      IS_SESSION_ID((short)3, "isSessionId");

      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 __USER_ID_ISSET_ID = 0;
    private static final int __ITEM_ID_ISSET_ID = 1;
    private static final int __ISSESSIONID_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("user_id", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
      put(_Fields.ITEM_ID, new FieldMetaData("item_id", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
      put(_Fields.IS_SESSION_ID, new FieldMetaData("isSessionId", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.BOOL)));
    }});

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

    public updateBrowseHistory_args() {
    }

    public updateBrowseHistory_args(
      long user_id,
      long item_id,
      boolean isSessionId)
    {
      this();
      this.user_id = user_id;
      setUser_idIsSet(true);
      this.item_id = item_id;
      setItem_idIsSet(true);
      this.isSessionId = isSessionId;
      setIsSessionIdIsSet(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.user_id = other.user_id;
      this.item_id = other.item_id;
      this.isSessionId = other.isSessionId;
    }

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

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

    public long getUser_id() {
      return this.user_id;
    }

    public updateBrowseHistory_args setUser_id(long user_id) {
      this.user_id = user_id;
      setUser_idIsSet(true);
      return this;
    }

    public void unsetUser_id() {
      __isset_bit_vector.clear(__USER_ID_ISSET_ID);
    }

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

    public void setUser_idIsSet(boolean value) {
      __isset_bit_vector.set(__USER_ID_ISSET_ID, value);
    }

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

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

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

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

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

    public boolean isIsSessionId() {
      return this.isSessionId;
    }

    public updateBrowseHistory_args setIsSessionId(boolean isSessionId) {
      this.isSessionId = isSessionId;
      setIsSessionIdIsSet(true);
      return this;
    }

    public void unsetIsSessionId() {
      __isset_bit_vector.clear(__ISSESSIONID_ISSET_ID);
    }

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

    public void setIsSessionIdIsSet(boolean value) {
      __isset_bit_vector.set(__ISSESSIONID_ISSET_ID, value);
    }

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

      case ITEM_ID:
        if (value == null) {
          unsetItem_id();
        } else {
          setItem_id((Long)value);
        }
        break;

      case IS_SESSION_ID:
        if (value == null) {
          unsetIsSessionId();
        } else {
          setIsSessionId((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(getUser_id());

      case ITEM_ID:
        return new Long(getItem_id());

      case IS_SESSION_ID:
        return new Boolean(isIsSessionId());

      }
      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 isSetUser_id();
      case ITEM_ID:
        return isSetItem_id();
      case IS_SESSION_ID:
        return isSetIsSessionId();
      }
      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_user_id = true;
      boolean that_present_user_id = true;
      if (this_present_user_id || that_present_user_id) {
        if (!(this_present_user_id && that_present_user_id))
          return false;
        if (this.user_id != that.user_id)
          return false;
      }

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

      boolean this_present_isSessionId = true;
      boolean that_present_isSessionId = true;
      if (this_present_isSessionId || that_present_isSessionId) {
        if (!(this_present_isSessionId && that_present_isSessionId))
          return false;
        if (this.isSessionId != that.isSessionId)
          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(isSetUser_id()).compareTo(isSetUser_id());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(user_id, typedOther.user_id);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetItem_id()).compareTo(isSetItem_id());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(item_id, typedOther.item_id);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetIsSessionId()).compareTo(isSetIsSessionId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(isSessionId, typedOther.isSessionId);
      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.user_id = iprot.readI64();
                setUser_idIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case ITEM_ID:
              if (field.type == TType.I64) {
                this.item_id = iprot.readI64();
                setItem_idIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case IS_SESSION_ID:
              if (field.type == TType.BOOL) {
                this.isSessionId = iprot.readBool();
                setIsSessionIdIsSet(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.user_id);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(ITEM_ID_FIELD_DESC);
      oprot.writeI64(this.item_id);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(IS_SESSION_ID_FIELD_DESC);
      oprot.writeBool(this.isSessionId);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

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

      sb.append("user_id:");
      sb.append(this.user_id);
      first = false;
      if (!first) sb.append(", ");
      sb.append("item_id:");
      sb.append(this.item_id);
      first = false;
      if (!first) sb.append(", ");
      sb.append("isSessionId:");
      sb.append(this.isSessionId);
      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 static final TField IS_SESSION_ID_FIELD_DESC = new TField("isSessionId", TType.BOOL, (short)2);

    private long userId;
    private boolean isSessionId;

    /** 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"),
      IS_SESSION_ID((short)2, "isSessionId");

      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 __ISSESSIONID_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.IS_SESSION_ID, new FieldMetaData("isSessionId", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.BOOL)));
    }});

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

    public getBrowseHistory_args() {
    }

    public getBrowseHistory_args(
      long userId,
      boolean isSessionId)
    {
      this();
      this.userId = userId;
      setUserIdIsSet(true);
      this.isSessionId = isSessionId;
      setIsSessionIdIsSet(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;
      this.isSessionId = other.isSessionId;
    }

    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 boolean isIsSessionId() {
      return this.isSessionId;
    }

    public getBrowseHistory_args setIsSessionId(boolean isSessionId) {
      this.isSessionId = isSessionId;
      setIsSessionIdIsSet(true);
      return this;
    }

    public void unsetIsSessionId() {
      __isset_bit_vector.clear(__ISSESSIONID_ISSET_ID);
    }

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

    public void setIsSessionIdIsSet(boolean value) {
      __isset_bit_vector.set(__ISSESSIONID_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 IS_SESSION_ID:
        if (value == null) {
          unsetIsSessionId();
        } else {
          setIsSessionId((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 IS_SESSION_ID:
        return new Boolean(isIsSessionId());

      }
      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 IS_SESSION_ID:
        return isSetIsSessionId();
      }
      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;
      }

      boolean this_present_isSessionId = true;
      boolean that_present_isSessionId = true;
      if (this_present_isSessionId || that_present_isSessionId) {
        if (!(this_present_isSessionId && that_present_isSessionId))
          return false;
        if (this.isSessionId != that.isSessionId)
          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;
      }
      lastComparison = Boolean.valueOf(isSetIsSessionId()).compareTo(isSetIsSessionId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(isSessionId, typedOther.isSessionId);
      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 IS_SESSION_ID:
              if (field.type == TType.BOOL) {
                this.isSessionId = iprot.readBool();
                setIsSessionIdIsSet(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(IS_SESSION_ID_FIELD_DESC);
      oprot.writeBool(this.isSessionId);
      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;
      if (!first) sb.append(", ");
      sb.append("isSessionId:");
      sb.append(this.isSessionId);
      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
    }

  }

}