/**
 * 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 ICSRChatMessage {

  public interface Iface {

    public void sendContent(String content, String csrId) throws org.apache.thrift.TException;

    public List<Message> getChatHistory(String customerId, int lastUpdateTime) throws org.apache.thrift.TException;

    public List<Message> getUnreadMessagesHistory(String csrId, int lastUpdateTime) throws org.apache.thrift.TException;

  }

  public interface AsyncIface {

    public void sendContent(String content, String csrId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;

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

    public void getUnreadMessagesHistory(String csrId, int lastUpdateTime, 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 void sendContent(String content, String csrId) throws org.apache.thrift.TException
    {
      send_sendContent(content, csrId);
      recv_sendContent();
    }

    public void send_sendContent(String content, String csrId) throws org.apache.thrift.TException
    {
      sendContent_args args = new sendContent_args();
      args.setContent(content);
      args.setCsrId(csrId);
      sendBase("sendContent", args);
    }

    public void recv_sendContent() throws org.apache.thrift.TException
    {
      sendContent_result result = new sendContent_result();
      receiveBase(result, "sendContent");
      return;
    }

    public List<Message> getChatHistory(String customerId, int lastUpdateTime) throws org.apache.thrift.TException
    {
      send_getChatHistory(customerId, lastUpdateTime);
      return recv_getChatHistory();
    }

    public void send_getChatHistory(String customerId, int lastUpdateTime) throws org.apache.thrift.TException
    {
      getChatHistory_args args = new getChatHistory_args();
      args.setCustomerId(customerId);
      args.setLastUpdateTime(lastUpdateTime);
      sendBase("getChatHistory", args);
    }

    public List<Message> recv_getChatHistory() throws org.apache.thrift.TException
    {
      getChatHistory_result result = new getChatHistory_result();
      receiveBase(result, "getChatHistory");
      if (result.isSetSuccess()) {
        return result.success;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getChatHistory failed: unknown result");
    }

    public List<Message> getUnreadMessagesHistory(String csrId, int lastUpdateTime) throws org.apache.thrift.TException
    {
      send_getUnreadMessagesHistory(csrId, lastUpdateTime);
      return recv_getUnreadMessagesHistory();
    }

    public void send_getUnreadMessagesHistory(String csrId, int lastUpdateTime) throws org.apache.thrift.TException
    {
      getUnreadMessagesHistory_args args = new getUnreadMessagesHistory_args();
      args.setCsrId(csrId);
      args.setLastUpdateTime(lastUpdateTime);
      sendBase("getUnreadMessagesHistory", args);
    }

    public List<Message> recv_getUnreadMessagesHistory() throws org.apache.thrift.TException
    {
      getUnreadMessagesHistory_result result = new getUnreadMessagesHistory_result();
      receiveBase(result, "getUnreadMessagesHistory");
      if (result.isSetSuccess()) {
        return result.success;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getUnreadMessagesHistory failed: unknown result");
    }

  }
  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 sendContent(String content, String csrId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
      checkReady();
      sendContent_call method_call = new sendContent_call(content, csrId, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class sendContent_call extends org.apache.thrift.async.TAsyncMethodCall {
      private String content;
      private String csrId;
      public sendContent_call(String content, String 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.content = content;
        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("sendContent", org.apache.thrift.protocol.TMessageType.CALL, 0));
        sendContent_args args = new sendContent_args();
        args.setContent(content);
        args.setCsrId(csrId);
        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_sendContent();
      }
    }

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

    public static class getChatHistory_call extends org.apache.thrift.async.TAsyncMethodCall {
      private String customerId;
      private int lastUpdateTime;
      public getChatHistory_call(String customerId, int lastUpdateTime, 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;
        this.lastUpdateTime = lastUpdateTime;
      }

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

      public List<Message> 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_getChatHistory();
      }
    }

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

    public static class getUnreadMessagesHistory_call extends org.apache.thrift.async.TAsyncMethodCall {
      private String csrId;
      private int lastUpdateTime;
      public getUnreadMessagesHistory_call(String csrId, int lastUpdateTime, 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.lastUpdateTime = lastUpdateTime;
      }

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

      public List<Message> 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_getUnreadMessagesHistory();
      }
    }

  }

  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("sendContent", new sendContent());
      processMap.put("getChatHistory", new getChatHistory());
      processMap.put("getUnreadMessagesHistory", new getUnreadMessagesHistory());
      return processMap;
    }

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

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

      protected boolean isOneway() {
        return false;
      }

      public sendContent_result getResult(I iface, sendContent_args args) throws org.apache.thrift.TException {
        sendContent_result result = new sendContent_result();
        iface.sendContent(args.content, args.csrId);
        return result;
      }
    }

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

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

      protected boolean isOneway() {
        return false;
      }

      public getChatHistory_result getResult(I iface, getChatHistory_args args) throws org.apache.thrift.TException {
        getChatHistory_result result = new getChatHistory_result();
        result.success = iface.getChatHistory(args.customerId, args.lastUpdateTime);
        return result;
      }
    }

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

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

      protected boolean isOneway() {
        return false;
      }

      public getUnreadMessagesHistory_result getResult(I iface, getUnreadMessagesHistory_args args) throws org.apache.thrift.TException {
        getUnreadMessagesHistory_result result = new getUnreadMessagesHistory_result();
        result.success = iface.getUnreadMessagesHistory(args.csrId, args.lastUpdateTime);
        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("sendContent", new sendContent());
      processMap.put("getChatHistory", new getChatHistory());
      processMap.put("getUnreadMessagesHistory", new getUnreadMessagesHistory());
      return processMap;
    }

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

      public sendContent_args getEmptyArgsInstance() {
        return new sendContent_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) {
            sendContent_result result = new sendContent_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;
            sendContent_result result = new sendContent_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, sendContent_args args, org.apache.thrift.async.AsyncMethodCallback<Void> resultHandler) throws TException {
        iface.sendContent(args.content, args.csrId,resultHandler);
      }
    }

    public static class getChatHistory<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getChatHistory_args, List<Message>> {
      public getChatHistory() {
        super("getChatHistory");
      }

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

      public AsyncMethodCallback<List<Message>> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
        final org.apache.thrift.AsyncProcessFunction fcall = this;
        return new AsyncMethodCallback<List<Message>>() { 
          public void onComplete(List<Message> o) {
            getChatHistory_result result = new getChatHistory_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;
            getChatHistory_result result = new getChatHistory_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, getChatHistory_args args, org.apache.thrift.async.AsyncMethodCallback<List<Message>> resultHandler) throws TException {
        iface.getChatHistory(args.customerId, args.lastUpdateTime,resultHandler);
      }
    }

    public static class getUnreadMessagesHistory<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getUnreadMessagesHistory_args, List<Message>> {
      public getUnreadMessagesHistory() {
        super("getUnreadMessagesHistory");
      }

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

      public AsyncMethodCallback<List<Message>> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
        final org.apache.thrift.AsyncProcessFunction fcall = this;
        return new AsyncMethodCallback<List<Message>>() { 
          public void onComplete(List<Message> o) {
            getUnreadMessagesHistory_result result = new getUnreadMessagesHistory_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;
            getUnreadMessagesHistory_result result = new getUnreadMessagesHistory_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, getUnreadMessagesHistory_args args, org.apache.thrift.async.AsyncMethodCallback<List<Message>> resultHandler) throws TException {
        iface.getUnreadMessagesHistory(args.csrId, args.lastUpdateTime,resultHandler);
      }
    }

  }

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

    private static final org.apache.thrift.protocol.TField CONTENT_FIELD_DESC = new org.apache.thrift.protocol.TField("content", 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.STRING, (short)2);

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

    public String content; // required
    public String 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 {
      CONTENT((short)1, "content"),
      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: // CONTENT
            return CONTENT;
          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
    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.CONTENT, new org.apache.thrift.meta_data.FieldMetaData("content", 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.STRING)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(sendContent_args.class, metaDataMap);
    }

    public sendContent_args() {
    }

    public sendContent_args(
      String content,
      String csrId)
    {
      this();
      this.content = content;
      this.csrId = csrId;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public sendContent_args(sendContent_args other) {
      if (other.isSetContent()) {
        this.content = other.content;
      }
      if (other.isSetCsrId()) {
        this.csrId = other.csrId;
      }
    }

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

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

    public String getContent() {
      return this.content;
    }

    public sendContent_args setContent(String content) {
      this.content = content;
      return this;
    }

    public void unsetContent() {
      this.content = null;
    }

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

    public void setContentIsSet(boolean value) {
      if (!value) {
        this.content = null;
      }
    }

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

    public sendContent_args setCsrId(String csrId) {
      this.csrId = csrId;
      return this;
    }

    public void unsetCsrId() {
      this.csrId = null;
    }

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

    public void setCsrIdIsSet(boolean value) {
      if (!value) {
        this.csrId = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case CONTENT:
        if (value == null) {
          unsetContent();
        } else {
          setContent((String)value);
        }
        break;

      case CSR_ID:
        if (value == null) {
          unsetCsrId();
        } else {
          setCsrId((String)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case CONTENT:
        return getContent();

      case CSR_ID:
        return 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 CONTENT:
        return isSetContent();
      case CSR_ID:
        return isSetCsrId();
      }
      throw new IllegalStateException();
    }

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

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

      boolean this_present_content = true && this.isSetContent();
      boolean that_present_content = true && that.isSetContent();
      if (this_present_content || that_present_content) {
        if (!(this_present_content && that_present_content))
          return false;
        if (!this.content.equals(that.content))
          return false;
      }

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

      return true;
    }

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

      boolean present_content = true && (isSetContent());
      list.add(present_content);
      if (present_content)
        list.add(content);

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

      return list.hashCode();
    }

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

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetContent()).compareTo(other.isSetContent());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetContent()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.content, other.content);
        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("sendContent_args(");
      boolean first = true;

      sb.append("content:");
      if (this.content == null) {
        sb.append("null");
      } else {
        sb.append(this.content);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("csrId:");
      if (this.csrId == null) {
        sb.append("null");
      } else {
        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 {
        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 sendContent_argsStandardSchemeFactory implements SchemeFactory {
      public sendContent_argsStandardScheme getScheme() {
        return new sendContent_argsStandardScheme();
      }
    }

    private static class sendContent_argsStandardScheme extends StandardScheme<sendContent_args> {

      public void read(org.apache.thrift.protocol.TProtocol iprot, sendContent_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: // CONTENT
              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
                struct.content = iprot.readString();
                struct.setContentIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // CSR_ID
              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
                struct.csrId = iprot.readString();
                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, sendContent_args struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.content != null) {
          oprot.writeFieldBegin(CONTENT_FIELD_DESC);
          oprot.writeString(struct.content);
          oprot.writeFieldEnd();
        }
        if (struct.csrId != null) {
          oprot.writeFieldBegin(CSR_ID_FIELD_DESC);
          oprot.writeString(struct.csrId);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class sendContent_argsTupleSchemeFactory implements SchemeFactory {
      public sendContent_argsTupleScheme getScheme() {
        return new sendContent_argsTupleScheme();
      }
    }

    private static class sendContent_argsTupleScheme extends TupleScheme<sendContent_args> {

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

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

  }

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


    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new sendContent_resultStandardSchemeFactory());
      schemes.put(TupleScheme.class, new sendContent_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(sendContent_result.class, metaDataMap);
    }

    public sendContent_result() {
    }

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

    public sendContent_result deepCopy() {
      return new sendContent_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 sendContent_result)
        return this.equals((sendContent_result)that);
      return false;
    }

    public boolean equals(sendContent_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(sendContent_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("sendContent_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 sendContent_resultStandardSchemeFactory implements SchemeFactory {
      public sendContent_resultStandardScheme getScheme() {
        return new sendContent_resultStandardScheme();
      }
    }

    private static class sendContent_resultStandardScheme extends StandardScheme<sendContent_result> {

      public void read(org.apache.thrift.protocol.TProtocol iprot, sendContent_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, sendContent_result struct) throws org.apache.thrift.TException {
        struct.validate();

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

    }

    private static class sendContent_resultTupleSchemeFactory implements SchemeFactory {
      public sendContent_resultTupleScheme getScheme() {
        return new sendContent_resultTupleScheme();
      }
    }

    private static class sendContent_resultTupleScheme extends TupleScheme<sendContent_result> {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, sendContent_result struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, sendContent_result struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
      }
    }

  }

  public static class getChatHistory_args implements org.apache.thrift.TBase<getChatHistory_args, getChatHistory_args._Fields>, java.io.Serializable, Cloneable, Comparable<getChatHistory_args>   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getChatHistory_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.STRING, (short)1);
    private static final org.apache.thrift.protocol.TField LAST_UPDATE_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("lastUpdateTime", 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 getChatHistory_argsStandardSchemeFactory());
      schemes.put(TupleScheme.class, new getChatHistory_argsTupleSchemeFactory());
    }

    public String customerId; // required
    public int lastUpdateTime; // 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"),
      LAST_UPDATE_TIME((short)2, "lastUpdateTime");

      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;
          case 2: // LAST_UPDATE_TIME
            return LAST_UPDATE_TIME;
          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 __LASTUPDATETIME_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.STRING)));
      tmpMap.put(_Fields.LAST_UPDATE_TIME, new org.apache.thrift.meta_data.FieldMetaData("lastUpdateTime", 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(getChatHistory_args.class, metaDataMap);
    }

    public getChatHistory_args() {
    }

    public getChatHistory_args(
      String customerId,
      int lastUpdateTime)
    {
      this();
      this.customerId = customerId;
      this.lastUpdateTime = lastUpdateTime;
      setLastUpdateTimeIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getChatHistory_args(getChatHistory_args other) {
      __isset_bitfield = other.__isset_bitfield;
      if (other.isSetCustomerId()) {
        this.customerId = other.customerId;
      }
      this.lastUpdateTime = other.lastUpdateTime;
    }

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

    @Override
    public void clear() {
      this.customerId = null;
      setLastUpdateTimeIsSet(false);
      this.lastUpdateTime = 0;
    }

    public String getCustomerId() {
      return this.customerId;
    }

    public getChatHistory_args setCustomerId(String customerId) {
      this.customerId = customerId;
      return this;
    }

    public void unsetCustomerId() {
      this.customerId = null;
    }

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

    public void setCustomerIdIsSet(boolean value) {
      if (!value) {
        this.customerId = null;
      }
    }

    public int getLastUpdateTime() {
      return this.lastUpdateTime;
    }

    public getChatHistory_args setLastUpdateTime(int lastUpdateTime) {
      this.lastUpdateTime = lastUpdateTime;
      setLastUpdateTimeIsSet(true);
      return this;
    }

    public void unsetLastUpdateTime() {
      __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __LASTUPDATETIME_ISSET_ID);
    }

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

    public void setLastUpdateTimeIsSet(boolean value) {
      __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __LASTUPDATETIME_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case CUSTOMER_ID:
        if (value == null) {
          unsetCustomerId();
        } else {
          setCustomerId((String)value);
        }
        break;

      case LAST_UPDATE_TIME:
        if (value == null) {
          unsetLastUpdateTime();
        } else {
          setLastUpdateTime((Integer)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case CUSTOMER_ID:
        return getCustomerId();

      case LAST_UPDATE_TIME:
        return Integer.valueOf(getLastUpdateTime());

      }
      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();
      case LAST_UPDATE_TIME:
        return isSetLastUpdateTime();
      }
      throw new IllegalStateException();
    }

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

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

      boolean this_present_customerId = true && this.isSetCustomerId();
      boolean that_present_customerId = true && that.isSetCustomerId();
      if (this_present_customerId || that_present_customerId) {
        if (!(this_present_customerId && that_present_customerId))
          return false;
        if (!this.customerId.equals(that.customerId))
          return false;
      }

      boolean this_present_lastUpdateTime = true;
      boolean that_present_lastUpdateTime = true;
      if (this_present_lastUpdateTime || that_present_lastUpdateTime) {
        if (!(this_present_lastUpdateTime && that_present_lastUpdateTime))
          return false;
        if (this.lastUpdateTime != that.lastUpdateTime)
          return false;
      }

      return true;
    }

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

      boolean present_customerId = true && (isSetCustomerId());
      list.add(present_customerId);
      if (present_customerId)
        list.add(customerId);

      boolean present_lastUpdateTime = true;
      list.add(present_lastUpdateTime);
      if (present_lastUpdateTime)
        list.add(lastUpdateTime);

      return list.hashCode();
    }

    @Override
    public int compareTo(getChatHistory_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;
        }
      }
      lastComparison = Boolean.valueOf(isSetLastUpdateTime()).compareTo(other.isSetLastUpdateTime());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetLastUpdateTime()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.lastUpdateTime, other.lastUpdateTime);
        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("getChatHistory_args(");
      boolean first = true;

      sb.append("customerId:");
      if (this.customerId == null) {
        sb.append("null");
      } else {
        sb.append(this.customerId);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("lastUpdateTime:");
      sb.append(this.lastUpdateTime);
      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 getChatHistory_argsStandardSchemeFactory implements SchemeFactory {
      public getChatHistory_argsStandardScheme getScheme() {
        return new getChatHistory_argsStandardScheme();
      }
    }

    private static class getChatHistory_argsStandardScheme extends StandardScheme<getChatHistory_args> {

      public void read(org.apache.thrift.protocol.TProtocol iprot, getChatHistory_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.STRING) {
                struct.customerId = iprot.readString();
                struct.setCustomerIdIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // LAST_UPDATE_TIME
              if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
                struct.lastUpdateTime = iprot.readI32();
                struct.setLastUpdateTimeIsSet(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, getChatHistory_args struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.customerId != null) {
          oprot.writeFieldBegin(CUSTOMER_ID_FIELD_DESC);
          oprot.writeString(struct.customerId);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldBegin(LAST_UPDATE_TIME_FIELD_DESC);
        oprot.writeI32(struct.lastUpdateTime);
        oprot.writeFieldEnd();
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class getChatHistory_argsTupleSchemeFactory implements SchemeFactory {
      public getChatHistory_argsTupleScheme getScheme() {
        return new getChatHistory_argsTupleScheme();
      }
    }

    private static class getChatHistory_argsTupleScheme extends TupleScheme<getChatHistory_args> {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, getChatHistory_args struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetCustomerId()) {
          optionals.set(0);
        }
        if (struct.isSetLastUpdateTime()) {
          optionals.set(1);
        }
        oprot.writeBitSet(optionals, 2);
        if (struct.isSetCustomerId()) {
          oprot.writeString(struct.customerId);
        }
        if (struct.isSetLastUpdateTime()) {
          oprot.writeI32(struct.lastUpdateTime);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, getChatHistory_args struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(2);
        if (incoming.get(0)) {
          struct.customerId = iprot.readString();
          struct.setCustomerIdIsSet(true);
        }
        if (incoming.get(1)) {
          struct.lastUpdateTime = iprot.readI32();
          struct.setLastUpdateTimeIsSet(true);
        }
      }
    }

  }

  public static class getChatHistory_result implements org.apache.thrift.TBase<getChatHistory_result, getChatHistory_result._Fields>, java.io.Serializable, Cloneable, Comparable<getChatHistory_result>   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getChatHistory_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 getChatHistory_resultStandardSchemeFactory());
      schemes.put(TupleScheme.class, new getChatHistory_resultTupleSchemeFactory());
    }

    public List<Message> 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          , "MessageList")));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getChatHistory_result.class, metaDataMap);
    }

    public getChatHistory_result() {
    }

    public getChatHistory_result(
      List<Message> success)
    {
      this();
      this.success = success;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getChatHistory_result(getChatHistory_result other) {
      if (other.isSetSuccess()) {
        this.success = other.success;
      }
    }

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

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

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

    public java.util.Iterator<Message> getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(Message elem) {
      if (this.success == null) {
        this.success = new ArrayList<Message>();
      }
      this.success.add(elem);
    }

    public List<Message> getSuccess() {
      return this.success;
    }

    public getChatHistory_result setSuccess(List<Message> 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<Message>)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 getChatHistory_result)
        return this.equals((getChatHistory_result)that);
      return false;
    }

    public boolean equals(getChatHistory_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(getChatHistory_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("getChatHistory_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 getChatHistory_resultStandardSchemeFactory implements SchemeFactory {
      public getChatHistory_resultStandardScheme getScheme() {
        return new getChatHistory_resultStandardScheme();
      }
    }

    private static class getChatHistory_resultStandardScheme extends StandardScheme<getChatHistory_result> {

      public void read(org.apache.thrift.protocol.TProtocol iprot, getChatHistory_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 _list40 = iprot.readListBegin();
                  struct.success = new ArrayList<Message>(_list40.size);
                  Message _elem41;
                  for (int _i42 = 0; _i42 < _list40.size; ++_i42)
                  {
                    _elem41 = new Message();
                    _elem41.read(iprot);
                    struct.success.add(_elem41);
                  }
                  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, getChatHistory_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 (Message _iter43 : struct.success)
            {
              _iter43.write(oprot);
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class getChatHistory_resultTupleSchemeFactory implements SchemeFactory {
      public getChatHistory_resultTupleScheme getScheme() {
        return new getChatHistory_resultTupleScheme();
      }
    }

    private static class getChatHistory_resultTupleScheme extends TupleScheme<getChatHistory_result> {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, getChatHistory_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 (Message _iter44 : struct.success)
            {
              _iter44.write(oprot);
            }
          }
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, getChatHistory_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 _list45 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
            struct.success = new ArrayList<Message>(_list45.size);
            Message _elem46;
            for (int _i47 = 0; _i47 < _list45.size; ++_i47)
            {
              _elem46 = new Message();
              _elem46.read(iprot);
              struct.success.add(_elem46);
            }
          }
          struct.setSuccessIsSet(true);
        }
      }
    }

  }

  public static class getUnreadMessagesHistory_args implements org.apache.thrift.TBase<getUnreadMessagesHistory_args, getUnreadMessagesHistory_args._Fields>, java.io.Serializable, Cloneable, Comparable<getUnreadMessagesHistory_args>   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getUnreadMessagesHistory_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.STRING, (short)1);
    private static final org.apache.thrift.protocol.TField LAST_UPDATE_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("lastUpdateTime", 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 getUnreadMessagesHistory_argsStandardSchemeFactory());
      schemes.put(TupleScheme.class, new getUnreadMessagesHistory_argsTupleSchemeFactory());
    }

    public String csrId; // required
    public int lastUpdateTime; // 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"),
      LAST_UPDATE_TIME((short)2, "lastUpdateTime");

      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: // LAST_UPDATE_TIME
            return LAST_UPDATE_TIME;
          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 __LASTUPDATETIME_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.STRING)));
      tmpMap.put(_Fields.LAST_UPDATE_TIME, new org.apache.thrift.meta_data.FieldMetaData("lastUpdateTime", 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(getUnreadMessagesHistory_args.class, metaDataMap);
    }

    public getUnreadMessagesHistory_args() {
    }

    public getUnreadMessagesHistory_args(
      String csrId,
      int lastUpdateTime)
    {
      this();
      this.csrId = csrId;
      this.lastUpdateTime = lastUpdateTime;
      setLastUpdateTimeIsSet(true);
    }

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

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

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

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

    public getUnreadMessagesHistory_args setCsrId(String csrId) {
      this.csrId = csrId;
      return this;
    }

    public void unsetCsrId() {
      this.csrId = null;
    }

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

    public void setCsrIdIsSet(boolean value) {
      if (!value) {
        this.csrId = null;
      }
    }

    public int getLastUpdateTime() {
      return this.lastUpdateTime;
    }

    public getUnreadMessagesHistory_args setLastUpdateTime(int lastUpdateTime) {
      this.lastUpdateTime = lastUpdateTime;
      setLastUpdateTimeIsSet(true);
      return this;
    }

    public void unsetLastUpdateTime() {
      __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __LASTUPDATETIME_ISSET_ID);
    }

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

    public void setLastUpdateTimeIsSet(boolean value) {
      __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __LASTUPDATETIME_ISSET_ID, value);
    }

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

      case LAST_UPDATE_TIME:
        if (value == null) {
          unsetLastUpdateTime();
        } else {
          setLastUpdateTime((Integer)value);
        }
        break;

      }
    }

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

      case LAST_UPDATE_TIME:
        return Integer.valueOf(getLastUpdateTime());

      }
      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 LAST_UPDATE_TIME:
        return isSetLastUpdateTime();
      }
      throw new IllegalStateException();
    }

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

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

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

      boolean this_present_lastUpdateTime = true;
      boolean that_present_lastUpdateTime = true;
      if (this_present_lastUpdateTime || that_present_lastUpdateTime) {
        if (!(this_present_lastUpdateTime && that_present_lastUpdateTime))
          return false;
        if (this.lastUpdateTime != that.lastUpdateTime)
          return false;
      }

      return true;
    }

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

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

      boolean present_lastUpdateTime = true;
      list.add(present_lastUpdateTime);
      if (present_lastUpdateTime)
        list.add(lastUpdateTime);

      return list.hashCode();
    }

    @Override
    public int compareTo(getUnreadMessagesHistory_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(isSetLastUpdateTime()).compareTo(other.isSetLastUpdateTime());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetLastUpdateTime()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.lastUpdateTime, other.lastUpdateTime);
        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("getUnreadMessagesHistory_args(");
      boolean first = true;

      sb.append("csrId:");
      if (this.csrId == null) {
        sb.append("null");
      } else {
        sb.append(this.csrId);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("lastUpdateTime:");
      sb.append(this.lastUpdateTime);
      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 getUnreadMessagesHistory_argsStandardSchemeFactory implements SchemeFactory {
      public getUnreadMessagesHistory_argsStandardScheme getScheme() {
        return new getUnreadMessagesHistory_argsStandardScheme();
      }
    }

    private static class getUnreadMessagesHistory_argsStandardScheme extends StandardScheme<getUnreadMessagesHistory_args> {

      public void read(org.apache.thrift.protocol.TProtocol iprot, getUnreadMessagesHistory_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.STRING) {
                struct.csrId = iprot.readString();
                struct.setCsrIdIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // LAST_UPDATE_TIME
              if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
                struct.lastUpdateTime = iprot.readI32();
                struct.setLastUpdateTimeIsSet(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, getUnreadMessagesHistory_args struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.csrId != null) {
          oprot.writeFieldBegin(CSR_ID_FIELD_DESC);
          oprot.writeString(struct.csrId);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldBegin(LAST_UPDATE_TIME_FIELD_DESC);
        oprot.writeI32(struct.lastUpdateTime);
        oprot.writeFieldEnd();
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class getUnreadMessagesHistory_argsTupleSchemeFactory implements SchemeFactory {
      public getUnreadMessagesHistory_argsTupleScheme getScheme() {
        return new getUnreadMessagesHistory_argsTupleScheme();
      }
    }

    private static class getUnreadMessagesHistory_argsTupleScheme extends TupleScheme<getUnreadMessagesHistory_args> {

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

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

  }

  public static class getUnreadMessagesHistory_result implements org.apache.thrift.TBase<getUnreadMessagesHistory_result, getUnreadMessagesHistory_result._Fields>, java.io.Serializable, Cloneable, Comparable<getUnreadMessagesHistory_result>   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getUnreadMessagesHistory_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 getUnreadMessagesHistory_resultStandardSchemeFactory());
      schemes.put(TupleScheme.class, new getUnreadMessagesHistory_resultTupleSchemeFactory());
    }

    public List<Message> 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          , "MessageList")));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getUnreadMessagesHistory_result.class, metaDataMap);
    }

    public getUnreadMessagesHistory_result() {
    }

    public getUnreadMessagesHistory_result(
      List<Message> success)
    {
      this();
      this.success = success;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getUnreadMessagesHistory_result(getUnreadMessagesHistory_result other) {
      if (other.isSetSuccess()) {
        this.success = other.success;
      }
    }

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

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

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

    public java.util.Iterator<Message> getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(Message elem) {
      if (this.success == null) {
        this.success = new ArrayList<Message>();
      }
      this.success.add(elem);
    }

    public List<Message> getSuccess() {
      return this.success;
    }

    public getUnreadMessagesHistory_result setSuccess(List<Message> 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<Message>)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 getUnreadMessagesHistory_result)
        return this.equals((getUnreadMessagesHistory_result)that);
      return false;
    }

    public boolean equals(getUnreadMessagesHistory_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(getUnreadMessagesHistory_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("getUnreadMessagesHistory_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 getUnreadMessagesHistory_resultStandardSchemeFactory implements SchemeFactory {
      public getUnreadMessagesHistory_resultStandardScheme getScheme() {
        return new getUnreadMessagesHistory_resultStandardScheme();
      }
    }

    private static class getUnreadMessagesHistory_resultStandardScheme extends StandardScheme<getUnreadMessagesHistory_result> {

      public void read(org.apache.thrift.protocol.TProtocol iprot, getUnreadMessagesHistory_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 _list48 = iprot.readListBegin();
                  struct.success = new ArrayList<Message>(_list48.size);
                  Message _elem49;
                  for (int _i50 = 0; _i50 < _list48.size; ++_i50)
                  {
                    _elem49 = new Message();
                    _elem49.read(iprot);
                    struct.success.add(_elem49);
                  }
                  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, getUnreadMessagesHistory_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 (Message _iter51 : struct.success)
            {
              _iter51.write(oprot);
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class getUnreadMessagesHistory_resultTupleSchemeFactory implements SchemeFactory {
      public getUnreadMessagesHistory_resultTupleScheme getScheme() {
        return new getUnreadMessagesHistory_resultTupleScheme();
      }
    }

    private static class getUnreadMessagesHistory_resultTupleScheme extends TupleScheme<getUnreadMessagesHistory_result> {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, getUnreadMessagesHistory_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 (Message _iter52 : struct.success)
            {
              _iter52.write(oprot);
            }
          }
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, getUnreadMessagesHistory_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 _list53 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
            struct.success = new ArrayList<Message>(_list53.size);
            Message _elem54;
            for (int _i55 = 0; _i55 < _list53.size; ++_i55)
            {
              _elem54 = new Message();
              _elem54.read(iprot);
              struct.success.add(_elem54);
            }
          }
          struct.setSuccessIsSet(true);
        }
      }
    }

  }

}
