Subversion Repositories SmartDukaan

Rev

Blame | Last modification | View Log | RSS feed

/**
 * Autogenerated by Thrift Compiler (0.7.0)
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 */
package in.shop2020.utils;

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 org.slf4j.Logger;
import org.slf4j.LoggerFactory;

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

  private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.I64, (short)1);
  private static final org.apache.thrift.protocol.TField USER_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("user_id", org.apache.thrift.protocol.TType.I64, (short)2);
  private static final org.apache.thrift.protocol.TField MOBILE_NUMBER_FIELD_DESC = new org.apache.thrift.protocol.TField("mobileNumber", org.apache.thrift.protocol.TType.STRING, (short)3);
  private static final org.apache.thrift.protocol.TField SMS_TEXT_FIELD_DESC = new org.apache.thrift.protocol.TField("smsText", org.apache.thrift.protocol.TType.STRING, (short)4);
  private static final org.apache.thrift.protocol.TField TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("type", org.apache.thrift.protocol.TType.I32, (short)5);
  private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status", org.apache.thrift.protocol.TType.I32, (short)6);
  private static final org.apache.thrift.protocol.TField ATTEMPTS_FIELD_DESC = new org.apache.thrift.protocol.TField("attempts", org.apache.thrift.protocol.TType.I64, (short)7);
  private static final org.apache.thrift.protocol.TField CREATED_TIMESTAMP_FIELD_DESC = new org.apache.thrift.protocol.TField("createdTimestamp", org.apache.thrift.protocol.TType.I64, (short)8);
  private static final org.apache.thrift.protocol.TField RESPONSE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("responseId", org.apache.thrift.protocol.TType.STRING, (short)9);
  private static final org.apache.thrift.protocol.TField RESPONSE_TEXT_FIELD_DESC = new org.apache.thrift.protocol.TField("responseText", org.apache.thrift.protocol.TType.STRING, (short)10);
  private static final org.apache.thrift.protocol.TField DELIVERY_STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("deliveryStatus", org.apache.thrift.protocol.TType.I32, (short)11);

  private long id; // required
  private long user_id; // required
  private String mobileNumber; // required
  private String smsText; // required
  private SmsType type; // required
  private SmsStatus status; // required
  private long attempts; // required
  private long createdTimestamp; // required
  private String responseId; // required
  private String responseText; // required
  private SmsDeliveryStatus deliveryStatus; // 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 {
    ID((short)1, "id"),
    USER_ID((short)2, "user_id"),
    MOBILE_NUMBER((short)3, "mobileNumber"),
    SMS_TEXT((short)4, "smsText"),
    /**
     * 
     * @see SmsType
     */
    TYPE((short)5, "type"),
    /**
     * 
     * @see SmsStatus
     */
    STATUS((short)6, "status"),
    ATTEMPTS((short)7, "attempts"),
    CREATED_TIMESTAMP((short)8, "createdTimestamp"),
    RESPONSE_ID((short)9, "responseId"),
    RESPONSE_TEXT((short)10, "responseText"),
    /**
     * 
     * @see SmsDeliveryStatus
     */
    DELIVERY_STATUS((short)11, "deliveryStatus");

    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: // ID
          return ID;
        case 2: // USER_ID
          return USER_ID;
        case 3: // MOBILE_NUMBER
          return MOBILE_NUMBER;
        case 4: // SMS_TEXT
          return SMS_TEXT;
        case 5: // TYPE
          return TYPE;
        case 6: // STATUS
          return STATUS;
        case 7: // ATTEMPTS
          return ATTEMPTS;
        case 8: // CREATED_TIMESTAMP
          return CREATED_TIMESTAMP;
        case 9: // RESPONSE_ID
          return RESPONSE_ID;
        case 10: // RESPONSE_TEXT
          return RESPONSE_TEXT;
        case 11: // DELIVERY_STATUS
          return DELIVERY_STATUS;
        default:
          return null;
      }
    }

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

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

    private final short _thriftId;
    private final String _fieldName;

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

    public short getThriftFieldId() {
      return _thriftId;
    }

    public String getFieldName() {
      return _fieldName;
    }
  }

  // isset id assignments
  private static final int __ID_ISSET_ID = 0;
  private static final int __USER_ID_ISSET_ID = 1;
  private static final int __ATTEMPTS_ISSET_ID = 2;
  private static final int __CREATEDTIMESTAMP_ISSET_ID = 3;
  private BitSet __isset_bit_vector = new BitSet(4);

  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.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.USER_ID, new org.apache.thrift.meta_data.FieldMetaData("user_id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.MOBILE_NUMBER, new org.apache.thrift.meta_data.FieldMetaData("mobileNumber", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.SMS_TEXT, new org.apache.thrift.meta_data.FieldMetaData("smsText", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.TYPE, new org.apache.thrift.meta_data.FieldMetaData("type", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, SmsType.class)));
    tmpMap.put(_Fields.STATUS, new org.apache.thrift.meta_data.FieldMetaData("status", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, SmsStatus.class)));
    tmpMap.put(_Fields.ATTEMPTS, new org.apache.thrift.meta_data.FieldMetaData("attempts", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.CREATED_TIMESTAMP, new org.apache.thrift.meta_data.FieldMetaData("createdTimestamp", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.RESPONSE_ID, new org.apache.thrift.meta_data.FieldMetaData("responseId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.RESPONSE_TEXT, new org.apache.thrift.meta_data.FieldMetaData("responseText", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.DELIVERY_STATUS, new org.apache.thrift.meta_data.FieldMetaData("deliveryStatus", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, SmsDeliveryStatus.class)));
    metaDataMap = Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(UserSms.class, metaDataMap);
  }

  public UserSms() {
  }

  public UserSms(
    long id,
    long user_id,
    String mobileNumber,
    String smsText,
    SmsType type,
    SmsStatus status,
    long attempts,
    long createdTimestamp,
    String responseId,
    String responseText,
    SmsDeliveryStatus deliveryStatus)
  {
    this();
    this.id = id;
    setIdIsSet(true);
    this.user_id = user_id;
    setUser_idIsSet(true);
    this.mobileNumber = mobileNumber;
    this.smsText = smsText;
    this.type = type;
    this.status = status;
    this.attempts = attempts;
    setAttemptsIsSet(true);
    this.createdTimestamp = createdTimestamp;
    setCreatedTimestampIsSet(true);
    this.responseId = responseId;
    this.responseText = responseText;
    this.deliveryStatus = deliveryStatus;
  }

  /**
   * Performs a deep copy on <i>other</i>.
   */
  public UserSms(UserSms other) {
    __isset_bit_vector.clear();
    __isset_bit_vector.or(other.__isset_bit_vector);
    this.id = other.id;
    this.user_id = other.user_id;
    if (other.isSetMobileNumber()) {
      this.mobileNumber = other.mobileNumber;
    }
    if (other.isSetSmsText()) {
      this.smsText = other.smsText;
    }
    if (other.isSetType()) {
      this.type = other.type;
    }
    if (other.isSetStatus()) {
      this.status = other.status;
    }
    this.attempts = other.attempts;
    this.createdTimestamp = other.createdTimestamp;
    if (other.isSetResponseId()) {
      this.responseId = other.responseId;
    }
    if (other.isSetResponseText()) {
      this.responseText = other.responseText;
    }
    if (other.isSetDeliveryStatus()) {
      this.deliveryStatus = other.deliveryStatus;
    }
  }

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

  @Override
  public void clear() {
    setIdIsSet(false);
    this.id = 0;
    setUser_idIsSet(false);
    this.user_id = 0;
    this.mobileNumber = null;
    this.smsText = null;
    this.type = null;
    this.status = null;
    setAttemptsIsSet(false);
    this.attempts = 0;
    setCreatedTimestampIsSet(false);
    this.createdTimestamp = 0;
    this.responseId = null;
    this.responseText = null;
    this.deliveryStatus = null;
  }

  public long getId() {
    return this.id;
  }

  public void setId(long id) {
    this.id = id;
    setIdIsSet(true);
  }

  public void unsetId() {
    __isset_bit_vector.clear(__ID_ISSET_ID);
  }

  /** Returns true if field id is set (has been assigned a value) and false otherwise */
  public boolean isSetId() {
    return __isset_bit_vector.get(__ID_ISSET_ID);
  }

  public void setIdIsSet(boolean value) {
    __isset_bit_vector.set(__ID_ISSET_ID, value);
  }

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

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

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

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

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

  public String getMobileNumber() {
    return this.mobileNumber;
  }

  public void setMobileNumber(String mobileNumber) {
    this.mobileNumber = mobileNumber;
  }

  public void unsetMobileNumber() {
    this.mobileNumber = null;
  }

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

  public void setMobileNumberIsSet(boolean value) {
    if (!value) {
      this.mobileNumber = null;
    }
  }

  public String getSmsText() {
    return this.smsText;
  }

  public void setSmsText(String smsText) {
    this.smsText = smsText;
  }

  public void unsetSmsText() {
    this.smsText = null;
  }

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

  public void setSmsTextIsSet(boolean value) {
    if (!value) {
      this.smsText = null;
    }
  }

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

  /**
   * 
   * @see SmsType
   */
  public void setType(SmsType type) {
    this.type = type;
  }

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

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

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

  /**
   * 
   * @see SmsStatus
   */
  public SmsStatus getStatus() {
    return this.status;
  }

  /**
   * 
   * @see SmsStatus
   */
  public void setStatus(SmsStatus status) {
    this.status = status;
  }

  public void unsetStatus() {
    this.status = null;
  }

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

  public void setStatusIsSet(boolean value) {
    if (!value) {
      this.status = null;
    }
  }

  public long getAttempts() {
    return this.attempts;
  }

  public void setAttempts(long attempts) {
    this.attempts = attempts;
    setAttemptsIsSet(true);
  }

  public void unsetAttempts() {
    __isset_bit_vector.clear(__ATTEMPTS_ISSET_ID);
  }

  /** Returns true if field attempts is set (has been assigned a value) and false otherwise */
  public boolean isSetAttempts() {
    return __isset_bit_vector.get(__ATTEMPTS_ISSET_ID);
  }

  public void setAttemptsIsSet(boolean value) {
    __isset_bit_vector.set(__ATTEMPTS_ISSET_ID, value);
  }

  public long getCreatedTimestamp() {
    return this.createdTimestamp;
  }

  public void setCreatedTimestamp(long createdTimestamp) {
    this.createdTimestamp = createdTimestamp;
    setCreatedTimestampIsSet(true);
  }

  public void unsetCreatedTimestamp() {
    __isset_bit_vector.clear(__CREATEDTIMESTAMP_ISSET_ID);
  }

  /** Returns true if field createdTimestamp is set (has been assigned a value) and false otherwise */
  public boolean isSetCreatedTimestamp() {
    return __isset_bit_vector.get(__CREATEDTIMESTAMP_ISSET_ID);
  }

  public void setCreatedTimestampIsSet(boolean value) {
    __isset_bit_vector.set(__CREATEDTIMESTAMP_ISSET_ID, value);
  }

  public String getResponseId() {
    return this.responseId;
  }

  public void setResponseId(String responseId) {
    this.responseId = responseId;
  }

  public void unsetResponseId() {
    this.responseId = null;
  }

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

  public void setResponseIdIsSet(boolean value) {
    if (!value) {
      this.responseId = null;
    }
  }

  public String getResponseText() {
    return this.responseText;
  }

  public void setResponseText(String responseText) {
    this.responseText = responseText;
  }

  public void unsetResponseText() {
    this.responseText = null;
  }

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

  public void setResponseTextIsSet(boolean value) {
    if (!value) {
      this.responseText = null;
    }
  }

  /**
   * 
   * @see SmsDeliveryStatus
   */
  public SmsDeliveryStatus getDeliveryStatus() {
    return this.deliveryStatus;
  }

  /**
   * 
   * @see SmsDeliveryStatus
   */
  public void setDeliveryStatus(SmsDeliveryStatus deliveryStatus) {
    this.deliveryStatus = deliveryStatus;
  }

  public void unsetDeliveryStatus() {
    this.deliveryStatus = null;
  }

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

  public void setDeliveryStatusIsSet(boolean value) {
    if (!value) {
      this.deliveryStatus = null;
    }
  }

  public void setFieldValue(_Fields field, Object value) {
    switch (field) {
    case ID:
      if (value == null) {
        unsetId();
      } else {
        setId((Long)value);
      }
      break;

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

    case MOBILE_NUMBER:
      if (value == null) {
        unsetMobileNumber();
      } else {
        setMobileNumber((String)value);
      }
      break;

    case SMS_TEXT:
      if (value == null) {
        unsetSmsText();
      } else {
        setSmsText((String)value);
      }
      break;

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

    case STATUS:
      if (value == null) {
        unsetStatus();
      } else {
        setStatus((SmsStatus)value);
      }
      break;

    case ATTEMPTS:
      if (value == null) {
        unsetAttempts();
      } else {
        setAttempts((Long)value);
      }
      break;

    case CREATED_TIMESTAMP:
      if (value == null) {
        unsetCreatedTimestamp();
      } else {
        setCreatedTimestamp((Long)value);
      }
      break;

    case RESPONSE_ID:
      if (value == null) {
        unsetResponseId();
      } else {
        setResponseId((String)value);
      }
      break;

    case RESPONSE_TEXT:
      if (value == null) {
        unsetResponseText();
      } else {
        setResponseText((String)value);
      }
      break;

    case DELIVERY_STATUS:
      if (value == null) {
        unsetDeliveryStatus();
      } else {
        setDeliveryStatus((SmsDeliveryStatus)value);
      }
      break;

    }
  }

  public Object getFieldValue(_Fields field) {
    switch (field) {
    case ID:
      return Long.valueOf(getId());

    case USER_ID:
      return Long.valueOf(getUser_id());

    case MOBILE_NUMBER:
      return getMobileNumber();

    case SMS_TEXT:
      return getSmsText();

    case TYPE:
      return getType();

    case STATUS:
      return getStatus();

    case ATTEMPTS:
      return Long.valueOf(getAttempts());

    case CREATED_TIMESTAMP:
      return Long.valueOf(getCreatedTimestamp());

    case RESPONSE_ID:
      return getResponseId();

    case RESPONSE_TEXT:
      return getResponseText();

    case DELIVERY_STATUS:
      return getDeliveryStatus();

    }
    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 ID:
      return isSetId();
    case USER_ID:
      return isSetUser_id();
    case MOBILE_NUMBER:
      return isSetMobileNumber();
    case SMS_TEXT:
      return isSetSmsText();
    case TYPE:
      return isSetType();
    case STATUS:
      return isSetStatus();
    case ATTEMPTS:
      return isSetAttempts();
    case CREATED_TIMESTAMP:
      return isSetCreatedTimestamp();
    case RESPONSE_ID:
      return isSetResponseId();
    case RESPONSE_TEXT:
      return isSetResponseText();
    case DELIVERY_STATUS:
      return isSetDeliveryStatus();
    }
    throw new IllegalStateException();
  }

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

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

    boolean this_present_id = true;
    boolean that_present_id = true;
    if (this_present_id || that_present_id) {
      if (!(this_present_id && that_present_id))
        return false;
      if (this.id != that.id)
        return false;
    }

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

    boolean this_present_mobileNumber = true && this.isSetMobileNumber();
    boolean that_present_mobileNumber = true && that.isSetMobileNumber();
    if (this_present_mobileNumber || that_present_mobileNumber) {
      if (!(this_present_mobileNumber && that_present_mobileNumber))
        return false;
      if (!this.mobileNumber.equals(that.mobileNumber))
        return false;
    }

    boolean this_present_smsText = true && this.isSetSmsText();
    boolean that_present_smsText = true && that.isSetSmsText();
    if (this_present_smsText || that_present_smsText) {
      if (!(this_present_smsText && that_present_smsText))
        return false;
      if (!this.smsText.equals(that.smsText))
        return false;
    }

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

    boolean this_present_status = true && this.isSetStatus();
    boolean that_present_status = true && that.isSetStatus();
    if (this_present_status || that_present_status) {
      if (!(this_present_status && that_present_status))
        return false;
      if (!this.status.equals(that.status))
        return false;
    }

    boolean this_present_attempts = true;
    boolean that_present_attempts = true;
    if (this_present_attempts || that_present_attempts) {
      if (!(this_present_attempts && that_present_attempts))
        return false;
      if (this.attempts != that.attempts)
        return false;
    }

    boolean this_present_createdTimestamp = true;
    boolean that_present_createdTimestamp = true;
    if (this_present_createdTimestamp || that_present_createdTimestamp) {
      if (!(this_present_createdTimestamp && that_present_createdTimestamp))
        return false;
      if (this.createdTimestamp != that.createdTimestamp)
        return false;
    }

    boolean this_present_responseId = true && this.isSetResponseId();
    boolean that_present_responseId = true && that.isSetResponseId();
    if (this_present_responseId || that_present_responseId) {
      if (!(this_present_responseId && that_present_responseId))
        return false;
      if (!this.responseId.equals(that.responseId))
        return false;
    }

    boolean this_present_responseText = true && this.isSetResponseText();
    boolean that_present_responseText = true && that.isSetResponseText();
    if (this_present_responseText || that_present_responseText) {
      if (!(this_present_responseText && that_present_responseText))
        return false;
      if (!this.responseText.equals(that.responseText))
        return false;
    }

    boolean this_present_deliveryStatus = true && this.isSetDeliveryStatus();
    boolean that_present_deliveryStatus = true && that.isSetDeliveryStatus();
    if (this_present_deliveryStatus || that_present_deliveryStatus) {
      if (!(this_present_deliveryStatus && that_present_deliveryStatus))
        return false;
      if (!this.deliveryStatus.equals(that.deliveryStatus))
        return false;
    }

    return true;
  }

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

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

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

    lastComparison = Boolean.valueOf(isSetId()).compareTo(typedOther.isSetId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetId()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, typedOther.id);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetUser_id()).compareTo(typedOther.isSetUser_id());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetUser_id()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.user_id, typedOther.user_id);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetMobileNumber()).compareTo(typedOther.isSetMobileNumber());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMobileNumber()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.mobileNumber, typedOther.mobileNumber);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetSmsText()).compareTo(typedOther.isSetSmsText());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSmsText()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.smsText, typedOther.smsText);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetType()).compareTo(typedOther.isSetType());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetType()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.type, typedOther.type);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetStatus()).compareTo(typedOther.isSetStatus());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetStatus()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, typedOther.status);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetAttempts()).compareTo(typedOther.isSetAttempts());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetAttempts()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.attempts, typedOther.attempts);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetCreatedTimestamp()).compareTo(typedOther.isSetCreatedTimestamp());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetCreatedTimestamp()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.createdTimestamp, typedOther.createdTimestamp);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetResponseId()).compareTo(typedOther.isSetResponseId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetResponseId()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.responseId, typedOther.responseId);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetResponseText()).compareTo(typedOther.isSetResponseText());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetResponseText()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.responseText, typedOther.responseText);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetDeliveryStatus()).compareTo(typedOther.isSetDeliveryStatus());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetDeliveryStatus()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.deliveryStatus, typedOther.deliveryStatus);
      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 {
    org.apache.thrift.protocol.TField field;
    iprot.readStructBegin();
    while (true)
    {
      field = iprot.readFieldBegin();
      if (field.type == org.apache.thrift.protocol.TType.STOP) { 
        break;
      }
      switch (field.id) {
        case 1: // ID
          if (field.type == org.apache.thrift.protocol.TType.I64) {
            this.id = iprot.readI64();
            setIdIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 2: // USER_ID
          if (field.type == org.apache.thrift.protocol.TType.I64) {
            this.user_id = iprot.readI64();
            setUser_idIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 3: // MOBILE_NUMBER
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
            this.mobileNumber = iprot.readString();
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 4: // SMS_TEXT
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
            this.smsText = iprot.readString();
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 5: // TYPE
          if (field.type == org.apache.thrift.protocol.TType.I32) {
            this.type = SmsType.findByValue(iprot.readI32());
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 6: // STATUS
          if (field.type == org.apache.thrift.protocol.TType.I32) {
            this.status = SmsStatus.findByValue(iprot.readI32());
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 7: // ATTEMPTS
          if (field.type == org.apache.thrift.protocol.TType.I64) {
            this.attempts = iprot.readI64();
            setAttemptsIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 8: // CREATED_TIMESTAMP
          if (field.type == org.apache.thrift.protocol.TType.I64) {
            this.createdTimestamp = iprot.readI64();
            setCreatedTimestampIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 9: // RESPONSE_ID
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
            this.responseId = iprot.readString();
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 10: // RESPONSE_TEXT
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
            this.responseText = iprot.readString();
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 11: // DELIVERY_STATUS
          if (field.type == org.apache.thrift.protocol.TType.I32) {
            this.deliveryStatus = SmsDeliveryStatus.findByValue(iprot.readI32());
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        default:
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
      }
      iprot.readFieldEnd();
    }
    iprot.readStructEnd();
    validate();
  }

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

    oprot.writeStructBegin(STRUCT_DESC);
    oprot.writeFieldBegin(ID_FIELD_DESC);
    oprot.writeI64(this.id);
    oprot.writeFieldEnd();
    oprot.writeFieldBegin(USER_ID_FIELD_DESC);
    oprot.writeI64(this.user_id);
    oprot.writeFieldEnd();
    if (this.mobileNumber != null) {
      oprot.writeFieldBegin(MOBILE_NUMBER_FIELD_DESC);
      oprot.writeString(this.mobileNumber);
      oprot.writeFieldEnd();
    }
    if (this.smsText != null) {
      oprot.writeFieldBegin(SMS_TEXT_FIELD_DESC);
      oprot.writeString(this.smsText);
      oprot.writeFieldEnd();
    }
    if (this.type != null) {
      oprot.writeFieldBegin(TYPE_FIELD_DESC);
      oprot.writeI32(this.type.getValue());
      oprot.writeFieldEnd();
    }
    if (this.status != null) {
      oprot.writeFieldBegin(STATUS_FIELD_DESC);
      oprot.writeI32(this.status.getValue());
      oprot.writeFieldEnd();
    }
    oprot.writeFieldBegin(ATTEMPTS_FIELD_DESC);
    oprot.writeI64(this.attempts);
    oprot.writeFieldEnd();
    oprot.writeFieldBegin(CREATED_TIMESTAMP_FIELD_DESC);
    oprot.writeI64(this.createdTimestamp);
    oprot.writeFieldEnd();
    if (this.responseId != null) {
      oprot.writeFieldBegin(RESPONSE_ID_FIELD_DESC);
      oprot.writeString(this.responseId);
      oprot.writeFieldEnd();
    }
    if (this.responseText != null) {
      oprot.writeFieldBegin(RESPONSE_TEXT_FIELD_DESC);
      oprot.writeString(this.responseText);
      oprot.writeFieldEnd();
    }
    if (this.deliveryStatus != null) {
      oprot.writeFieldBegin(DELIVERY_STATUS_FIELD_DESC);
      oprot.writeI32(this.deliveryStatus.getValue());
      oprot.writeFieldEnd();
    }
    oprot.writeFieldStop();
    oprot.writeStructEnd();
  }

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

    sb.append("id:");
    sb.append(this.id);
    first = false;
    if (!first) sb.append(", ");
    sb.append("user_id:");
    sb.append(this.user_id);
    first = false;
    if (!first) sb.append(", ");
    sb.append("mobileNumber:");
    if (this.mobileNumber == null) {
      sb.append("null");
    } else {
      sb.append(this.mobileNumber);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("smsText:");
    if (this.smsText == null) {
      sb.append("null");
    } else {
      sb.append(this.smsText);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("type:");
    if (this.type == null) {
      sb.append("null");
    } else {
      sb.append(this.type);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("status:");
    if (this.status == null) {
      sb.append("null");
    } else {
      sb.append(this.status);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("attempts:");
    sb.append(this.attempts);
    first = false;
    if (!first) sb.append(", ");
    sb.append("createdTimestamp:");
    sb.append(this.createdTimestamp);
    first = false;
    if (!first) sb.append(", ");
    sb.append("responseId:");
    if (this.responseId == null) {
      sb.append("null");
    } else {
      sb.append(this.responseId);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("responseText:");
    if (this.responseText == null) {
      sb.append("null");
    } else {
      sb.append(this.responseText);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("deliveryStatus:");
    if (this.deliveryStatus == null) {
      sb.append("null");
    } else {
      sb.append(this.deliveryStatus);
    }
    first = false;
    sb.append(")");
    return sb.toString();
  }

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

  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_bit_vector = new BitSet(1);
      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);
    }
  }

}