Subversion Repositories SmartDukaan

Rev

Rev 3168 | Rev 3269 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

/**
 * Autogenerated by Thrift
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 */
package in.shop2020.crm;

import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;
import java.util.EnumMap;
import java.util.Set;
import java.util.HashSet;
import java.util.EnumSet;
import java.util.Collections;
import java.util.BitSet;
import java.util.Arrays;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import org.apache.thrift.*;
import org.apache.thrift.meta_data.*;
import org.apache.thrift.protocol.*;

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

  private static final TField ID_FIELD_DESC = new TField("id", TType.I64, (short)1);
  private static final TField DESCRIPTION_FIELD_DESC = new TField("description", TType.STRING, (short)2);
  private static final TField CREATION_TIMESTAMP_FIELD_DESC = new TField("creationTimestamp", TType.I64, (short)3);
  private static final TField TYPE_FIELD_DESC = new TField("type", TType.I32, (short)4);
  private static final TField CUSTOMER_ID_FIELD_DESC = new TField("customerId", TType.I64, (short)5);
  private static final TField CREATOR_ID_FIELD_DESC = new TField("creatorId", TType.I64, (short)6);
  private static final TField EMAIL_ID_FIELD_DESC = new TField("emailId", TType.I64, (short)7);
  private static final TField TICKET_ID_FIELD_DESC = new TField("ticketId", TType.I64, (short)8);
  private static final TField TICKET_PRIORITY_FIELD_DESC = new TField("ticketPriority", TType.I32, (short)9);
  private static final TField TICKET_ASSIGNEE_ID_FIELD_DESC = new TField("ticketAssigneeId", TType.I64, (short)10);
  private static final TField TICKET_STATUS_FIELD_DESC = new TField("ticketStatus", TType.I32, (short)11);
  private static final TField TICKET_CATEGORY_FIELD_DESC = new TField("ticketCategory", TType.I32, (short)12);
  private static final TField TICKET_DESCRIPTION_FIELD_DESC = new TField("ticketDescription", TType.STRING, (short)13);

  private long id;
  private String description;
  private long creationTimestamp;
  private ActivityType type;
  private long customerId;
  private long creatorId;
  private long emailId;
  private long ticketId;
  private TicketPriority ticketPriority;
  private long ticketAssigneeId;
  private TicketStatus ticketStatus;
  private TicketCategory ticketCategory;
  private String ticketDescription;

  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
  public enum _Fields implements TFieldIdEnum {
    ID((short)1, "id"),
    DESCRIPTION((short)2, "description"),
    CREATION_TIMESTAMP((short)3, "creationTimestamp"),
    /**
     * 
     * @see ActivityType
     */
    TYPE((short)4, "type"),
    CUSTOMER_ID((short)5, "customerId"),
    CREATOR_ID((short)6, "creatorId"),
    EMAIL_ID((short)7, "emailId"),
    TICKET_ID((short)8, "ticketId"),
    /**
     * 
     * @see TicketPriority
     */
    TICKET_PRIORITY((short)9, "ticketPriority"),
    TICKET_ASSIGNEE_ID((short)10, "ticketAssigneeId"),
    /**
     * 
     * @see TicketStatus
     */
    TICKET_STATUS((short)11, "ticketStatus"),
    /**
     * 
     * @see TicketCategory
     */
    TICKET_CATEGORY((short)12, "ticketCategory"),
    TICKET_DESCRIPTION((short)13, "ticketDescription");

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

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

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

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

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

    private final short _thriftId;
    private final String _fieldName;

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

    public short getThriftFieldId() {
      return _thriftId;
    }

    public String getFieldName() {
      return _fieldName;
    }
  }

  // isset id assignments
  private static final int __ID_ISSET_ID = 0;
  private static final int __CREATIONTIMESTAMP_ISSET_ID = 1;
  private static final int __CUSTOMERID_ISSET_ID = 2;
  private static final int __CREATORID_ISSET_ID = 3;
  private static final int __EMAILID_ISSET_ID = 4;
  private static final int __TICKETID_ISSET_ID = 5;
  private static final int __TICKETASSIGNEEID_ISSET_ID = 6;
  private BitSet __isset_bit_vector = new BitSet(7);

  public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
    put(_Fields.ID, new FieldMetaData("id", TFieldRequirementType.DEFAULT, 
        new FieldValueMetaData(TType.I64)));
    put(_Fields.DESCRIPTION, new FieldMetaData("description", TFieldRequirementType.OPTIONAL, 
        new FieldValueMetaData(TType.STRING)));
    put(_Fields.CREATION_TIMESTAMP, new FieldMetaData("creationTimestamp", TFieldRequirementType.DEFAULT, 
        new FieldValueMetaData(TType.I64)));
    put(_Fields.TYPE, new FieldMetaData("type", TFieldRequirementType.DEFAULT, 
        new EnumMetaData(TType.ENUM, ActivityType.class)));
    put(_Fields.CUSTOMER_ID, new FieldMetaData("customerId", TFieldRequirementType.DEFAULT, 
        new FieldValueMetaData(TType.I64)));
    put(_Fields.CREATOR_ID, new FieldMetaData("creatorId", TFieldRequirementType.DEFAULT, 
        new FieldValueMetaData(TType.I64)));
    put(_Fields.EMAIL_ID, new FieldMetaData("emailId", TFieldRequirementType.OPTIONAL, 
        new FieldValueMetaData(TType.I64)));
    put(_Fields.TICKET_ID, new FieldMetaData("ticketId", TFieldRequirementType.OPTIONAL, 
        new FieldValueMetaData(TType.I64)));
    put(_Fields.TICKET_PRIORITY, new FieldMetaData("ticketPriority", TFieldRequirementType.OPTIONAL, 
        new EnumMetaData(TType.ENUM, TicketPriority.class)));
    put(_Fields.TICKET_ASSIGNEE_ID, new FieldMetaData("ticketAssigneeId", TFieldRequirementType.OPTIONAL, 
        new FieldValueMetaData(TType.I64)));
    put(_Fields.TICKET_STATUS, new FieldMetaData("ticketStatus", TFieldRequirementType.OPTIONAL, 
        new EnumMetaData(TType.ENUM, TicketStatus.class)));
    put(_Fields.TICKET_CATEGORY, new FieldMetaData("ticketCategory", TFieldRequirementType.OPTIONAL, 
        new EnumMetaData(TType.ENUM, TicketCategory.class)));
    put(_Fields.TICKET_DESCRIPTION, new FieldMetaData("ticketDescription", TFieldRequirementType.OPTIONAL, 
        new FieldValueMetaData(TType.STRING)));
  }});

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

  public Activity() {
  }

  public Activity(
    long id,
    long creationTimestamp,
    ActivityType type,
    long customerId,
    long creatorId)
  {
    this();
    this.id = id;
    setIdIsSet(true);
    this.creationTimestamp = creationTimestamp;
    setCreationTimestampIsSet(true);
    this.type = type;
    this.customerId = customerId;
    setCustomerIdIsSet(true);
    this.creatorId = creatorId;
    setCreatorIdIsSet(true);
  }

  /**
   * Performs a deep copy on <i>other</i>.
   */
  public Activity(Activity other) {
    __isset_bit_vector.clear();
    __isset_bit_vector.or(other.__isset_bit_vector);
    this.id = other.id;
    if (other.isSetDescription()) {
      this.description = other.description;
    }
    this.creationTimestamp = other.creationTimestamp;
    if (other.isSetType()) {
      this.type = other.type;
    }
    this.customerId = other.customerId;
    this.creatorId = other.creatorId;
    this.emailId = other.emailId;
    this.ticketId = other.ticketId;
    if (other.isSetTicketPriority()) {
      this.ticketPriority = other.ticketPriority;
    }
    this.ticketAssigneeId = other.ticketAssigneeId;
    if (other.isSetTicketStatus()) {
      this.ticketStatus = other.ticketStatus;
    }
    if (other.isSetTicketCategory()) {
      this.ticketCategory = other.ticketCategory;
    }
    if (other.isSetTicketDescription()) {
      this.ticketDescription = other.ticketDescription;
    }
  }

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

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

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

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

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

  /** Returns true if field id is set (has been asigned 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 String getDescription() {
    return this.description;
  }

  public Activity setDescription(String description) {
    this.description = description;
    return this;
  }

  public void unsetDescription() {
    this.description = null;
  }

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

  public void setDescriptionIsSet(boolean value) {
    if (!value) {
      this.description = null;
    }
  }

  public long getCreationTimestamp() {
    return this.creationTimestamp;
  }

  public Activity setCreationTimestamp(long creationTimestamp) {
    this.creationTimestamp = creationTimestamp;
    setCreationTimestampIsSet(true);
    return this;
  }

  public void unsetCreationTimestamp() {
    __isset_bit_vector.clear(__CREATIONTIMESTAMP_ISSET_ID);
  }

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

  public void setCreationTimestampIsSet(boolean value) {
    __isset_bit_vector.set(__CREATIONTIMESTAMP_ISSET_ID, value);
  }

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

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

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

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

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

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

  public Activity setCustomerId(long customerId) {
    this.customerId = customerId;
    setCustomerIdIsSet(true);
    return this;
  }

  public void unsetCustomerId() {
    __isset_bit_vector.clear(__CUSTOMERID_ISSET_ID);
  }

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

  public void setCustomerIdIsSet(boolean value) {
    __isset_bit_vector.set(__CUSTOMERID_ISSET_ID, value);
  }

  public long getCreatorId() {
    return this.creatorId;
  }

  public Activity setCreatorId(long creatorId) {
    this.creatorId = creatorId;
    setCreatorIdIsSet(true);
    return this;
  }

  public void unsetCreatorId() {
    __isset_bit_vector.clear(__CREATORID_ISSET_ID);
  }

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

  public void setCreatorIdIsSet(boolean value) {
    __isset_bit_vector.set(__CREATORID_ISSET_ID, value);
  }

  public long getEmailId() {
    return this.emailId;
  }

  public Activity setEmailId(long emailId) {
    this.emailId = emailId;
    setEmailIdIsSet(true);
    return this;
  }

  public void unsetEmailId() {
    __isset_bit_vector.clear(__EMAILID_ISSET_ID);
  }

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

  public void setEmailIdIsSet(boolean value) {
    __isset_bit_vector.set(__EMAILID_ISSET_ID, value);
  }

  public long getTicketId() {
    return this.ticketId;
  }

  public Activity setTicketId(long ticketId) {
    this.ticketId = ticketId;
    setTicketIdIsSet(true);
    return this;
  }

  public void unsetTicketId() {
    __isset_bit_vector.clear(__TICKETID_ISSET_ID);
  }

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

  public void setTicketIdIsSet(boolean value) {
    __isset_bit_vector.set(__TICKETID_ISSET_ID, value);
  }

  /**
   * 
   * @see TicketPriority
   */
  public TicketPriority getTicketPriority() {
    return this.ticketPriority;
  }

  /**
   * 
   * @see TicketPriority
   */
  public Activity setTicketPriority(TicketPriority ticketPriority) {
    this.ticketPriority = ticketPriority;
    return this;
  }

  public void unsetTicketPriority() {
    this.ticketPriority = null;
  }

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

  public void setTicketPriorityIsSet(boolean value) {
    if (!value) {
      this.ticketPriority = null;
    }
  }

  public long getTicketAssigneeId() {
    return this.ticketAssigneeId;
  }

  public Activity setTicketAssigneeId(long ticketAssigneeId) {
    this.ticketAssigneeId = ticketAssigneeId;
    setTicketAssigneeIdIsSet(true);
    return this;
  }

  public void unsetTicketAssigneeId() {
    __isset_bit_vector.clear(__TICKETASSIGNEEID_ISSET_ID);
  }

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

  public void setTicketAssigneeIdIsSet(boolean value) {
    __isset_bit_vector.set(__TICKETASSIGNEEID_ISSET_ID, value);
  }

  /**
   * 
   * @see TicketStatus
   */
  public TicketStatus getTicketStatus() {
    return this.ticketStatus;
  }

  /**
   * 
   * @see TicketStatus
   */
  public Activity setTicketStatus(TicketStatus ticketStatus) {
    this.ticketStatus = ticketStatus;
    return this;
  }

  public void unsetTicketStatus() {
    this.ticketStatus = null;
  }

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

  public void setTicketStatusIsSet(boolean value) {
    if (!value) {
      this.ticketStatus = null;
    }
  }

  /**
   * 
   * @see TicketCategory
   */
  public TicketCategory getTicketCategory() {
    return this.ticketCategory;
  }

  /**
   * 
   * @see TicketCategory
   */
  public Activity setTicketCategory(TicketCategory ticketCategory) {
    this.ticketCategory = ticketCategory;
    return this;
  }

  public void unsetTicketCategory() {
    this.ticketCategory = null;
  }

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

  public void setTicketCategoryIsSet(boolean value) {
    if (!value) {
      this.ticketCategory = null;
    }
  }

  public String getTicketDescription() {
    return this.ticketDescription;
  }

  public Activity setTicketDescription(String ticketDescription) {
    this.ticketDescription = ticketDescription;
    return this;
  }

  public void unsetTicketDescription() {
    this.ticketDescription = null;
  }

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

  public void setTicketDescriptionIsSet(boolean value) {
    if (!value) {
      this.ticketDescription = null;
    }
  }

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

    case DESCRIPTION:
      if (value == null) {
        unsetDescription();
      } else {
        setDescription((String)value);
      }
      break;

    case CREATION_TIMESTAMP:
      if (value == null) {
        unsetCreationTimestamp();
      } else {
        setCreationTimestamp((Long)value);
      }
      break;

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

    case CUSTOMER_ID:
      if (value == null) {
        unsetCustomerId();
      } else {
        setCustomerId((Long)value);
      }
      break;

    case CREATOR_ID:
      if (value == null) {
        unsetCreatorId();
      } else {
        setCreatorId((Long)value);
      }
      break;

    case EMAIL_ID:
      if (value == null) {
        unsetEmailId();
      } else {
        setEmailId((Long)value);
      }
      break;

    case TICKET_ID:
      if (value == null) {
        unsetTicketId();
      } else {
        setTicketId((Long)value);
      }
      break;

    case TICKET_PRIORITY:
      if (value == null) {
        unsetTicketPriority();
      } else {
        setTicketPriority((TicketPriority)value);
      }
      break;

    case TICKET_ASSIGNEE_ID:
      if (value == null) {
        unsetTicketAssigneeId();
      } else {
        setTicketAssigneeId((Long)value);
      }
      break;

    case TICKET_STATUS:
      if (value == null) {
        unsetTicketStatus();
      } else {
        setTicketStatus((TicketStatus)value);
      }
      break;

    case TICKET_CATEGORY:
      if (value == null) {
        unsetTicketCategory();
      } else {
        setTicketCategory((TicketCategory)value);
      }
      break;

    case TICKET_DESCRIPTION:
      if (value == null) {
        unsetTicketDescription();
      } else {
        setTicketDescription((String)value);
      }
      break;

    }
  }

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

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

    case DESCRIPTION:
      return getDescription();

    case CREATION_TIMESTAMP:
      return new Long(getCreationTimestamp());

    case TYPE:
      return getType();

    case CUSTOMER_ID:
      return new Long(getCustomerId());

    case CREATOR_ID:
      return new Long(getCreatorId());

    case EMAIL_ID:
      return new Long(getEmailId());

    case TICKET_ID:
      return new Long(getTicketId());

    case TICKET_PRIORITY:
      return getTicketPriority();

    case TICKET_ASSIGNEE_ID:
      return new Long(getTicketAssigneeId());

    case TICKET_STATUS:
      return getTicketStatus();

    case TICKET_CATEGORY:
      return getTicketCategory();

    case TICKET_DESCRIPTION:
      return getTicketDescription();

    }
    throw new IllegalStateException();
  }

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

  /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
  public boolean isSet(_Fields field) {
    switch (field) {
    case ID:
      return isSetId();
    case DESCRIPTION:
      return isSetDescription();
    case CREATION_TIMESTAMP:
      return isSetCreationTimestamp();
    case TYPE:
      return isSetType();
    case CUSTOMER_ID:
      return isSetCustomerId();
    case CREATOR_ID:
      return isSetCreatorId();
    case EMAIL_ID:
      return isSetEmailId();
    case TICKET_ID:
      return isSetTicketId();
    case TICKET_PRIORITY:
      return isSetTicketPriority();
    case TICKET_ASSIGNEE_ID:
      return isSetTicketAssigneeId();
    case TICKET_STATUS:
      return isSetTicketStatus();
    case TICKET_CATEGORY:
      return isSetTicketCategory();
    case TICKET_DESCRIPTION:
      return isSetTicketDescription();
    }
    throw new IllegalStateException();
  }

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

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

  public boolean equals(Activity 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_description = true && this.isSetDescription();
    boolean that_present_description = true && that.isSetDescription();
    if (this_present_description || that_present_description) {
      if (!(this_present_description && that_present_description))
        return false;
      if (!this.description.equals(that.description))
        return false;
    }

    boolean this_present_creationTimestamp = true;
    boolean that_present_creationTimestamp = true;
    if (this_present_creationTimestamp || that_present_creationTimestamp) {
      if (!(this_present_creationTimestamp && that_present_creationTimestamp))
        return false;
      if (this.creationTimestamp != that.creationTimestamp)
        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_customerId = true;
    boolean that_present_customerId = true;
    if (this_present_customerId || that_present_customerId) {
      if (!(this_present_customerId && that_present_customerId))
        return false;
      if (this.customerId != that.customerId)
        return false;
    }

    boolean this_present_creatorId = true;
    boolean that_present_creatorId = true;
    if (this_present_creatorId || that_present_creatorId) {
      if (!(this_present_creatorId && that_present_creatorId))
        return false;
      if (this.creatorId != that.creatorId)
        return false;
    }

    boolean this_present_emailId = true && this.isSetEmailId();
    boolean that_present_emailId = true && that.isSetEmailId();
    if (this_present_emailId || that_present_emailId) {
      if (!(this_present_emailId && that_present_emailId))
        return false;
      if (this.emailId != that.emailId)
        return false;
    }

    boolean this_present_ticketId = true && this.isSetTicketId();
    boolean that_present_ticketId = true && that.isSetTicketId();
    if (this_present_ticketId || that_present_ticketId) {
      if (!(this_present_ticketId && that_present_ticketId))
        return false;
      if (this.ticketId != that.ticketId)
        return false;
    }

    boolean this_present_ticketPriority = true && this.isSetTicketPriority();
    boolean that_present_ticketPriority = true && that.isSetTicketPriority();
    if (this_present_ticketPriority || that_present_ticketPriority) {
      if (!(this_present_ticketPriority && that_present_ticketPriority))
        return false;
      if (!this.ticketPriority.equals(that.ticketPriority))
        return false;
    }

    boolean this_present_ticketAssigneeId = true && this.isSetTicketAssigneeId();
    boolean that_present_ticketAssigneeId = true && that.isSetTicketAssigneeId();
    if (this_present_ticketAssigneeId || that_present_ticketAssigneeId) {
      if (!(this_present_ticketAssigneeId && that_present_ticketAssigneeId))
        return false;
      if (this.ticketAssigneeId != that.ticketAssigneeId)
        return false;
    }

    boolean this_present_ticketStatus = true && this.isSetTicketStatus();
    boolean that_present_ticketStatus = true && that.isSetTicketStatus();
    if (this_present_ticketStatus || that_present_ticketStatus) {
      if (!(this_present_ticketStatus && that_present_ticketStatus))
        return false;
      if (!this.ticketStatus.equals(that.ticketStatus))
        return false;
    }

    boolean this_present_ticketCategory = true && this.isSetTicketCategory();
    boolean that_present_ticketCategory = true && that.isSetTicketCategory();
    if (this_present_ticketCategory || that_present_ticketCategory) {
      if (!(this_present_ticketCategory && that_present_ticketCategory))
        return false;
      if (!this.ticketCategory.equals(that.ticketCategory))
        return false;
    }

    boolean this_present_ticketDescription = true && this.isSetTicketDescription();
    boolean that_present_ticketDescription = true && that.isSetTicketDescription();
    if (this_present_ticketDescription || that_present_ticketDescription) {
      if (!(this_present_ticketDescription && that_present_ticketDescription))
        return false;
      if (!this.ticketDescription.equals(that.ticketDescription))
        return false;
    }

    return true;
  }

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

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

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

    lastComparison = Boolean.valueOf(isSetId()).compareTo(isSetId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    lastComparison = TBaseHelper.compareTo(id, typedOther.id);
    if (lastComparison != 0) {
      return lastComparison;
    }
    lastComparison = Boolean.valueOf(isSetDescription()).compareTo(isSetDescription());
    if (lastComparison != 0) {
      return lastComparison;
    }
    lastComparison = TBaseHelper.compareTo(description, typedOther.description);
    if (lastComparison != 0) {
      return lastComparison;
    }
    lastComparison = Boolean.valueOf(isSetCreationTimestamp()).compareTo(isSetCreationTimestamp());
    if (lastComparison != 0) {
      return lastComparison;
    }
    lastComparison = TBaseHelper.compareTo(creationTimestamp, typedOther.creationTimestamp);
    if (lastComparison != 0) {
      return lastComparison;
    }
    lastComparison = Boolean.valueOf(isSetType()).compareTo(isSetType());
    if (lastComparison != 0) {
      return lastComparison;
    }
    lastComparison = TBaseHelper.compareTo(type, typedOther.type);
    if (lastComparison != 0) {
      return lastComparison;
    }
    lastComparison = Boolean.valueOf(isSetCustomerId()).compareTo(isSetCustomerId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    lastComparison = TBaseHelper.compareTo(customerId, typedOther.customerId);
    if (lastComparison != 0) {
      return lastComparison;
    }
    lastComparison = Boolean.valueOf(isSetCreatorId()).compareTo(isSetCreatorId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    lastComparison = TBaseHelper.compareTo(creatorId, typedOther.creatorId);
    if (lastComparison != 0) {
      return lastComparison;
    }
    lastComparison = Boolean.valueOf(isSetEmailId()).compareTo(isSetEmailId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    lastComparison = TBaseHelper.compareTo(emailId, typedOther.emailId);
    if (lastComparison != 0) {
      return lastComparison;
    }
    lastComparison = Boolean.valueOf(isSetTicketId()).compareTo(isSetTicketId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    lastComparison = TBaseHelper.compareTo(ticketId, typedOther.ticketId);
    if (lastComparison != 0) {
      return lastComparison;
    }
    lastComparison = Boolean.valueOf(isSetTicketPriority()).compareTo(isSetTicketPriority());
    if (lastComparison != 0) {
      return lastComparison;
    }
    lastComparison = TBaseHelper.compareTo(ticketPriority, typedOther.ticketPriority);
    if (lastComparison != 0) {
      return lastComparison;
    }
    lastComparison = Boolean.valueOf(isSetTicketAssigneeId()).compareTo(isSetTicketAssigneeId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    lastComparison = TBaseHelper.compareTo(ticketAssigneeId, typedOther.ticketAssigneeId);
    if (lastComparison != 0) {
      return lastComparison;
    }
    lastComparison = Boolean.valueOf(isSetTicketStatus()).compareTo(isSetTicketStatus());
    if (lastComparison != 0) {
      return lastComparison;
    }
    lastComparison = TBaseHelper.compareTo(ticketStatus, typedOther.ticketStatus);
    if (lastComparison != 0) {
      return lastComparison;
    }
    lastComparison = Boolean.valueOf(isSetTicketCategory()).compareTo(isSetTicketCategory());
    if (lastComparison != 0) {
      return lastComparison;
    }
    lastComparison = TBaseHelper.compareTo(ticketCategory, typedOther.ticketCategory);
    if (lastComparison != 0) {
      return lastComparison;
    }
    lastComparison = Boolean.valueOf(isSetTicketDescription()).compareTo(isSetTicketDescription());
    if (lastComparison != 0) {
      return lastComparison;
    }
    lastComparison = TBaseHelper.compareTo(ticketDescription, typedOther.ticketDescription);
    if (lastComparison != 0) {
      return lastComparison;
    }
    return 0;
  }

  public void read(TProtocol iprot) throws TException {
    TField field;
    iprot.readStructBegin();
    while (true)
    {
      field = iprot.readFieldBegin();
      if (field.type == TType.STOP) { 
        break;
      }
      _Fields fieldId = _Fields.findByThriftId(field.id);
      if (fieldId == null) {
        TProtocolUtil.skip(iprot, field.type);
      } else {
        switch (fieldId) {
          case ID:
            if (field.type == TType.I64) {
              this.id = iprot.readI64();
              setIdIsSet(true);
            } else { 
              TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case DESCRIPTION:
            if (field.type == TType.STRING) {
              this.description = iprot.readString();
            } else { 
              TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case CREATION_TIMESTAMP:
            if (field.type == TType.I64) {
              this.creationTimestamp = iprot.readI64();
              setCreationTimestampIsSet(true);
            } else { 
              TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case TYPE:
            if (field.type == TType.I32) {
              this.type = ActivityType.findByValue(iprot.readI32());
            } else { 
              TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case CUSTOMER_ID:
            if (field.type == TType.I64) {
              this.customerId = iprot.readI64();
              setCustomerIdIsSet(true);
            } else { 
              TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case CREATOR_ID:
            if (field.type == TType.I64) {
              this.creatorId = iprot.readI64();
              setCreatorIdIsSet(true);
            } else { 
              TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case EMAIL_ID:
            if (field.type == TType.I64) {
              this.emailId = iprot.readI64();
              setEmailIdIsSet(true);
            } else { 
              TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case TICKET_ID:
            if (field.type == TType.I64) {
              this.ticketId = iprot.readI64();
              setTicketIdIsSet(true);
            } else { 
              TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case TICKET_PRIORITY:
            if (field.type == TType.I32) {
              this.ticketPriority = TicketPriority.findByValue(iprot.readI32());
            } else { 
              TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case TICKET_ASSIGNEE_ID:
            if (field.type == TType.I64) {
              this.ticketAssigneeId = iprot.readI64();
              setTicketAssigneeIdIsSet(true);
            } else { 
              TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case TICKET_STATUS:
            if (field.type == TType.I32) {
              this.ticketStatus = TicketStatus.findByValue(iprot.readI32());
            } else { 
              TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case TICKET_CATEGORY:
            if (field.type == TType.I32) {
              this.ticketCategory = TicketCategory.findByValue(iprot.readI32());
            } else { 
              TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case TICKET_DESCRIPTION:
            if (field.type == TType.STRING) {
              this.ticketDescription = iprot.readString();
            } else { 
              TProtocolUtil.skip(iprot, field.type);
            }
            break;
        }
        iprot.readFieldEnd();
      }
    }
    iprot.readStructEnd();
    validate();
  }

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

    oprot.writeStructBegin(STRUCT_DESC);
    oprot.writeFieldBegin(ID_FIELD_DESC);
    oprot.writeI64(this.id);
    oprot.writeFieldEnd();
    if (this.description != null) {
      if (isSetDescription()) {
        oprot.writeFieldBegin(DESCRIPTION_FIELD_DESC);
        oprot.writeString(this.description);
        oprot.writeFieldEnd();
      }
    }
    oprot.writeFieldBegin(CREATION_TIMESTAMP_FIELD_DESC);
    oprot.writeI64(this.creationTimestamp);
    oprot.writeFieldEnd();
    if (this.type != null) {
      oprot.writeFieldBegin(TYPE_FIELD_DESC);
      oprot.writeI32(this.type.getValue());
      oprot.writeFieldEnd();
    }
    oprot.writeFieldBegin(CUSTOMER_ID_FIELD_DESC);
    oprot.writeI64(this.customerId);
    oprot.writeFieldEnd();
    oprot.writeFieldBegin(CREATOR_ID_FIELD_DESC);
    oprot.writeI64(this.creatorId);
    oprot.writeFieldEnd();
    if (isSetEmailId()) {
      oprot.writeFieldBegin(EMAIL_ID_FIELD_DESC);
      oprot.writeI64(this.emailId);
      oprot.writeFieldEnd();
    }
    if (isSetTicketId()) {
      oprot.writeFieldBegin(TICKET_ID_FIELD_DESC);
      oprot.writeI64(this.ticketId);
      oprot.writeFieldEnd();
    }
    if (this.ticketPriority != null) {
      if (isSetTicketPriority()) {
        oprot.writeFieldBegin(TICKET_PRIORITY_FIELD_DESC);
        oprot.writeI32(this.ticketPriority.getValue());
        oprot.writeFieldEnd();
      }
    }
    if (isSetTicketAssigneeId()) {
      oprot.writeFieldBegin(TICKET_ASSIGNEE_ID_FIELD_DESC);
      oprot.writeI64(this.ticketAssigneeId);
      oprot.writeFieldEnd();
    }
    if (this.ticketStatus != null) {
      if (isSetTicketStatus()) {
        oprot.writeFieldBegin(TICKET_STATUS_FIELD_DESC);
        oprot.writeI32(this.ticketStatus.getValue());
        oprot.writeFieldEnd();
      }
    }
    if (this.ticketCategory != null) {
      if (isSetTicketCategory()) {
        oprot.writeFieldBegin(TICKET_CATEGORY_FIELD_DESC);
        oprot.writeI32(this.ticketCategory.getValue());
        oprot.writeFieldEnd();
      }
    }
    if (this.ticketDescription != null) {
      if (isSetTicketDescription()) {
        oprot.writeFieldBegin(TICKET_DESCRIPTION_FIELD_DESC);
        oprot.writeString(this.ticketDescription);
        oprot.writeFieldEnd();
      }
    }
    oprot.writeFieldStop();
    oprot.writeStructEnd();
  }

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

    sb.append("id:");
    sb.append(this.id);
    first = false;
    if (isSetDescription()) {
      if (!first) sb.append(", ");
      sb.append("description:");
      if (this.description == null) {
        sb.append("null");
      } else {
        sb.append(this.description);
      }
      first = false;
    }
    if (!first) sb.append(", ");
    sb.append("creationTimestamp:");
    sb.append(this.creationTimestamp);
    first = false;
    if (!first) sb.append(", ");
    sb.append("type:");
    if (this.type == null) {
      sb.append("null");
    } else {
      String type_name = type.name();
      if (type_name != null) {
        sb.append(type_name);
        sb.append(" (");
      }
      sb.append(this.type);
      if (type_name != null) {
        sb.append(")");
      }
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("customerId:");
    sb.append(this.customerId);
    first = false;
    if (!first) sb.append(", ");
    sb.append("creatorId:");
    sb.append(this.creatorId);
    first = false;
    if (isSetEmailId()) {
      if (!first) sb.append(", ");
      sb.append("emailId:");
      sb.append(this.emailId);
      first = false;
    }
    if (isSetTicketId()) {
      if (!first) sb.append(", ");
      sb.append("ticketId:");
      sb.append(this.ticketId);
      first = false;
    }
    if (isSetTicketPriority()) {
      if (!first) sb.append(", ");
      sb.append("ticketPriority:");
      if (this.ticketPriority == null) {
        sb.append("null");
      } else {
        String ticketPriority_name = ticketPriority.name();
        if (ticketPriority_name != null) {
          sb.append(ticketPriority_name);
          sb.append(" (");
        }
        sb.append(this.ticketPriority);
        if (ticketPriority_name != null) {
          sb.append(")");
        }
      }
      first = false;
    }
    if (isSetTicketAssigneeId()) {
      if (!first) sb.append(", ");
      sb.append("ticketAssigneeId:");
      sb.append(this.ticketAssigneeId);
      first = false;
    }
    if (isSetTicketStatus()) {
      if (!first) sb.append(", ");
      sb.append("ticketStatus:");
      if (this.ticketStatus == null) {
        sb.append("null");
      } else {
        String ticketStatus_name = ticketStatus.name();
        if (ticketStatus_name != null) {
          sb.append(ticketStatus_name);
          sb.append(" (");
        }
        sb.append(this.ticketStatus);
        if (ticketStatus_name != null) {
          sb.append(")");
        }
      }
      first = false;
    }
    if (isSetTicketCategory()) {
      if (!first) sb.append(", ");
      sb.append("ticketCategory:");
      if (this.ticketCategory == null) {
        sb.append("null");
      } else {
        String ticketCategory_name = ticketCategory.name();
        if (ticketCategory_name != null) {
          sb.append(ticketCategory_name);
          sb.append(" (");
        }
        sb.append(this.ticketCategory);
        if (ticketCategory_name != null) {
          sb.append(")");
        }
      }
      first = false;
    }
    if (isSetTicketDescription()) {
      if (!first) sb.append(", ");
      sb.append("ticketDescription:");
      if (this.ticketDescription == null) {
        sb.append("null");
      } else {
        sb.append(this.ticketDescription);
      }
      first = false;
    }
    sb.append(")");
    return sb.toString();
  }

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

}