/**
 * Autogenerated by Thrift Compiler (0.9.2)
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */
package ytx;

import org.apache.thrift.scheme.IScheme;
import org.apache.thrift.scheme.SchemeFactory;
import org.apache.thrift.scheme.StandardScheme;

import org.apache.thrift.scheme.TupleScheme;
import org.apache.thrift.protocol.TTupleProtocol;
import org.apache.thrift.protocol.TProtocolException;
import org.apache.thrift.EncodingUtils;
import org.apache.thrift.TException;
import org.apache.thrift.async.AsyncMethodCallback;
import org.apache.thrift.server.AbstractNonblockingServer.*;
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.nio.ByteBuffer;
import java.util.Arrays;
import javax.annotation.Generated;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2015-3-30")
public class CrmService {

  public interface Iface {

    public int csrLogin(String csrName, String password) throws csr_error, org.apache.thrift.TException;

    public CSRInfo getCSRInfoByCSRId(int csrId) throws bind_error, org.apache.thrift.TException;

    public CSRInfo getCSRInfoByCSRJobId(int csrJobId) throws bind_error, org.apache.thrift.TException;

    public CSRInfo getRelatedCSRInfoByUsername(String username) throws csr_error, org.apache.thrift.TException;

    public CSRInfo getRelatedCSPByUsername(String username) throws csr_error, org.apache.thrift.TException;

    public List<Customer> getCusomterListByCSRId(int csrId) throws csr_error, org.apache.thrift.TException;

    public List<String> getCustomerUsernameList(int csrId, int customerStatus) throws csr_error, org.apache.thrift.TException;

    public Customer getCusomterByUsername(String username, int csrId) throws org.apache.thrift.TException;

    public Customer getCusomterInfoByUsername(String username) throws csr_error, org.apache.thrift.TException;

    public void phoneCallback(String username, int csrId) throws csr_error, org.apache.thrift.TException;

    public List<String> getCustomerUsernameByCustomerId(int customerId) throws csr_error, org.apache.thrift.TException;

    public void setCustomerInfo(CustomerDetail customerDetail) throws org.apache.thrift.TException;

    public CSRInfo bindCSR(String username, int newCSRId) throws bind_error, org.apache.thrift.TException;

    public CSRInfo getRelatedCSRInfoByUsername_client(String username) throws csr_error, org.apache.thrift.TException;

    public List<CSRInfo> getRecommendCSRList() throws org.apache.thrift.TException;

    public void sendMsgToCSROrCSP(String sender, String message, int msgType, boolean sendToCSP) throws CRMMsgError, org.apache.thrift.TException;

  }

  public interface AsyncIface {

    public void csrLogin(String csrName, String password, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;

    public void getCSRInfoByCSRId(int csrId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;

    public void getCSRInfoByCSRJobId(int csrJobId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;

    public void getRelatedCSRInfoByUsername(String username, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;

    public void getRelatedCSPByUsername(String username, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;

    public void getCusomterListByCSRId(int csrId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;

    public void getCustomerUsernameList(int csrId, int customerStatus, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;

    public void getCusomterByUsername(String username, int csrId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;

    public void getCusomterInfoByUsername(String username, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;

    public void phoneCallback(String username, int csrId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;

    public void getCustomerUsernameByCustomerId(int customerId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;

    public void setCustomerInfo(CustomerDetail customerDetail, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;

    public void bindCSR(String username, int newCSRId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;

    public void getRelatedCSRInfoByUsername_client(String username, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;

    public void getRecommendCSRList(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;

    public void sendMsgToCSROrCSP(String sender, String message, int msgType, boolean sendToCSP, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;

  }

  public static class Client extends org.apache.thrift.TServiceClient implements Iface {
    public static class Factory implements org.apache.thrift.TServiceClientFactory<Client> {
      public Factory() {}
      public Client getClient(org.apache.thrift.protocol.TProtocol prot) {
        return new Client(prot);
      }
      public Client getClient(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
        return new Client(iprot, oprot);
      }
    }

    public Client(org.apache.thrift.protocol.TProtocol prot)
    {
      super(prot, prot);
    }

    public Client(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
      super(iprot, oprot);
    }

    public int csrLogin(String csrName, String password) throws csr_error, org.apache.thrift.TException
    {
      send_csrLogin(csrName, password);
      return recv_csrLogin();
    }

    public void send_csrLogin(String csrName, String password) throws org.apache.thrift.TException
    {
      csrLogin_args args = new csrLogin_args();
      args.setCsrName(csrName);
      args.setPassword(password);
      sendBase("csrLogin", args);
    }

    public int recv_csrLogin() throws csr_error, org.apache.thrift.TException
    {
      csrLogin_result result = new csrLogin_result();
      receiveBase(result, "csrLogin");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.error != null) {
        throw result.error;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "csrLogin failed: unknown result");
    }

    public CSRInfo getCSRInfoByCSRId(int csrId) throws bind_error, org.apache.thrift.TException
    {
      send_getCSRInfoByCSRId(csrId);
      return recv_getCSRInfoByCSRId();
    }

    public void send_getCSRInfoByCSRId(int csrId) throws org.apache.thrift.TException
    {
      getCSRInfoByCSRId_args args = new getCSRInfoByCSRId_args();
      args.setCsrId(csrId);
      sendBase("getCSRInfoByCSRId", args);
    }

    public CSRInfo recv_getCSRInfoByCSRId() throws bind_error, org.apache.thrift.TException
    {
      getCSRInfoByCSRId_result result = new getCSRInfoByCSRId_result();
      receiveBase(result, "getCSRInfoByCSRId");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.error != null) {
        throw result.error;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getCSRInfoByCSRId failed: unknown result");
    }

    public CSRInfo getCSRInfoByCSRJobId(int csrJobId) throws bind_error, org.apache.thrift.TException
    {
      send_getCSRInfoByCSRJobId(csrJobId);
      return recv_getCSRInfoByCSRJobId();
    }

    public void send_getCSRInfoByCSRJobId(int csrJobId) throws org.apache.thrift.TException
    {
      getCSRInfoByCSRJobId_args args = new getCSRInfoByCSRJobId_args();
      args.setCsrJobId(csrJobId);
      sendBase("getCSRInfoByCSRJobId", args);
    }

    public CSRInfo recv_getCSRInfoByCSRJobId() throws bind_error, org.apache.thrift.TException
    {
      getCSRInfoByCSRJobId_result result = new getCSRInfoByCSRJobId_result();
      receiveBase(result, "getCSRInfoByCSRJobId");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.error != null) {
        throw result.error;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getCSRInfoByCSRJobId failed: unknown result");
    }

    public CSRInfo getRelatedCSRInfoByUsername(String username) throws csr_error, org.apache.thrift.TException
    {
      send_getRelatedCSRInfoByUsername(username);
      return recv_getRelatedCSRInfoByUsername();
    }

    public void send_getRelatedCSRInfoByUsername(String username) throws org.apache.thrift.TException
    {
      getRelatedCSRInfoByUsername_args args = new getRelatedCSRInfoByUsername_args();
      args.setUsername(username);
      sendBase("getRelatedCSRInfoByUsername", args);
    }

    public CSRInfo recv_getRelatedCSRInfoByUsername() throws csr_error, org.apache.thrift.TException
    {
      getRelatedCSRInfoByUsername_result result = new getRelatedCSRInfoByUsername_result();
      receiveBase(result, "getRelatedCSRInfoByUsername");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.error != null) {
        throw result.error;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getRelatedCSRInfoByUsername failed: unknown result");
    }

    public CSRInfo getRelatedCSPByUsername(String username) throws csr_error, org.apache.thrift.TException
    {
      send_getRelatedCSPByUsername(username);
      return recv_getRelatedCSPByUsername();
    }

    public void send_getRelatedCSPByUsername(String username) throws org.apache.thrift.TException
    {
      getRelatedCSPByUsername_args args = new getRelatedCSPByUsername_args();
      args.setUsername(username);
      sendBase("getRelatedCSPByUsername", args);
    }

    public CSRInfo recv_getRelatedCSPByUsername() throws csr_error, org.apache.thrift.TException
    {
      getRelatedCSPByUsername_result result = new getRelatedCSPByUsername_result();
      receiveBase(result, "getRelatedCSPByUsername");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.error != null) {
        throw result.error;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getRelatedCSPByUsername failed: unknown result");
    }

    public List<Customer> getCusomterListByCSRId(int csrId) throws csr_error, org.apache.thrift.TException
    {
      send_getCusomterListByCSRId(csrId);
      return recv_getCusomterListByCSRId();
    }

    public void send_getCusomterListByCSRId(int csrId) throws org.apache.thrift.TException
    {
      getCusomterListByCSRId_args args = new getCusomterListByCSRId_args();
      args.setCsrId(csrId);
      sendBase("getCusomterListByCSRId", args);
    }

    public List<Customer> recv_getCusomterListByCSRId() throws csr_error, org.apache.thrift.TException
    {
      getCusomterListByCSRId_result result = new getCusomterListByCSRId_result();
      receiveBase(result, "getCusomterListByCSRId");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.error != null) {
        throw result.error;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getCusomterListByCSRId failed: unknown result");
    }

    public List<String> getCustomerUsernameList(int csrId, int customerStatus) throws csr_error, org.apache.thrift.TException
    {
      send_getCustomerUsernameList(csrId, customerStatus);
      return recv_getCustomerUsernameList();
    }

    public void send_getCustomerUsernameList(int csrId, int customerStatus) throws org.apache.thrift.TException
    {
      getCustomerUsernameList_args args = new getCustomerUsernameList_args();
      args.setCsrId(csrId);
      args.setCustomerStatus(customerStatus);
      sendBase("getCustomerUsernameList", args);
    }

    public List<String> recv_getCustomerUsernameList() throws csr_error, org.apache.thrift.TException
    {
      getCustomerUsernameList_result result = new getCustomerUsernameList_result();
      receiveBase(result, "getCustomerUsernameList");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.error != null) {
        throw result.error;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getCustomerUsernameList failed: unknown result");
    }

    public Customer getCusomterByUsername(String username, int csrId) throws org.apache.thrift.TException
    {
      send_getCusomterByUsername(username, csrId);
      return recv_getCusomterByUsername();
    }

    public void send_getCusomterByUsername(String username, int csrId) throws org.apache.thrift.TException
    {
      getCusomterByUsername_args args = new getCusomterByUsername_args();
      args.setUsername(username);
      args.setCsrId(csrId);
      sendBase("getCusomterByUsername", args);
    }

    public Customer recv_getCusomterByUsername() throws org.apache.thrift.TException
    {
      getCusomterByUsername_result result = new getCusomterByUsername_result();
      receiveBase(result, "getCusomterByUsername");
      if (result.isSetSuccess()) {
        return result.success;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getCusomterByUsername failed: unknown result");
    }

    public Customer getCusomterInfoByUsername(String username) throws csr_error, org.apache.thrift.TException
    {
      send_getCusomterInfoByUsername(username);
      return recv_getCusomterInfoByUsername();
    }

    public void send_getCusomterInfoByUsername(String username) throws org.apache.thrift.TException
    {
      getCusomterInfoByUsername_args args = new getCusomterInfoByUsername_args();
      args.setUsername(username);
      sendBase("getCusomterInfoByUsername", args);
    }

    public Customer recv_getCusomterInfoByUsername() throws csr_error, org.apache.thrift.TException
    {
      getCusomterInfoByUsername_result result = new getCusomterInfoByUsername_result();
      receiveBase(result, "getCusomterInfoByUsername");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.error != null) {
        throw result.error;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getCusomterInfoByUsername failed: unknown result");
    }

    public void phoneCallback(String username, int csrId) throws csr_error, org.apache.thrift.TException
    {
      send_phoneCallback(username, csrId);
      recv_phoneCallback();
    }

    public void send_phoneCallback(String username, int csrId) throws org.apache.thrift.TException
    {
      phoneCallback_args args = new phoneCallback_args();
      args.setUsername(username);
      args.setCsrId(csrId);
      sendBase("phoneCallback", args);
    }

    public void recv_phoneCallback() throws csr_error, org.apache.thrift.TException
    {
      phoneCallback_result result = new phoneCallback_result();
      receiveBase(result, "phoneCallback");
      if (result.error != null) {
        throw result.error;
      }
      return;
    }

    public List<String> getCustomerUsernameByCustomerId(int customerId) throws csr_error, org.apache.thrift.TException
    {
      send_getCustomerUsernameByCustomerId(customerId);
      return recv_getCustomerUsernameByCustomerId();
    }

    public void send_getCustomerUsernameByCustomerId(int customerId) throws org.apache.thrift.TException
    {
      getCustomerUsernameByCustomerId_args args = new getCustomerUsernameByCustomerId_args();
      args.setCustomerId(customerId);
      sendBase("getCustomerUsernameByCustomerId", args);
    }

    public List<String> recv_getCustomerUsernameByCustomerId() throws csr_error, org.apache.thrift.TException
    {
      getCustomerUsernameByCustomerId_result result = new getCustomerUsernameByCustomerId_result();
      receiveBase(result, "getCustomerUsernameByCustomerId");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.error != null) {
        throw result.error;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getCustomerUsernameByCustomerId failed: unknown result");
    }

    public void setCustomerInfo(CustomerDetail customerDetail) throws org.apache.thrift.TException
    {
      send_setCustomerInfo(customerDetail);
      recv_setCustomerInfo();
    }

    public void send_setCustomerInfo(CustomerDetail customerDetail) throws org.apache.thrift.TException
    {
      setCustomerInfo_args args = new setCustomerInfo_args();
      args.setCustomerDetail(customerDetail);
      sendBase("setCustomerInfo", args);
    }

    public void recv_setCustomerInfo() throws org.apache.thrift.TException
    {
      setCustomerInfo_result result = new setCustomerInfo_result();
      receiveBase(result, "setCustomerInfo");
      return;
    }

    public CSRInfo bindCSR(String username, int newCSRId) throws bind_error, org.apache.thrift.TException
    {
      send_bindCSR(username, newCSRId);
      return recv_bindCSR();
    }

    public void send_bindCSR(String username, int newCSRId) throws org.apache.thrift.TException
    {
      bindCSR_args args = new bindCSR_args();
      args.setUsername(username);
      args.setNewCSRId(newCSRId);
      sendBase("bindCSR", args);
    }

    public CSRInfo recv_bindCSR() throws bind_error, org.apache.thrift.TException
    {
      bindCSR_result result = new bindCSR_result();
      receiveBase(result, "bindCSR");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.error != null) {
        throw result.error;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "bindCSR failed: unknown result");
    }

    public CSRInfo getRelatedCSRInfoByUsername_client(String username) throws csr_error, org.apache.thrift.TException
    {
      send_getRelatedCSRInfoByUsername_client(username);
      return recv_getRelatedCSRInfoByUsername_client();
    }

    public void send_getRelatedCSRInfoByUsername_client(String username) throws org.apache.thrift.TException
    {
      getRelatedCSRInfoByUsername_client_args args = new getRelatedCSRInfoByUsername_client_args();
      args.setUsername(username);
      sendBase("getRelatedCSRInfoByUsername_client", args);
    }

    public CSRInfo recv_getRelatedCSRInfoByUsername_client() throws csr_error, org.apache.thrift.TException
    {
      getRelatedCSRInfoByUsername_client_result result = new getRelatedCSRInfoByUsername_client_result();
      receiveBase(result, "getRelatedCSRInfoByUsername_client");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.error != null) {
        throw result.error;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getRelatedCSRInfoByUsername_client failed: unknown result");
    }

    public List<CSRInfo> getRecommendCSRList() throws org.apache.thrift.TException
    {
      send_getRecommendCSRList();
      return recv_getRecommendCSRList();
    }

    public void send_getRecommendCSRList() throws org.apache.thrift.TException
    {
      getRecommendCSRList_args args = new getRecommendCSRList_args();
      sendBase("getRecommendCSRList", args);
    }

    public List<CSRInfo> recv_getRecommendCSRList() throws org.apache.thrift.TException
    {
      getRecommendCSRList_result result = new getRecommendCSRList_result();
      receiveBase(result, "getRecommendCSRList");
      if (result.isSetSuccess()) {
        return result.success;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getRecommendCSRList failed: unknown result");
    }

    public void sendMsgToCSROrCSP(String sender, String message, int msgType, boolean sendToCSP) throws CRMMsgError, org.apache.thrift.TException
    {
      send_sendMsgToCSROrCSP(sender, message, msgType, sendToCSP);
      recv_sendMsgToCSROrCSP();
    }

    public void send_sendMsgToCSROrCSP(String sender, String message, int msgType, boolean sendToCSP) throws org.apache.thrift.TException
    {
      sendMsgToCSROrCSP_args args = new sendMsgToCSROrCSP_args();
      args.setSender(sender);
      args.setMessage(message);
      args.setMsgType(msgType);
      args.setSendToCSP(sendToCSP);
      sendBase("sendMsgToCSROrCSP", args);
    }

    public void recv_sendMsgToCSROrCSP() throws CRMMsgError, org.apache.thrift.TException
    {
      sendMsgToCSROrCSP_result result = new sendMsgToCSROrCSP_result();
      receiveBase(result, "sendMsgToCSROrCSP");
      if (result.error != null) {
        throw result.error;
      }
      return;
    }

  }
  public static class AsyncClient extends org.apache.thrift.async.TAsyncClient implements AsyncIface {
    public static class Factory implements org.apache.thrift.async.TAsyncClientFactory<AsyncClient> {
      private org.apache.thrift.async.TAsyncClientManager clientManager;
      private org.apache.thrift.protocol.TProtocolFactory protocolFactory;
      public Factory(org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.protocol.TProtocolFactory protocolFactory) {
        this.clientManager = clientManager;
        this.protocolFactory = protocolFactory;
      }
      public AsyncClient getAsyncClient(org.apache.thrift.transport.TNonblockingTransport transport) {
        return new AsyncClient(protocolFactory, clientManager, transport);
      }
    }

    public AsyncClient(org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.transport.TNonblockingTransport transport) {
      super(protocolFactory, clientManager, transport);
    }

    public void csrLogin(String csrName, String password, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
      checkReady();
      csrLogin_call method_call = new csrLogin_call(csrName, password, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class csrLogin_call extends org.apache.thrift.async.TAsyncMethodCall {
      private String csrName;
      private String password;
      public csrLogin_call(String csrName, String password, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.csrName = csrName;
        this.password = password;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("csrLogin", org.apache.thrift.protocol.TMessageType.CALL, 0));
        csrLogin_args args = new csrLogin_args();
        args.setCsrName(csrName);
        args.setPassword(password);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public int getResult() throws csr_error, org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_csrLogin();
      }
    }

    public void getCSRInfoByCSRId(int csrId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
      checkReady();
      getCSRInfoByCSRId_call method_call = new getCSRInfoByCSRId_call(csrId, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class getCSRInfoByCSRId_call extends org.apache.thrift.async.TAsyncMethodCall {
      private int csrId;
      public getCSRInfoByCSRId_call(int csrId, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.csrId = csrId;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getCSRInfoByCSRId", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getCSRInfoByCSRId_args args = new getCSRInfoByCSRId_args();
        args.setCsrId(csrId);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public CSRInfo getResult() throws bind_error, org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_getCSRInfoByCSRId();
      }
    }

    public void getCSRInfoByCSRJobId(int csrJobId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
      checkReady();
      getCSRInfoByCSRJobId_call method_call = new getCSRInfoByCSRJobId_call(csrJobId, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class getCSRInfoByCSRJobId_call extends org.apache.thrift.async.TAsyncMethodCall {
      private int csrJobId;
      public getCSRInfoByCSRJobId_call(int csrJobId, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.csrJobId = csrJobId;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getCSRInfoByCSRJobId", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getCSRInfoByCSRJobId_args args = new getCSRInfoByCSRJobId_args();
        args.setCsrJobId(csrJobId);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public CSRInfo getResult() throws bind_error, org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_getCSRInfoByCSRJobId();
      }
    }

    public void getRelatedCSRInfoByUsername(String username, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
      checkReady();
      getRelatedCSRInfoByUsername_call method_call = new getRelatedCSRInfoByUsername_call(username, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class getRelatedCSRInfoByUsername_call extends org.apache.thrift.async.TAsyncMethodCall {
      private String username;
      public getRelatedCSRInfoByUsername_call(String username, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.username = username;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getRelatedCSRInfoByUsername", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getRelatedCSRInfoByUsername_args args = new getRelatedCSRInfoByUsername_args();
        args.setUsername(username);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public CSRInfo getResult() throws csr_error, org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_getRelatedCSRInfoByUsername();
      }
    }

    public void getRelatedCSPByUsername(String username, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
      checkReady();
      getRelatedCSPByUsername_call method_call = new getRelatedCSPByUsername_call(username, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class getRelatedCSPByUsername_call extends org.apache.thrift.async.TAsyncMethodCall {
      private String username;
      public getRelatedCSPByUsername_call(String username, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.username = username;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getRelatedCSPByUsername", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getRelatedCSPByUsername_args args = new getRelatedCSPByUsername_args();
        args.setUsername(username);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public CSRInfo getResult() throws csr_error, org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_getRelatedCSPByUsername();
      }
    }

    public void getCusomterListByCSRId(int csrId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
      checkReady();
      getCusomterListByCSRId_call method_call = new getCusomterListByCSRId_call(csrId, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class getCusomterListByCSRId_call extends org.apache.thrift.async.TAsyncMethodCall {
      private int csrId;
      public getCusomterListByCSRId_call(int csrId, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.csrId = csrId;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getCusomterListByCSRId", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getCusomterListByCSRId_args args = new getCusomterListByCSRId_args();
        args.setCsrId(csrId);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public List<Customer> getResult() throws csr_error, org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_getCusomterListByCSRId();
      }
    }

    public void getCustomerUsernameList(int csrId, int customerStatus, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
      checkReady();
      getCustomerUsernameList_call method_call = new getCustomerUsernameList_call(csrId, customerStatus, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class getCustomerUsernameList_call extends org.apache.thrift.async.TAsyncMethodCall {
      private int csrId;
      private int customerStatus;
      public getCustomerUsernameList_call(int csrId, int customerStatus, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.csrId = csrId;
        this.customerStatus = customerStatus;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getCustomerUsernameList", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getCustomerUsernameList_args args = new getCustomerUsernameList_args();
        args.setCsrId(csrId);
        args.setCustomerStatus(customerStatus);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public List<String> getResult() throws csr_error, org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_getCustomerUsernameList();
      }
    }

    public void getCusomterByUsername(String username, int csrId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
      checkReady();
      getCusomterByUsername_call method_call = new getCusomterByUsername_call(username, csrId, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class getCusomterByUsername_call extends org.apache.thrift.async.TAsyncMethodCall {
      private String username;
      private int csrId;
      public getCusomterByUsername_call(String username, int csrId, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.username = username;
        this.csrId = csrId;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getCusomterByUsername", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getCusomterByUsername_args args = new getCusomterByUsername_args();
        args.setUsername(username);
        args.setCsrId(csrId);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public Customer getResult() throws org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_getCusomterByUsername();
      }
    }

    public void getCusomterInfoByUsername(String username, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
      checkReady();
      getCusomterInfoByUsername_call method_call = new getCusomterInfoByUsername_call(username, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class getCusomterInfoByUsername_call extends org.apache.thrift.async.TAsyncMethodCall {
      private String username;
      public getCusomterInfoByUsername_call(String username, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.username = username;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getCusomterInfoByUsername", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getCusomterInfoByUsername_args args = new getCusomterInfoByUsername_args();
        args.setUsername(username);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public Customer getResult() throws csr_error, org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_getCusomterInfoByUsername();
      }
    }

    public void phoneCallback(String username, int csrId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
      checkReady();
      phoneCallback_call method_call = new phoneCallback_call(username, csrId, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class phoneCallback_call extends org.apache.thrift.async.TAsyncMethodCall {
      private String username;
      private int csrId;
      public phoneCallback_call(String username, int csrId, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.username = username;
        this.csrId = csrId;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("phoneCallback", org.apache.thrift.protocol.TMessageType.CALL, 0));
        phoneCallback_args args = new phoneCallback_args();
        args.setUsername(username);
        args.setCsrId(csrId);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public void getResult() throws csr_error, org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        (new Client(prot)).recv_phoneCallback();
      }
    }

    public void getCustomerUsernameByCustomerId(int customerId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
      checkReady();
      getCustomerUsernameByCustomerId_call method_call = new getCustomerUsernameByCustomerId_call(customerId, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class getCustomerUsernameByCustomerId_call extends org.apache.thrift.async.TAsyncMethodCall {
      private int customerId;
      public getCustomerUsernameByCustomerId_call(int customerId, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.customerId = customerId;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getCustomerUsernameByCustomerId", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getCustomerUsernameByCustomerId_args args = new getCustomerUsernameByCustomerId_args();
        args.setCustomerId(customerId);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public List<String> getResult() throws csr_error, org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_getCustomerUsernameByCustomerId();
      }
    }

    public void setCustomerInfo(CustomerDetail customerDetail, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
      checkReady();
      setCustomerInfo_call method_call = new setCustomerInfo_call(customerDetail, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class setCustomerInfo_call extends org.apache.thrift.async.TAsyncMethodCall {
      private CustomerDetail customerDetail;
      public setCustomerInfo_call(CustomerDetail customerDetail, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.customerDetail = customerDetail;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("setCustomerInfo", org.apache.thrift.protocol.TMessageType.CALL, 0));
        setCustomerInfo_args args = new setCustomerInfo_args();
        args.setCustomerDetail(customerDetail);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public void getResult() throws org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        (new Client(prot)).recv_setCustomerInfo();
      }
    }

    public void bindCSR(String username, int newCSRId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
      checkReady();
      bindCSR_call method_call = new bindCSR_call(username, newCSRId, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class bindCSR_call extends org.apache.thrift.async.TAsyncMethodCall {
      private String username;
      private int newCSRId;
      public bindCSR_call(String username, int newCSRId, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.username = username;
        this.newCSRId = newCSRId;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("bindCSR", org.apache.thrift.protocol.TMessageType.CALL, 0));
        bindCSR_args args = new bindCSR_args();
        args.setUsername(username);
        args.setNewCSRId(newCSRId);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public CSRInfo getResult() throws bind_error, org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_bindCSR();
      }
    }

    public void getRelatedCSRInfoByUsername_client(String username, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
      checkReady();
      getRelatedCSRInfoByUsername_client_call method_call = new getRelatedCSRInfoByUsername_client_call(username, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class getRelatedCSRInfoByUsername_client_call extends org.apache.thrift.async.TAsyncMethodCall {
      private String username;
      public getRelatedCSRInfoByUsername_client_call(String username, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.username = username;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getRelatedCSRInfoByUsername_client", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getRelatedCSRInfoByUsername_client_args args = new getRelatedCSRInfoByUsername_client_args();
        args.setUsername(username);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public CSRInfo getResult() throws csr_error, org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_getRelatedCSRInfoByUsername_client();
      }
    }

    public void getRecommendCSRList(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
      checkReady();
      getRecommendCSRList_call method_call = new getRecommendCSRList_call(resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class getRecommendCSRList_call extends org.apache.thrift.async.TAsyncMethodCall {
      public getRecommendCSRList_call(org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getRecommendCSRList", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getRecommendCSRList_args args = new getRecommendCSRList_args();
        args.write(prot);
        prot.writeMessageEnd();
      }

      public List<CSRInfo> getResult() throws org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_getRecommendCSRList();
      }
    }

    public void sendMsgToCSROrCSP(String sender, String message, int msgType, boolean sendToCSP, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
      checkReady();
      sendMsgToCSROrCSP_call method_call = new sendMsgToCSROrCSP_call(sender, message, msgType, sendToCSP, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class sendMsgToCSROrCSP_call extends org.apache.thrift.async.TAsyncMethodCall {
      private String sender;
      private String message;
      private int msgType;
      private boolean sendToCSP;
      public sendMsgToCSROrCSP_call(String sender, String message, int msgType, boolean sendToCSP, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.sender = sender;
        this.message = message;
        this.msgType = msgType;
        this.sendToCSP = sendToCSP;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("sendMsgToCSROrCSP", org.apache.thrift.protocol.TMessageType.CALL, 0));
        sendMsgToCSROrCSP_args args = new sendMsgToCSROrCSP_args();
        args.setSender(sender);
        args.setMessage(message);
        args.setMsgType(msgType);
        args.setSendToCSP(sendToCSP);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public void getResult() throws CRMMsgError, org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        (new Client(prot)).recv_sendMsgToCSROrCSP();
      }
    }

  }

  public static class Processor<I extends Iface> extends org.apache.thrift.TBaseProcessor<I> implements org.apache.thrift.TProcessor {
    private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName());
    public Processor(I iface) {
      super(iface, getProcessMap(new HashMap<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>>()));
    }

    protected Processor(I iface, Map<String,  org.apache.thrift.ProcessFunction<I, ? extends  org.apache.thrift.TBase>> processMap) {
      super(iface, getProcessMap(processMap));
    }

    private static <I extends Iface> Map<String,  org.apache.thrift.ProcessFunction<I, ? extends  org.apache.thrift.TBase>> getProcessMap(Map<String,  org.apache.thrift.ProcessFunction<I, ? extends  org.apache.thrift.TBase>> processMap) {
      processMap.put("csrLogin", new csrLogin());
      processMap.put("getCSRInfoByCSRId", new getCSRInfoByCSRId());
      processMap.put("getCSRInfoByCSRJobId", new getCSRInfoByCSRJobId());
      processMap.put("getRelatedCSRInfoByUsername", new getRelatedCSRInfoByUsername());
      processMap.put("getRelatedCSPByUsername", new getRelatedCSPByUsername());
      processMap.put("getCusomterListByCSRId", new getCusomterListByCSRId());
      processMap.put("getCustomerUsernameList", new getCustomerUsernameList());
      processMap.put("getCusomterByUsername", new getCusomterByUsername());
      processMap.put("getCusomterInfoByUsername", new getCusomterInfoByUsername());
      processMap.put("phoneCallback", new phoneCallback());
      processMap.put("getCustomerUsernameByCustomerId", new getCustomerUsernameByCustomerId());
      processMap.put("setCustomerInfo", new setCustomerInfo());
      processMap.put("bindCSR", new bindCSR());
      processMap.put("getRelatedCSRInfoByUsername_client", new getRelatedCSRInfoByUsername_client());
      processMap.put("getRecommendCSRList", new getRecommendCSRList());
      processMap.put("sendMsgToCSROrCSP", new sendMsgToCSROrCSP());
      return processMap;
    }

    public static class csrLogin<I extends Iface> extends org.apache.thrift.ProcessFunction<I, csrLogin_args> {
      public csrLogin() {
        super("csrLogin");
      }

      public csrLogin_args getEmptyArgsInstance() {
        return new csrLogin_args();
      }

      protected boolean isOneway() {
        return false;
      }

      public csrLogin_result getResult(I iface, csrLogin_args args) throws org.apache.thrift.TException {
        csrLogin_result result = new csrLogin_result();
        try {
          result.success = iface.csrLogin(args.csrName, args.password);
          result.setSuccessIsSet(true);
        } catch (csr_error error) {
          result.error = error;
        }
        return result;
      }
    }

    public static class getCSRInfoByCSRId<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getCSRInfoByCSRId_args> {
      public getCSRInfoByCSRId() {
        super("getCSRInfoByCSRId");
      }

      public getCSRInfoByCSRId_args getEmptyArgsInstance() {
        return new getCSRInfoByCSRId_args();
      }

      protected boolean isOneway() {
        return false;
      }

      public getCSRInfoByCSRId_result getResult(I iface, getCSRInfoByCSRId_args args) throws org.apache.thrift.TException {
        getCSRInfoByCSRId_result result = new getCSRInfoByCSRId_result();
        try {
          result.success = iface.getCSRInfoByCSRId(args.csrId);
        } catch (bind_error error) {
          result.error = error;
        }
        return result;
      }
    }

    public static class getCSRInfoByCSRJobId<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getCSRInfoByCSRJobId_args> {
      public getCSRInfoByCSRJobId() {
        super("getCSRInfoByCSRJobId");
      }

      public getCSRInfoByCSRJobId_args getEmptyArgsInstance() {
        return new getCSRInfoByCSRJobId_args();
      }

      protected boolean isOneway() {
        return false;
      }

      public getCSRInfoByCSRJobId_result getResult(I iface, getCSRInfoByCSRJobId_args args) throws org.apache.thrift.TException {
        getCSRInfoByCSRJobId_result result = new getCSRInfoByCSRJobId_result();
        try {
          result.success = iface.getCSRInfoByCSRJobId(args.csrJobId);
        } catch (bind_error error) {
          result.error = error;
        }
        return result;
      }
    }

    public static class getRelatedCSRInfoByUsername<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getRelatedCSRInfoByUsername_args> {
      public getRelatedCSRInfoByUsername() {
        super("getRelatedCSRInfoByUsername");
      }

      public getRelatedCSRInfoByUsername_args getEmptyArgsInstance() {
        return new getRelatedCSRInfoByUsername_args();
      }

      protected boolean isOneway() {
        return false;
      }

      public getRelatedCSRInfoByUsername_result getResult(I iface, getRelatedCSRInfoByUsername_args args) throws org.apache.thrift.TException {
        getRelatedCSRInfoByUsername_result result = new getRelatedCSRInfoByUsername_result();
        try {
          result.success = iface.getRelatedCSRInfoByUsername(args.username);
        } catch (csr_error error) {
          result.error = error;
        }
        return result;
      }
    }

    public static class getRelatedCSPByUsername<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getRelatedCSPByUsername_args> {
      public getRelatedCSPByUsername() {
        super("getRelatedCSPByUsername");
      }

      public getRelatedCSPByUsername_args getEmptyArgsInstance() {
        return new getRelatedCSPByUsername_args();
      }

      protected boolean isOneway() {
        return false;
      }

      public getRelatedCSPByUsername_result getResult(I iface, getRelatedCSPByUsername_args args) throws org.apache.thrift.TException {
        getRelatedCSPByUsername_result result = new getRelatedCSPByUsername_result();
        try {
          result.success = iface.getRelatedCSPByUsername(args.username);
        } catch (csr_error error) {
          result.error = error;
        }
        return result;
      }
    }

    public static class getCusomterListByCSRId<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getCusomterListByCSRId_args> {
      public getCusomterListByCSRId() {
        super("getCusomterListByCSRId");
      }

      public getCusomterListByCSRId_args getEmptyArgsInstance() {
        return new getCusomterListByCSRId_args();
      }

      protected boolean isOneway() {
        return false;
      }

      public getCusomterListByCSRId_result getResult(I iface, getCusomterListByCSRId_args args) throws org.apache.thrift.TException {
        getCusomterListByCSRId_result result = new getCusomterListByCSRId_result();
        try {
          result.success = iface.getCusomterListByCSRId(args.csrId);
        } catch (csr_error error) {
          result.error = error;
        }
        return result;
      }
    }

    public static class getCustomerUsernameList<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getCustomerUsernameList_args> {
      public getCustomerUsernameList() {
        super("getCustomerUsernameList");
      }

      public getCustomerUsernameList_args getEmptyArgsInstance() {
        return new getCustomerUsernameList_args();
      }

      protected boolean isOneway() {
        return false;
      }

      public getCustomerUsernameList_result getResult(I iface, getCustomerUsernameList_args args) throws org.apache.thrift.TException {
        getCustomerUsernameList_result result = new getCustomerUsernameList_result();
        try {
          result.success = iface.getCustomerUsernameList(args.csrId, args.customerStatus);
        } catch (csr_error error) {
          result.error = error;
        }
        return result;
      }
    }

    public static class getCusomterByUsername<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getCusomterByUsername_args> {
      public getCusomterByUsername() {
        super("getCusomterByUsername");
      }

      public getCusomterByUsername_args getEmptyArgsInstance() {
        return new getCusomterByUsername_args();
      }

      protected boolean isOneway() {
        return false;
      }

      public getCusomterByUsername_result getResult(I iface, getCusomterByUsername_args args) throws org.apache.thrift.TException {
        getCusomterByUsername_result result = new getCusomterByUsername_result();
        result.success = iface.getCusomterByUsername(args.username, args.csrId);
        return result;
      }
    }

    public static class getCusomterInfoByUsername<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getCusomterInfoByUsername_args> {
      public getCusomterInfoByUsername() {
        super("getCusomterInfoByUsername");
      }

      public getCusomterInfoByUsername_args getEmptyArgsInstance() {
        return new getCusomterInfoByUsername_args();
      }

      protected boolean isOneway() {
        return false;
      }

      public getCusomterInfoByUsername_result getResult(I iface, getCusomterInfoByUsername_args args) throws org.apache.thrift.TException {
        getCusomterInfoByUsername_result result = new getCusomterInfoByUsername_result();
        try {
          result.success = iface.getCusomterInfoByUsername(args.username);
        } catch (csr_error error) {
          result.error = error;
        }
        return result;
      }
    }

    public static class phoneCallback<I extends Iface> extends org.apache.thrift.ProcessFunction<I, phoneCallback_args> {
      public phoneCallback() {
        super("phoneCallback");
      }

      public phoneCallback_args getEmptyArgsInstance() {
        return new phoneCallback_args();
      }

      protected boolean isOneway() {
        return false;
      }

      public phoneCallback_result getResult(I iface, phoneCallback_args args) throws org.apache.thrift.TException {
        phoneCallback_result result = new phoneCallback_result();
        try {
          iface.phoneCallback(args.username, args.csrId);
        } catch (csr_error error) {
          result.error = error;
        }
        return result;
      }
    }

    public static class getCustomerUsernameByCustomerId<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getCustomerUsernameByCustomerId_args> {
      public getCustomerUsernameByCustomerId() {
        super("getCustomerUsernameByCustomerId");
      }

      public getCustomerUsernameByCustomerId_args getEmptyArgsInstance() {
        return new getCustomerUsernameByCustomerId_args();
      }

      protected boolean isOneway() {
        return false;
      }

      public getCustomerUsernameByCustomerId_result getResult(I iface, getCustomerUsernameByCustomerId_args args) throws org.apache.thrift.TException {
        getCustomerUsernameByCustomerId_result result = new getCustomerUsernameByCustomerId_result();
        try {
          result.success = iface.getCustomerUsernameByCustomerId(args.customerId);
        } catch (csr_error error) {
          result.error = error;
        }
        return result;
      }
    }

    public static class setCustomerInfo<I extends Iface> extends org.apache.thrift.ProcessFunction<I, setCustomerInfo_args> {
      public setCustomerInfo() {
        super("setCustomerInfo");
      }

      public setCustomerInfo_args getEmptyArgsInstance() {
        return new setCustomerInfo_args();
      }

      protected boolean isOneway() {
        return false;
      }

      public setCustomerInfo_result getResult(I iface, setCustomerInfo_args args) throws org.apache.thrift.TException {
        setCustomerInfo_result result = new setCustomerInfo_result();
        iface.setCustomerInfo(args.customerDetail);
        return result;
      }
    }

    public static class bindCSR<I extends Iface> extends org.apache.thrift.ProcessFunction<I, bindCSR_args> {
      public bindCSR() {
        super("bindCSR");
      }

      public bindCSR_args getEmptyArgsInstance() {
        return new bindCSR_args();
      }

      protected boolean isOneway() {
        return false;
      }

      public bindCSR_result getResult(I iface, bindCSR_args args) throws org.apache.thrift.TException {
        bindCSR_result result = new bindCSR_result();
        try {
          result.success = iface.bindCSR(args.username, args.newCSRId);
        } catch (bind_error error) {
          result.error = error;
        }
        return result;
      }
    }

    public static class getRelatedCSRInfoByUsername_client<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getRelatedCSRInfoByUsername_client_args> {
      public getRelatedCSRInfoByUsername_client() {
        super("getRelatedCSRInfoByUsername_client");
      }

      public getRelatedCSRInfoByUsername_client_args getEmptyArgsInstance() {
        return new getRelatedCSRInfoByUsername_client_args();
      }

      protected boolean isOneway() {
        return false;
      }

      public getRelatedCSRInfoByUsername_client_result getResult(I iface, getRelatedCSRInfoByUsername_client_args args) throws org.apache.thrift.TException {
        getRelatedCSRInfoByUsername_client_result result = new getRelatedCSRInfoByUsername_client_result();
        try {
          result.success = iface.getRelatedCSRInfoByUsername_client(args.username);
        } catch (csr_error error) {
          result.error = error;
        }
        return result;
      }
    }

    public static class getRecommendCSRList<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getRecommendCSRList_args> {
      public getRecommendCSRList() {
        super("getRecommendCSRList");
      }

      public getRecommendCSRList_args getEmptyArgsInstance() {
        return new getRecommendCSRList_args();
      }

      protected boolean isOneway() {
        return false;
      }

      public getRecommendCSRList_result getResult(I iface, getRecommendCSRList_args args) throws org.apache.thrift.TException {
        getRecommendCSRList_result result = new getRecommendCSRList_result();
        result.success = iface.getRecommendCSRList();
        return result;
      }
    }

    public static class sendMsgToCSROrCSP<I extends Iface> extends org.apache.thrift.ProcessFunction<I, sendMsgToCSROrCSP_args> {
      public sendMsgToCSROrCSP() {
        super("sendMsgToCSROrCSP");
      }

      public sendMsgToCSROrCSP_args getEmptyArgsInstance() {
        return new sendMsgToCSROrCSP_args();
      }

      protected boolean isOneway() {
        return false;
      }

      public sendMsgToCSROrCSP_result getResult(I iface, sendMsgToCSROrCSP_args args) throws org.apache.thrift.TException {
        sendMsgToCSROrCSP_result result = new sendMsgToCSROrCSP_result();
        try {
          iface.sendMsgToCSROrCSP(args.sender, args.message, args.msgType, args.sendToCSP);
        } catch (CRMMsgError error) {
          result.error = error;
        }
        return result;
      }
    }

  }

  public static class AsyncProcessor<I extends AsyncIface> extends org.apache.thrift.TBaseAsyncProcessor<I> {
    private static final Logger LOGGER = LoggerFactory.getLogger(AsyncProcessor.class.getName());
    public AsyncProcessor(I iface) {
      super(iface, getProcessMap(new HashMap<String, org.apache.thrift.AsyncProcessFunction<I, ? extends org.apache.thrift.TBase, ?>>()));
    }

    protected AsyncProcessor(I iface, Map<String,  org.apache.thrift.AsyncProcessFunction<I, ? extends  org.apache.thrift.TBase, ?>> processMap) {
      super(iface, getProcessMap(processMap));
    }

    private static <I extends AsyncIface> Map<String,  org.apache.thrift.AsyncProcessFunction<I, ? extends  org.apache.thrift.TBase,?>> getProcessMap(Map<String,  org.apache.thrift.AsyncProcessFunction<I, ? extends  org.apache.thrift.TBase, ?>> processMap) {
      processMap.put("csrLogin", new csrLogin());
      processMap.put("getCSRInfoByCSRId", new getCSRInfoByCSRId());
      processMap.put("getCSRInfoByCSRJobId", new getCSRInfoByCSRJobId());
      processMap.put("getRelatedCSRInfoByUsername", new getRelatedCSRInfoByUsername());
      processMap.put("getRelatedCSPByUsername", new getRelatedCSPByUsername());
      processMap.put("getCusomterListByCSRId", new getCusomterListByCSRId());
      processMap.put("getCustomerUsernameList", new getCustomerUsernameList());
      processMap.put("getCusomterByUsername", new getCusomterByUsername());
      processMap.put("getCusomterInfoByUsername", new getCusomterInfoByUsername());
      processMap.put("phoneCallback", new phoneCallback());
      processMap.put("getCustomerUsernameByCustomerId", new getCustomerUsernameByCustomerId());
      processMap.put("setCustomerInfo", new setCustomerInfo());
      processMap.put("bindCSR", new bindCSR());
      processMap.put("getRelatedCSRInfoByUsername_client", new getRelatedCSRInfoByUsername_client());
      processMap.put("getRecommendCSRList", new getRecommendCSRList());
      processMap.put("sendMsgToCSROrCSP", new sendMsgToCSROrCSP());
      return processMap;
    }

    public static class csrLogin<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, csrLogin_args, Integer> {
      public csrLogin() {
        super("csrLogin");
      }

      public csrLogin_args getEmptyArgsInstance() {
        return new csrLogin_args();
      }

      public AsyncMethodCallback<Integer> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
        final org.apache.thrift.AsyncProcessFunction fcall = this;
        return new AsyncMethodCallback<Integer>() { 
          public void onComplete(Integer o) {
            csrLogin_result result = new csrLogin_result();
            result.success = o;
            result.setSuccessIsSet(true);
            try {
              fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
              return;
            } catch (Exception e) {
              LOGGER.error("Exception writing to internal frame buffer", e);
            }
            fb.close();
          }
          public void onError(Exception e) {
            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
            org.apache.thrift.TBase msg;
            csrLogin_result result = new csrLogin_result();
            if (e instanceof csr_error) {
                        result.error = (csr_error) e;
                        result.setErrorIsSet(true);
                        msg = result;
            }
             else 
            {
              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
              msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
            }
            try {
              fcall.sendResponse(fb,msg,msgType,seqid);
              return;
            } catch (Exception ex) {
              LOGGER.error("Exception writing to internal frame buffer", ex);
            }
            fb.close();
          }
        };
      }

      protected boolean isOneway() {
        return false;
      }

      public void start(I iface, csrLogin_args args, org.apache.thrift.async.AsyncMethodCallback<Integer> resultHandler) throws TException {
        iface.csrLogin(args.csrName, args.password,resultHandler);
      }
    }

    public static class getCSRInfoByCSRId<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getCSRInfoByCSRId_args, CSRInfo> {
      public getCSRInfoByCSRId() {
        super("getCSRInfoByCSRId");
      }

      public getCSRInfoByCSRId_args getEmptyArgsInstance() {
        return new getCSRInfoByCSRId_args();
      }

      public AsyncMethodCallback<CSRInfo> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
        final org.apache.thrift.AsyncProcessFunction fcall = this;
        return new AsyncMethodCallback<CSRInfo>() { 
          public void onComplete(CSRInfo o) {
            getCSRInfoByCSRId_result result = new getCSRInfoByCSRId_result();
            result.success = o;
            try {
              fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
              return;
            } catch (Exception e) {
              LOGGER.error("Exception writing to internal frame buffer", e);
            }
            fb.close();
          }
          public void onError(Exception e) {
            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
            org.apache.thrift.TBase msg;
            getCSRInfoByCSRId_result result = new getCSRInfoByCSRId_result();
            if (e instanceof bind_error) {
                        result.error = (bind_error) e;
                        result.setErrorIsSet(true);
                        msg = result;
            }
             else 
            {
              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
              msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
            }
            try {
              fcall.sendResponse(fb,msg,msgType,seqid);
              return;
            } catch (Exception ex) {
              LOGGER.error("Exception writing to internal frame buffer", ex);
            }
            fb.close();
          }
        };
      }

      protected boolean isOneway() {
        return false;
      }

      public void start(I iface, getCSRInfoByCSRId_args args, org.apache.thrift.async.AsyncMethodCallback<CSRInfo> resultHandler) throws TException {
        iface.getCSRInfoByCSRId(args.csrId,resultHandler);
      }
    }

    public static class getCSRInfoByCSRJobId<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getCSRInfoByCSRJobId_args, CSRInfo> {
      public getCSRInfoByCSRJobId() {
        super("getCSRInfoByCSRJobId");
      }

      public getCSRInfoByCSRJobId_args getEmptyArgsInstance() {
        return new getCSRInfoByCSRJobId_args();
      }

      public AsyncMethodCallback<CSRInfo> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
        final org.apache.thrift.AsyncProcessFunction fcall = this;
        return new AsyncMethodCallback<CSRInfo>() { 
          public void onComplete(CSRInfo o) {
            getCSRInfoByCSRJobId_result result = new getCSRInfoByCSRJobId_result();
            result.success = o;
            try {
              fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
              return;
            } catch (Exception e) {
              LOGGER.error("Exception writing to internal frame buffer", e);
            }
            fb.close();
          }
          public void onError(Exception e) {
            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
            org.apache.thrift.TBase msg;
            getCSRInfoByCSRJobId_result result = new getCSRInfoByCSRJobId_result();
            if (e instanceof bind_error) {
                        result.error = (bind_error) e;
                        result.setErrorIsSet(true);
                        msg = result;
            }
             else 
            {
              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
              msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
            }
            try {
              fcall.sendResponse(fb,msg,msgType,seqid);
              return;
            } catch (Exception ex) {
              LOGGER.error("Exception writing to internal frame buffer", ex);
            }
            fb.close();
          }
        };
      }

      protected boolean isOneway() {
        return false;
      }

      public void start(I iface, getCSRInfoByCSRJobId_args args, org.apache.thrift.async.AsyncMethodCallback<CSRInfo> resultHandler) throws TException {
        iface.getCSRInfoByCSRJobId(args.csrJobId,resultHandler);
      }
    }

    public static class getRelatedCSRInfoByUsername<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getRelatedCSRInfoByUsername_args, CSRInfo> {
      public getRelatedCSRInfoByUsername() {
        super("getRelatedCSRInfoByUsername");
      }

      public getRelatedCSRInfoByUsername_args getEmptyArgsInstance() {
        return new getRelatedCSRInfoByUsername_args();
      }

      public AsyncMethodCallback<CSRInfo> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
        final org.apache.thrift.AsyncProcessFunction fcall = this;
        return new AsyncMethodCallback<CSRInfo>() { 
          public void onComplete(CSRInfo o) {
            getRelatedCSRInfoByUsername_result result = new getRelatedCSRInfoByUsername_result();
            result.success = o;
            try {
              fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
              return;
            } catch (Exception e) {
              LOGGER.error("Exception writing to internal frame buffer", e);
            }
            fb.close();
          }
          public void onError(Exception e) {
            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
            org.apache.thrift.TBase msg;
            getRelatedCSRInfoByUsername_result result = new getRelatedCSRInfoByUsername_result();
            if (e instanceof csr_error) {
                        result.error = (csr_error) e;
                        result.setErrorIsSet(true);
                        msg = result;
            }
             else 
            {
              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
              msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
            }
            try {
              fcall.sendResponse(fb,msg,msgType,seqid);
              return;
            } catch (Exception ex) {
              LOGGER.error("Exception writing to internal frame buffer", ex);
            }
            fb.close();
          }
        };
      }

      protected boolean isOneway() {
        return false;
      }

      public void start(I iface, getRelatedCSRInfoByUsername_args args, org.apache.thrift.async.AsyncMethodCallback<CSRInfo> resultHandler) throws TException {
        iface.getRelatedCSRInfoByUsername(args.username,resultHandler);
      }
    }

    public static class getRelatedCSPByUsername<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getRelatedCSPByUsername_args, CSRInfo> {
      public getRelatedCSPByUsername() {
        super("getRelatedCSPByUsername");
      }

      public getRelatedCSPByUsername_args getEmptyArgsInstance() {
        return new getRelatedCSPByUsername_args();
      }

      public AsyncMethodCallback<CSRInfo> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
        final org.apache.thrift.AsyncProcessFunction fcall = this;
        return new AsyncMethodCallback<CSRInfo>() { 
          public void onComplete(CSRInfo o) {
            getRelatedCSPByUsername_result result = new getRelatedCSPByUsername_result();
            result.success = o;
            try {
              fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
              return;
            } catch (Exception e) {
              LOGGER.error("Exception writing to internal frame buffer", e);
            }
            fb.close();
          }
          public void onError(Exception e) {
            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
            org.apache.thrift.TBase msg;
            getRelatedCSPByUsername_result result = new getRelatedCSPByUsername_result();
            if (e instanceof csr_error) {
                        result.error = (csr_error) e;
                        result.setErrorIsSet(true);
                        msg = result;
            }
             else 
            {
              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
              msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
            }
            try {
              fcall.sendResponse(fb,msg,msgType,seqid);
              return;
            } catch (Exception ex) {
              LOGGER.error("Exception writing to internal frame buffer", ex);
            }
            fb.close();
          }
        };
      }

      protected boolean isOneway() {
        return false;
      }

      public void start(I iface, getRelatedCSPByUsername_args args, org.apache.thrift.async.AsyncMethodCallback<CSRInfo> resultHandler) throws TException {
        iface.getRelatedCSPByUsername(args.username,resultHandler);
      }
    }

    public static class getCusomterListByCSRId<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getCusomterListByCSRId_args, List<Customer>> {
      public getCusomterListByCSRId() {
        super("getCusomterListByCSRId");
      }

      public getCusomterListByCSRId_args getEmptyArgsInstance() {
        return new getCusomterListByCSRId_args();
      }

      public AsyncMethodCallback<List<Customer>> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
        final org.apache.thrift.AsyncProcessFunction fcall = this;
        return new AsyncMethodCallback<List<Customer>>() { 
          public void onComplete(List<Customer> o) {
            getCusomterListByCSRId_result result = new getCusomterListByCSRId_result();
            result.success = o;
            try {
              fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
              return;
            } catch (Exception e) {
              LOGGER.error("Exception writing to internal frame buffer", e);
            }
            fb.close();
          }
          public void onError(Exception e) {
            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
            org.apache.thrift.TBase msg;
            getCusomterListByCSRId_result result = new getCusomterListByCSRId_result();
            if (e instanceof csr_error) {
                        result.error = (csr_error) e;
                        result.setErrorIsSet(true);
                        msg = result;
            }
             else 
            {
              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
              msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
            }
            try {
              fcall.sendResponse(fb,msg,msgType,seqid);
              return;
            } catch (Exception ex) {
              LOGGER.error("Exception writing to internal frame buffer", ex);
            }
            fb.close();
          }
        };
      }

      protected boolean isOneway() {
        return false;
      }

      public void start(I iface, getCusomterListByCSRId_args args, org.apache.thrift.async.AsyncMethodCallback<List<Customer>> resultHandler) throws TException {
        iface.getCusomterListByCSRId(args.csrId,resultHandler);
      }
    }

    public static class getCustomerUsernameList<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getCustomerUsernameList_args, List<String>> {
      public getCustomerUsernameList() {
        super("getCustomerUsernameList");
      }

      public getCustomerUsernameList_args getEmptyArgsInstance() {
        return new getCustomerUsernameList_args();
      }

      public AsyncMethodCallback<List<String>> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
        final org.apache.thrift.AsyncProcessFunction fcall = this;
        return new AsyncMethodCallback<List<String>>() { 
          public void onComplete(List<String> o) {
            getCustomerUsernameList_result result = new getCustomerUsernameList_result();
            result.success = o;
            try {
              fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
              return;
            } catch (Exception e) {
              LOGGER.error("Exception writing to internal frame buffer", e);
            }
            fb.close();
          }
          public void onError(Exception e) {
            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
            org.apache.thrift.TBase msg;
            getCustomerUsernameList_result result = new getCustomerUsernameList_result();
            if (e instanceof csr_error) {
                        result.error = (csr_error) e;
                        result.setErrorIsSet(true);
                        msg = result;
            }
             else 
            {
              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
              msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
            }
            try {
              fcall.sendResponse(fb,msg,msgType,seqid);
              return;
            } catch (Exception ex) {
              LOGGER.error("Exception writing to internal frame buffer", ex);
            }
            fb.close();
          }
        };
      }

      protected boolean isOneway() {
        return false;
      }

      public void start(I iface, getCustomerUsernameList_args args, org.apache.thrift.async.AsyncMethodCallback<List<String>> resultHandler) throws TException {
        iface.getCustomerUsernameList(args.csrId, args.customerStatus,resultHandler);
      }
    }

    public static class getCusomterByUsername<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getCusomterByUsername_args, Customer> {
      public getCusomterByUsername() {
        super("getCusomterByUsername");
      }

      public getCusomterByUsername_args getEmptyArgsInstance() {
        return new getCusomterByUsername_args();
      }

      public AsyncMethodCallback<Customer> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
        final org.apache.thrift.AsyncProcessFunction fcall = this;
        return new AsyncMethodCallback<Customer>() { 
          public void onComplete(Customer o) {
            getCusomterByUsername_result result = new getCusomterByUsername_result();
            result.success = o;
            try {
              fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
              return;
            } catch (Exception e) {
              LOGGER.error("Exception writing to internal frame buffer", e);
            }
            fb.close();
          }
          public void onError(Exception e) {
            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
            org.apache.thrift.TBase msg;
            getCusomterByUsername_result result = new getCusomterByUsername_result();
            {
              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
              msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
            }
            try {
              fcall.sendResponse(fb,msg,msgType,seqid);
              return;
            } catch (Exception ex) {
              LOGGER.error("Exception writing to internal frame buffer", ex);
            }
            fb.close();
          }
        };
      }

      protected boolean isOneway() {
        return false;
      }

      public void start(I iface, getCusomterByUsername_args args, org.apache.thrift.async.AsyncMethodCallback<Customer> resultHandler) throws TException {
        iface.getCusomterByUsername(args.username, args.csrId,resultHandler);
      }
    }

    public static class getCusomterInfoByUsername<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getCusomterInfoByUsername_args, Customer> {
      public getCusomterInfoByUsername() {
        super("getCusomterInfoByUsername");
      }

      public getCusomterInfoByUsername_args getEmptyArgsInstance() {
        return new getCusomterInfoByUsername_args();
      }

      public AsyncMethodCallback<Customer> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
        final org.apache.thrift.AsyncProcessFunction fcall = this;
        return new AsyncMethodCallback<Customer>() { 
          public void onComplete(Customer o) {
            getCusomterInfoByUsername_result result = new getCusomterInfoByUsername_result();
            result.success = o;
            try {
              fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
              return;
            } catch (Exception e) {
              LOGGER.error("Exception writing to internal frame buffer", e);
            }
            fb.close();
          }
          public void onError(Exception e) {
            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
            org.apache.thrift.TBase msg;
            getCusomterInfoByUsername_result result = new getCusomterInfoByUsername_result();
            if (e instanceof csr_error) {
                        result.error = (csr_error) e;
                        result.setErrorIsSet(true);
                        msg = result;
            }
             else 
            {
              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
              msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
            }
            try {
              fcall.sendResponse(fb,msg,msgType,seqid);
              return;
            } catch (Exception ex) {
              LOGGER.error("Exception writing to internal frame buffer", ex);
            }
            fb.close();
          }
        };
      }

      protected boolean isOneway() {
        return false;
      }

      public void start(I iface, getCusomterInfoByUsername_args args, org.apache.thrift.async.AsyncMethodCallback<Customer> resultHandler) throws TException {
        iface.getCusomterInfoByUsername(args.username,resultHandler);
      }
    }

    public static class phoneCallback<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, phoneCallback_args, Void> {
      public phoneCallback() {
        super("phoneCallback");
      }

      public phoneCallback_args getEmptyArgsInstance() {
        return new phoneCallback_args();
      }

      public AsyncMethodCallback<Void> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
        final org.apache.thrift.AsyncProcessFunction fcall = this;
        return new AsyncMethodCallback<Void>() { 
          public void onComplete(Void o) {
            phoneCallback_result result = new phoneCallback_result();
            try {
              fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
              return;
            } catch (Exception e) {
              LOGGER.error("Exception writing to internal frame buffer", e);
            }
            fb.close();
          }
          public void onError(Exception e) {
            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
            org.apache.thrift.TBase msg;
            phoneCallback_result result = new phoneCallback_result();
            if (e instanceof csr_error) {
                        result.error = (csr_error) e;
                        result.setErrorIsSet(true);
                        msg = result;
            }
             else 
            {
              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
              msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
            }
            try {
              fcall.sendResponse(fb,msg,msgType,seqid);
              return;
            } catch (Exception ex) {
              LOGGER.error("Exception writing to internal frame buffer", ex);
            }
            fb.close();
          }
        };
      }

      protected boolean isOneway() {
        return false;
      }

      public void start(I iface, phoneCallback_args args, org.apache.thrift.async.AsyncMethodCallback<Void> resultHandler) throws TException {
        iface.phoneCallback(args.username, args.csrId,resultHandler);
      }
    }

    public static class getCustomerUsernameByCustomerId<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getCustomerUsernameByCustomerId_args, List<String>> {
      public getCustomerUsernameByCustomerId() {
        super("getCustomerUsernameByCustomerId");
      }

      public getCustomerUsernameByCustomerId_args getEmptyArgsInstance() {
        return new getCustomerUsernameByCustomerId_args();
      }

      public AsyncMethodCallback<List<String>> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
        final org.apache.thrift.AsyncProcessFunction fcall = this;
        return new AsyncMethodCallback<List<String>>() { 
          public void onComplete(List<String> o) {
            getCustomerUsernameByCustomerId_result result = new getCustomerUsernameByCustomerId_result();
            result.success = o;
            try {
              fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
              return;
            } catch (Exception e) {
              LOGGER.error("Exception writing to internal frame buffer", e);
            }
            fb.close();
          }
          public void onError(Exception e) {
            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
            org.apache.thrift.TBase msg;
            getCustomerUsernameByCustomerId_result result = new getCustomerUsernameByCustomerId_result();
            if (e instanceof csr_error) {
                        result.error = (csr_error) e;
                        result.setErrorIsSet(true);
                        msg = result;
            }
             else 
            {
              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
              msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
            }
            try {
              fcall.sendResponse(fb,msg,msgType,seqid);
              return;
            } catch (Exception ex) {
              LOGGER.error("Exception writing to internal frame buffer", ex);
            }
            fb.close();
          }
        };
      }

      protected boolean isOneway() {
        return false;
      }

      public void start(I iface, getCustomerUsernameByCustomerId_args args, org.apache.thrift.async.AsyncMethodCallback<List<String>> resultHandler) throws TException {
        iface.getCustomerUsernameByCustomerId(args.customerId,resultHandler);
      }
    }

    public static class setCustomerInfo<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, setCustomerInfo_args, Void> {
      public setCustomerInfo() {
        super("setCustomerInfo");
      }

      public setCustomerInfo_args getEmptyArgsInstance() {
        return new setCustomerInfo_args();
      }

      public AsyncMethodCallback<Void> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
        final org.apache.thrift.AsyncProcessFunction fcall = this;
        return new AsyncMethodCallback<Void>() { 
          public void onComplete(Void o) {
            setCustomerInfo_result result = new setCustomerInfo_result();
            try {
              fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
              return;
            } catch (Exception e) {
              LOGGER.error("Exception writing to internal frame buffer", e);
            }
            fb.close();
          }
          public void onError(Exception e) {
            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
            org.apache.thrift.TBase msg;
            setCustomerInfo_result result = new setCustomerInfo_result();
            {
              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
              msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
            }
            try {
              fcall.sendResponse(fb,msg,msgType,seqid);
              return;
            } catch (Exception ex) {
              LOGGER.error("Exception writing to internal frame buffer", ex);
            }
            fb.close();
          }
        };
      }

      protected boolean isOneway() {
        return false;
      }

      public void start(I iface, setCustomerInfo_args args, org.apache.thrift.async.AsyncMethodCallback<Void> resultHandler) throws TException {
        iface.setCustomerInfo(args.customerDetail,resultHandler);
      }
    }

    public static class bindCSR<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, bindCSR_args, CSRInfo> {
      public bindCSR() {
        super("bindCSR");
      }

      public bindCSR_args getEmptyArgsInstance() {
        return new bindCSR_args();
      }

      public AsyncMethodCallback<CSRInfo> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
        final org.apache.thrift.AsyncProcessFunction fcall = this;
        return new AsyncMethodCallback<CSRInfo>() { 
          public void onComplete(CSRInfo o) {
            bindCSR_result result = new bindCSR_result();
            result.success = o;
            try {
              fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
              return;
            } catch (Exception e) {
              LOGGER.error("Exception writing to internal frame buffer", e);
            }
            fb.close();
          }
          public void onError(Exception e) {
            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
            org.apache.thrift.TBase msg;
            bindCSR_result result = new bindCSR_result();
            if (e instanceof bind_error) {
                        result.error = (bind_error) e;
                        result.setErrorIsSet(true);
                        msg = result;
            }
             else 
            {
              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
              msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
            }
            try {
              fcall.sendResponse(fb,msg,msgType,seqid);
              return;
            } catch (Exception ex) {
              LOGGER.error("Exception writing to internal frame buffer", ex);
            }
            fb.close();
          }
        };
      }

      protected boolean isOneway() {
        return false;
      }

      public void start(I iface, bindCSR_args args, org.apache.thrift.async.AsyncMethodCallback<CSRInfo> resultHandler) throws TException {
        iface.bindCSR(args.username, args.newCSRId,resultHandler);
      }
    }

    public static class getRelatedCSRInfoByUsername_client<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getRelatedCSRInfoByUsername_client_args, CSRInfo> {
      public getRelatedCSRInfoByUsername_client() {
        super("getRelatedCSRInfoByUsername_client");
      }

      public getRelatedCSRInfoByUsername_client_args getEmptyArgsInstance() {
        return new getRelatedCSRInfoByUsername_client_args();
      }

      public AsyncMethodCallback<CSRInfo> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
        final org.apache.thrift.AsyncProcessFunction fcall = this;
        return new AsyncMethodCallback<CSRInfo>() { 
          public void onComplete(CSRInfo o) {
            getRelatedCSRInfoByUsername_client_result result = new getRelatedCSRInfoByUsername_client_result();
            result.success = o;
            try {
              fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
              return;
            } catch (Exception e) {
              LOGGER.error("Exception writing to internal frame buffer", e);
            }
            fb.close();
          }
          public void onError(Exception e) {
            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
            org.apache.thrift.TBase msg;
            getRelatedCSRInfoByUsername_client_result result = new getRelatedCSRInfoByUsername_client_result();
            if (e instanceof csr_error) {
                        result.error = (csr_error) e;
                        result.setErrorIsSet(true);
                        msg = result;
            }
             else 
            {
              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
              msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
            }
            try {
              fcall.sendResponse(fb,msg,msgType,seqid);
              return;
            } catch (Exception ex) {
              LOGGER.error("Exception writing to internal frame buffer", ex);
            }
            fb.close();
          }
        };
      }

      protected boolean isOneway() {
        return false;
      }

      public void start(I iface, getRelatedCSRInfoByUsername_client_args args, org.apache.thrift.async.AsyncMethodCallback<CSRInfo> resultHandler) throws TException {
        iface.getRelatedCSRInfoByUsername_client(args.username,resultHandler);
      }
    }

    public static class getRecommendCSRList<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getRecommendCSRList_args, List<CSRInfo>> {
      public getRecommendCSRList() {
        super("getRecommendCSRList");
      }

      public getRecommendCSRList_args getEmptyArgsInstance() {
        return new getRecommendCSRList_args();
      }

      public AsyncMethodCallback<List<CSRInfo>> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
        final org.apache.thrift.AsyncProcessFunction fcall = this;
        return new AsyncMethodCallback<List<CSRInfo>>() { 
          public void onComplete(List<CSRInfo> o) {
            getRecommendCSRList_result result = new getRecommendCSRList_result();
            result.success = o;
            try {
              fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
              return;
            } catch (Exception e) {
              LOGGER.error("Exception writing to internal frame buffer", e);
            }
            fb.close();
          }
          public void onError(Exception e) {
            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
            org.apache.thrift.TBase msg;
            getRecommendCSRList_result result = new getRecommendCSRList_result();
            {
              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
              msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
            }
            try {
              fcall.sendResponse(fb,msg,msgType,seqid);
              return;
            } catch (Exception ex) {
              LOGGER.error("Exception writing to internal frame buffer", ex);
            }
            fb.close();
          }
        };
      }

      protected boolean isOneway() {
        return false;
      }

      public void start(I iface, getRecommendCSRList_args args, org.apache.thrift.async.AsyncMethodCallback<List<CSRInfo>> resultHandler) throws TException {
        iface.getRecommendCSRList(resultHandler);
      }
    }

    public static class sendMsgToCSROrCSP<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, sendMsgToCSROrCSP_args, Void> {
      public sendMsgToCSROrCSP() {
        super("sendMsgToCSROrCSP");
      }

      public sendMsgToCSROrCSP_args getEmptyArgsInstance() {
        return new sendMsgToCSROrCSP_args();
      }

      public AsyncMethodCallback<Void> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
        final org.apache.thrift.AsyncProcessFunction fcall = this;
        return new AsyncMethodCallback<Void>() { 
          public void onComplete(Void o) {
            sendMsgToCSROrCSP_result result = new sendMsgToCSROrCSP_result();
            try {
              fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
              return;
            } catch (Exception e) {
              LOGGER.error("Exception writing to internal frame buffer", e);
            }
            fb.close();
          }
          public void onError(Exception e) {
            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
            org.apache.thrift.TBase msg;
            sendMsgToCSROrCSP_result result = new sendMsgToCSROrCSP_result();
            if (e instanceof CRMMsgError) {
                        result.error = (CRMMsgError) e;
                        result.setErrorIsSet(true);
                        msg = result;
            }
             else 
            {
              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
              msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
            }
            try {
              fcall.sendResponse(fb,msg,msgType,seqid);
              return;
            } catch (Exception ex) {
              LOGGER.error("Exception writing to internal frame buffer", ex);
            }
            fb.close();
          }
        };
      }

      protected boolean isOneway() {
        return false;
      }

      public void start(I iface, sendMsgToCSROrCSP_args args, org.apache.thrift.async.AsyncMethodCallback<Void> resultHandler) throws TException {
        iface.sendMsgToCSROrCSP(args.sender, args.message, args.msgType, args.sendToCSP,resultHandler);
      }
    }

  }

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

    private static final org.apache.thrift.protocol.TField CSR_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("csrName", org.apache.thrift.protocol.TType.STRING, (short)1);
    private static final org.apache.thrift.protocol.TField PASSWORD_FIELD_DESC = new org.apache.thrift.protocol.TField("password", org.apache.thrift.protocol.TType.STRING, (short)2);

    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new csrLogin_argsStandardSchemeFactory());
      schemes.put(TupleScheme.class, new csrLogin_argsTupleSchemeFactory());
    }

    public String csrName; // required
    public String password; // required

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

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

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

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // CSR_NAME
            return CSR_NAME;
          case 2: // PASSWORD
            return PASSWORD;
          default:
            return null;
        }
      }

      /**
       * 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, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.CSR_NAME, new org.apache.thrift.meta_data.FieldMetaData("csrName", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
      tmpMap.put(_Fields.PASSWORD, new org.apache.thrift.meta_data.FieldMetaData("password", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(csrLogin_args.class, metaDataMap);
    }

    public csrLogin_args() {
    }

    public csrLogin_args(
      String csrName,
      String password)
    {
      this();
      this.csrName = csrName;
      this.password = password;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public csrLogin_args(csrLogin_args other) {
      if (other.isSetCsrName()) {
        this.csrName = other.csrName;
      }
      if (other.isSetPassword()) {
        this.password = other.password;
      }
    }

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

    @Override
    public void clear() {
      this.csrName = null;
      this.password = null;
    }

    public String getCsrName() {
      return this.csrName;
    }

    public csrLogin_args setCsrName(String csrName) {
      this.csrName = csrName;
      return this;
    }

    public void unsetCsrName() {
      this.csrName = null;
    }

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

    public void setCsrNameIsSet(boolean value) {
      if (!value) {
        this.csrName = null;
      }
    }

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

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

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

    /** Returns true if field password is set (has been assigned 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 CSR_NAME:
        if (value == null) {
          unsetCsrName();
        } else {
          setCsrName((String)value);
        }
        break;

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

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case CSR_NAME:
        return getCsrName();

      case PASSWORD:
        return getPassword();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case CSR_NAME:
        return isSetCsrName();
      case PASSWORD:
        return isSetPassword();
      }
      throw new IllegalStateException();
    }

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

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

      boolean this_present_csrName = true && this.isSetCsrName();
      boolean that_present_csrName = true && that.isSetCsrName();
      if (this_present_csrName || that_present_csrName) {
        if (!(this_present_csrName && that_present_csrName))
          return false;
        if (!this.csrName.equals(that.csrName))
          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() {
      List<Object> list = new ArrayList<Object>();

      boolean present_csrName = true && (isSetCsrName());
      list.add(present_csrName);
      if (present_csrName)
        list.add(csrName);

      boolean present_password = true && (isSetPassword());
      list.add(present_password);
      if (present_password)
        list.add(password);

      return list.hashCode();
    }

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

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetCsrName()).compareTo(other.isSetCsrName());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetCsrName()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.csrName, other.csrName);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetPassword()).compareTo(other.isSetPassword());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetPassword()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.password, other.password);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
    }

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

      sb.append("csrName:");
      if (this.csrName == null) {
        sb.append("null");
      } else {
        sb.append(this.csrName);
      }
      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 org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class csrLogin_argsStandardSchemeFactory implements SchemeFactory {
      public csrLogin_argsStandardScheme getScheme() {
        return new csrLogin_argsStandardScheme();
      }
    }

    private static class csrLogin_argsStandardScheme extends StandardScheme<csrLogin_args> {

      public void read(org.apache.thrift.protocol.TProtocol iprot, csrLogin_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 1: // CSR_NAME
              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
                struct.csrName = iprot.readString();
                struct.setCsrNameIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // PASSWORD
              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
                struct.password = iprot.readString();
                struct.setPasswordIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, csrLogin_args struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.csrName != null) {
          oprot.writeFieldBegin(CSR_NAME_FIELD_DESC);
          oprot.writeString(struct.csrName);
          oprot.writeFieldEnd();
        }
        if (struct.password != null) {
          oprot.writeFieldBegin(PASSWORD_FIELD_DESC);
          oprot.writeString(struct.password);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class csrLogin_argsTupleSchemeFactory implements SchemeFactory {
      public csrLogin_argsTupleScheme getScheme() {
        return new csrLogin_argsTupleScheme();
      }
    }

    private static class csrLogin_argsTupleScheme extends TupleScheme<csrLogin_args> {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, csrLogin_args struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetCsrName()) {
          optionals.set(0);
        }
        if (struct.isSetPassword()) {
          optionals.set(1);
        }
        oprot.writeBitSet(optionals, 2);
        if (struct.isSetCsrName()) {
          oprot.writeString(struct.csrName);
        }
        if (struct.isSetPassword()) {
          oprot.writeString(struct.password);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, csrLogin_args struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(2);
        if (incoming.get(0)) {
          struct.csrName = iprot.readString();
          struct.setCsrNameIsSet(true);
        }
        if (incoming.get(1)) {
          struct.password = iprot.readString();
          struct.setPasswordIsSet(true);
        }
      }
    }

  }

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

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I32, (short)0);
    private static final org.apache.thrift.protocol.TField ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("error", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new csrLogin_resultStandardSchemeFactory());
      schemes.put(TupleScheme.class, new csrLogin_resultTupleSchemeFactory());
    }

    public int success; // required
    public csr_error error; // required

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

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

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

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          case 1: // ERROR
            return ERROR;
          default:
            return null;
        }
      }

      /**
       * 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 byte __isset_bitfield = 0;
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
      tmpMap.put(_Fields.ERROR, new org.apache.thrift.meta_data.FieldMetaData("error", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(csrLogin_result.class, metaDataMap);
    }

    public csrLogin_result() {
    }

    public csrLogin_result(
      int success,
      csr_error error)
    {
      this();
      this.success = success;
      setSuccessIsSet(true);
      this.error = error;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public csrLogin_result(csrLogin_result other) {
      __isset_bitfield = other.__isset_bitfield;
      this.success = other.success;
      if (other.isSetError()) {
        this.error = new csr_error(other.error);
      }
    }

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

    @Override
    public void clear() {
      setSuccessIsSet(false);
      this.success = 0;
      this.error = null;
    }

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

    public csrLogin_result setSuccess(int success) {
      this.success = success;
      setSuccessIsSet(true);
      return this;
    }

    public void unsetSuccess() {
      __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID);
    }

    /** Returns true if field success is set (has been assigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID);
    }

    public void setSuccessIsSet(boolean value) {
      __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value);
    }

    public csr_error getError() {
      return this.error;
    }

    public csrLogin_result setError(csr_error error) {
      this.error = error;
      return this;
    }

    public void unsetError() {
      this.error = null;
    }

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

    public void setErrorIsSet(boolean value) {
      if (!value) {
        this.error = null;
      }
    }

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

      case ERROR:
        if (value == null) {
          unsetError();
        } else {
          setError((csr_error)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return Integer.valueOf(getSuccess());

      case ERROR:
        return getError();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case ERROR:
        return isSetError();
      }
      throw new IllegalStateException();
    }

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

    public boolean equals(csrLogin_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_error = true && this.isSetError();
      boolean that_present_error = true && that.isSetError();
      if (this_present_error || that_present_error) {
        if (!(this_present_error && that_present_error))
          return false;
        if (!this.error.equals(that.error))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      List<Object> list = new ArrayList<Object>();

      boolean present_success = true;
      list.add(present_success);
      if (present_success)
        list.add(success);

      boolean present_error = true && (isSetError());
      list.add(present_error);
      if (present_error)
        list.add(error);

      return list.hashCode();
    }

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

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetError()).compareTo(other.isSetError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.error, other.error);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
      }

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

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

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bitfield = 0;
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class csrLogin_resultStandardSchemeFactory implements SchemeFactory {
      public csrLogin_resultStandardScheme getScheme() {
        return new csrLogin_resultStandardScheme();
      }
    }

    private static class csrLogin_resultStandardScheme extends StandardScheme<csrLogin_result> {

      public void read(org.apache.thrift.protocol.TProtocol iprot, csrLogin_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 0: // SUCCESS
              if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
                struct.success = iprot.readI32();
                struct.setSuccessIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 1: // ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.error = new csr_error();
                struct.error.read(iprot);
                struct.setErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, csrLogin_result struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.isSetSuccess()) {
          oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
          oprot.writeI32(struct.success);
          oprot.writeFieldEnd();
        }
        if (struct.error != null) {
          oprot.writeFieldBegin(ERROR_FIELD_DESC);
          struct.error.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class csrLogin_resultTupleSchemeFactory implements SchemeFactory {
      public csrLogin_resultTupleScheme getScheme() {
        return new csrLogin_resultTupleScheme();
      }
    }

    private static class csrLogin_resultTupleScheme extends TupleScheme<csrLogin_result> {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, csrLogin_result struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetSuccess()) {
          optionals.set(0);
        }
        if (struct.isSetError()) {
          optionals.set(1);
        }
        oprot.writeBitSet(optionals, 2);
        if (struct.isSetSuccess()) {
          oprot.writeI32(struct.success);
        }
        if (struct.isSetError()) {
          struct.error.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, csrLogin_result struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(2);
        if (incoming.get(0)) {
          struct.success = iprot.readI32();
          struct.setSuccessIsSet(true);
        }
        if (incoming.get(1)) {
          struct.error = new csr_error();
          struct.error.read(iprot);
          struct.setErrorIsSet(true);
        }
      }
    }

  }

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

    private static final org.apache.thrift.protocol.TField CSR_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("csrId", org.apache.thrift.protocol.TType.I32, (short)1);

    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new getCSRInfoByCSRId_argsStandardSchemeFactory());
      schemes.put(TupleScheme.class, new getCSRInfoByCSRId_argsTupleSchemeFactory());
    }

    public int csrId; // required

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

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

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

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // CSR_ID
            return CSR_ID;
          default:
            return null;
        }
      }

      /**
       * 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 __CSRID_ISSET_ID = 0;
    private byte __isset_bitfield = 0;
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.CSR_ID, new org.apache.thrift.meta_data.FieldMetaData("csrId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCSRInfoByCSRId_args.class, metaDataMap);
    }

    public getCSRInfoByCSRId_args() {
    }

    public getCSRInfoByCSRId_args(
      int csrId)
    {
      this();
      this.csrId = csrId;
      setCsrIdIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getCSRInfoByCSRId_args(getCSRInfoByCSRId_args other) {
      __isset_bitfield = other.__isset_bitfield;
      this.csrId = other.csrId;
    }

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

    @Override
    public void clear() {
      setCsrIdIsSet(false);
      this.csrId = 0;
    }

    public int getCsrId() {
      return this.csrId;
    }

    public getCSRInfoByCSRId_args setCsrId(int csrId) {
      this.csrId = csrId;
      setCsrIdIsSet(true);
      return this;
    }

    public void unsetCsrId() {
      __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __CSRID_ISSET_ID);
    }

    /** Returns true if field csrId is set (has been assigned a value) and false otherwise */
    public boolean isSetCsrId() {
      return EncodingUtils.testBit(__isset_bitfield, __CSRID_ISSET_ID);
    }

    public void setCsrIdIsSet(boolean value) {
      __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __CSRID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case CSR_ID:
        if (value == null) {
          unsetCsrId();
        } else {
          setCsrId((Integer)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case CSR_ID:
        return Integer.valueOf(getCsrId());

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case CSR_ID:
        return isSetCsrId();
      }
      throw new IllegalStateException();
    }

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

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

      boolean this_present_csrId = true;
      boolean that_present_csrId = true;
      if (this_present_csrId || that_present_csrId) {
        if (!(this_present_csrId && that_present_csrId))
          return false;
        if (this.csrId != that.csrId)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      List<Object> list = new ArrayList<Object>();

      boolean present_csrId = true;
      list.add(present_csrId);
      if (present_csrId)
        list.add(csrId);

      return list.hashCode();
    }

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

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetCsrId()).compareTo(other.isSetCsrId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetCsrId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.csrId, other.csrId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
    }

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

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

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bitfield = 0;
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class getCSRInfoByCSRId_argsStandardSchemeFactory implements SchemeFactory {
      public getCSRInfoByCSRId_argsStandardScheme getScheme() {
        return new getCSRInfoByCSRId_argsStandardScheme();
      }
    }

    private static class getCSRInfoByCSRId_argsStandardScheme extends StandardScheme<getCSRInfoByCSRId_args> {

      public void read(org.apache.thrift.protocol.TProtocol iprot, getCSRInfoByCSRId_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 1: // CSR_ID
              if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
                struct.csrId = iprot.readI32();
                struct.setCsrIdIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, getCSRInfoByCSRId_args struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        oprot.writeFieldBegin(CSR_ID_FIELD_DESC);
        oprot.writeI32(struct.csrId);
        oprot.writeFieldEnd();
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class getCSRInfoByCSRId_argsTupleSchemeFactory implements SchemeFactory {
      public getCSRInfoByCSRId_argsTupleScheme getScheme() {
        return new getCSRInfoByCSRId_argsTupleScheme();
      }
    }

    private static class getCSRInfoByCSRId_argsTupleScheme extends TupleScheme<getCSRInfoByCSRId_args> {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, getCSRInfoByCSRId_args struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetCsrId()) {
          optionals.set(0);
        }
        oprot.writeBitSet(optionals, 1);
        if (struct.isSetCsrId()) {
          oprot.writeI32(struct.csrId);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, getCSRInfoByCSRId_args struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          struct.csrId = iprot.readI32();
          struct.setCsrIdIsSet(true);
        }
      }
    }

  }

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

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0);
    private static final org.apache.thrift.protocol.TField ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("error", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new getCSRInfoByCSRId_resultStandardSchemeFactory());
      schemes.put(TupleScheme.class, new getCSRInfoByCSRId_resultTupleSchemeFactory());
    }

    public CSRInfo success; // required
    public bind_error error; // required

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

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

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

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          case 1: // ERROR
            return ERROR;
          default:
            return null;
        }
      }

      /**
       * 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, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, CSRInfo.class)));
      tmpMap.put(_Fields.ERROR, new org.apache.thrift.meta_data.FieldMetaData("error", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCSRInfoByCSRId_result.class, metaDataMap);
    }

    public getCSRInfoByCSRId_result() {
    }

    public getCSRInfoByCSRId_result(
      CSRInfo success,
      bind_error error)
    {
      this();
      this.success = success;
      this.error = error;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getCSRInfoByCSRId_result(getCSRInfoByCSRId_result other) {
      if (other.isSetSuccess()) {
        this.success = new CSRInfo(other.success);
      }
      if (other.isSetError()) {
        this.error = new bind_error(other.error);
      }
    }

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

    @Override
    public void clear() {
      this.success = null;
      this.error = null;
    }

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

    public getCSRInfoByCSRId_result setSuccess(CSRInfo success) {
      this.success = success;
      return this;
    }

    public void unsetSuccess() {
      this.success = null;
    }

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

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public bind_error getError() {
      return this.error;
    }

    public getCSRInfoByCSRId_result setError(bind_error error) {
      this.error = error;
      return this;
    }

    public void unsetError() {
      this.error = null;
    }

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

    public void setErrorIsSet(boolean value) {
      if (!value) {
        this.error = null;
      }
    }

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

      case ERROR:
        if (value == null) {
          unsetError();
        } else {
          setError((bind_error)value);
        }
        break;

      }
    }

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

      case ERROR:
        return getError();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case ERROR:
        return isSetError();
      }
      throw new IllegalStateException();
    }

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

    public boolean equals(getCSRInfoByCSRId_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_error = true && this.isSetError();
      boolean that_present_error = true && that.isSetError();
      if (this_present_error || that_present_error) {
        if (!(this_present_error && that_present_error))
          return false;
        if (!this.error.equals(that.error))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      List<Object> list = new ArrayList<Object>();

      boolean present_success = true && (isSetSuccess());
      list.add(present_success);
      if (present_success)
        list.add(success);

      boolean present_error = true && (isSetError());
      list.add(present_error);
      if (present_error)
        list.add(error);

      return list.hashCode();
    }

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

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetError()).compareTo(other.isSetError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.error, other.error);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
      }

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

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
      if (success != null) {
        success.validate();
      }
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class getCSRInfoByCSRId_resultStandardSchemeFactory implements SchemeFactory {
      public getCSRInfoByCSRId_resultStandardScheme getScheme() {
        return new getCSRInfoByCSRId_resultStandardScheme();
      }
    }

    private static class getCSRInfoByCSRId_resultStandardScheme extends StandardScheme<getCSRInfoByCSRId_result> {

      public void read(org.apache.thrift.protocol.TProtocol iprot, getCSRInfoByCSRId_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 0: // SUCCESS
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.success = new CSRInfo();
                struct.success.read(iprot);
                struct.setSuccessIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 1: // ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.error = new bind_error();
                struct.error.read(iprot);
                struct.setErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, getCSRInfoByCSRId_result struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.success != null) {
          oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
          struct.success.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.error != null) {
          oprot.writeFieldBegin(ERROR_FIELD_DESC);
          struct.error.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class getCSRInfoByCSRId_resultTupleSchemeFactory implements SchemeFactory {
      public getCSRInfoByCSRId_resultTupleScheme getScheme() {
        return new getCSRInfoByCSRId_resultTupleScheme();
      }
    }

    private static class getCSRInfoByCSRId_resultTupleScheme extends TupleScheme<getCSRInfoByCSRId_result> {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, getCSRInfoByCSRId_result struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetSuccess()) {
          optionals.set(0);
        }
        if (struct.isSetError()) {
          optionals.set(1);
        }
        oprot.writeBitSet(optionals, 2);
        if (struct.isSetSuccess()) {
          struct.success.write(oprot);
        }
        if (struct.isSetError()) {
          struct.error.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, getCSRInfoByCSRId_result struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(2);
        if (incoming.get(0)) {
          struct.success = new CSRInfo();
          struct.success.read(iprot);
          struct.setSuccessIsSet(true);
        }
        if (incoming.get(1)) {
          struct.error = new bind_error();
          struct.error.read(iprot);
          struct.setErrorIsSet(true);
        }
      }
    }

  }

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

    private static final org.apache.thrift.protocol.TField CSR_JOB_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("csrJobId", org.apache.thrift.protocol.TType.I32, (short)1);

    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new getCSRInfoByCSRJobId_argsStandardSchemeFactory());
      schemes.put(TupleScheme.class, new getCSRInfoByCSRJobId_argsTupleSchemeFactory());
    }

    public int csrJobId; // required

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

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

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

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // CSR_JOB_ID
            return CSR_JOB_ID;
          default:
            return null;
        }
      }

      /**
       * 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 __CSRJOBID_ISSET_ID = 0;
    private byte __isset_bitfield = 0;
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.CSR_JOB_ID, new org.apache.thrift.meta_data.FieldMetaData("csrJobId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCSRInfoByCSRJobId_args.class, metaDataMap);
    }

    public getCSRInfoByCSRJobId_args() {
    }

    public getCSRInfoByCSRJobId_args(
      int csrJobId)
    {
      this();
      this.csrJobId = csrJobId;
      setCsrJobIdIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getCSRInfoByCSRJobId_args(getCSRInfoByCSRJobId_args other) {
      __isset_bitfield = other.__isset_bitfield;
      this.csrJobId = other.csrJobId;
    }

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

    @Override
    public void clear() {
      setCsrJobIdIsSet(false);
      this.csrJobId = 0;
    }

    public int getCsrJobId() {
      return this.csrJobId;
    }

    public getCSRInfoByCSRJobId_args setCsrJobId(int csrJobId) {
      this.csrJobId = csrJobId;
      setCsrJobIdIsSet(true);
      return this;
    }

    public void unsetCsrJobId() {
      __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __CSRJOBID_ISSET_ID);
    }

    /** Returns true if field csrJobId is set (has been assigned a value) and false otherwise */
    public boolean isSetCsrJobId() {
      return EncodingUtils.testBit(__isset_bitfield, __CSRJOBID_ISSET_ID);
    }

    public void setCsrJobIdIsSet(boolean value) {
      __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __CSRJOBID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case CSR_JOB_ID:
        if (value == null) {
          unsetCsrJobId();
        } else {
          setCsrJobId((Integer)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case CSR_JOB_ID:
        return Integer.valueOf(getCsrJobId());

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case CSR_JOB_ID:
        return isSetCsrJobId();
      }
      throw new IllegalStateException();
    }

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

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

      boolean this_present_csrJobId = true;
      boolean that_present_csrJobId = true;
      if (this_present_csrJobId || that_present_csrJobId) {
        if (!(this_present_csrJobId && that_present_csrJobId))
          return false;
        if (this.csrJobId != that.csrJobId)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      List<Object> list = new ArrayList<Object>();

      boolean present_csrJobId = true;
      list.add(present_csrJobId);
      if (present_csrJobId)
        list.add(csrJobId);

      return list.hashCode();
    }

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

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetCsrJobId()).compareTo(other.isSetCsrJobId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetCsrJobId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.csrJobId, other.csrJobId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
    }

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

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

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bitfield = 0;
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class getCSRInfoByCSRJobId_argsStandardSchemeFactory implements SchemeFactory {
      public getCSRInfoByCSRJobId_argsStandardScheme getScheme() {
        return new getCSRInfoByCSRJobId_argsStandardScheme();
      }
    }

    private static class getCSRInfoByCSRJobId_argsStandardScheme extends StandardScheme<getCSRInfoByCSRJobId_args> {

      public void read(org.apache.thrift.protocol.TProtocol iprot, getCSRInfoByCSRJobId_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 1: // CSR_JOB_ID
              if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
                struct.csrJobId = iprot.readI32();
                struct.setCsrJobIdIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, getCSRInfoByCSRJobId_args struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        oprot.writeFieldBegin(CSR_JOB_ID_FIELD_DESC);
        oprot.writeI32(struct.csrJobId);
        oprot.writeFieldEnd();
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class getCSRInfoByCSRJobId_argsTupleSchemeFactory implements SchemeFactory {
      public getCSRInfoByCSRJobId_argsTupleScheme getScheme() {
        return new getCSRInfoByCSRJobId_argsTupleScheme();
      }
    }

    private static class getCSRInfoByCSRJobId_argsTupleScheme extends TupleScheme<getCSRInfoByCSRJobId_args> {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, getCSRInfoByCSRJobId_args struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetCsrJobId()) {
          optionals.set(0);
        }
        oprot.writeBitSet(optionals, 1);
        if (struct.isSetCsrJobId()) {
          oprot.writeI32(struct.csrJobId);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, getCSRInfoByCSRJobId_args struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          struct.csrJobId = iprot.readI32();
          struct.setCsrJobIdIsSet(true);
        }
      }
    }

  }

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

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0);
    private static final org.apache.thrift.protocol.TField ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("error", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new getCSRInfoByCSRJobId_resultStandardSchemeFactory());
      schemes.put(TupleScheme.class, new getCSRInfoByCSRJobId_resultTupleSchemeFactory());
    }

    public CSRInfo success; // required
    public bind_error error; // required

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

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

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

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          case 1: // ERROR
            return ERROR;
          default:
            return null;
        }
      }

      /**
       * 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, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, CSRInfo.class)));
      tmpMap.put(_Fields.ERROR, new org.apache.thrift.meta_data.FieldMetaData("error", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCSRInfoByCSRJobId_result.class, metaDataMap);
    }

    public getCSRInfoByCSRJobId_result() {
    }

    public getCSRInfoByCSRJobId_result(
      CSRInfo success,
      bind_error error)
    {
      this();
      this.success = success;
      this.error = error;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getCSRInfoByCSRJobId_result(getCSRInfoByCSRJobId_result other) {
      if (other.isSetSuccess()) {
        this.success = new CSRInfo(other.success);
      }
      if (other.isSetError()) {
        this.error = new bind_error(other.error);
      }
    }

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

    @Override
    public void clear() {
      this.success = null;
      this.error = null;
    }

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

    public getCSRInfoByCSRJobId_result setSuccess(CSRInfo success) {
      this.success = success;
      return this;
    }

    public void unsetSuccess() {
      this.success = null;
    }

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

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public bind_error getError() {
      return this.error;
    }

    public getCSRInfoByCSRJobId_result setError(bind_error error) {
      this.error = error;
      return this;
    }

    public void unsetError() {
      this.error = null;
    }

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

    public void setErrorIsSet(boolean value) {
      if (!value) {
        this.error = null;
      }
    }

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

      case ERROR:
        if (value == null) {
          unsetError();
        } else {
          setError((bind_error)value);
        }
        break;

      }
    }

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

      case ERROR:
        return getError();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case ERROR:
        return isSetError();
      }
      throw new IllegalStateException();
    }

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

    public boolean equals(getCSRInfoByCSRJobId_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_error = true && this.isSetError();
      boolean that_present_error = true && that.isSetError();
      if (this_present_error || that_present_error) {
        if (!(this_present_error && that_present_error))
          return false;
        if (!this.error.equals(that.error))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      List<Object> list = new ArrayList<Object>();

      boolean present_success = true && (isSetSuccess());
      list.add(present_success);
      if (present_success)
        list.add(success);

      boolean present_error = true && (isSetError());
      list.add(present_error);
      if (present_error)
        list.add(error);

      return list.hashCode();
    }

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

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetError()).compareTo(other.isSetError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.error, other.error);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
      }

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

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
      if (success != null) {
        success.validate();
      }
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class getCSRInfoByCSRJobId_resultStandardSchemeFactory implements SchemeFactory {
      public getCSRInfoByCSRJobId_resultStandardScheme getScheme() {
        return new getCSRInfoByCSRJobId_resultStandardScheme();
      }
    }

    private static class getCSRInfoByCSRJobId_resultStandardScheme extends StandardScheme<getCSRInfoByCSRJobId_result> {

      public void read(org.apache.thrift.protocol.TProtocol iprot, getCSRInfoByCSRJobId_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 0: // SUCCESS
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.success = new CSRInfo();
                struct.success.read(iprot);
                struct.setSuccessIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 1: // ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.error = new bind_error();
                struct.error.read(iprot);
                struct.setErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, getCSRInfoByCSRJobId_result struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.success != null) {
          oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
          struct.success.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.error != null) {
          oprot.writeFieldBegin(ERROR_FIELD_DESC);
          struct.error.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class getCSRInfoByCSRJobId_resultTupleSchemeFactory implements SchemeFactory {
      public getCSRInfoByCSRJobId_resultTupleScheme getScheme() {
        return new getCSRInfoByCSRJobId_resultTupleScheme();
      }
    }

    private static class getCSRInfoByCSRJobId_resultTupleScheme extends TupleScheme<getCSRInfoByCSRJobId_result> {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, getCSRInfoByCSRJobId_result struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetSuccess()) {
          optionals.set(0);
        }
        if (struct.isSetError()) {
          optionals.set(1);
        }
        oprot.writeBitSet(optionals, 2);
        if (struct.isSetSuccess()) {
          struct.success.write(oprot);
        }
        if (struct.isSetError()) {
          struct.error.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, getCSRInfoByCSRJobId_result struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(2);
        if (incoming.get(0)) {
          struct.success = new CSRInfo();
          struct.success.read(iprot);
          struct.setSuccessIsSet(true);
        }
        if (incoming.get(1)) {
          struct.error = new bind_error();
          struct.error.read(iprot);
          struct.setErrorIsSet(true);
        }
      }
    }

  }

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

    private static final org.apache.thrift.protocol.TField USERNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("username", org.apache.thrift.protocol.TType.STRING, (short)1);

    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new getRelatedCSRInfoByUsername_argsStandardSchemeFactory());
      schemes.put(TupleScheme.class, new getRelatedCSRInfoByUsername_argsTupleSchemeFactory());
    }

    public String username; // required

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

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

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

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // USERNAME
            return USERNAME;
          default:
            return null;
        }
      }

      /**
       * 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, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.USERNAME, new org.apache.thrift.meta_data.FieldMetaData("username", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getRelatedCSRInfoByUsername_args.class, metaDataMap);
    }

    public getRelatedCSRInfoByUsername_args() {
    }

    public getRelatedCSRInfoByUsername_args(
      String username)
    {
      this();
      this.username = username;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getRelatedCSRInfoByUsername_args(getRelatedCSRInfoByUsername_args other) {
      if (other.isSetUsername()) {
        this.username = other.username;
      }
    }

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

    @Override
    public void clear() {
      this.username = null;
    }

    public String getUsername() {
      return this.username;
    }

    public getRelatedCSRInfoByUsername_args setUsername(String username) {
      this.username = username;
      return this;
    }

    public void unsetUsername() {
      this.username = null;
    }

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

    public void setUsernameIsSet(boolean value) {
      if (!value) {
        this.username = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case USERNAME:
        if (value == null) {
          unsetUsername();
        } else {
          setUsername((String)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case USERNAME:
        return getUsername();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case USERNAME:
        return isSetUsername();
      }
      throw new IllegalStateException();
    }

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

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

      boolean this_present_username = true && this.isSetUsername();
      boolean that_present_username = true && that.isSetUsername();
      if (this_present_username || that_present_username) {
        if (!(this_present_username && that_present_username))
          return false;
        if (!this.username.equals(that.username))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      List<Object> list = new ArrayList<Object>();

      boolean present_username = true && (isSetUsername());
      list.add(present_username);
      if (present_username)
        list.add(username);

      return list.hashCode();
    }

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

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetUsername()).compareTo(other.isSetUsername());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetUsername()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.username, other.username);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
    }

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

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

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class getRelatedCSRInfoByUsername_argsStandardSchemeFactory implements SchemeFactory {
      public getRelatedCSRInfoByUsername_argsStandardScheme getScheme() {
        return new getRelatedCSRInfoByUsername_argsStandardScheme();
      }
    }

    private static class getRelatedCSRInfoByUsername_argsStandardScheme extends StandardScheme<getRelatedCSRInfoByUsername_args> {

      public void read(org.apache.thrift.protocol.TProtocol iprot, getRelatedCSRInfoByUsername_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 1: // USERNAME
              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
                struct.username = iprot.readString();
                struct.setUsernameIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, getRelatedCSRInfoByUsername_args struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.username != null) {
          oprot.writeFieldBegin(USERNAME_FIELD_DESC);
          oprot.writeString(struct.username);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class getRelatedCSRInfoByUsername_argsTupleSchemeFactory implements SchemeFactory {
      public getRelatedCSRInfoByUsername_argsTupleScheme getScheme() {
        return new getRelatedCSRInfoByUsername_argsTupleScheme();
      }
    }

    private static class getRelatedCSRInfoByUsername_argsTupleScheme extends TupleScheme<getRelatedCSRInfoByUsername_args> {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, getRelatedCSRInfoByUsername_args struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetUsername()) {
          optionals.set(0);
        }
        oprot.writeBitSet(optionals, 1);
        if (struct.isSetUsername()) {
          oprot.writeString(struct.username);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, getRelatedCSRInfoByUsername_args struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          struct.username = iprot.readString();
          struct.setUsernameIsSet(true);
        }
      }
    }

  }

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

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0);
    private static final org.apache.thrift.protocol.TField ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("error", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new getRelatedCSRInfoByUsername_resultStandardSchemeFactory());
      schemes.put(TupleScheme.class, new getRelatedCSRInfoByUsername_resultTupleSchemeFactory());
    }

    public CSRInfo success; // required
    public csr_error error; // required

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

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

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

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          case 1: // ERROR
            return ERROR;
          default:
            return null;
        }
      }

      /**
       * 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, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, CSRInfo.class)));
      tmpMap.put(_Fields.ERROR, new org.apache.thrift.meta_data.FieldMetaData("error", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getRelatedCSRInfoByUsername_result.class, metaDataMap);
    }

    public getRelatedCSRInfoByUsername_result() {
    }

    public getRelatedCSRInfoByUsername_result(
      CSRInfo success,
      csr_error error)
    {
      this();
      this.success = success;
      this.error = error;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getRelatedCSRInfoByUsername_result(getRelatedCSRInfoByUsername_result other) {
      if (other.isSetSuccess()) {
        this.success = new CSRInfo(other.success);
      }
      if (other.isSetError()) {
        this.error = new csr_error(other.error);
      }
    }

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

    @Override
    public void clear() {
      this.success = null;
      this.error = null;
    }

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

    public getRelatedCSRInfoByUsername_result setSuccess(CSRInfo success) {
      this.success = success;
      return this;
    }

    public void unsetSuccess() {
      this.success = null;
    }

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

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public csr_error getError() {
      return this.error;
    }

    public getRelatedCSRInfoByUsername_result setError(csr_error error) {
      this.error = error;
      return this;
    }

    public void unsetError() {
      this.error = null;
    }

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

    public void setErrorIsSet(boolean value) {
      if (!value) {
        this.error = null;
      }
    }

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

      case ERROR:
        if (value == null) {
          unsetError();
        } else {
          setError((csr_error)value);
        }
        break;

      }
    }

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

      case ERROR:
        return getError();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case ERROR:
        return isSetError();
      }
      throw new IllegalStateException();
    }

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

    public boolean equals(getRelatedCSRInfoByUsername_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_error = true && this.isSetError();
      boolean that_present_error = true && that.isSetError();
      if (this_present_error || that_present_error) {
        if (!(this_present_error && that_present_error))
          return false;
        if (!this.error.equals(that.error))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      List<Object> list = new ArrayList<Object>();

      boolean present_success = true && (isSetSuccess());
      list.add(present_success);
      if (present_success)
        list.add(success);

      boolean present_error = true && (isSetError());
      list.add(present_error);
      if (present_error)
        list.add(error);

      return list.hashCode();
    }

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

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetError()).compareTo(other.isSetError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.error, other.error);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
      }

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

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
      if (success != null) {
        success.validate();
      }
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class getRelatedCSRInfoByUsername_resultStandardSchemeFactory implements SchemeFactory {
      public getRelatedCSRInfoByUsername_resultStandardScheme getScheme() {
        return new getRelatedCSRInfoByUsername_resultStandardScheme();
      }
    }

    private static class getRelatedCSRInfoByUsername_resultStandardScheme extends StandardScheme<getRelatedCSRInfoByUsername_result> {

      public void read(org.apache.thrift.protocol.TProtocol iprot, getRelatedCSRInfoByUsername_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 0: // SUCCESS
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.success = new CSRInfo();
                struct.success.read(iprot);
                struct.setSuccessIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 1: // ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.error = new csr_error();
                struct.error.read(iprot);
                struct.setErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, getRelatedCSRInfoByUsername_result struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.success != null) {
          oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
          struct.success.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.error != null) {
          oprot.writeFieldBegin(ERROR_FIELD_DESC);
          struct.error.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class getRelatedCSRInfoByUsername_resultTupleSchemeFactory implements SchemeFactory {
      public getRelatedCSRInfoByUsername_resultTupleScheme getScheme() {
        return new getRelatedCSRInfoByUsername_resultTupleScheme();
      }
    }

    private static class getRelatedCSRInfoByUsername_resultTupleScheme extends TupleScheme<getRelatedCSRInfoByUsername_result> {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, getRelatedCSRInfoByUsername_result struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetSuccess()) {
          optionals.set(0);
        }
        if (struct.isSetError()) {
          optionals.set(1);
        }
        oprot.writeBitSet(optionals, 2);
        if (struct.isSetSuccess()) {
          struct.success.write(oprot);
        }
        if (struct.isSetError()) {
          struct.error.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, getRelatedCSRInfoByUsername_result struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(2);
        if (incoming.get(0)) {
          struct.success = new CSRInfo();
          struct.success.read(iprot);
          struct.setSuccessIsSet(true);
        }
        if (incoming.get(1)) {
          struct.error = new csr_error();
          struct.error.read(iprot);
          struct.setErrorIsSet(true);
        }
      }
    }

  }

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

    private static final org.apache.thrift.protocol.TField USERNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("username", org.apache.thrift.protocol.TType.STRING, (short)1);

    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new getRelatedCSPByUsername_argsStandardSchemeFactory());
      schemes.put(TupleScheme.class, new getRelatedCSPByUsername_argsTupleSchemeFactory());
    }

    public String username; // required

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

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

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

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // USERNAME
            return USERNAME;
          default:
            return null;
        }
      }

      /**
       * 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, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.USERNAME, new org.apache.thrift.meta_data.FieldMetaData("username", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getRelatedCSPByUsername_args.class, metaDataMap);
    }

    public getRelatedCSPByUsername_args() {
    }

    public getRelatedCSPByUsername_args(
      String username)
    {
      this();
      this.username = username;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getRelatedCSPByUsername_args(getRelatedCSPByUsername_args other) {
      if (other.isSetUsername()) {
        this.username = other.username;
      }
    }

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

    @Override
    public void clear() {
      this.username = null;
    }

    public String getUsername() {
      return this.username;
    }

    public getRelatedCSPByUsername_args setUsername(String username) {
      this.username = username;
      return this;
    }

    public void unsetUsername() {
      this.username = null;
    }

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

    public void setUsernameIsSet(boolean value) {
      if (!value) {
        this.username = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case USERNAME:
        if (value == null) {
          unsetUsername();
        } else {
          setUsername((String)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case USERNAME:
        return getUsername();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case USERNAME:
        return isSetUsername();
      }
      throw new IllegalStateException();
    }

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

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

      boolean this_present_username = true && this.isSetUsername();
      boolean that_present_username = true && that.isSetUsername();
      if (this_present_username || that_present_username) {
        if (!(this_present_username && that_present_username))
          return false;
        if (!this.username.equals(that.username))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      List<Object> list = new ArrayList<Object>();

      boolean present_username = true && (isSetUsername());
      list.add(present_username);
      if (present_username)
        list.add(username);

      return list.hashCode();
    }

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

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetUsername()).compareTo(other.isSetUsername());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetUsername()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.username, other.username);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
    }

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

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

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class getRelatedCSPByUsername_argsStandardSchemeFactory implements SchemeFactory {
      public getRelatedCSPByUsername_argsStandardScheme getScheme() {
        return new getRelatedCSPByUsername_argsStandardScheme();
      }
    }

    private static class getRelatedCSPByUsername_argsStandardScheme extends StandardScheme<getRelatedCSPByUsername_args> {

      public void read(org.apache.thrift.protocol.TProtocol iprot, getRelatedCSPByUsername_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 1: // USERNAME
              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
                struct.username = iprot.readString();
                struct.setUsernameIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, getRelatedCSPByUsername_args struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.username != null) {
          oprot.writeFieldBegin(USERNAME_FIELD_DESC);
          oprot.writeString(struct.username);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class getRelatedCSPByUsername_argsTupleSchemeFactory implements SchemeFactory {
      public getRelatedCSPByUsername_argsTupleScheme getScheme() {
        return new getRelatedCSPByUsername_argsTupleScheme();
      }
    }

    private static class getRelatedCSPByUsername_argsTupleScheme extends TupleScheme<getRelatedCSPByUsername_args> {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, getRelatedCSPByUsername_args struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetUsername()) {
          optionals.set(0);
        }
        oprot.writeBitSet(optionals, 1);
        if (struct.isSetUsername()) {
          oprot.writeString(struct.username);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, getRelatedCSPByUsername_args struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          struct.username = iprot.readString();
          struct.setUsernameIsSet(true);
        }
      }
    }

  }

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

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0);
    private static final org.apache.thrift.protocol.TField ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("error", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new getRelatedCSPByUsername_resultStandardSchemeFactory());
      schemes.put(TupleScheme.class, new getRelatedCSPByUsername_resultTupleSchemeFactory());
    }

    public CSRInfo success; // required
    public csr_error error; // required

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

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

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

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          case 1: // ERROR
            return ERROR;
          default:
            return null;
        }
      }

      /**
       * 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, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, CSRInfo.class)));
      tmpMap.put(_Fields.ERROR, new org.apache.thrift.meta_data.FieldMetaData("error", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getRelatedCSPByUsername_result.class, metaDataMap);
    }

    public getRelatedCSPByUsername_result() {
    }

    public getRelatedCSPByUsername_result(
      CSRInfo success,
      csr_error error)
    {
      this();
      this.success = success;
      this.error = error;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getRelatedCSPByUsername_result(getRelatedCSPByUsername_result other) {
      if (other.isSetSuccess()) {
        this.success = new CSRInfo(other.success);
      }
      if (other.isSetError()) {
        this.error = new csr_error(other.error);
      }
    }

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

    @Override
    public void clear() {
      this.success = null;
      this.error = null;
    }

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

    public getRelatedCSPByUsername_result setSuccess(CSRInfo success) {
      this.success = success;
      return this;
    }

    public void unsetSuccess() {
      this.success = null;
    }

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

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public csr_error getError() {
      return this.error;
    }

    public getRelatedCSPByUsername_result setError(csr_error error) {
      this.error = error;
      return this;
    }

    public void unsetError() {
      this.error = null;
    }

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

    public void setErrorIsSet(boolean value) {
      if (!value) {
        this.error = null;
      }
    }

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

      case ERROR:
        if (value == null) {
          unsetError();
        } else {
          setError((csr_error)value);
        }
        break;

      }
    }

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

      case ERROR:
        return getError();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case ERROR:
        return isSetError();
      }
      throw new IllegalStateException();
    }

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

    public boolean equals(getRelatedCSPByUsername_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_error = true && this.isSetError();
      boolean that_present_error = true && that.isSetError();
      if (this_present_error || that_present_error) {
        if (!(this_present_error && that_present_error))
          return false;
        if (!this.error.equals(that.error))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      List<Object> list = new ArrayList<Object>();

      boolean present_success = true && (isSetSuccess());
      list.add(present_success);
      if (present_success)
        list.add(success);

      boolean present_error = true && (isSetError());
      list.add(present_error);
      if (present_error)
        list.add(error);

      return list.hashCode();
    }

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

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetError()).compareTo(other.isSetError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.error, other.error);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
      }

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

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
      if (success != null) {
        success.validate();
      }
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class getRelatedCSPByUsername_resultStandardSchemeFactory implements SchemeFactory {
      public getRelatedCSPByUsername_resultStandardScheme getScheme() {
        return new getRelatedCSPByUsername_resultStandardScheme();
      }
    }

    private static class getRelatedCSPByUsername_resultStandardScheme extends StandardScheme<getRelatedCSPByUsername_result> {

      public void read(org.apache.thrift.protocol.TProtocol iprot, getRelatedCSPByUsername_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 0: // SUCCESS
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.success = new CSRInfo();
                struct.success.read(iprot);
                struct.setSuccessIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 1: // ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.error = new csr_error();
                struct.error.read(iprot);
                struct.setErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, getRelatedCSPByUsername_result struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.success != null) {
          oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
          struct.success.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.error != null) {
          oprot.writeFieldBegin(ERROR_FIELD_DESC);
          struct.error.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class getRelatedCSPByUsername_resultTupleSchemeFactory implements SchemeFactory {
      public getRelatedCSPByUsername_resultTupleScheme getScheme() {
        return new getRelatedCSPByUsername_resultTupleScheme();
      }
    }

    private static class getRelatedCSPByUsername_resultTupleScheme extends TupleScheme<getRelatedCSPByUsername_result> {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, getRelatedCSPByUsername_result struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetSuccess()) {
          optionals.set(0);
        }
        if (struct.isSetError()) {
          optionals.set(1);
        }
        oprot.writeBitSet(optionals, 2);
        if (struct.isSetSuccess()) {
          struct.success.write(oprot);
        }
        if (struct.isSetError()) {
          struct.error.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, getRelatedCSPByUsername_result struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(2);
        if (incoming.get(0)) {
          struct.success = new CSRInfo();
          struct.success.read(iprot);
          struct.setSuccessIsSet(true);
        }
        if (incoming.get(1)) {
          struct.error = new csr_error();
          struct.error.read(iprot);
          struct.setErrorIsSet(true);
        }
      }
    }

  }

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

    private static final org.apache.thrift.protocol.TField CSR_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("csrId", org.apache.thrift.protocol.TType.I32, (short)1);

    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new getCusomterListByCSRId_argsStandardSchemeFactory());
      schemes.put(TupleScheme.class, new getCusomterListByCSRId_argsTupleSchemeFactory());
    }

    public int csrId; // required

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

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

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

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // CSR_ID
            return CSR_ID;
          default:
            return null;
        }
      }

      /**
       * 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 __CSRID_ISSET_ID = 0;
    private byte __isset_bitfield = 0;
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.CSR_ID, new org.apache.thrift.meta_data.FieldMetaData("csrId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCusomterListByCSRId_args.class, metaDataMap);
    }

    public getCusomterListByCSRId_args() {
    }

    public getCusomterListByCSRId_args(
      int csrId)
    {
      this();
      this.csrId = csrId;
      setCsrIdIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getCusomterListByCSRId_args(getCusomterListByCSRId_args other) {
      __isset_bitfield = other.__isset_bitfield;
      this.csrId = other.csrId;
    }

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

    @Override
    public void clear() {
      setCsrIdIsSet(false);
      this.csrId = 0;
    }

    public int getCsrId() {
      return this.csrId;
    }

    public getCusomterListByCSRId_args setCsrId(int csrId) {
      this.csrId = csrId;
      setCsrIdIsSet(true);
      return this;
    }

    public void unsetCsrId() {
      __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __CSRID_ISSET_ID);
    }

    /** Returns true if field csrId is set (has been assigned a value) and false otherwise */
    public boolean isSetCsrId() {
      return EncodingUtils.testBit(__isset_bitfield, __CSRID_ISSET_ID);
    }

    public void setCsrIdIsSet(boolean value) {
      __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __CSRID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case CSR_ID:
        if (value == null) {
          unsetCsrId();
        } else {
          setCsrId((Integer)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case CSR_ID:
        return Integer.valueOf(getCsrId());

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case CSR_ID:
        return isSetCsrId();
      }
      throw new IllegalStateException();
    }

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

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

      boolean this_present_csrId = true;
      boolean that_present_csrId = true;
      if (this_present_csrId || that_present_csrId) {
        if (!(this_present_csrId && that_present_csrId))
          return false;
        if (this.csrId != that.csrId)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      List<Object> list = new ArrayList<Object>();

      boolean present_csrId = true;
      list.add(present_csrId);
      if (present_csrId)
        list.add(csrId);

      return list.hashCode();
    }

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

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetCsrId()).compareTo(other.isSetCsrId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetCsrId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.csrId, other.csrId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
    }

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

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

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bitfield = 0;
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class getCusomterListByCSRId_argsStandardSchemeFactory implements SchemeFactory {
      public getCusomterListByCSRId_argsStandardScheme getScheme() {
        return new getCusomterListByCSRId_argsStandardScheme();
      }
    }

    private static class getCusomterListByCSRId_argsStandardScheme extends StandardScheme<getCusomterListByCSRId_args> {

      public void read(org.apache.thrift.protocol.TProtocol iprot, getCusomterListByCSRId_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 1: // CSR_ID
              if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
                struct.csrId = iprot.readI32();
                struct.setCsrIdIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, getCusomterListByCSRId_args struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        oprot.writeFieldBegin(CSR_ID_FIELD_DESC);
        oprot.writeI32(struct.csrId);
        oprot.writeFieldEnd();
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class getCusomterListByCSRId_argsTupleSchemeFactory implements SchemeFactory {
      public getCusomterListByCSRId_argsTupleScheme getScheme() {
        return new getCusomterListByCSRId_argsTupleScheme();
      }
    }

    private static class getCusomterListByCSRId_argsTupleScheme extends TupleScheme<getCusomterListByCSRId_args> {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, getCusomterListByCSRId_args struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetCsrId()) {
          optionals.set(0);
        }
        oprot.writeBitSet(optionals, 1);
        if (struct.isSetCsrId()) {
          oprot.writeI32(struct.csrId);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, getCusomterListByCSRId_args struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          struct.csrId = iprot.readI32();
          struct.setCsrIdIsSet(true);
        }
      }
    }

  }

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

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0);
    private static final org.apache.thrift.protocol.TField ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("error", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new getCusomterListByCSRId_resultStandardSchemeFactory());
      schemes.put(TupleScheme.class, new getCusomterListByCSRId_resultTupleSchemeFactory());
    }

    public List<Customer> success; // required
    public csr_error error; // required

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

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

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

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          case 1: // ERROR
            return ERROR;
          default:
            return null;
        }
      }

      /**
       * 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, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.LIST          , "CustomerList")));
      tmpMap.put(_Fields.ERROR, new org.apache.thrift.meta_data.FieldMetaData("error", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCusomterListByCSRId_result.class, metaDataMap);
    }

    public getCusomterListByCSRId_result() {
    }

    public getCusomterListByCSRId_result(
      List<Customer> success,
      csr_error error)
    {
      this();
      this.success = success;
      this.error = error;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getCusomterListByCSRId_result(getCusomterListByCSRId_result other) {
      if (other.isSetSuccess()) {
        this.success = other.success;
      }
      if (other.isSetError()) {
        this.error = new csr_error(other.error);
      }
    }

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

    @Override
    public void clear() {
      this.success = null;
      this.error = null;
    }

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

    public java.util.Iterator<Customer> getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(Customer elem) {
      if (this.success == null) {
        this.success = new ArrayList<Customer>();
      }
      this.success.add(elem);
    }

    public List<Customer> getSuccess() {
      return this.success;
    }

    public getCusomterListByCSRId_result setSuccess(List<Customer> success) {
      this.success = success;
      return this;
    }

    public void unsetSuccess() {
      this.success = null;
    }

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

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public csr_error getError() {
      return this.error;
    }

    public getCusomterListByCSRId_result setError(csr_error error) {
      this.error = error;
      return this;
    }

    public void unsetError() {
      this.error = null;
    }

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

    public void setErrorIsSet(boolean value) {
      if (!value) {
        this.error = null;
      }
    }

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

      case ERROR:
        if (value == null) {
          unsetError();
        } else {
          setError((csr_error)value);
        }
        break;

      }
    }

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

      case ERROR:
        return getError();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case ERROR:
        return isSetError();
      }
      throw new IllegalStateException();
    }

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

    public boolean equals(getCusomterListByCSRId_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_error = true && this.isSetError();
      boolean that_present_error = true && that.isSetError();
      if (this_present_error || that_present_error) {
        if (!(this_present_error && that_present_error))
          return false;
        if (!this.error.equals(that.error))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      List<Object> list = new ArrayList<Object>();

      boolean present_success = true && (isSetSuccess());
      list.add(present_success);
      if (present_success)
        list.add(success);

      boolean present_error = true && (isSetError());
      list.add(present_error);
      if (present_error)
        list.add(error);

      return list.hashCode();
    }

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

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetError()).compareTo(other.isSetError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.error, other.error);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
      }

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

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class getCusomterListByCSRId_resultStandardSchemeFactory implements SchemeFactory {
      public getCusomterListByCSRId_resultStandardScheme getScheme() {
        return new getCusomterListByCSRId_resultStandardScheme();
      }
    }

    private static class getCusomterListByCSRId_resultStandardScheme extends StandardScheme<getCusomterListByCSRId_result> {

      public void read(org.apache.thrift.protocol.TProtocol iprot, getCusomterListByCSRId_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 0: // SUCCESS
              if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
                {
                  org.apache.thrift.protocol.TList _list8 = iprot.readListBegin();
                  struct.success = new ArrayList<Customer>(_list8.size);
                  Customer _elem9;
                  for (int _i10 = 0; _i10 < _list8.size; ++_i10)
                  {
                    _elem9 = new Customer();
                    _elem9.read(iprot);
                    struct.success.add(_elem9);
                  }
                  iprot.readListEnd();
                }
                struct.setSuccessIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 1: // ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.error = new csr_error();
                struct.error.read(iprot);
                struct.setErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, getCusomterListByCSRId_result struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.success != null) {
          oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
          {
            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size()));
            for (Customer _iter11 : struct.success)
            {
              _iter11.write(oprot);
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
        if (struct.error != null) {
          oprot.writeFieldBegin(ERROR_FIELD_DESC);
          struct.error.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class getCusomterListByCSRId_resultTupleSchemeFactory implements SchemeFactory {
      public getCusomterListByCSRId_resultTupleScheme getScheme() {
        return new getCusomterListByCSRId_resultTupleScheme();
      }
    }

    private static class getCusomterListByCSRId_resultTupleScheme extends TupleScheme<getCusomterListByCSRId_result> {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, getCusomterListByCSRId_result struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetSuccess()) {
          optionals.set(0);
        }
        if (struct.isSetError()) {
          optionals.set(1);
        }
        oprot.writeBitSet(optionals, 2);
        if (struct.isSetSuccess()) {
          {
            oprot.writeI32(struct.success.size());
            for (Customer _iter12 : struct.success)
            {
              _iter12.write(oprot);
            }
          }
        }
        if (struct.isSetError()) {
          struct.error.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, getCusomterListByCSRId_result struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(2);
        if (incoming.get(0)) {
          {
            org.apache.thrift.protocol.TList _list13 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
            struct.success = new ArrayList<Customer>(_list13.size);
            Customer _elem14;
            for (int _i15 = 0; _i15 < _list13.size; ++_i15)
            {
              _elem14 = new Customer();
              _elem14.read(iprot);
              struct.success.add(_elem14);
            }
          }
          struct.setSuccessIsSet(true);
        }
        if (incoming.get(1)) {
          struct.error = new csr_error();
          struct.error.read(iprot);
          struct.setErrorIsSet(true);
        }
      }
    }

  }

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

    private static final org.apache.thrift.protocol.TField CSR_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("csrId", org.apache.thrift.protocol.TType.I32, (short)1);
    private static final org.apache.thrift.protocol.TField CUSTOMER_STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("customerStatus", org.apache.thrift.protocol.TType.I32, (short)2);

    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new getCustomerUsernameList_argsStandardSchemeFactory());
      schemes.put(TupleScheme.class, new getCustomerUsernameList_argsTupleSchemeFactory());
    }

    public int csrId; // required
    public int customerStatus; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      CSR_ID((short)1, "csrId"),
      CUSTOMER_STATUS((short)2, "customerStatus");

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

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

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // CSR_ID
            return CSR_ID;
          case 2: // CUSTOMER_STATUS
            return CUSTOMER_STATUS;
          default:
            return null;
        }
      }

      /**
       * 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 __CSRID_ISSET_ID = 0;
    private static final int __CUSTOMERSTATUS_ISSET_ID = 1;
    private byte __isset_bitfield = 0;
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.CSR_ID, new org.apache.thrift.meta_data.FieldMetaData("csrId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
      tmpMap.put(_Fields.CUSTOMER_STATUS, new org.apache.thrift.meta_data.FieldMetaData("customerStatus", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCustomerUsernameList_args.class, metaDataMap);
    }

    public getCustomerUsernameList_args() {
    }

    public getCustomerUsernameList_args(
      int csrId,
      int customerStatus)
    {
      this();
      this.csrId = csrId;
      setCsrIdIsSet(true);
      this.customerStatus = customerStatus;
      setCustomerStatusIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getCustomerUsernameList_args(getCustomerUsernameList_args other) {
      __isset_bitfield = other.__isset_bitfield;
      this.csrId = other.csrId;
      this.customerStatus = other.customerStatus;
    }

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

    @Override
    public void clear() {
      setCsrIdIsSet(false);
      this.csrId = 0;
      setCustomerStatusIsSet(false);
      this.customerStatus = 0;
    }

    public int getCsrId() {
      return this.csrId;
    }

    public getCustomerUsernameList_args setCsrId(int csrId) {
      this.csrId = csrId;
      setCsrIdIsSet(true);
      return this;
    }

    public void unsetCsrId() {
      __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __CSRID_ISSET_ID);
    }

    /** Returns true if field csrId is set (has been assigned a value) and false otherwise */
    public boolean isSetCsrId() {
      return EncodingUtils.testBit(__isset_bitfield, __CSRID_ISSET_ID);
    }

    public void setCsrIdIsSet(boolean value) {
      __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __CSRID_ISSET_ID, value);
    }

    public int getCustomerStatus() {
      return this.customerStatus;
    }

    public getCustomerUsernameList_args setCustomerStatus(int customerStatus) {
      this.customerStatus = customerStatus;
      setCustomerStatusIsSet(true);
      return this;
    }

    public void unsetCustomerStatus() {
      __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __CUSTOMERSTATUS_ISSET_ID);
    }

    /** Returns true if field customerStatus is set (has been assigned a value) and false otherwise */
    public boolean isSetCustomerStatus() {
      return EncodingUtils.testBit(__isset_bitfield, __CUSTOMERSTATUS_ISSET_ID);
    }

    public void setCustomerStatusIsSet(boolean value) {
      __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __CUSTOMERSTATUS_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case CSR_ID:
        if (value == null) {
          unsetCsrId();
        } else {
          setCsrId((Integer)value);
        }
        break;

      case CUSTOMER_STATUS:
        if (value == null) {
          unsetCustomerStatus();
        } else {
          setCustomerStatus((Integer)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case CSR_ID:
        return Integer.valueOf(getCsrId());

      case CUSTOMER_STATUS:
        return Integer.valueOf(getCustomerStatus());

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case CSR_ID:
        return isSetCsrId();
      case CUSTOMER_STATUS:
        return isSetCustomerStatus();
      }
      throw new IllegalStateException();
    }

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

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

      boolean this_present_csrId = true;
      boolean that_present_csrId = true;
      if (this_present_csrId || that_present_csrId) {
        if (!(this_present_csrId && that_present_csrId))
          return false;
        if (this.csrId != that.csrId)
          return false;
      }

      boolean this_present_customerStatus = true;
      boolean that_present_customerStatus = true;
      if (this_present_customerStatus || that_present_customerStatus) {
        if (!(this_present_customerStatus && that_present_customerStatus))
          return false;
        if (this.customerStatus != that.customerStatus)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      List<Object> list = new ArrayList<Object>();

      boolean present_csrId = true;
      list.add(present_csrId);
      if (present_csrId)
        list.add(csrId);

      boolean present_customerStatus = true;
      list.add(present_customerStatus);
      if (present_customerStatus)
        list.add(customerStatus);

      return list.hashCode();
    }

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

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetCsrId()).compareTo(other.isSetCsrId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetCsrId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.csrId, other.csrId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetCustomerStatus()).compareTo(other.isSetCustomerStatus());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetCustomerStatus()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.customerStatus, other.customerStatus);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
    }

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

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

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bitfield = 0;
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class getCustomerUsernameList_argsStandardSchemeFactory implements SchemeFactory {
      public getCustomerUsernameList_argsStandardScheme getScheme() {
        return new getCustomerUsernameList_argsStandardScheme();
      }
    }

    private static class getCustomerUsernameList_argsStandardScheme extends StandardScheme<getCustomerUsernameList_args> {

      public void read(org.apache.thrift.protocol.TProtocol iprot, getCustomerUsernameList_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 1: // CSR_ID
              if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
                struct.csrId = iprot.readI32();
                struct.setCsrIdIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // CUSTOMER_STATUS
              if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
                struct.customerStatus = iprot.readI32();
                struct.setCustomerStatusIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, getCustomerUsernameList_args struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        oprot.writeFieldBegin(CSR_ID_FIELD_DESC);
        oprot.writeI32(struct.csrId);
        oprot.writeFieldEnd();
        oprot.writeFieldBegin(CUSTOMER_STATUS_FIELD_DESC);
        oprot.writeI32(struct.customerStatus);
        oprot.writeFieldEnd();
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class getCustomerUsernameList_argsTupleSchemeFactory implements SchemeFactory {
      public getCustomerUsernameList_argsTupleScheme getScheme() {
        return new getCustomerUsernameList_argsTupleScheme();
      }
    }

    private static class getCustomerUsernameList_argsTupleScheme extends TupleScheme<getCustomerUsernameList_args> {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, getCustomerUsernameList_args struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetCsrId()) {
          optionals.set(0);
        }
        if (struct.isSetCustomerStatus()) {
          optionals.set(1);
        }
        oprot.writeBitSet(optionals, 2);
        if (struct.isSetCsrId()) {
          oprot.writeI32(struct.csrId);
        }
        if (struct.isSetCustomerStatus()) {
          oprot.writeI32(struct.customerStatus);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, getCustomerUsernameList_args struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(2);
        if (incoming.get(0)) {
          struct.csrId = iprot.readI32();
          struct.setCsrIdIsSet(true);
        }
        if (incoming.get(1)) {
          struct.customerStatus = iprot.readI32();
          struct.setCustomerStatusIsSet(true);
        }
      }
    }

  }

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

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0);
    private static final org.apache.thrift.protocol.TField ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("error", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new getCustomerUsernameList_resultStandardSchemeFactory());
      schemes.put(TupleScheme.class, new getCustomerUsernameList_resultTupleSchemeFactory());
    }

    public List<String> success; // required
    public csr_error error; // required

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

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

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

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          case 1: // ERROR
            return ERROR;
          default:
            return null;
        }
      }

      /**
       * 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, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.LIST          , "UsernameList")));
      tmpMap.put(_Fields.ERROR, new org.apache.thrift.meta_data.FieldMetaData("error", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCustomerUsernameList_result.class, metaDataMap);
    }

    public getCustomerUsernameList_result() {
    }

    public getCustomerUsernameList_result(
      List<String> success,
      csr_error error)
    {
      this();
      this.success = success;
      this.error = error;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getCustomerUsernameList_result(getCustomerUsernameList_result other) {
      if (other.isSetSuccess()) {
        this.success = other.success;
      }
      if (other.isSetError()) {
        this.error = new csr_error(other.error);
      }
    }

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

    @Override
    public void clear() {
      this.success = null;
      this.error = null;
    }

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

    public java.util.Iterator<String> getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(String elem) {
      if (this.success == null) {
        this.success = new ArrayList<String>();
      }
      this.success.add(elem);
    }

    public List<String> getSuccess() {
      return this.success;
    }

    public getCustomerUsernameList_result setSuccess(List<String> success) {
      this.success = success;
      return this;
    }

    public void unsetSuccess() {
      this.success = null;
    }

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

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public csr_error getError() {
      return this.error;
    }

    public getCustomerUsernameList_result setError(csr_error error) {
      this.error = error;
      return this;
    }

    public void unsetError() {
      this.error = null;
    }

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

    public void setErrorIsSet(boolean value) {
      if (!value) {
        this.error = null;
      }
    }

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

      case ERROR:
        if (value == null) {
          unsetError();
        } else {
          setError((csr_error)value);
        }
        break;

      }
    }

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

      case ERROR:
        return getError();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case ERROR:
        return isSetError();
      }
      throw new IllegalStateException();
    }

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

    public boolean equals(getCustomerUsernameList_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_error = true && this.isSetError();
      boolean that_present_error = true && that.isSetError();
      if (this_present_error || that_present_error) {
        if (!(this_present_error && that_present_error))
          return false;
        if (!this.error.equals(that.error))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      List<Object> list = new ArrayList<Object>();

      boolean present_success = true && (isSetSuccess());
      list.add(present_success);
      if (present_success)
        list.add(success);

      boolean present_error = true && (isSetError());
      list.add(present_error);
      if (present_error)
        list.add(error);

      return list.hashCode();
    }

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

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetError()).compareTo(other.isSetError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.error, other.error);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
      }

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

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class getCustomerUsernameList_resultStandardSchemeFactory implements SchemeFactory {
      public getCustomerUsernameList_resultStandardScheme getScheme() {
        return new getCustomerUsernameList_resultStandardScheme();
      }
    }

    private static class getCustomerUsernameList_resultStandardScheme extends StandardScheme<getCustomerUsernameList_result> {

      public void read(org.apache.thrift.protocol.TProtocol iprot, getCustomerUsernameList_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 0: // SUCCESS
              if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
                {
                  org.apache.thrift.protocol.TList _list16 = iprot.readListBegin();
                  struct.success = new ArrayList<String>(_list16.size);
                  String _elem17;
                  for (int _i18 = 0; _i18 < _list16.size; ++_i18)
                  {
                    _elem17 = iprot.readString();
                    struct.success.add(_elem17);
                  }
                  iprot.readListEnd();
                }
                struct.setSuccessIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 1: // ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.error = new csr_error();
                struct.error.read(iprot);
                struct.setErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, getCustomerUsernameList_result struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.success != null) {
          oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
          {
            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.success.size()));
            for (String _iter19 : struct.success)
            {
              oprot.writeString(_iter19);
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
        if (struct.error != null) {
          oprot.writeFieldBegin(ERROR_FIELD_DESC);
          struct.error.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class getCustomerUsernameList_resultTupleSchemeFactory implements SchemeFactory {
      public getCustomerUsernameList_resultTupleScheme getScheme() {
        return new getCustomerUsernameList_resultTupleScheme();
      }
    }

    private static class getCustomerUsernameList_resultTupleScheme extends TupleScheme<getCustomerUsernameList_result> {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, getCustomerUsernameList_result struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetSuccess()) {
          optionals.set(0);
        }
        if (struct.isSetError()) {
          optionals.set(1);
        }
        oprot.writeBitSet(optionals, 2);
        if (struct.isSetSuccess()) {
          {
            oprot.writeI32(struct.success.size());
            for (String _iter20 : struct.success)
            {
              oprot.writeString(_iter20);
            }
          }
        }
        if (struct.isSetError()) {
          struct.error.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, getCustomerUsernameList_result struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(2);
        if (incoming.get(0)) {
          {
            org.apache.thrift.protocol.TList _list21 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
            struct.success = new ArrayList<String>(_list21.size);
            String _elem22;
            for (int _i23 = 0; _i23 < _list21.size; ++_i23)
            {
              _elem22 = iprot.readString();
              struct.success.add(_elem22);
            }
          }
          struct.setSuccessIsSet(true);
        }
        if (incoming.get(1)) {
          struct.error = new csr_error();
          struct.error.read(iprot);
          struct.setErrorIsSet(true);
        }
      }
    }

  }

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

    private static final org.apache.thrift.protocol.TField USERNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("username", org.apache.thrift.protocol.TType.STRING, (short)1);
    private static final org.apache.thrift.protocol.TField CSR_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("csrId", org.apache.thrift.protocol.TType.I32, (short)2);

    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new getCusomterByUsername_argsStandardSchemeFactory());
      schemes.put(TupleScheme.class, new getCusomterByUsername_argsTupleSchemeFactory());
    }

    public String username; // required
    public int csrId; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      USERNAME((short)1, "username"),
      CSR_ID((short)2, "csrId");

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

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

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // USERNAME
            return USERNAME;
          case 2: // CSR_ID
            return CSR_ID;
          default:
            return null;
        }
      }

      /**
       * 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 __CSRID_ISSET_ID = 0;
    private byte __isset_bitfield = 0;
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.USERNAME, new org.apache.thrift.meta_data.FieldMetaData("username", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
      tmpMap.put(_Fields.CSR_ID, new org.apache.thrift.meta_data.FieldMetaData("csrId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCusomterByUsername_args.class, metaDataMap);
    }

    public getCusomterByUsername_args() {
    }

    public getCusomterByUsername_args(
      String username,
      int csrId)
    {
      this();
      this.username = username;
      this.csrId = csrId;
      setCsrIdIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getCusomterByUsername_args(getCusomterByUsername_args other) {
      __isset_bitfield = other.__isset_bitfield;
      if (other.isSetUsername()) {
        this.username = other.username;
      }
      this.csrId = other.csrId;
    }

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

    @Override
    public void clear() {
      this.username = null;
      setCsrIdIsSet(false);
      this.csrId = 0;
    }

    public String getUsername() {
      return this.username;
    }

    public getCusomterByUsername_args setUsername(String username) {
      this.username = username;
      return this;
    }

    public void unsetUsername() {
      this.username = null;
    }

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

    public void setUsernameIsSet(boolean value) {
      if (!value) {
        this.username = null;
      }
    }

    public int getCsrId() {
      return this.csrId;
    }

    public getCusomterByUsername_args setCsrId(int csrId) {
      this.csrId = csrId;
      setCsrIdIsSet(true);
      return this;
    }

    public void unsetCsrId() {
      __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __CSRID_ISSET_ID);
    }

    /** Returns true if field csrId is set (has been assigned a value) and false otherwise */
    public boolean isSetCsrId() {
      return EncodingUtils.testBit(__isset_bitfield, __CSRID_ISSET_ID);
    }

    public void setCsrIdIsSet(boolean value) {
      __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __CSRID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case USERNAME:
        if (value == null) {
          unsetUsername();
        } else {
          setUsername((String)value);
        }
        break;

      case CSR_ID:
        if (value == null) {
          unsetCsrId();
        } else {
          setCsrId((Integer)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case USERNAME:
        return getUsername();

      case CSR_ID:
        return Integer.valueOf(getCsrId());

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case USERNAME:
        return isSetUsername();
      case CSR_ID:
        return isSetCsrId();
      }
      throw new IllegalStateException();
    }

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

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

      boolean this_present_username = true && this.isSetUsername();
      boolean that_present_username = true && that.isSetUsername();
      if (this_present_username || that_present_username) {
        if (!(this_present_username && that_present_username))
          return false;
        if (!this.username.equals(that.username))
          return false;
      }

      boolean this_present_csrId = true;
      boolean that_present_csrId = true;
      if (this_present_csrId || that_present_csrId) {
        if (!(this_present_csrId && that_present_csrId))
          return false;
        if (this.csrId != that.csrId)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      List<Object> list = new ArrayList<Object>();

      boolean present_username = true && (isSetUsername());
      list.add(present_username);
      if (present_username)
        list.add(username);

      boolean present_csrId = true;
      list.add(present_csrId);
      if (present_csrId)
        list.add(csrId);

      return list.hashCode();
    }

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

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetUsername()).compareTo(other.isSetUsername());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetUsername()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.username, other.username);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetCsrId()).compareTo(other.isSetCsrId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetCsrId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.csrId, other.csrId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
    }

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

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

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bitfield = 0;
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class getCusomterByUsername_argsStandardSchemeFactory implements SchemeFactory {
      public getCusomterByUsername_argsStandardScheme getScheme() {
        return new getCusomterByUsername_argsStandardScheme();
      }
    }

    private static class getCusomterByUsername_argsStandardScheme extends StandardScheme<getCusomterByUsername_args> {

      public void read(org.apache.thrift.protocol.TProtocol iprot, getCusomterByUsername_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 1: // USERNAME
              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
                struct.username = iprot.readString();
                struct.setUsernameIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // CSR_ID
              if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
                struct.csrId = iprot.readI32();
                struct.setCsrIdIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, getCusomterByUsername_args struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.username != null) {
          oprot.writeFieldBegin(USERNAME_FIELD_DESC);
          oprot.writeString(struct.username);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldBegin(CSR_ID_FIELD_DESC);
        oprot.writeI32(struct.csrId);
        oprot.writeFieldEnd();
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class getCusomterByUsername_argsTupleSchemeFactory implements SchemeFactory {
      public getCusomterByUsername_argsTupleScheme getScheme() {
        return new getCusomterByUsername_argsTupleScheme();
      }
    }

    private static class getCusomterByUsername_argsTupleScheme extends TupleScheme<getCusomterByUsername_args> {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, getCusomterByUsername_args struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetUsername()) {
          optionals.set(0);
        }
        if (struct.isSetCsrId()) {
          optionals.set(1);
        }
        oprot.writeBitSet(optionals, 2);
        if (struct.isSetUsername()) {
          oprot.writeString(struct.username);
        }
        if (struct.isSetCsrId()) {
          oprot.writeI32(struct.csrId);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, getCusomterByUsername_args struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(2);
        if (incoming.get(0)) {
          struct.username = iprot.readString();
          struct.setUsernameIsSet(true);
        }
        if (incoming.get(1)) {
          struct.csrId = iprot.readI32();
          struct.setCsrIdIsSet(true);
        }
      }
    }

  }

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

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0);

    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new getCusomterByUsername_resultStandardSchemeFactory());
      schemes.put(TupleScheme.class, new getCusomterByUsername_resultTupleSchemeFactory());
    }

    public Customer success; // required

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

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

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

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          default:
            return null;
        }
      }

      /**
       * 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, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Customer.class)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCusomterByUsername_result.class, metaDataMap);
    }

    public getCusomterByUsername_result() {
    }

    public getCusomterByUsername_result(
      Customer success)
    {
      this();
      this.success = success;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getCusomterByUsername_result(getCusomterByUsername_result other) {
      if (other.isSetSuccess()) {
        this.success = new Customer(other.success);
      }
    }

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

    @Override
    public void clear() {
      this.success = null;
    }

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

    public getCusomterByUsername_result setSuccess(Customer success) {
      this.success = success;
      return this;
    }

    public void unsetSuccess() {
      this.success = null;
    }

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

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

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

      }
    }

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

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      }
      throw new IllegalStateException();
    }

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

    public boolean equals(getCusomterByUsername_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;
      }

      return true;
    }

    @Override
    public int hashCode() {
      List<Object> list = new ArrayList<Object>();

      boolean present_success = true && (isSetSuccess());
      list.add(present_success);
      if (present_success)
        list.add(success);

      return list.hashCode();
    }

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

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
      }

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

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

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
      if (success != null) {
        success.validate();
      }
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class getCusomterByUsername_resultStandardSchemeFactory implements SchemeFactory {
      public getCusomterByUsername_resultStandardScheme getScheme() {
        return new getCusomterByUsername_resultStandardScheme();
      }
    }

    private static class getCusomterByUsername_resultStandardScheme extends StandardScheme<getCusomterByUsername_result> {

      public void read(org.apache.thrift.protocol.TProtocol iprot, getCusomterByUsername_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 0: // SUCCESS
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.success = new Customer();
                struct.success.read(iprot);
                struct.setSuccessIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, getCusomterByUsername_result struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.success != null) {
          oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
          struct.success.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class getCusomterByUsername_resultTupleSchemeFactory implements SchemeFactory {
      public getCusomterByUsername_resultTupleScheme getScheme() {
        return new getCusomterByUsername_resultTupleScheme();
      }
    }

    private static class getCusomterByUsername_resultTupleScheme extends TupleScheme<getCusomterByUsername_result> {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, getCusomterByUsername_result struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetSuccess()) {
          optionals.set(0);
        }
        oprot.writeBitSet(optionals, 1);
        if (struct.isSetSuccess()) {
          struct.success.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, getCusomterByUsername_result struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          struct.success = new Customer();
          struct.success.read(iprot);
          struct.setSuccessIsSet(true);
        }
      }
    }

  }

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

    private static final org.apache.thrift.protocol.TField USERNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("username", org.apache.thrift.protocol.TType.STRING, (short)1);

    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new getCusomterInfoByUsername_argsStandardSchemeFactory());
      schemes.put(TupleScheme.class, new getCusomterInfoByUsername_argsTupleSchemeFactory());
    }

    public String username; // required

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

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

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

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // USERNAME
            return USERNAME;
          default:
            return null;
        }
      }

      /**
       * 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, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.USERNAME, new org.apache.thrift.meta_data.FieldMetaData("username", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCusomterInfoByUsername_args.class, metaDataMap);
    }

    public getCusomterInfoByUsername_args() {
    }

    public getCusomterInfoByUsername_args(
      String username)
    {
      this();
      this.username = username;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getCusomterInfoByUsername_args(getCusomterInfoByUsername_args other) {
      if (other.isSetUsername()) {
        this.username = other.username;
      }
    }

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

    @Override
    public void clear() {
      this.username = null;
    }

    public String getUsername() {
      return this.username;
    }

    public getCusomterInfoByUsername_args setUsername(String username) {
      this.username = username;
      return this;
    }

    public void unsetUsername() {
      this.username = null;
    }

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

    public void setUsernameIsSet(boolean value) {
      if (!value) {
        this.username = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case USERNAME:
        if (value == null) {
          unsetUsername();
        } else {
          setUsername((String)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case USERNAME:
        return getUsername();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case USERNAME:
        return isSetUsername();
      }
      throw new IllegalStateException();
    }

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

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

      boolean this_present_username = true && this.isSetUsername();
      boolean that_present_username = true && that.isSetUsername();
      if (this_present_username || that_present_username) {
        if (!(this_present_username && that_present_username))
          return false;
        if (!this.username.equals(that.username))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      List<Object> list = new ArrayList<Object>();

      boolean present_username = true && (isSetUsername());
      list.add(present_username);
      if (present_username)
        list.add(username);

      return list.hashCode();
    }

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

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetUsername()).compareTo(other.isSetUsername());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetUsername()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.username, other.username);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
    }

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

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

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class getCusomterInfoByUsername_argsStandardSchemeFactory implements SchemeFactory {
      public getCusomterInfoByUsername_argsStandardScheme getScheme() {
        return new getCusomterInfoByUsername_argsStandardScheme();
      }
    }

    private static class getCusomterInfoByUsername_argsStandardScheme extends StandardScheme<getCusomterInfoByUsername_args> {

      public void read(org.apache.thrift.protocol.TProtocol iprot, getCusomterInfoByUsername_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 1: // USERNAME
              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
                struct.username = iprot.readString();
                struct.setUsernameIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, getCusomterInfoByUsername_args struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.username != null) {
          oprot.writeFieldBegin(USERNAME_FIELD_DESC);
          oprot.writeString(struct.username);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class getCusomterInfoByUsername_argsTupleSchemeFactory implements SchemeFactory {
      public getCusomterInfoByUsername_argsTupleScheme getScheme() {
        return new getCusomterInfoByUsername_argsTupleScheme();
      }
    }

    private static class getCusomterInfoByUsername_argsTupleScheme extends TupleScheme<getCusomterInfoByUsername_args> {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, getCusomterInfoByUsername_args struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetUsername()) {
          optionals.set(0);
        }
        oprot.writeBitSet(optionals, 1);
        if (struct.isSetUsername()) {
          oprot.writeString(struct.username);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, getCusomterInfoByUsername_args struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          struct.username = iprot.readString();
          struct.setUsernameIsSet(true);
        }
      }
    }

  }

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

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0);
    private static final org.apache.thrift.protocol.TField ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("error", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new getCusomterInfoByUsername_resultStandardSchemeFactory());
      schemes.put(TupleScheme.class, new getCusomterInfoByUsername_resultTupleSchemeFactory());
    }

    public Customer success; // required
    public csr_error error; // required

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

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

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

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          case 1: // ERROR
            return ERROR;
          default:
            return null;
        }
      }

      /**
       * 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, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Customer.class)));
      tmpMap.put(_Fields.ERROR, new org.apache.thrift.meta_data.FieldMetaData("error", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCusomterInfoByUsername_result.class, metaDataMap);
    }

    public getCusomterInfoByUsername_result() {
    }

    public getCusomterInfoByUsername_result(
      Customer success,
      csr_error error)
    {
      this();
      this.success = success;
      this.error = error;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getCusomterInfoByUsername_result(getCusomterInfoByUsername_result other) {
      if (other.isSetSuccess()) {
        this.success = new Customer(other.success);
      }
      if (other.isSetError()) {
        this.error = new csr_error(other.error);
      }
    }

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

    @Override
    public void clear() {
      this.success = null;
      this.error = null;
    }

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

    public getCusomterInfoByUsername_result setSuccess(Customer success) {
      this.success = success;
      return this;
    }

    public void unsetSuccess() {
      this.success = null;
    }

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

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public csr_error getError() {
      return this.error;
    }

    public getCusomterInfoByUsername_result setError(csr_error error) {
      this.error = error;
      return this;
    }

    public void unsetError() {
      this.error = null;
    }

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

    public void setErrorIsSet(boolean value) {
      if (!value) {
        this.error = null;
      }
    }

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

      case ERROR:
        if (value == null) {
          unsetError();
        } else {
          setError((csr_error)value);
        }
        break;

      }
    }

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

      case ERROR:
        return getError();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case ERROR:
        return isSetError();
      }
      throw new IllegalStateException();
    }

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

    public boolean equals(getCusomterInfoByUsername_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_error = true && this.isSetError();
      boolean that_present_error = true && that.isSetError();
      if (this_present_error || that_present_error) {
        if (!(this_present_error && that_present_error))
          return false;
        if (!this.error.equals(that.error))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      List<Object> list = new ArrayList<Object>();

      boolean present_success = true && (isSetSuccess());
      list.add(present_success);
      if (present_success)
        list.add(success);

      boolean present_error = true && (isSetError());
      list.add(present_error);
      if (present_error)
        list.add(error);

      return list.hashCode();
    }

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

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetError()).compareTo(other.isSetError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.error, other.error);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
      }

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

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
      if (success != null) {
        success.validate();
      }
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class getCusomterInfoByUsername_resultStandardSchemeFactory implements SchemeFactory {
      public getCusomterInfoByUsername_resultStandardScheme getScheme() {
        return new getCusomterInfoByUsername_resultStandardScheme();
      }
    }

    private static class getCusomterInfoByUsername_resultStandardScheme extends StandardScheme<getCusomterInfoByUsername_result> {

      public void read(org.apache.thrift.protocol.TProtocol iprot, getCusomterInfoByUsername_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 0: // SUCCESS
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.success = new Customer();
                struct.success.read(iprot);
                struct.setSuccessIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 1: // ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.error = new csr_error();
                struct.error.read(iprot);
                struct.setErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, getCusomterInfoByUsername_result struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.success != null) {
          oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
          struct.success.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.error != null) {
          oprot.writeFieldBegin(ERROR_FIELD_DESC);
          struct.error.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class getCusomterInfoByUsername_resultTupleSchemeFactory implements SchemeFactory {
      public getCusomterInfoByUsername_resultTupleScheme getScheme() {
        return new getCusomterInfoByUsername_resultTupleScheme();
      }
    }

    private static class getCusomterInfoByUsername_resultTupleScheme extends TupleScheme<getCusomterInfoByUsername_result> {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, getCusomterInfoByUsername_result struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetSuccess()) {
          optionals.set(0);
        }
        if (struct.isSetError()) {
          optionals.set(1);
        }
        oprot.writeBitSet(optionals, 2);
        if (struct.isSetSuccess()) {
          struct.success.write(oprot);
        }
        if (struct.isSetError()) {
          struct.error.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, getCusomterInfoByUsername_result struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(2);
        if (incoming.get(0)) {
          struct.success = new Customer();
          struct.success.read(iprot);
          struct.setSuccessIsSet(true);
        }
        if (incoming.get(1)) {
          struct.error = new csr_error();
          struct.error.read(iprot);
          struct.setErrorIsSet(true);
        }
      }
    }

  }

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

    private static final org.apache.thrift.protocol.TField USERNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("username", org.apache.thrift.protocol.TType.STRING, (short)1);
    private static final org.apache.thrift.protocol.TField CSR_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("csrId", org.apache.thrift.protocol.TType.I32, (short)2);

    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new phoneCallback_argsStandardSchemeFactory());
      schemes.put(TupleScheme.class, new phoneCallback_argsTupleSchemeFactory());
    }

    public String username; // required
    public int csrId; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      USERNAME((short)1, "username"),
      CSR_ID((short)2, "csrId");

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

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

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // USERNAME
            return USERNAME;
          case 2: // CSR_ID
            return CSR_ID;
          default:
            return null;
        }
      }

      /**
       * 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 __CSRID_ISSET_ID = 0;
    private byte __isset_bitfield = 0;
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.USERNAME, new org.apache.thrift.meta_data.FieldMetaData("username", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
      tmpMap.put(_Fields.CSR_ID, new org.apache.thrift.meta_data.FieldMetaData("csrId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(phoneCallback_args.class, metaDataMap);
    }

    public phoneCallback_args() {
    }

    public phoneCallback_args(
      String username,
      int csrId)
    {
      this();
      this.username = username;
      this.csrId = csrId;
      setCsrIdIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public phoneCallback_args(phoneCallback_args other) {
      __isset_bitfield = other.__isset_bitfield;
      if (other.isSetUsername()) {
        this.username = other.username;
      }
      this.csrId = other.csrId;
    }

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

    @Override
    public void clear() {
      this.username = null;
      setCsrIdIsSet(false);
      this.csrId = 0;
    }

    public String getUsername() {
      return this.username;
    }

    public phoneCallback_args setUsername(String username) {
      this.username = username;
      return this;
    }

    public void unsetUsername() {
      this.username = null;
    }

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

    public void setUsernameIsSet(boolean value) {
      if (!value) {
        this.username = null;
      }
    }

    public int getCsrId() {
      return this.csrId;
    }

    public phoneCallback_args setCsrId(int csrId) {
      this.csrId = csrId;
      setCsrIdIsSet(true);
      return this;
    }

    public void unsetCsrId() {
      __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __CSRID_ISSET_ID);
    }

    /** Returns true if field csrId is set (has been assigned a value) and false otherwise */
    public boolean isSetCsrId() {
      return EncodingUtils.testBit(__isset_bitfield, __CSRID_ISSET_ID);
    }

    public void setCsrIdIsSet(boolean value) {
      __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __CSRID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case USERNAME:
        if (value == null) {
          unsetUsername();
        } else {
          setUsername((String)value);
        }
        break;

      case CSR_ID:
        if (value == null) {
          unsetCsrId();
        } else {
          setCsrId((Integer)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case USERNAME:
        return getUsername();

      case CSR_ID:
        return Integer.valueOf(getCsrId());

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case USERNAME:
        return isSetUsername();
      case CSR_ID:
        return isSetCsrId();
      }
      throw new IllegalStateException();
    }

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

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

      boolean this_present_username = true && this.isSetUsername();
      boolean that_present_username = true && that.isSetUsername();
      if (this_present_username || that_present_username) {
        if (!(this_present_username && that_present_username))
          return false;
        if (!this.username.equals(that.username))
          return false;
      }

      boolean this_present_csrId = true;
      boolean that_present_csrId = true;
      if (this_present_csrId || that_present_csrId) {
        if (!(this_present_csrId && that_present_csrId))
          return false;
        if (this.csrId != that.csrId)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      List<Object> list = new ArrayList<Object>();

      boolean present_username = true && (isSetUsername());
      list.add(present_username);
      if (present_username)
        list.add(username);

      boolean present_csrId = true;
      list.add(present_csrId);
      if (present_csrId)
        list.add(csrId);

      return list.hashCode();
    }

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

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetUsername()).compareTo(other.isSetUsername());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetUsername()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.username, other.username);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetCsrId()).compareTo(other.isSetCsrId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetCsrId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.csrId, other.csrId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
    }

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

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

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bitfield = 0;
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class phoneCallback_argsStandardSchemeFactory implements SchemeFactory {
      public phoneCallback_argsStandardScheme getScheme() {
        return new phoneCallback_argsStandardScheme();
      }
    }

    private static class phoneCallback_argsStandardScheme extends StandardScheme<phoneCallback_args> {

      public void read(org.apache.thrift.protocol.TProtocol iprot, phoneCallback_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 1: // USERNAME
              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
                struct.username = iprot.readString();
                struct.setUsernameIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // CSR_ID
              if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
                struct.csrId = iprot.readI32();
                struct.setCsrIdIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, phoneCallback_args struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.username != null) {
          oprot.writeFieldBegin(USERNAME_FIELD_DESC);
          oprot.writeString(struct.username);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldBegin(CSR_ID_FIELD_DESC);
        oprot.writeI32(struct.csrId);
        oprot.writeFieldEnd();
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class phoneCallback_argsTupleSchemeFactory implements SchemeFactory {
      public phoneCallback_argsTupleScheme getScheme() {
        return new phoneCallback_argsTupleScheme();
      }
    }

    private static class phoneCallback_argsTupleScheme extends TupleScheme<phoneCallback_args> {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, phoneCallback_args struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetUsername()) {
          optionals.set(0);
        }
        if (struct.isSetCsrId()) {
          optionals.set(1);
        }
        oprot.writeBitSet(optionals, 2);
        if (struct.isSetUsername()) {
          oprot.writeString(struct.username);
        }
        if (struct.isSetCsrId()) {
          oprot.writeI32(struct.csrId);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, phoneCallback_args struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(2);
        if (incoming.get(0)) {
          struct.username = iprot.readString();
          struct.setUsernameIsSet(true);
        }
        if (incoming.get(1)) {
          struct.csrId = iprot.readI32();
          struct.setCsrIdIsSet(true);
        }
      }
    }

  }

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

    private static final org.apache.thrift.protocol.TField ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("error", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new phoneCallback_resultStandardSchemeFactory());
      schemes.put(TupleScheme.class, new phoneCallback_resultTupleSchemeFactory());
    }

    public csr_error error; // required

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

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

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

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // ERROR
            return ERROR;
          default:
            return null;
        }
      }

      /**
       * 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, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.ERROR, new org.apache.thrift.meta_data.FieldMetaData("error", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(phoneCallback_result.class, metaDataMap);
    }

    public phoneCallback_result() {
    }

    public phoneCallback_result(
      csr_error error)
    {
      this();
      this.error = error;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public phoneCallback_result(phoneCallback_result other) {
      if (other.isSetError()) {
        this.error = new csr_error(other.error);
      }
    }

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

    @Override
    public void clear() {
      this.error = null;
    }

    public csr_error getError() {
      return this.error;
    }

    public phoneCallback_result setError(csr_error error) {
      this.error = error;
      return this;
    }

    public void unsetError() {
      this.error = null;
    }

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

    public void setErrorIsSet(boolean value) {
      if (!value) {
        this.error = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case ERROR:
        if (value == null) {
          unsetError();
        } else {
          setError((csr_error)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case ERROR:
        return getError();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case ERROR:
        return isSetError();
      }
      throw new IllegalStateException();
    }

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

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

      boolean this_present_error = true && this.isSetError();
      boolean that_present_error = true && that.isSetError();
      if (this_present_error || that_present_error) {
        if (!(this_present_error && that_present_error))
          return false;
        if (!this.error.equals(that.error))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      List<Object> list = new ArrayList<Object>();

      boolean present_error = true && (isSetError());
      list.add(present_error);
      if (present_error)
        list.add(error);

      return list.hashCode();
    }

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

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetError()).compareTo(other.isSetError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.error, other.error);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
      }

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

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

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class phoneCallback_resultStandardSchemeFactory implements SchemeFactory {
      public phoneCallback_resultStandardScheme getScheme() {
        return new phoneCallback_resultStandardScheme();
      }
    }

    private static class phoneCallback_resultStandardScheme extends StandardScheme<phoneCallback_result> {

      public void read(org.apache.thrift.protocol.TProtocol iprot, phoneCallback_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 1: // ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.error = new csr_error();
                struct.error.read(iprot);
                struct.setErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, phoneCallback_result struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.error != null) {
          oprot.writeFieldBegin(ERROR_FIELD_DESC);
          struct.error.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class phoneCallback_resultTupleSchemeFactory implements SchemeFactory {
      public phoneCallback_resultTupleScheme getScheme() {
        return new phoneCallback_resultTupleScheme();
      }
    }

    private static class phoneCallback_resultTupleScheme extends TupleScheme<phoneCallback_result> {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, phoneCallback_result struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetError()) {
          optionals.set(0);
        }
        oprot.writeBitSet(optionals, 1);
        if (struct.isSetError()) {
          struct.error.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, phoneCallback_result struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          struct.error = new csr_error();
          struct.error.read(iprot);
          struct.setErrorIsSet(true);
        }
      }
    }

  }

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

    private static final org.apache.thrift.protocol.TField CUSTOMER_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("customerId", org.apache.thrift.protocol.TType.I32, (short)1);

    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new getCustomerUsernameByCustomerId_argsStandardSchemeFactory());
      schemes.put(TupleScheme.class, new getCustomerUsernameByCustomerId_argsTupleSchemeFactory());
    }

    public int customerId; // required

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

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

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

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // CUSTOMER_ID
            return CUSTOMER_ID;
          default:
            return null;
        }
      }

      /**
       * 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 __CUSTOMERID_ISSET_ID = 0;
    private byte __isset_bitfield = 0;
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.CUSTOMER_ID, new org.apache.thrift.meta_data.FieldMetaData("customerId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCustomerUsernameByCustomerId_args.class, metaDataMap);
    }

    public getCustomerUsernameByCustomerId_args() {
    }

    public getCustomerUsernameByCustomerId_args(
      int customerId)
    {
      this();
      this.customerId = customerId;
      setCustomerIdIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getCustomerUsernameByCustomerId_args(getCustomerUsernameByCustomerId_args other) {
      __isset_bitfield = other.__isset_bitfield;
      this.customerId = other.customerId;
    }

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

    @Override
    public void clear() {
      setCustomerIdIsSet(false);
      this.customerId = 0;
    }

    public int getCustomerId() {
      return this.customerId;
    }

    public getCustomerUsernameByCustomerId_args setCustomerId(int customerId) {
      this.customerId = customerId;
      setCustomerIdIsSet(true);
      return this;
    }

    public void unsetCustomerId() {
      __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __CUSTOMERID_ISSET_ID);
    }

    /** Returns true if field customerId is set (has been assigned a value) and false otherwise */
    public boolean isSetCustomerId() {
      return EncodingUtils.testBit(__isset_bitfield, __CUSTOMERID_ISSET_ID);
    }

    public void setCustomerIdIsSet(boolean value) {
      __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __CUSTOMERID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case CUSTOMER_ID:
        if (value == null) {
          unsetCustomerId();
        } else {
          setCustomerId((Integer)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case CUSTOMER_ID:
        return Integer.valueOf(getCustomerId());

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case CUSTOMER_ID:
        return isSetCustomerId();
      }
      throw new IllegalStateException();
    }

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

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

      boolean this_present_customerId = true;
      boolean that_present_customerId = true;
      if (this_present_customerId || that_present_customerId) {
        if (!(this_present_customerId && that_present_customerId))
          return false;
        if (this.customerId != that.customerId)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      List<Object> list = new ArrayList<Object>();

      boolean present_customerId = true;
      list.add(present_customerId);
      if (present_customerId)
        list.add(customerId);

      return list.hashCode();
    }

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

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetCustomerId()).compareTo(other.isSetCustomerId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetCustomerId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.customerId, other.customerId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
    }

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

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

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bitfield = 0;
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class getCustomerUsernameByCustomerId_argsStandardSchemeFactory implements SchemeFactory {
      public getCustomerUsernameByCustomerId_argsStandardScheme getScheme() {
        return new getCustomerUsernameByCustomerId_argsStandardScheme();
      }
    }

    private static class getCustomerUsernameByCustomerId_argsStandardScheme extends StandardScheme<getCustomerUsernameByCustomerId_args> {

      public void read(org.apache.thrift.protocol.TProtocol iprot, getCustomerUsernameByCustomerId_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 1: // CUSTOMER_ID
              if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
                struct.customerId = iprot.readI32();
                struct.setCustomerIdIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, getCustomerUsernameByCustomerId_args struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        oprot.writeFieldBegin(CUSTOMER_ID_FIELD_DESC);
        oprot.writeI32(struct.customerId);
        oprot.writeFieldEnd();
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class getCustomerUsernameByCustomerId_argsTupleSchemeFactory implements SchemeFactory {
      public getCustomerUsernameByCustomerId_argsTupleScheme getScheme() {
        return new getCustomerUsernameByCustomerId_argsTupleScheme();
      }
    }

    private static class getCustomerUsernameByCustomerId_argsTupleScheme extends TupleScheme<getCustomerUsernameByCustomerId_args> {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, getCustomerUsernameByCustomerId_args struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetCustomerId()) {
          optionals.set(0);
        }
        oprot.writeBitSet(optionals, 1);
        if (struct.isSetCustomerId()) {
          oprot.writeI32(struct.customerId);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, getCustomerUsernameByCustomerId_args struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          struct.customerId = iprot.readI32();
          struct.setCustomerIdIsSet(true);
        }
      }
    }

  }

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

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0);
    private static final org.apache.thrift.protocol.TField ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("error", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new getCustomerUsernameByCustomerId_resultStandardSchemeFactory());
      schemes.put(TupleScheme.class, new getCustomerUsernameByCustomerId_resultTupleSchemeFactory());
    }

    public List<String> success; // required
    public csr_error error; // required

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

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

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

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          case 1: // ERROR
            return ERROR;
          default:
            return null;
        }
      }

      /**
       * 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, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.LIST          , "UsernameList")));
      tmpMap.put(_Fields.ERROR, new org.apache.thrift.meta_data.FieldMetaData("error", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCustomerUsernameByCustomerId_result.class, metaDataMap);
    }

    public getCustomerUsernameByCustomerId_result() {
    }

    public getCustomerUsernameByCustomerId_result(
      List<String> success,
      csr_error error)
    {
      this();
      this.success = success;
      this.error = error;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getCustomerUsernameByCustomerId_result(getCustomerUsernameByCustomerId_result other) {
      if (other.isSetSuccess()) {
        this.success = other.success;
      }
      if (other.isSetError()) {
        this.error = new csr_error(other.error);
      }
    }

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

    @Override
    public void clear() {
      this.success = null;
      this.error = null;
    }

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

    public java.util.Iterator<String> getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(String elem) {
      if (this.success == null) {
        this.success = new ArrayList<String>();
      }
      this.success.add(elem);
    }

    public List<String> getSuccess() {
      return this.success;
    }

    public getCustomerUsernameByCustomerId_result setSuccess(List<String> success) {
      this.success = success;
      return this;
    }

    public void unsetSuccess() {
      this.success = null;
    }

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

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public csr_error getError() {
      return this.error;
    }

    public getCustomerUsernameByCustomerId_result setError(csr_error error) {
      this.error = error;
      return this;
    }

    public void unsetError() {
      this.error = null;
    }

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

    public void setErrorIsSet(boolean value) {
      if (!value) {
        this.error = null;
      }
    }

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

      case ERROR:
        if (value == null) {
          unsetError();
        } else {
          setError((csr_error)value);
        }
        break;

      }
    }

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

      case ERROR:
        return getError();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case ERROR:
        return isSetError();
      }
      throw new IllegalStateException();
    }

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

    public boolean equals(getCustomerUsernameByCustomerId_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_error = true && this.isSetError();
      boolean that_present_error = true && that.isSetError();
      if (this_present_error || that_present_error) {
        if (!(this_present_error && that_present_error))
          return false;
        if (!this.error.equals(that.error))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      List<Object> list = new ArrayList<Object>();

      boolean present_success = true && (isSetSuccess());
      list.add(present_success);
      if (present_success)
        list.add(success);

      boolean present_error = true && (isSetError());
      list.add(present_error);
      if (present_error)
        list.add(error);

      return list.hashCode();
    }

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

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetError()).compareTo(other.isSetError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.error, other.error);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
      }

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

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class getCustomerUsernameByCustomerId_resultStandardSchemeFactory implements SchemeFactory {
      public getCustomerUsernameByCustomerId_resultStandardScheme getScheme() {
        return new getCustomerUsernameByCustomerId_resultStandardScheme();
      }
    }

    private static class getCustomerUsernameByCustomerId_resultStandardScheme extends StandardScheme<getCustomerUsernameByCustomerId_result> {

      public void read(org.apache.thrift.protocol.TProtocol iprot, getCustomerUsernameByCustomerId_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 0: // SUCCESS
              if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
                {
                  org.apache.thrift.protocol.TList _list24 = iprot.readListBegin();
                  struct.success = new ArrayList<String>(_list24.size);
                  String _elem25;
                  for (int _i26 = 0; _i26 < _list24.size; ++_i26)
                  {
                    _elem25 = iprot.readString();
                    struct.success.add(_elem25);
                  }
                  iprot.readListEnd();
                }
                struct.setSuccessIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 1: // ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.error = new csr_error();
                struct.error.read(iprot);
                struct.setErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, getCustomerUsernameByCustomerId_result struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.success != null) {
          oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
          {
            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.success.size()));
            for (String _iter27 : struct.success)
            {
              oprot.writeString(_iter27);
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
        if (struct.error != null) {
          oprot.writeFieldBegin(ERROR_FIELD_DESC);
          struct.error.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class getCustomerUsernameByCustomerId_resultTupleSchemeFactory implements SchemeFactory {
      public getCustomerUsernameByCustomerId_resultTupleScheme getScheme() {
        return new getCustomerUsernameByCustomerId_resultTupleScheme();
      }
    }

    private static class getCustomerUsernameByCustomerId_resultTupleScheme extends TupleScheme<getCustomerUsernameByCustomerId_result> {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, getCustomerUsernameByCustomerId_result struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetSuccess()) {
          optionals.set(0);
        }
        if (struct.isSetError()) {
          optionals.set(1);
        }
        oprot.writeBitSet(optionals, 2);
        if (struct.isSetSuccess()) {
          {
            oprot.writeI32(struct.success.size());
            for (String _iter28 : struct.success)
            {
              oprot.writeString(_iter28);
            }
          }
        }
        if (struct.isSetError()) {
          struct.error.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, getCustomerUsernameByCustomerId_result struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(2);
        if (incoming.get(0)) {
          {
            org.apache.thrift.protocol.TList _list29 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
            struct.success = new ArrayList<String>(_list29.size);
            String _elem30;
            for (int _i31 = 0; _i31 < _list29.size; ++_i31)
            {
              _elem30 = iprot.readString();
              struct.success.add(_elem30);
            }
          }
          struct.setSuccessIsSet(true);
        }
        if (incoming.get(1)) {
          struct.error = new csr_error();
          struct.error.read(iprot);
          struct.setErrorIsSet(true);
        }
      }
    }

  }

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

    private static final org.apache.thrift.protocol.TField CUSTOMER_DETAIL_FIELD_DESC = new org.apache.thrift.protocol.TField("customerDetail", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new setCustomerInfo_argsStandardSchemeFactory());
      schemes.put(TupleScheme.class, new setCustomerInfo_argsTupleSchemeFactory());
    }

    public CustomerDetail customerDetail; // required

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

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

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

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // CUSTOMER_DETAIL
            return CUSTOMER_DETAIL;
          default:
            return null;
        }
      }

      /**
       * 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, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.CUSTOMER_DETAIL, new org.apache.thrift.meta_data.FieldMetaData("customerDetail", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, CustomerDetail.class)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(setCustomerInfo_args.class, metaDataMap);
    }

    public setCustomerInfo_args() {
    }

    public setCustomerInfo_args(
      CustomerDetail customerDetail)
    {
      this();
      this.customerDetail = customerDetail;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public setCustomerInfo_args(setCustomerInfo_args other) {
      if (other.isSetCustomerDetail()) {
        this.customerDetail = new CustomerDetail(other.customerDetail);
      }
    }

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

    @Override
    public void clear() {
      this.customerDetail = null;
    }

    public CustomerDetail getCustomerDetail() {
      return this.customerDetail;
    }

    public setCustomerInfo_args setCustomerDetail(CustomerDetail customerDetail) {
      this.customerDetail = customerDetail;
      return this;
    }

    public void unsetCustomerDetail() {
      this.customerDetail = null;
    }

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

    public void setCustomerDetailIsSet(boolean value) {
      if (!value) {
        this.customerDetail = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case CUSTOMER_DETAIL:
        if (value == null) {
          unsetCustomerDetail();
        } else {
          setCustomerDetail((CustomerDetail)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case CUSTOMER_DETAIL:
        return getCustomerDetail();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case CUSTOMER_DETAIL:
        return isSetCustomerDetail();
      }
      throw new IllegalStateException();
    }

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

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

      boolean this_present_customerDetail = true && this.isSetCustomerDetail();
      boolean that_present_customerDetail = true && that.isSetCustomerDetail();
      if (this_present_customerDetail || that_present_customerDetail) {
        if (!(this_present_customerDetail && that_present_customerDetail))
          return false;
        if (!this.customerDetail.equals(that.customerDetail))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      List<Object> list = new ArrayList<Object>();

      boolean present_customerDetail = true && (isSetCustomerDetail());
      list.add(present_customerDetail);
      if (present_customerDetail)
        list.add(customerDetail);

      return list.hashCode();
    }

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

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetCustomerDetail()).compareTo(other.isSetCustomerDetail());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetCustomerDetail()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.customerDetail, other.customerDetail);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
    }

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

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

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
      if (customerDetail != null) {
        customerDetail.validate();
      }
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class setCustomerInfo_argsStandardSchemeFactory implements SchemeFactory {
      public setCustomerInfo_argsStandardScheme getScheme() {
        return new setCustomerInfo_argsStandardScheme();
      }
    }

    private static class setCustomerInfo_argsStandardScheme extends StandardScheme<setCustomerInfo_args> {

      public void read(org.apache.thrift.protocol.TProtocol iprot, setCustomerInfo_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 1: // CUSTOMER_DETAIL
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.customerDetail = new CustomerDetail();
                struct.customerDetail.read(iprot);
                struct.setCustomerDetailIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, setCustomerInfo_args struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.customerDetail != null) {
          oprot.writeFieldBegin(CUSTOMER_DETAIL_FIELD_DESC);
          struct.customerDetail.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class setCustomerInfo_argsTupleSchemeFactory implements SchemeFactory {
      public setCustomerInfo_argsTupleScheme getScheme() {
        return new setCustomerInfo_argsTupleScheme();
      }
    }

    private static class setCustomerInfo_argsTupleScheme extends TupleScheme<setCustomerInfo_args> {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, setCustomerInfo_args struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetCustomerDetail()) {
          optionals.set(0);
        }
        oprot.writeBitSet(optionals, 1);
        if (struct.isSetCustomerDetail()) {
          struct.customerDetail.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, setCustomerInfo_args struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          struct.customerDetail = new CustomerDetail();
          struct.customerDetail.read(iprot);
          struct.setCustomerDetailIsSet(true);
        }
      }
    }

  }

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


    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new setCustomerInfo_resultStandardSchemeFactory());
      schemes.put(TupleScheme.class, new setCustomerInfo_resultTupleSchemeFactory());
    }


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

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

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

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

      /**
       * 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, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(setCustomerInfo_result.class, metaDataMap);
    }

    public setCustomerInfo_result() {
    }

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

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

    @Override
    public void clear() {
    }

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

    public Object getFieldValue(_Fields field) {
      switch (field) {
      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      }
      throw new IllegalStateException();
    }

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

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

      return true;
    }

    @Override
    public int hashCode() {
      List<Object> list = new ArrayList<Object>();

      return list.hashCode();
    }

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

      int lastComparison = 0;

      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
      }

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

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

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class setCustomerInfo_resultStandardSchemeFactory implements SchemeFactory {
      public setCustomerInfo_resultStandardScheme getScheme() {
        return new setCustomerInfo_resultStandardScheme();
      }
    }

    private static class setCustomerInfo_resultStandardScheme extends StandardScheme<setCustomerInfo_result> {

      public void read(org.apache.thrift.protocol.TProtocol iprot, setCustomerInfo_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, setCustomerInfo_result struct) throws org.apache.thrift.TException {
        struct.validate();

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

    }

    private static class setCustomerInfo_resultTupleSchemeFactory implements SchemeFactory {
      public setCustomerInfo_resultTupleScheme getScheme() {
        return new setCustomerInfo_resultTupleScheme();
      }
    }

    private static class setCustomerInfo_resultTupleScheme extends TupleScheme<setCustomerInfo_result> {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, setCustomerInfo_result struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, setCustomerInfo_result struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
      }
    }

  }

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

    private static final org.apache.thrift.protocol.TField USERNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("username", org.apache.thrift.protocol.TType.STRING, (short)1);
    private static final org.apache.thrift.protocol.TField NEW_CSRID_FIELD_DESC = new org.apache.thrift.protocol.TField("newCSRId", org.apache.thrift.protocol.TType.I32, (short)2);

    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new bindCSR_argsStandardSchemeFactory());
      schemes.put(TupleScheme.class, new bindCSR_argsTupleSchemeFactory());
    }

    public String username; // required
    public int newCSRId; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      USERNAME((short)1, "username"),
      NEW_CSRID((short)2, "newCSRId");

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

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

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // USERNAME
            return USERNAME;
          case 2: // NEW_CSRID
            return NEW_CSRID;
          default:
            return null;
        }
      }

      /**
       * 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 __NEWCSRID_ISSET_ID = 0;
    private byte __isset_bitfield = 0;
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.USERNAME, new org.apache.thrift.meta_data.FieldMetaData("username", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
      tmpMap.put(_Fields.NEW_CSRID, new org.apache.thrift.meta_data.FieldMetaData("newCSRId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(bindCSR_args.class, metaDataMap);
    }

    public bindCSR_args() {
    }

    public bindCSR_args(
      String username,
      int newCSRId)
    {
      this();
      this.username = username;
      this.newCSRId = newCSRId;
      setNewCSRIdIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public bindCSR_args(bindCSR_args other) {
      __isset_bitfield = other.__isset_bitfield;
      if (other.isSetUsername()) {
        this.username = other.username;
      }
      this.newCSRId = other.newCSRId;
    }

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

    @Override
    public void clear() {
      this.username = null;
      setNewCSRIdIsSet(false);
      this.newCSRId = 0;
    }

    public String getUsername() {
      return this.username;
    }

    public bindCSR_args setUsername(String username) {
      this.username = username;
      return this;
    }

    public void unsetUsername() {
      this.username = null;
    }

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

    public void setUsernameIsSet(boolean value) {
      if (!value) {
        this.username = null;
      }
    }

    public int getNewCSRId() {
      return this.newCSRId;
    }

    public bindCSR_args setNewCSRId(int newCSRId) {
      this.newCSRId = newCSRId;
      setNewCSRIdIsSet(true);
      return this;
    }

    public void unsetNewCSRId() {
      __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __NEWCSRID_ISSET_ID);
    }

    /** Returns true if field newCSRId is set (has been assigned a value) and false otherwise */
    public boolean isSetNewCSRId() {
      return EncodingUtils.testBit(__isset_bitfield, __NEWCSRID_ISSET_ID);
    }

    public void setNewCSRIdIsSet(boolean value) {
      __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __NEWCSRID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case USERNAME:
        if (value == null) {
          unsetUsername();
        } else {
          setUsername((String)value);
        }
        break;

      case NEW_CSRID:
        if (value == null) {
          unsetNewCSRId();
        } else {
          setNewCSRId((Integer)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case USERNAME:
        return getUsername();

      case NEW_CSRID:
        return Integer.valueOf(getNewCSRId());

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case USERNAME:
        return isSetUsername();
      case NEW_CSRID:
        return isSetNewCSRId();
      }
      throw new IllegalStateException();
    }

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

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

      boolean this_present_username = true && this.isSetUsername();
      boolean that_present_username = true && that.isSetUsername();
      if (this_present_username || that_present_username) {
        if (!(this_present_username && that_present_username))
          return false;
        if (!this.username.equals(that.username))
          return false;
      }

      boolean this_present_newCSRId = true;
      boolean that_present_newCSRId = true;
      if (this_present_newCSRId || that_present_newCSRId) {
        if (!(this_present_newCSRId && that_present_newCSRId))
          return false;
        if (this.newCSRId != that.newCSRId)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      List<Object> list = new ArrayList<Object>();

      boolean present_username = true && (isSetUsername());
      list.add(present_username);
      if (present_username)
        list.add(username);

      boolean present_newCSRId = true;
      list.add(present_newCSRId);
      if (present_newCSRId)
        list.add(newCSRId);

      return list.hashCode();
    }

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

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetUsername()).compareTo(other.isSetUsername());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetUsername()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.username, other.username);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetNewCSRId()).compareTo(other.isSetNewCSRId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetNewCSRId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.newCSRId, other.newCSRId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
    }

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

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

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bitfield = 0;
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class bindCSR_argsStandardSchemeFactory implements SchemeFactory {
      public bindCSR_argsStandardScheme getScheme() {
        return new bindCSR_argsStandardScheme();
      }
    }

    private static class bindCSR_argsStandardScheme extends StandardScheme<bindCSR_args> {

      public void read(org.apache.thrift.protocol.TProtocol iprot, bindCSR_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 1: // USERNAME
              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
                struct.username = iprot.readString();
                struct.setUsernameIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // NEW_CSRID
              if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
                struct.newCSRId = iprot.readI32();
                struct.setNewCSRIdIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, bindCSR_args struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.username != null) {
          oprot.writeFieldBegin(USERNAME_FIELD_DESC);
          oprot.writeString(struct.username);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldBegin(NEW_CSRID_FIELD_DESC);
        oprot.writeI32(struct.newCSRId);
        oprot.writeFieldEnd();
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class bindCSR_argsTupleSchemeFactory implements SchemeFactory {
      public bindCSR_argsTupleScheme getScheme() {
        return new bindCSR_argsTupleScheme();
      }
    }

    private static class bindCSR_argsTupleScheme extends TupleScheme<bindCSR_args> {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, bindCSR_args struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetUsername()) {
          optionals.set(0);
        }
        if (struct.isSetNewCSRId()) {
          optionals.set(1);
        }
        oprot.writeBitSet(optionals, 2);
        if (struct.isSetUsername()) {
          oprot.writeString(struct.username);
        }
        if (struct.isSetNewCSRId()) {
          oprot.writeI32(struct.newCSRId);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, bindCSR_args struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(2);
        if (incoming.get(0)) {
          struct.username = iprot.readString();
          struct.setUsernameIsSet(true);
        }
        if (incoming.get(1)) {
          struct.newCSRId = iprot.readI32();
          struct.setNewCSRIdIsSet(true);
        }
      }
    }

  }

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

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0);
    private static final org.apache.thrift.protocol.TField ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("error", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new bindCSR_resultStandardSchemeFactory());
      schemes.put(TupleScheme.class, new bindCSR_resultTupleSchemeFactory());
    }

    public CSRInfo success; // required
    public bind_error error; // required

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

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

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

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          case 1: // ERROR
            return ERROR;
          default:
            return null;
        }
      }

      /**
       * 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, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, CSRInfo.class)));
      tmpMap.put(_Fields.ERROR, new org.apache.thrift.meta_data.FieldMetaData("error", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(bindCSR_result.class, metaDataMap);
    }

    public bindCSR_result() {
    }

    public bindCSR_result(
      CSRInfo success,
      bind_error error)
    {
      this();
      this.success = success;
      this.error = error;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public bindCSR_result(bindCSR_result other) {
      if (other.isSetSuccess()) {
        this.success = new CSRInfo(other.success);
      }
      if (other.isSetError()) {
        this.error = new bind_error(other.error);
      }
    }

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

    @Override
    public void clear() {
      this.success = null;
      this.error = null;
    }

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

    public bindCSR_result setSuccess(CSRInfo success) {
      this.success = success;
      return this;
    }

    public void unsetSuccess() {
      this.success = null;
    }

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

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public bind_error getError() {
      return this.error;
    }

    public bindCSR_result setError(bind_error error) {
      this.error = error;
      return this;
    }

    public void unsetError() {
      this.error = null;
    }

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

    public void setErrorIsSet(boolean value) {
      if (!value) {
        this.error = null;
      }
    }

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

      case ERROR:
        if (value == null) {
          unsetError();
        } else {
          setError((bind_error)value);
        }
        break;

      }
    }

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

      case ERROR:
        return getError();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case ERROR:
        return isSetError();
      }
      throw new IllegalStateException();
    }

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

    public boolean equals(bindCSR_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_error = true && this.isSetError();
      boolean that_present_error = true && that.isSetError();
      if (this_present_error || that_present_error) {
        if (!(this_present_error && that_present_error))
          return false;
        if (!this.error.equals(that.error))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      List<Object> list = new ArrayList<Object>();

      boolean present_success = true && (isSetSuccess());
      list.add(present_success);
      if (present_success)
        list.add(success);

      boolean present_error = true && (isSetError());
      list.add(present_error);
      if (present_error)
        list.add(error);

      return list.hashCode();
    }

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

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetError()).compareTo(other.isSetError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.error, other.error);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
      }

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

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
      if (success != null) {
        success.validate();
      }
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class bindCSR_resultStandardSchemeFactory implements SchemeFactory {
      public bindCSR_resultStandardScheme getScheme() {
        return new bindCSR_resultStandardScheme();
      }
    }

    private static class bindCSR_resultStandardScheme extends StandardScheme<bindCSR_result> {

      public void read(org.apache.thrift.protocol.TProtocol iprot, bindCSR_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 0: // SUCCESS
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.success = new CSRInfo();
                struct.success.read(iprot);
                struct.setSuccessIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 1: // ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.error = new bind_error();
                struct.error.read(iprot);
                struct.setErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, bindCSR_result struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.success != null) {
          oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
          struct.success.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.error != null) {
          oprot.writeFieldBegin(ERROR_FIELD_DESC);
          struct.error.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class bindCSR_resultTupleSchemeFactory implements SchemeFactory {
      public bindCSR_resultTupleScheme getScheme() {
        return new bindCSR_resultTupleScheme();
      }
    }

    private static class bindCSR_resultTupleScheme extends TupleScheme<bindCSR_result> {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, bindCSR_result struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetSuccess()) {
          optionals.set(0);
        }
        if (struct.isSetError()) {
          optionals.set(1);
        }
        oprot.writeBitSet(optionals, 2);
        if (struct.isSetSuccess()) {
          struct.success.write(oprot);
        }
        if (struct.isSetError()) {
          struct.error.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, bindCSR_result struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(2);
        if (incoming.get(0)) {
          struct.success = new CSRInfo();
          struct.success.read(iprot);
          struct.setSuccessIsSet(true);
        }
        if (incoming.get(1)) {
          struct.error = new bind_error();
          struct.error.read(iprot);
          struct.setErrorIsSet(true);
        }
      }
    }

  }

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

    private static final org.apache.thrift.protocol.TField USERNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("username", org.apache.thrift.protocol.TType.STRING, (short)1);

    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new getRelatedCSRInfoByUsername_client_argsStandardSchemeFactory());
      schemes.put(TupleScheme.class, new getRelatedCSRInfoByUsername_client_argsTupleSchemeFactory());
    }

    public String username; // required

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

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

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

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // USERNAME
            return USERNAME;
          default:
            return null;
        }
      }

      /**
       * 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, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.USERNAME, new org.apache.thrift.meta_data.FieldMetaData("username", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getRelatedCSRInfoByUsername_client_args.class, metaDataMap);
    }

    public getRelatedCSRInfoByUsername_client_args() {
    }

    public getRelatedCSRInfoByUsername_client_args(
      String username)
    {
      this();
      this.username = username;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getRelatedCSRInfoByUsername_client_args(getRelatedCSRInfoByUsername_client_args other) {
      if (other.isSetUsername()) {
        this.username = other.username;
      }
    }

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

    @Override
    public void clear() {
      this.username = null;
    }

    public String getUsername() {
      return this.username;
    }

    public getRelatedCSRInfoByUsername_client_args setUsername(String username) {
      this.username = username;
      return this;
    }

    public void unsetUsername() {
      this.username = null;
    }

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

    public void setUsernameIsSet(boolean value) {
      if (!value) {
        this.username = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case USERNAME:
        if (value == null) {
          unsetUsername();
        } else {
          setUsername((String)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case USERNAME:
        return getUsername();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case USERNAME:
        return isSetUsername();
      }
      throw new IllegalStateException();
    }

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

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

      boolean this_present_username = true && this.isSetUsername();
      boolean that_present_username = true && that.isSetUsername();
      if (this_present_username || that_present_username) {
        if (!(this_present_username && that_present_username))
          return false;
        if (!this.username.equals(that.username))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      List<Object> list = new ArrayList<Object>();

      boolean present_username = true && (isSetUsername());
      list.add(present_username);
      if (present_username)
        list.add(username);

      return list.hashCode();
    }

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

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetUsername()).compareTo(other.isSetUsername());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetUsername()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.username, other.username);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
    }

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

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

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class getRelatedCSRInfoByUsername_client_argsStandardSchemeFactory implements SchemeFactory {
      public getRelatedCSRInfoByUsername_client_argsStandardScheme getScheme() {
        return new getRelatedCSRInfoByUsername_client_argsStandardScheme();
      }
    }

    private static class getRelatedCSRInfoByUsername_client_argsStandardScheme extends StandardScheme<getRelatedCSRInfoByUsername_client_args> {

      public void read(org.apache.thrift.protocol.TProtocol iprot, getRelatedCSRInfoByUsername_client_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 1: // USERNAME
              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
                struct.username = iprot.readString();
                struct.setUsernameIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, getRelatedCSRInfoByUsername_client_args struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.username != null) {
          oprot.writeFieldBegin(USERNAME_FIELD_DESC);
          oprot.writeString(struct.username);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class getRelatedCSRInfoByUsername_client_argsTupleSchemeFactory implements SchemeFactory {
      public getRelatedCSRInfoByUsername_client_argsTupleScheme getScheme() {
        return new getRelatedCSRInfoByUsername_client_argsTupleScheme();
      }
    }

    private static class getRelatedCSRInfoByUsername_client_argsTupleScheme extends TupleScheme<getRelatedCSRInfoByUsername_client_args> {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, getRelatedCSRInfoByUsername_client_args struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetUsername()) {
          optionals.set(0);
        }
        oprot.writeBitSet(optionals, 1);
        if (struct.isSetUsername()) {
          oprot.writeString(struct.username);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, getRelatedCSRInfoByUsername_client_args struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          struct.username = iprot.readString();
          struct.setUsernameIsSet(true);
        }
      }
    }

  }

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

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0);
    private static final org.apache.thrift.protocol.TField ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("error", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new getRelatedCSRInfoByUsername_client_resultStandardSchemeFactory());
      schemes.put(TupleScheme.class, new getRelatedCSRInfoByUsername_client_resultTupleSchemeFactory());
    }

    public CSRInfo success; // required
    public csr_error error; // required

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

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

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

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          case 1: // ERROR
            return ERROR;
          default:
            return null;
        }
      }

      /**
       * 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, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, CSRInfo.class)));
      tmpMap.put(_Fields.ERROR, new org.apache.thrift.meta_data.FieldMetaData("error", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getRelatedCSRInfoByUsername_client_result.class, metaDataMap);
    }

    public getRelatedCSRInfoByUsername_client_result() {
    }

    public getRelatedCSRInfoByUsername_client_result(
      CSRInfo success,
      csr_error error)
    {
      this();
      this.success = success;
      this.error = error;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getRelatedCSRInfoByUsername_client_result(getRelatedCSRInfoByUsername_client_result other) {
      if (other.isSetSuccess()) {
        this.success = new CSRInfo(other.success);
      }
      if (other.isSetError()) {
        this.error = new csr_error(other.error);
      }
    }

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

    @Override
    public void clear() {
      this.success = null;
      this.error = null;
    }

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

    public getRelatedCSRInfoByUsername_client_result setSuccess(CSRInfo success) {
      this.success = success;
      return this;
    }

    public void unsetSuccess() {
      this.success = null;
    }

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

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public csr_error getError() {
      return this.error;
    }

    public getRelatedCSRInfoByUsername_client_result setError(csr_error error) {
      this.error = error;
      return this;
    }

    public void unsetError() {
      this.error = null;
    }

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

    public void setErrorIsSet(boolean value) {
      if (!value) {
        this.error = null;
      }
    }

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

      case ERROR:
        if (value == null) {
          unsetError();
        } else {
          setError((csr_error)value);
        }
        break;

      }
    }

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

      case ERROR:
        return getError();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case ERROR:
        return isSetError();
      }
      throw new IllegalStateException();
    }

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

    public boolean equals(getRelatedCSRInfoByUsername_client_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_error = true && this.isSetError();
      boolean that_present_error = true && that.isSetError();
      if (this_present_error || that_present_error) {
        if (!(this_present_error && that_present_error))
          return false;
        if (!this.error.equals(that.error))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      List<Object> list = new ArrayList<Object>();

      boolean present_success = true && (isSetSuccess());
      list.add(present_success);
      if (present_success)
        list.add(success);

      boolean present_error = true && (isSetError());
      list.add(present_error);
      if (present_error)
        list.add(error);

      return list.hashCode();
    }

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

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetError()).compareTo(other.isSetError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.error, other.error);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
      }

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

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
      if (success != null) {
        success.validate();
      }
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class getRelatedCSRInfoByUsername_client_resultStandardSchemeFactory implements SchemeFactory {
      public getRelatedCSRInfoByUsername_client_resultStandardScheme getScheme() {
        return new getRelatedCSRInfoByUsername_client_resultStandardScheme();
      }
    }

    private static class getRelatedCSRInfoByUsername_client_resultStandardScheme extends StandardScheme<getRelatedCSRInfoByUsername_client_result> {

      public void read(org.apache.thrift.protocol.TProtocol iprot, getRelatedCSRInfoByUsername_client_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 0: // SUCCESS
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.success = new CSRInfo();
                struct.success.read(iprot);
                struct.setSuccessIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 1: // ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.error = new csr_error();
                struct.error.read(iprot);
                struct.setErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, getRelatedCSRInfoByUsername_client_result struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.success != null) {
          oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
          struct.success.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.error != null) {
          oprot.writeFieldBegin(ERROR_FIELD_DESC);
          struct.error.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class getRelatedCSRInfoByUsername_client_resultTupleSchemeFactory implements SchemeFactory {
      public getRelatedCSRInfoByUsername_client_resultTupleScheme getScheme() {
        return new getRelatedCSRInfoByUsername_client_resultTupleScheme();
      }
    }

    private static class getRelatedCSRInfoByUsername_client_resultTupleScheme extends TupleScheme<getRelatedCSRInfoByUsername_client_result> {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, getRelatedCSRInfoByUsername_client_result struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetSuccess()) {
          optionals.set(0);
        }
        if (struct.isSetError()) {
          optionals.set(1);
        }
        oprot.writeBitSet(optionals, 2);
        if (struct.isSetSuccess()) {
          struct.success.write(oprot);
        }
        if (struct.isSetError()) {
          struct.error.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, getRelatedCSRInfoByUsername_client_result struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(2);
        if (incoming.get(0)) {
          struct.success = new CSRInfo();
          struct.success.read(iprot);
          struct.setSuccessIsSet(true);
        }
        if (incoming.get(1)) {
          struct.error = new csr_error();
          struct.error.read(iprot);
          struct.setErrorIsSet(true);
        }
      }
    }

  }

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


    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new getRecommendCSRList_argsStandardSchemeFactory());
      schemes.put(TupleScheme.class, new getRecommendCSRList_argsTupleSchemeFactory());
    }


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

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

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

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

      /**
       * 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, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getRecommendCSRList_args.class, metaDataMap);
    }

    public getRecommendCSRList_args() {
    }

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

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

    @Override
    public void clear() {
    }

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

    public Object getFieldValue(_Fields field) {
      switch (field) {
      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      }
      throw new IllegalStateException();
    }

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

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

      return true;
    }

    @Override
    public int hashCode() {
      List<Object> list = new ArrayList<Object>();

      return list.hashCode();
    }

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

      int lastComparison = 0;

      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
    }

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

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

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class getRecommendCSRList_argsStandardSchemeFactory implements SchemeFactory {
      public getRecommendCSRList_argsStandardScheme getScheme() {
        return new getRecommendCSRList_argsStandardScheme();
      }
    }

    private static class getRecommendCSRList_argsStandardScheme extends StandardScheme<getRecommendCSRList_args> {

      public void read(org.apache.thrift.protocol.TProtocol iprot, getRecommendCSRList_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, getRecommendCSRList_args struct) throws org.apache.thrift.TException {
        struct.validate();

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

    }

    private static class getRecommendCSRList_argsTupleSchemeFactory implements SchemeFactory {
      public getRecommendCSRList_argsTupleScheme getScheme() {
        return new getRecommendCSRList_argsTupleScheme();
      }
    }

    private static class getRecommendCSRList_argsTupleScheme extends TupleScheme<getRecommendCSRList_args> {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, getRecommendCSRList_args struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, getRecommendCSRList_args struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
      }
    }

  }

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

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0);

    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new getRecommendCSRList_resultStandardSchemeFactory());
      schemes.put(TupleScheme.class, new getRecommendCSRList_resultTupleSchemeFactory());
    }

    public List<CSRInfo> success; // required

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

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

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

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          default:
            return null;
        }
      }

      /**
       * 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, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.LIST          , "CSRInfoList")));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getRecommendCSRList_result.class, metaDataMap);
    }

    public getRecommendCSRList_result() {
    }

    public getRecommendCSRList_result(
      List<CSRInfo> success)
    {
      this();
      this.success = success;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getRecommendCSRList_result(getRecommendCSRList_result other) {
      if (other.isSetSuccess()) {
        this.success = other.success;
      }
    }

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

    @Override
    public void clear() {
      this.success = null;
    }

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

    public java.util.Iterator<CSRInfo> getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(CSRInfo elem) {
      if (this.success == null) {
        this.success = new ArrayList<CSRInfo>();
      }
      this.success.add(elem);
    }

    public List<CSRInfo> getSuccess() {
      return this.success;
    }

    public getRecommendCSRList_result setSuccess(List<CSRInfo> success) {
      this.success = success;
      return this;
    }

    public void unsetSuccess() {
      this.success = null;
    }

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

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

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

      }
    }

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

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      }
      throw new IllegalStateException();
    }

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

    public boolean equals(getRecommendCSRList_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;
      }

      return true;
    }

    @Override
    public int hashCode() {
      List<Object> list = new ArrayList<Object>();

      boolean present_success = true && (isSetSuccess());
      list.add(present_success);
      if (present_success)
        list.add(success);

      return list.hashCode();
    }

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

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
      }

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

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

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class getRecommendCSRList_resultStandardSchemeFactory implements SchemeFactory {
      public getRecommendCSRList_resultStandardScheme getScheme() {
        return new getRecommendCSRList_resultStandardScheme();
      }
    }

    private static class getRecommendCSRList_resultStandardScheme extends StandardScheme<getRecommendCSRList_result> {

      public void read(org.apache.thrift.protocol.TProtocol iprot, getRecommendCSRList_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 0: // SUCCESS
              if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
                {
                  org.apache.thrift.protocol.TList _list32 = iprot.readListBegin();
                  struct.success = new ArrayList<CSRInfo>(_list32.size);
                  CSRInfo _elem33;
                  for (int _i34 = 0; _i34 < _list32.size; ++_i34)
                  {
                    _elem33 = new CSRInfo();
                    _elem33.read(iprot);
                    struct.success.add(_elem33);
                  }
                  iprot.readListEnd();
                }
                struct.setSuccessIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, getRecommendCSRList_result struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.success != null) {
          oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
          {
            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size()));
            for (CSRInfo _iter35 : struct.success)
            {
              _iter35.write(oprot);
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class getRecommendCSRList_resultTupleSchemeFactory implements SchemeFactory {
      public getRecommendCSRList_resultTupleScheme getScheme() {
        return new getRecommendCSRList_resultTupleScheme();
      }
    }

    private static class getRecommendCSRList_resultTupleScheme extends TupleScheme<getRecommendCSRList_result> {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, getRecommendCSRList_result struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetSuccess()) {
          optionals.set(0);
        }
        oprot.writeBitSet(optionals, 1);
        if (struct.isSetSuccess()) {
          {
            oprot.writeI32(struct.success.size());
            for (CSRInfo _iter36 : struct.success)
            {
              _iter36.write(oprot);
            }
          }
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, getRecommendCSRList_result struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          {
            org.apache.thrift.protocol.TList _list37 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
            struct.success = new ArrayList<CSRInfo>(_list37.size);
            CSRInfo _elem38;
            for (int _i39 = 0; _i39 < _list37.size; ++_i39)
            {
              _elem38 = new CSRInfo();
              _elem38.read(iprot);
              struct.success.add(_elem38);
            }
          }
          struct.setSuccessIsSet(true);
        }
      }
    }

  }

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

    private static final org.apache.thrift.protocol.TField SENDER_FIELD_DESC = new org.apache.thrift.protocol.TField("sender", org.apache.thrift.protocol.TType.STRING, (short)1);
    private static final org.apache.thrift.protocol.TField MESSAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("message", org.apache.thrift.protocol.TType.STRING, (short)2);
    private static final org.apache.thrift.protocol.TField MSG_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("msgType", org.apache.thrift.protocol.TType.I32, (short)3);
    private static final org.apache.thrift.protocol.TField SEND_TO_CSP_FIELD_DESC = new org.apache.thrift.protocol.TField("sendToCSP", org.apache.thrift.protocol.TType.BOOL, (short)4);

    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new sendMsgToCSROrCSP_argsStandardSchemeFactory());
      schemes.put(TupleScheme.class, new sendMsgToCSROrCSP_argsTupleSchemeFactory());
    }

    public String sender; // required
    public String message; // required
    public int msgType; // required
    public boolean sendToCSP; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SENDER((short)1, "sender"),
      MESSAGE((short)2, "message"),
      MSG_TYPE((short)3, "msgType"),
      SEND_TO_CSP((short)4, "sendToCSP");

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

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

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // SENDER
            return SENDER;
          case 2: // MESSAGE
            return MESSAGE;
          case 3: // MSG_TYPE
            return MSG_TYPE;
          case 4: // SEND_TO_CSP
            return SEND_TO_CSP;
          default:
            return null;
        }
      }

      /**
       * 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 __MSGTYPE_ISSET_ID = 0;
    private static final int __SENDTOCSP_ISSET_ID = 1;
    private byte __isset_bitfield = 0;
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SENDER, new org.apache.thrift.meta_data.FieldMetaData("sender", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
      tmpMap.put(_Fields.MESSAGE, new org.apache.thrift.meta_data.FieldMetaData("message", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
      tmpMap.put(_Fields.MSG_TYPE, new org.apache.thrift.meta_data.FieldMetaData("msgType", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
      tmpMap.put(_Fields.SEND_TO_CSP, new org.apache.thrift.meta_data.FieldMetaData("sendToCSP", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(sendMsgToCSROrCSP_args.class, metaDataMap);
    }

    public sendMsgToCSROrCSP_args() {
    }

    public sendMsgToCSROrCSP_args(
      String sender,
      String message,
      int msgType,
      boolean sendToCSP)
    {
      this();
      this.sender = sender;
      this.message = message;
      this.msgType = msgType;
      setMsgTypeIsSet(true);
      this.sendToCSP = sendToCSP;
      setSendToCSPIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public sendMsgToCSROrCSP_args(sendMsgToCSROrCSP_args other) {
      __isset_bitfield = other.__isset_bitfield;
      if (other.isSetSender()) {
        this.sender = other.sender;
      }
      if (other.isSetMessage()) {
        this.message = other.message;
      }
      this.msgType = other.msgType;
      this.sendToCSP = other.sendToCSP;
    }

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

    @Override
    public void clear() {
      this.sender = null;
      this.message = null;
      setMsgTypeIsSet(false);
      this.msgType = 0;
      setSendToCSPIsSet(false);
      this.sendToCSP = false;
    }

    public String getSender() {
      return this.sender;
    }

    public sendMsgToCSROrCSP_args setSender(String sender) {
      this.sender = sender;
      return this;
    }

    public void unsetSender() {
      this.sender = null;
    }

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

    public void setSenderIsSet(boolean value) {
      if (!value) {
        this.sender = null;
      }
    }

    public String getMessage() {
      return this.message;
    }

    public sendMsgToCSROrCSP_args setMessage(String message) {
      this.message = message;
      return this;
    }

    public void unsetMessage() {
      this.message = null;
    }

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

    public void setMessageIsSet(boolean value) {
      if (!value) {
        this.message = null;
      }
    }

    public int getMsgType() {
      return this.msgType;
    }

    public sendMsgToCSROrCSP_args setMsgType(int msgType) {
      this.msgType = msgType;
      setMsgTypeIsSet(true);
      return this;
    }

    public void unsetMsgType() {
      __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __MSGTYPE_ISSET_ID);
    }

    /** Returns true if field msgType is set (has been assigned a value) and false otherwise */
    public boolean isSetMsgType() {
      return EncodingUtils.testBit(__isset_bitfield, __MSGTYPE_ISSET_ID);
    }

    public void setMsgTypeIsSet(boolean value) {
      __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __MSGTYPE_ISSET_ID, value);
    }

    public boolean isSendToCSP() {
      return this.sendToCSP;
    }

    public sendMsgToCSROrCSP_args setSendToCSP(boolean sendToCSP) {
      this.sendToCSP = sendToCSP;
      setSendToCSPIsSet(true);
      return this;
    }

    public void unsetSendToCSP() {
      __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SENDTOCSP_ISSET_ID);
    }

    /** Returns true if field sendToCSP is set (has been assigned a value) and false otherwise */
    public boolean isSetSendToCSP() {
      return EncodingUtils.testBit(__isset_bitfield, __SENDTOCSP_ISSET_ID);
    }

    public void setSendToCSPIsSet(boolean value) {
      __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SENDTOCSP_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SENDER:
        if (value == null) {
          unsetSender();
        } else {
          setSender((String)value);
        }
        break;

      case MESSAGE:
        if (value == null) {
          unsetMessage();
        } else {
          setMessage((String)value);
        }
        break;

      case MSG_TYPE:
        if (value == null) {
          unsetMsgType();
        } else {
          setMsgType((Integer)value);
        }
        break;

      case SEND_TO_CSP:
        if (value == null) {
          unsetSendToCSP();
        } else {
          setSendToCSP((Boolean)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SENDER:
        return getSender();

      case MESSAGE:
        return getMessage();

      case MSG_TYPE:
        return Integer.valueOf(getMsgType());

      case SEND_TO_CSP:
        return Boolean.valueOf(isSendToCSP());

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SENDER:
        return isSetSender();
      case MESSAGE:
        return isSetMessage();
      case MSG_TYPE:
        return isSetMsgType();
      case SEND_TO_CSP:
        return isSetSendToCSP();
      }
      throw new IllegalStateException();
    }

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

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

      boolean this_present_sender = true && this.isSetSender();
      boolean that_present_sender = true && that.isSetSender();
      if (this_present_sender || that_present_sender) {
        if (!(this_present_sender && that_present_sender))
          return false;
        if (!this.sender.equals(that.sender))
          return false;
      }

      boolean this_present_message = true && this.isSetMessage();
      boolean that_present_message = true && that.isSetMessage();
      if (this_present_message || that_present_message) {
        if (!(this_present_message && that_present_message))
          return false;
        if (!this.message.equals(that.message))
          return false;
      }

      boolean this_present_msgType = true;
      boolean that_present_msgType = true;
      if (this_present_msgType || that_present_msgType) {
        if (!(this_present_msgType && that_present_msgType))
          return false;
        if (this.msgType != that.msgType)
          return false;
      }

      boolean this_present_sendToCSP = true;
      boolean that_present_sendToCSP = true;
      if (this_present_sendToCSP || that_present_sendToCSP) {
        if (!(this_present_sendToCSP && that_present_sendToCSP))
          return false;
        if (this.sendToCSP != that.sendToCSP)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      List<Object> list = new ArrayList<Object>();

      boolean present_sender = true && (isSetSender());
      list.add(present_sender);
      if (present_sender)
        list.add(sender);

      boolean present_message = true && (isSetMessage());
      list.add(present_message);
      if (present_message)
        list.add(message);

      boolean present_msgType = true;
      list.add(present_msgType);
      if (present_msgType)
        list.add(msgType);

      boolean present_sendToCSP = true;
      list.add(present_sendToCSP);
      if (present_sendToCSP)
        list.add(sendToCSP);

      return list.hashCode();
    }

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

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetSender()).compareTo(other.isSetSender());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSender()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sender, other.sender);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetMessage()).compareTo(other.isSetMessage());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetMessage()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.message, other.message);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetMsgType()).compareTo(other.isSetMsgType());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetMsgType()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.msgType, other.msgType);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetSendToCSP()).compareTo(other.isSetSendToCSP());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSendToCSP()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sendToCSP, other.sendToCSP);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
    }

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

      sb.append("sender:");
      if (this.sender == null) {
        sb.append("null");
      } else {
        sb.append(this.sender);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("message:");
      if (this.message == null) {
        sb.append("null");
      } else {
        sb.append(this.message);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("msgType:");
      sb.append(this.msgType);
      first = false;
      if (!first) sb.append(", ");
      sb.append("sendToCSP:");
      sb.append(this.sendToCSP);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bitfield = 0;
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class sendMsgToCSROrCSP_argsStandardSchemeFactory implements SchemeFactory {
      public sendMsgToCSROrCSP_argsStandardScheme getScheme() {
        return new sendMsgToCSROrCSP_argsStandardScheme();
      }
    }

    private static class sendMsgToCSROrCSP_argsStandardScheme extends StandardScheme<sendMsgToCSROrCSP_args> {

      public void read(org.apache.thrift.protocol.TProtocol iprot, sendMsgToCSROrCSP_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 1: // SENDER
              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
                struct.sender = iprot.readString();
                struct.setSenderIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // MESSAGE
              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
                struct.message = iprot.readString();
                struct.setMessageIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 3: // MSG_TYPE
              if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
                struct.msgType = iprot.readI32();
                struct.setMsgTypeIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 4: // SEND_TO_CSP
              if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
                struct.sendToCSP = iprot.readBool();
                struct.setSendToCSPIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, sendMsgToCSROrCSP_args struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.sender != null) {
          oprot.writeFieldBegin(SENDER_FIELD_DESC);
          oprot.writeString(struct.sender);
          oprot.writeFieldEnd();
        }
        if (struct.message != null) {
          oprot.writeFieldBegin(MESSAGE_FIELD_DESC);
          oprot.writeString(struct.message);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldBegin(MSG_TYPE_FIELD_DESC);
        oprot.writeI32(struct.msgType);
        oprot.writeFieldEnd();
        oprot.writeFieldBegin(SEND_TO_CSP_FIELD_DESC);
        oprot.writeBool(struct.sendToCSP);
        oprot.writeFieldEnd();
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class sendMsgToCSROrCSP_argsTupleSchemeFactory implements SchemeFactory {
      public sendMsgToCSROrCSP_argsTupleScheme getScheme() {
        return new sendMsgToCSROrCSP_argsTupleScheme();
      }
    }

    private static class sendMsgToCSROrCSP_argsTupleScheme extends TupleScheme<sendMsgToCSROrCSP_args> {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, sendMsgToCSROrCSP_args struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetSender()) {
          optionals.set(0);
        }
        if (struct.isSetMessage()) {
          optionals.set(1);
        }
        if (struct.isSetMsgType()) {
          optionals.set(2);
        }
        if (struct.isSetSendToCSP()) {
          optionals.set(3);
        }
        oprot.writeBitSet(optionals, 4);
        if (struct.isSetSender()) {
          oprot.writeString(struct.sender);
        }
        if (struct.isSetMessage()) {
          oprot.writeString(struct.message);
        }
        if (struct.isSetMsgType()) {
          oprot.writeI32(struct.msgType);
        }
        if (struct.isSetSendToCSP()) {
          oprot.writeBool(struct.sendToCSP);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, sendMsgToCSROrCSP_args struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(4);
        if (incoming.get(0)) {
          struct.sender = iprot.readString();
          struct.setSenderIsSet(true);
        }
        if (incoming.get(1)) {
          struct.message = iprot.readString();
          struct.setMessageIsSet(true);
        }
        if (incoming.get(2)) {
          struct.msgType = iprot.readI32();
          struct.setMsgTypeIsSet(true);
        }
        if (incoming.get(3)) {
          struct.sendToCSP = iprot.readBool();
          struct.setSendToCSPIsSet(true);
        }
      }
    }

  }

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

    private static final org.apache.thrift.protocol.TField ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("error", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new sendMsgToCSROrCSP_resultStandardSchemeFactory());
      schemes.put(TupleScheme.class, new sendMsgToCSROrCSP_resultTupleSchemeFactory());
    }

    public CRMMsgError error; // required

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

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

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

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // ERROR
            return ERROR;
          default:
            return null;
        }
      }

      /**
       * 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, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.ERROR, new org.apache.thrift.meta_data.FieldMetaData("error", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(sendMsgToCSROrCSP_result.class, metaDataMap);
    }

    public sendMsgToCSROrCSP_result() {
    }

    public sendMsgToCSROrCSP_result(
      CRMMsgError error)
    {
      this();
      this.error = error;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public sendMsgToCSROrCSP_result(sendMsgToCSROrCSP_result other) {
      if (other.isSetError()) {
        this.error = new CRMMsgError(other.error);
      }
    }

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

    @Override
    public void clear() {
      this.error = null;
    }

    public CRMMsgError getError() {
      return this.error;
    }

    public sendMsgToCSROrCSP_result setError(CRMMsgError error) {
      this.error = error;
      return this;
    }

    public void unsetError() {
      this.error = null;
    }

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

    public void setErrorIsSet(boolean value) {
      if (!value) {
        this.error = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case ERROR:
        if (value == null) {
          unsetError();
        } else {
          setError((CRMMsgError)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case ERROR:
        return getError();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case ERROR:
        return isSetError();
      }
      throw new IllegalStateException();
    }

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

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

      boolean this_present_error = true && this.isSetError();
      boolean that_present_error = true && that.isSetError();
      if (this_present_error || that_present_error) {
        if (!(this_present_error && that_present_error))
          return false;
        if (!this.error.equals(that.error))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      List<Object> list = new ArrayList<Object>();

      boolean present_error = true && (isSetError());
      list.add(present_error);
      if (present_error)
        list.add(error);

      return list.hashCode();
    }

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

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetError()).compareTo(other.isSetError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.error, other.error);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
      }

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

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

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class sendMsgToCSROrCSP_resultStandardSchemeFactory implements SchemeFactory {
      public sendMsgToCSROrCSP_resultStandardScheme getScheme() {
        return new sendMsgToCSROrCSP_resultStandardScheme();
      }
    }

    private static class sendMsgToCSROrCSP_resultStandardScheme extends StandardScheme<sendMsgToCSROrCSP_result> {

      public void read(org.apache.thrift.protocol.TProtocol iprot, sendMsgToCSROrCSP_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 1: // ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.error = new CRMMsgError();
                struct.error.read(iprot);
                struct.setErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, sendMsgToCSROrCSP_result struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.error != null) {
          oprot.writeFieldBegin(ERROR_FIELD_DESC);
          struct.error.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class sendMsgToCSROrCSP_resultTupleSchemeFactory implements SchemeFactory {
      public sendMsgToCSROrCSP_resultTupleScheme getScheme() {
        return new sendMsgToCSROrCSP_resultTupleScheme();
      }
    }

    private static class sendMsgToCSROrCSP_resultTupleScheme extends TupleScheme<sendMsgToCSROrCSP_result> {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, sendMsgToCSROrCSP_result struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetError()) {
          optionals.set(0);
        }
        oprot.writeBitSet(optionals, 1);
        if (struct.isSetError()) {
          struct.error.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, sendMsgToCSROrCSP_result struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          struct.error = new CRMMsgError();
          struct.error.read(iprot);
          struct.setErrorIsSet(true);
        }
      }
    }

  }

}
