Rev 1396 | 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.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.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 UserEmail implements TBase<UserEmail._Fields>, java.io.Serializable, Cloneable, Comparable<UserEmail> {private static final TStruct STRUCT_DESC = new TStruct("UserEmail");private static final TField ID_FIELD_DESC = new TField("id", TType.I64, (short)1);private static final TField EMAIL_TO_FIELD_DESC = new TField("emailTo", TType.STRING, (short)2);private static final TField EMAIL_FROM_FIELD_DESC = new TField("emailFrom", TType.STRING, (short)3);private static final TField SUBJECT_FIELD_DESC = new TField("subject", TType.STRING, (short)4);private static final TField BODY_FIELD_DESC = new TField("body", TType.STRING, (short)5);private static final TField SOURCE_FIELD_DESC = new TField("source", TType.STRING, (short)6);private static final TField EMAIL_TYPE_FIELD_DESC = new TField("emailType", TType.STRING, (short)7);private static final TField STATUS_FIELD_DESC = new TField("status", TType.BOOL, (short)8);private static final TField TIMESTAMP_FIELD_DESC = new TField("timestamp", TType.I64, (short)9);private long id;private String emailTo;private String emailFrom;private String subject;private String body;private String source;private String emailType;private boolean status;private long timestamp;/** 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"),EMAIL_TO((short)2, "emailTo"),EMAIL_FROM((short)3, "emailFrom"),SUBJECT((short)4, "subject"),BODY((short)5, "body"),SOURCE((short)6, "source"),EMAIL_TYPE((short)7, "emailType"),STATUS((short)8, "status"),TIMESTAMP((short)9, "timestamp");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 assignmentsprivate static final int __ID_ISSET_ID = 0;private static final int __STATUS_ISSET_ID = 1;private static final int __TIMESTAMP_ISSET_ID = 2;private BitSet __isset_bit_vector = new BitSet(3);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.EMAIL_TO, new FieldMetaData("emailTo", TFieldRequirementType.DEFAULT,new FieldValueMetaData(TType.STRING)));put(_Fields.EMAIL_FROM, new FieldMetaData("emailFrom", TFieldRequirementType.DEFAULT,new FieldValueMetaData(TType.STRING)));put(_Fields.SUBJECT, new FieldMetaData("subject", TFieldRequirementType.DEFAULT,new FieldValueMetaData(TType.STRING)));put(_Fields.BODY, new FieldMetaData("body", TFieldRequirementType.DEFAULT,new FieldValueMetaData(TType.STRING)));put(_Fields.SOURCE, new FieldMetaData("source", TFieldRequirementType.DEFAULT,new FieldValueMetaData(TType.STRING)));put(_Fields.EMAIL_TYPE, new FieldMetaData("emailType", TFieldRequirementType.DEFAULT,new FieldValueMetaData(TType.STRING)));put(_Fields.STATUS, new FieldMetaData("status", TFieldRequirementType.DEFAULT,new FieldValueMetaData(TType.BOOL)));put(_Fields.TIMESTAMP, new FieldMetaData("timestamp", TFieldRequirementType.DEFAULT,new FieldValueMetaData(TType.I64)));}});static {FieldMetaData.addStructMetaDataMap(UserEmail.class, metaDataMap);}public UserEmail() {}public UserEmail(long id,String emailTo,String emailFrom,String subject,String body,String source,String emailType,boolean status,long timestamp){this();this.id = id;setIdIsSet(true);this.emailTo = emailTo;this.emailFrom = emailFrom;this.subject = subject;this.body = body;this.source = source;this.emailType = emailType;this.status = status;setStatusIsSet(true);this.timestamp = timestamp;setTimestampIsSet(true);}/*** Performs a deep copy on <i>other</i>.*/public UserEmail(UserEmail other) {__isset_bit_vector.clear();__isset_bit_vector.or(other.__isset_bit_vector);this.id = other.id;if (other.isSetEmailTo()) {this.emailTo = other.emailTo;}if (other.isSetEmailFrom()) {this.emailFrom = other.emailFrom;}if (other.isSetSubject()) {this.subject = other.subject;}if (other.isSetBody()) {this.body = other.body;}if (other.isSetSource()) {this.source = other.source;}if (other.isSetEmailType()) {this.emailType = other.emailType;}this.status = other.status;this.timestamp = other.timestamp;}public UserEmail deepCopy() {return new UserEmail(this);}@Deprecatedpublic UserEmail clone() {return new UserEmail(this);}public long getId() {return this.id;}public UserEmail 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 getEmailTo() {return this.emailTo;}public UserEmail setEmailTo(String emailTo) {this.emailTo = emailTo;return this;}public void unsetEmailTo() {this.emailTo = null;}/** Returns true if field emailTo is set (has been asigned a value) and false otherwise */public boolean isSetEmailTo() {return this.emailTo != null;}public void setEmailToIsSet(boolean value) {if (!value) {this.emailTo = null;}}public String getEmailFrom() {return this.emailFrom;}public UserEmail setEmailFrom(String emailFrom) {this.emailFrom = emailFrom;return this;}public void unsetEmailFrom() {this.emailFrom = null;}/** Returns true if field emailFrom is set (has been asigned a value) and false otherwise */public boolean isSetEmailFrom() {return this.emailFrom != null;}public void setEmailFromIsSet(boolean value) {if (!value) {this.emailFrom = null;}}public String getSubject() {return this.subject;}public UserEmail setSubject(String subject) {this.subject = subject;return this;}public void unsetSubject() {this.subject = null;}/** Returns true if field subject is set (has been asigned a value) and false otherwise */public boolean isSetSubject() {return this.subject != null;}public void setSubjectIsSet(boolean value) {if (!value) {this.subject = null;}}public String getBody() {return this.body;}public UserEmail setBody(String body) {this.body = body;return this;}public void unsetBody() {this.body = null;}/** Returns true if field body is set (has been asigned a value) and false otherwise */public boolean isSetBody() {return this.body != null;}public void setBodyIsSet(boolean value) {if (!value) {this.body = null;}}public String getSource() {return this.source;}public UserEmail setSource(String source) {this.source = source;return this;}public void unsetSource() {this.source = null;}/** Returns true if field source is set (has been asigned a value) and false otherwise */public boolean isSetSource() {return this.source != null;}public void setSourceIsSet(boolean value) {if (!value) {this.source = null;}}public String getEmailType() {return this.emailType;}public UserEmail setEmailType(String emailType) {this.emailType = emailType;return this;}public void unsetEmailType() {this.emailType = null;}/** Returns true if field emailType is set (has been asigned a value) and false otherwise */public boolean isSetEmailType() {return this.emailType != null;}public void setEmailTypeIsSet(boolean value) {if (!value) {this.emailType = null;}}public boolean isStatus() {return this.status;}public UserEmail setStatus(boolean status) {this.status = status;setStatusIsSet(true);return this;}public void unsetStatus() {__isset_bit_vector.clear(__STATUS_ISSET_ID);}/** Returns true if field status is set (has been asigned a value) and false otherwise */public boolean isSetStatus() {return __isset_bit_vector.get(__STATUS_ISSET_ID);}public void setStatusIsSet(boolean value) {__isset_bit_vector.set(__STATUS_ISSET_ID, value);}public long getTimestamp() {return this.timestamp;}public UserEmail setTimestamp(long timestamp) {this.timestamp = timestamp;setTimestampIsSet(true);return this;}public void unsetTimestamp() {__isset_bit_vector.clear(__TIMESTAMP_ISSET_ID);}/** Returns true if field timestamp is set (has been asigned a value) and false otherwise */public boolean isSetTimestamp() {return __isset_bit_vector.get(__TIMESTAMP_ISSET_ID);}public void setTimestampIsSet(boolean value) {__isset_bit_vector.set(__TIMESTAMP_ISSET_ID, value);}public void setFieldValue(_Fields field, Object value) {switch (field) {case ID:if (value == null) {unsetId();} else {setId((Long)value);}break;case EMAIL_TO:if (value == null) {unsetEmailTo();} else {setEmailTo((String)value);}break;case EMAIL_FROM:if (value == null) {unsetEmailFrom();} else {setEmailFrom((String)value);}break;case SUBJECT:if (value == null) {unsetSubject();} else {setSubject((String)value);}break;case BODY:if (value == null) {unsetBody();} else {setBody((String)value);}break;case SOURCE:if (value == null) {unsetSource();} else {setSource((String)value);}break;case EMAIL_TYPE:if (value == null) {unsetEmailType();} else {setEmailType((String)value);}break;case STATUS:if (value == null) {unsetStatus();} else {setStatus((Boolean)value);}break;case TIMESTAMP:if (value == null) {unsetTimestamp();} else {setTimestamp((Long)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 EMAIL_TO:return getEmailTo();case EMAIL_FROM:return getEmailFrom();case SUBJECT:return getSubject();case BODY:return getBody();case SOURCE:return getSource();case EMAIL_TYPE:return getEmailType();case STATUS:return new Boolean(isStatus());case TIMESTAMP:return new Long(getTimestamp());}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 EMAIL_TO:return isSetEmailTo();case EMAIL_FROM:return isSetEmailFrom();case SUBJECT:return isSetSubject();case BODY:return isSetBody();case SOURCE:return isSetSource();case EMAIL_TYPE:return isSetEmailType();case STATUS:return isSetStatus();case TIMESTAMP:return isSetTimestamp();}throw new IllegalStateException();}public boolean isSet(int fieldID) {return isSet(_Fields.findByThriftIdOrThrow(fieldID));}@Overridepublic boolean equals(Object that) {if (that == null)return false;if (that instanceof UserEmail)return this.equals((UserEmail)that);return false;}public boolean equals(UserEmail 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_emailTo = true && this.isSetEmailTo();boolean that_present_emailTo = true && that.isSetEmailTo();if (this_present_emailTo || that_present_emailTo) {if (!(this_present_emailTo && that_present_emailTo))return false;if (!this.emailTo.equals(that.emailTo))return false;}boolean this_present_emailFrom = true && this.isSetEmailFrom();boolean that_present_emailFrom = true && that.isSetEmailFrom();if (this_present_emailFrom || that_present_emailFrom) {if (!(this_present_emailFrom && that_present_emailFrom))return false;if (!this.emailFrom.equals(that.emailFrom))return false;}boolean this_present_subject = true && this.isSetSubject();boolean that_present_subject = true && that.isSetSubject();if (this_present_subject || that_present_subject) {if (!(this_present_subject && that_present_subject))return false;if (!this.subject.equals(that.subject))return false;}boolean this_present_body = true && this.isSetBody();boolean that_present_body = true && that.isSetBody();if (this_present_body || that_present_body) {if (!(this_present_body && that_present_body))return false;if (!this.body.equals(that.body))return false;}boolean this_present_source = true && this.isSetSource();boolean that_present_source = true && that.isSetSource();if (this_present_source || that_present_source) {if (!(this_present_source && that_present_source))return false;if (!this.source.equals(that.source))return false;}boolean this_present_emailType = true && this.isSetEmailType();boolean that_present_emailType = true && that.isSetEmailType();if (this_present_emailType || that_present_emailType) {if (!(this_present_emailType && that_present_emailType))return false;if (!this.emailType.equals(that.emailType))return false;}boolean this_present_status = true;boolean that_present_status = true;if (this_present_status || that_present_status) {if (!(this_present_status && that_present_status))return false;if (this.status != that.status)return false;}boolean this_present_timestamp = true;boolean that_present_timestamp = true;if (this_present_timestamp || that_present_timestamp) {if (!(this_present_timestamp && that_present_timestamp))return false;if (this.timestamp != that.timestamp)return false;}return true;}@Overridepublic int hashCode() {return 0;}public int compareTo(UserEmail other) {if (!getClass().equals(other.getClass())) {return getClass().getName().compareTo(other.getClass().getName());}int lastComparison = 0;UserEmail typedOther = (UserEmail)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(isSetEmailTo()).compareTo(isSetEmailTo());if (lastComparison != 0) {return lastComparison;}lastComparison = TBaseHelper.compareTo(emailTo, typedOther.emailTo);if (lastComparison != 0) {return lastComparison;}lastComparison = Boolean.valueOf(isSetEmailFrom()).compareTo(isSetEmailFrom());if (lastComparison != 0) {return lastComparison;}lastComparison = TBaseHelper.compareTo(emailFrom, typedOther.emailFrom);if (lastComparison != 0) {return lastComparison;}lastComparison = Boolean.valueOf(isSetSubject()).compareTo(isSetSubject());if (lastComparison != 0) {return lastComparison;}lastComparison = TBaseHelper.compareTo(subject, typedOther.subject);if (lastComparison != 0) {return lastComparison;}lastComparison = Boolean.valueOf(isSetBody()).compareTo(isSetBody());if (lastComparison != 0) {return lastComparison;}lastComparison = TBaseHelper.compareTo(body, typedOther.body);if (lastComparison != 0) {return lastComparison;}lastComparison = Boolean.valueOf(isSetSource()).compareTo(isSetSource());if (lastComparison != 0) {return lastComparison;}lastComparison = TBaseHelper.compareTo(source, typedOther.source);if (lastComparison != 0) {return lastComparison;}lastComparison = Boolean.valueOf(isSetEmailType()).compareTo(isSetEmailType());if (lastComparison != 0) {return lastComparison;}lastComparison = TBaseHelper.compareTo(emailType, typedOther.emailType);if (lastComparison != 0) {return lastComparison;}lastComparison = Boolean.valueOf(isSetStatus()).compareTo(isSetStatus());if (lastComparison != 0) {return lastComparison;}lastComparison = TBaseHelper.compareTo(status, typedOther.status);if (lastComparison != 0) {return lastComparison;}lastComparison = Boolean.valueOf(isSetTimestamp()).compareTo(isSetTimestamp());if (lastComparison != 0) {return lastComparison;}lastComparison = TBaseHelper.compareTo(timestamp, typedOther.timestamp);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 EMAIL_TO:if (field.type == TType.STRING) {this.emailTo = iprot.readString();} else {TProtocolUtil.skip(iprot, field.type);}break;case EMAIL_FROM:if (field.type == TType.STRING) {this.emailFrom = iprot.readString();} else {TProtocolUtil.skip(iprot, field.type);}break;case SUBJECT:if (field.type == TType.STRING) {this.subject = iprot.readString();} else {TProtocolUtil.skip(iprot, field.type);}break;case BODY:if (field.type == TType.STRING) {this.body = iprot.readString();} else {TProtocolUtil.skip(iprot, field.type);}break;case SOURCE:if (field.type == TType.STRING) {this.source = iprot.readString();} else {TProtocolUtil.skip(iprot, field.type);}break;case EMAIL_TYPE:if (field.type == TType.STRING) {this.emailType = iprot.readString();} else {TProtocolUtil.skip(iprot, field.type);}break;case STATUS:if (field.type == TType.BOOL) {this.status = iprot.readBool();setStatusIsSet(true);} else {TProtocolUtil.skip(iprot, field.type);}break;case TIMESTAMP:if (field.type == TType.I64) {this.timestamp = iprot.readI64();setTimestampIsSet(true);} 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.emailTo != null) {oprot.writeFieldBegin(EMAIL_TO_FIELD_DESC);oprot.writeString(this.emailTo);oprot.writeFieldEnd();}if (this.emailFrom != null) {oprot.writeFieldBegin(EMAIL_FROM_FIELD_DESC);oprot.writeString(this.emailFrom);oprot.writeFieldEnd();}if (this.subject != null) {oprot.writeFieldBegin(SUBJECT_FIELD_DESC);oprot.writeString(this.subject);oprot.writeFieldEnd();}if (this.body != null) {oprot.writeFieldBegin(BODY_FIELD_DESC);oprot.writeString(this.body);oprot.writeFieldEnd();}if (this.source != null) {oprot.writeFieldBegin(SOURCE_FIELD_DESC);oprot.writeString(this.source);oprot.writeFieldEnd();}if (this.emailType != null) {oprot.writeFieldBegin(EMAIL_TYPE_FIELD_DESC);oprot.writeString(this.emailType);oprot.writeFieldEnd();}oprot.writeFieldBegin(STATUS_FIELD_DESC);oprot.writeBool(this.status);oprot.writeFieldEnd();oprot.writeFieldBegin(TIMESTAMP_FIELD_DESC);oprot.writeI64(this.timestamp);oprot.writeFieldEnd();oprot.writeFieldStop();oprot.writeStructEnd();}@Overridepublic String toString() {StringBuilder sb = new StringBuilder("UserEmail(");boolean first = true;sb.append("id:");sb.append(this.id);first = false;if (!first) sb.append(", ");sb.append("emailTo:");if (this.emailTo == null) {sb.append("null");} else {sb.append(this.emailTo);}first = false;if (!first) sb.append(", ");sb.append("emailFrom:");if (this.emailFrom == null) {sb.append("null");} else {sb.append(this.emailFrom);}first = false;if (!first) sb.append(", ");sb.append("subject:");if (this.subject == null) {sb.append("null");} else {sb.append(this.subject);}first = false;if (!first) sb.append(", ");sb.append("body:");if (this.body == null) {sb.append("null");} else {sb.append(this.body);}first = false;if (!first) sb.append(", ");sb.append("source:");if (this.source == null) {sb.append("null");} else {sb.append(this.source);}first = false;if (!first) sb.append(", ");sb.append("emailType:");if (this.emailType == null) {sb.append("null");} else {sb.append(this.emailType);}first = false;if (!first) sb.append(", ");sb.append("status:");sb.append(this.status);first = false;if (!first) sb.append(", ");sb.append("timestamp:");sb.append(this.timestamp);first = false;sb.append(")");return sb.toString();}public void validate() throws TException {// check for required fields}}