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 UserSmsInfo implements org.apache.thrift.TBase<UserSmsInfo, UserSmsInfo._Fields>, java.io.Serializable, Cloneable {
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("UserSmsInfo");

  private static final org.apache.thrift.protocol.TField USER_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("userId", org.apache.thrift.protocol.TType.I64, (short)1);
  private static final org.apache.thrift.protocol.TField MOBILE_NO_FIELD_DESC = new org.apache.thrift.protocol.TField("mobileNo", org.apache.thrift.protocol.TType.STRING, (short)2);
  private static final org.apache.thrift.protocol.TField DAILY_COUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("dailyCount", org.apache.thrift.protocol.TType.I32, (short)3);
  private static final org.apache.thrift.protocol.TField WEEKLY_COUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("weeklyCount", org.apache.thrift.protocol.TType.I32, (short)4);
  private static final org.apache.thrift.protocol.TField DND_STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("dndStatus", org.apache.thrift.protocol.TType.BOOL, (short)5);
  private static final org.apache.thrift.protocol.TField SMS_SUBSCRIBED_FIELD_DESC = new org.apache.thrift.protocol.TField("smsSubscribed", org.apache.thrift.protocol.TType.BOOL, (short)6);
  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)7);
  private static final org.apache.thrift.protocol.TField UPDATE_TIMESTAMP_FIELD_DESC = new org.apache.thrift.protocol.TField("updateTimestamp", org.apache.thrift.protocol.TType.I64, (short)8);

  private long userId; // required
  private String mobileNo; // required
  private int dailyCount; // required
  private int weeklyCount; // required
  private boolean dndStatus; // required
  private boolean smsSubscribed; // required
  private long createdTimestamp; // required
  private long updateTimestamp; // 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 {
    USER_ID((short)1, "userId"),
    MOBILE_NO((short)2, "mobileNo"),
    DAILY_COUNT((short)3, "dailyCount"),
    WEEKLY_COUNT((short)4, "weeklyCount"),
    DND_STATUS((short)5, "dndStatus"),
    SMS_SUBSCRIBED((short)6, "smsSubscribed"),
    CREATED_TIMESTAMP((short)7, "createdTimestamp"),
    UPDATE_TIMESTAMP((short)8, "updateTimestamp");

    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: // USER_ID
          return USER_ID;
        case 2: // MOBILE_NO
          return MOBILE_NO;
        case 3: // DAILY_COUNT
          return DAILY_COUNT;
        case 4: // WEEKLY_COUNT
          return WEEKLY_COUNT;
        case 5: // DND_STATUS
          return DND_STATUS;
        case 6: // SMS_SUBSCRIBED
          return SMS_SUBSCRIBED;
        case 7: // CREATED_TIMESTAMP
          return CREATED_TIMESTAMP;
        case 8: // UPDATE_TIMESTAMP
          return UPDATE_TIMESTAMP;
        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 __USERID_ISSET_ID = 0;
  private static final int __DAILYCOUNT_ISSET_ID = 1;
  private static final int __WEEKLYCOUNT_ISSET_ID = 2;
  private static final int __DNDSTATUS_ISSET_ID = 3;
  private static final int __SMSSUBSCRIBED_ISSET_ID = 4;
  private static final int __CREATEDTIMESTAMP_ISSET_ID = 5;
  private static final int __UPDATETIMESTAMP_ISSET_ID = 6;
  private BitSet __isset_bit_vector = new BitSet(7);

  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.USER_ID, new org.apache.thrift.meta_data.FieldMetaData("userId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.MOBILE_NO, new org.apache.thrift.meta_data.FieldMetaData("mobileNo", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.DAILY_COUNT, new org.apache.thrift.meta_data.FieldMetaData("dailyCount", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
    tmpMap.put(_Fields.WEEKLY_COUNT, new org.apache.thrift.meta_data.FieldMetaData("weeklyCount", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
    tmpMap.put(_Fields.DND_STATUS, new org.apache.thrift.meta_data.FieldMetaData("dndStatus", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
    tmpMap.put(_Fields.SMS_SUBSCRIBED, new org.apache.thrift.meta_data.FieldMetaData("smsSubscribed", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
    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.UPDATE_TIMESTAMP, new org.apache.thrift.meta_data.FieldMetaData("updateTimestamp", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    metaDataMap = Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(UserSmsInfo.class, metaDataMap);
  }

  public UserSmsInfo() {
  }

  public UserSmsInfo(
    long userId,
    String mobileNo,
    int dailyCount,
    int weeklyCount,
    boolean dndStatus,
    boolean smsSubscribed,
    long createdTimestamp,
    long updateTimestamp)
  {
    this();
    this.userId = userId;
    setUserIdIsSet(true);
    this.mobileNo = mobileNo;
    this.dailyCount = dailyCount;
    setDailyCountIsSet(true);
    this.weeklyCount = weeklyCount;
    setWeeklyCountIsSet(true);
    this.dndStatus = dndStatus;
    setDndStatusIsSet(true);
    this.smsSubscribed = smsSubscribed;
    setSmsSubscribedIsSet(true);
    this.createdTimestamp = createdTimestamp;
    setCreatedTimestampIsSet(true);
    this.updateTimestamp = updateTimestamp;
    setUpdateTimestampIsSet(true);
  }

  /**
   * Performs a deep copy on <i>other</i>.
   */
  public UserSmsInfo(UserSmsInfo other) {
    __isset_bit_vector.clear();
    __isset_bit_vector.or(other.__isset_bit_vector);
    this.userId = other.userId;
    if (other.isSetMobileNo()) {
      this.mobileNo = other.mobileNo;
    }
    this.dailyCount = other.dailyCount;
    this.weeklyCount = other.weeklyCount;
    this.dndStatus = other.dndStatus;
    this.smsSubscribed = other.smsSubscribed;
    this.createdTimestamp = other.createdTimestamp;
    this.updateTimestamp = other.updateTimestamp;
  }

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

  @Override
  public void clear() {
    setUserIdIsSet(false);
    this.userId = 0;
    this.mobileNo = null;
    setDailyCountIsSet(false);
    this.dailyCount = 0;
    setWeeklyCountIsSet(false);
    this.weeklyCount = 0;
    setDndStatusIsSet(false);
    this.dndStatus = false;
    setSmsSubscribedIsSet(false);
    this.smsSubscribed = false;
    setCreatedTimestampIsSet(false);
    this.createdTimestamp = 0;
    setUpdateTimestampIsSet(false);
    this.updateTimestamp = 0;
  }

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

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

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

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

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

  public String getMobileNo() {
    return this.mobileNo;
  }

  public void setMobileNo(String mobileNo) {
    this.mobileNo = mobileNo;
  }

  public void unsetMobileNo() {
    this.mobileNo = null;
  }

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

  public void setMobileNoIsSet(boolean value) {
    if (!value) {
      this.mobileNo = null;
    }
  }

  public int getDailyCount() {
    return this.dailyCount;
  }

  public void setDailyCount(int dailyCount) {
    this.dailyCount = dailyCount;
    setDailyCountIsSet(true);
  }

  public void unsetDailyCount() {
    __isset_bit_vector.clear(__DAILYCOUNT_ISSET_ID);
  }

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

  public void setDailyCountIsSet(boolean value) {
    __isset_bit_vector.set(__DAILYCOUNT_ISSET_ID, value);
  }

  public int getWeeklyCount() {
    return this.weeklyCount;
  }

  public void setWeeklyCount(int weeklyCount) {
    this.weeklyCount = weeklyCount;
    setWeeklyCountIsSet(true);
  }

  public void unsetWeeklyCount() {
    __isset_bit_vector.clear(__WEEKLYCOUNT_ISSET_ID);
  }

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

  public void setWeeklyCountIsSet(boolean value) {
    __isset_bit_vector.set(__WEEKLYCOUNT_ISSET_ID, value);
  }

  public boolean isDndStatus() {
    return this.dndStatus;
  }

  public void setDndStatus(boolean dndStatus) {
    this.dndStatus = dndStatus;
    setDndStatusIsSet(true);
  }

  public void unsetDndStatus() {
    __isset_bit_vector.clear(__DNDSTATUS_ISSET_ID);
  }

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

  public void setDndStatusIsSet(boolean value) {
    __isset_bit_vector.set(__DNDSTATUS_ISSET_ID, value);
  }

  public boolean isSmsSubscribed() {
    return this.smsSubscribed;
  }

  public void setSmsSubscribed(boolean smsSubscribed) {
    this.smsSubscribed = smsSubscribed;
    setSmsSubscribedIsSet(true);
  }

  public void unsetSmsSubscribed() {
    __isset_bit_vector.clear(__SMSSUBSCRIBED_ISSET_ID);
  }

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

  public void setSmsSubscribedIsSet(boolean value) {
    __isset_bit_vector.set(__SMSSUBSCRIBED_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 long getUpdateTimestamp() {
    return this.updateTimestamp;
  }

  public void setUpdateTimestamp(long updateTimestamp) {
    this.updateTimestamp = updateTimestamp;
    setUpdateTimestampIsSet(true);
  }

  public void unsetUpdateTimestamp() {
    __isset_bit_vector.clear(__UPDATETIMESTAMP_ISSET_ID);
  }

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

  public void setUpdateTimestampIsSet(boolean value) {
    __isset_bit_vector.set(__UPDATETIMESTAMP_ISSET_ID, value);
  }

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

    case MOBILE_NO:
      if (value == null) {
        unsetMobileNo();
      } else {
        setMobileNo((String)value);
      }
      break;

    case DAILY_COUNT:
      if (value == null) {
        unsetDailyCount();
      } else {
        setDailyCount((Integer)value);
      }
      break;

    case WEEKLY_COUNT:
      if (value == null) {
        unsetWeeklyCount();
      } else {
        setWeeklyCount((Integer)value);
      }
      break;

    case DND_STATUS:
      if (value == null) {
        unsetDndStatus();
      } else {
        setDndStatus((Boolean)value);
      }
      break;

    case SMS_SUBSCRIBED:
      if (value == null) {
        unsetSmsSubscribed();
      } else {
        setSmsSubscribed((Boolean)value);
      }
      break;

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

    case UPDATE_TIMESTAMP:
      if (value == null) {
        unsetUpdateTimestamp();
      } else {
        setUpdateTimestamp((Long)value);
      }
      break;

    }
  }

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

    case MOBILE_NO:
      return getMobileNo();

    case DAILY_COUNT:
      return Integer.valueOf(getDailyCount());

    case WEEKLY_COUNT:
      return Integer.valueOf(getWeeklyCount());

    case DND_STATUS:
      return Boolean.valueOf(isDndStatus());

    case SMS_SUBSCRIBED:
      return Boolean.valueOf(isSmsSubscribed());

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

    case UPDATE_TIMESTAMP:
      return Long.valueOf(getUpdateTimestamp());

    }
    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 USER_ID:
      return isSetUserId();
    case MOBILE_NO:
      return isSetMobileNo();
    case DAILY_COUNT:
      return isSetDailyCount();
    case WEEKLY_COUNT:
      return isSetWeeklyCount();
    case DND_STATUS:
      return isSetDndStatus();
    case SMS_SUBSCRIBED:
      return isSetSmsSubscribed();
    case CREATED_TIMESTAMP:
      return isSetCreatedTimestamp();
    case UPDATE_TIMESTAMP:
      return isSetUpdateTimestamp();
    }
    throw new IllegalStateException();
  }

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

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

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

    boolean this_present_mobileNo = true && this.isSetMobileNo();
    boolean that_present_mobileNo = true && that.isSetMobileNo();
    if (this_present_mobileNo || that_present_mobileNo) {
      if (!(this_present_mobileNo && that_present_mobileNo))
        return false;
      if (!this.mobileNo.equals(that.mobileNo))
        return false;
    }

    boolean this_present_dailyCount = true;
    boolean that_present_dailyCount = true;
    if (this_present_dailyCount || that_present_dailyCount) {
      if (!(this_present_dailyCount && that_present_dailyCount))
        return false;
      if (this.dailyCount != that.dailyCount)
        return false;
    }

    boolean this_present_weeklyCount = true;
    boolean that_present_weeklyCount = true;
    if (this_present_weeklyCount || that_present_weeklyCount) {
      if (!(this_present_weeklyCount && that_present_weeklyCount))
        return false;
      if (this.weeklyCount != that.weeklyCount)
        return false;
    }

    boolean this_present_dndStatus = true;
    boolean that_present_dndStatus = true;
    if (this_present_dndStatus || that_present_dndStatus) {
      if (!(this_present_dndStatus && that_present_dndStatus))
        return false;
      if (this.dndStatus != that.dndStatus)
        return false;
    }

    boolean this_present_smsSubscribed = true;
    boolean that_present_smsSubscribed = true;
    if (this_present_smsSubscribed || that_present_smsSubscribed) {
      if (!(this_present_smsSubscribed && that_present_smsSubscribed))
        return false;
      if (this.smsSubscribed != that.smsSubscribed)
        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_updateTimestamp = true;
    boolean that_present_updateTimestamp = true;
    if (this_present_updateTimestamp || that_present_updateTimestamp) {
      if (!(this_present_updateTimestamp && that_present_updateTimestamp))
        return false;
      if (this.updateTimestamp != that.updateTimestamp)
        return false;
    }

    return true;
  }

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

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

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

    lastComparison = Boolean.valueOf(isSetUserId()).compareTo(typedOther.isSetUserId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetUserId()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userId, typedOther.userId);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetMobileNo()).compareTo(typedOther.isSetMobileNo());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMobileNo()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.mobileNo, typedOther.mobileNo);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetDailyCount()).compareTo(typedOther.isSetDailyCount());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetDailyCount()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.dailyCount, typedOther.dailyCount);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetWeeklyCount()).compareTo(typedOther.isSetWeeklyCount());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetWeeklyCount()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.weeklyCount, typedOther.weeklyCount);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetDndStatus()).compareTo(typedOther.isSetDndStatus());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetDndStatus()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.dndStatus, typedOther.dndStatus);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetSmsSubscribed()).compareTo(typedOther.isSetSmsSubscribed());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSmsSubscribed()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.smsSubscribed, typedOther.smsSubscribed);
      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(isSetUpdateTimestamp()).compareTo(typedOther.isSetUpdateTimestamp());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetUpdateTimestamp()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.updateTimestamp, typedOther.updateTimestamp);
      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: // USER_ID
          if (field.type == org.apache.thrift.protocol.TType.I64) {
            this.userId = iprot.readI64();
            setUserIdIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 2: // MOBILE_NO
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
            this.mobileNo = iprot.readString();
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 3: // DAILY_COUNT
          if (field.type == org.apache.thrift.protocol.TType.I32) {
            this.dailyCount = iprot.readI32();
            setDailyCountIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 4: // WEEKLY_COUNT
          if (field.type == org.apache.thrift.protocol.TType.I32) {
            this.weeklyCount = iprot.readI32();
            setWeeklyCountIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 5: // DND_STATUS
          if (field.type == org.apache.thrift.protocol.TType.BOOL) {
            this.dndStatus = iprot.readBool();
            setDndStatusIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 6: // SMS_SUBSCRIBED
          if (field.type == org.apache.thrift.protocol.TType.BOOL) {
            this.smsSubscribed = iprot.readBool();
            setSmsSubscribedIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 7: // 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 8: // UPDATE_TIMESTAMP
          if (field.type == org.apache.thrift.protocol.TType.I64) {
            this.updateTimestamp = iprot.readI64();
            setUpdateTimestampIsSet(true);
          } 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(USER_ID_FIELD_DESC);
    oprot.writeI64(this.userId);
    oprot.writeFieldEnd();
    if (this.mobileNo != null) {
      oprot.writeFieldBegin(MOBILE_NO_FIELD_DESC);
      oprot.writeString(this.mobileNo);
      oprot.writeFieldEnd();
    }
    oprot.writeFieldBegin(DAILY_COUNT_FIELD_DESC);
    oprot.writeI32(this.dailyCount);
    oprot.writeFieldEnd();
    oprot.writeFieldBegin(WEEKLY_COUNT_FIELD_DESC);
    oprot.writeI32(this.weeklyCount);
    oprot.writeFieldEnd();
    oprot.writeFieldBegin(DND_STATUS_FIELD_DESC);
    oprot.writeBool(this.dndStatus);
    oprot.writeFieldEnd();
    oprot.writeFieldBegin(SMS_SUBSCRIBED_FIELD_DESC);
    oprot.writeBool(this.smsSubscribed);
    oprot.writeFieldEnd();
    oprot.writeFieldBegin(CREATED_TIMESTAMP_FIELD_DESC);
    oprot.writeI64(this.createdTimestamp);
    oprot.writeFieldEnd();
    oprot.writeFieldBegin(UPDATE_TIMESTAMP_FIELD_DESC);
    oprot.writeI64(this.updateTimestamp);
    oprot.writeFieldEnd();
    oprot.writeFieldStop();
    oprot.writeStructEnd();
  }

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

    sb.append("userId:");
    sb.append(this.userId);
    first = false;
    if (!first) sb.append(", ");
    sb.append("mobileNo:");
    if (this.mobileNo == null) {
      sb.append("null");
    } else {
      sb.append(this.mobileNo);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("dailyCount:");
    sb.append(this.dailyCount);
    first = false;
    if (!first) sb.append(", ");
    sb.append("weeklyCount:");
    sb.append(this.weeklyCount);
    first = false;
    if (!first) sb.append(", ");
    sb.append("dndStatus:");
    sb.append(this.dndStatus);
    first = false;
    if (!first) sb.append(", ");
    sb.append("smsSubscribed:");
    sb.append(this.smsSubscribed);
    first = false;
    if (!first) sb.append(", ");
    sb.append("createdTimestamp:");
    sb.append(this.createdTimestamp);
    first = false;
    if (!first) sb.append(", ");
    sb.append("updateTimestamp:");
    sb.append(this.updateTimestamp);
    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);
    }
  }

}