Rev 3430 | Blame | Compare with Previous | 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 Mail implements org.apache.thrift.TBase<Mail, Mail._Fields>, java.io.Serializable, Cloneable {private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Mail");private static final org.apache.thrift.protocol.TField TO_FIELD_DESC = new org.apache.thrift.protocol.TField("to", org.apache.thrift.protocol.TType.LIST, (short)1);private static final org.apache.thrift.protocol.TField SUBJECT_FIELD_DESC = new org.apache.thrift.protocol.TField("subject", org.apache.thrift.protocol.TType.STRING, (short)2);private static final org.apache.thrift.protocol.TField DATA_FIELD_DESC = new org.apache.thrift.protocol.TField("data", org.apache.thrift.protocol.TType.STRING, (short)3);private static final org.apache.thrift.protocol.TField SENDER_FIELD_DESC = new org.apache.thrift.protocol.TField("sender", org.apache.thrift.protocol.TType.STRING, (short)4);private static final org.apache.thrift.protocol.TField ATTACHMENTS_FIELD_DESC = new org.apache.thrift.protocol.TField("attachments", org.apache.thrift.protocol.TType.LIST, (short)5);private static final org.apache.thrift.protocol.TField PASSWORD_FIELD_DESC = new org.apache.thrift.protocol.TField("password", org.apache.thrift.protocol.TType.STRING, (short)6);private List<String> to; // requiredprivate String subject; // requiredprivate String data; // requiredprivate String sender; // requiredprivate List<String> attachments; // requiredprivate String password; // 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 {TO((short)1, "to"),SUBJECT((short)2, "subject"),DATA((short)3, "data"),SENDER((short)4, "sender"),ATTACHMENTS((short)5, "attachments"),PASSWORD((short)6, "password");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: // TOreturn TO;case 2: // SUBJECTreturn SUBJECT;case 3: // DATAreturn DATA;case 4: // SENDERreturn SENDER;case 5: // ATTACHMENTSreturn ATTACHMENTS;case 6: // PASSWORDreturn PASSWORD;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 assignmentspublic 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.TO, new org.apache.thrift.meta_data.FieldMetaData("to", org.apache.thrift.TFieldRequirementType.DEFAULT,new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));tmpMap.put(_Fields.SUBJECT, new org.apache.thrift.meta_data.FieldMetaData("subject", org.apache.thrift.TFieldRequirementType.DEFAULT,new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));tmpMap.put(_Fields.DATA, new org.apache.thrift.meta_data.FieldMetaData("data", org.apache.thrift.TFieldRequirementType.DEFAULT,new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));tmpMap.put(_Fields.SENDER, new org.apache.thrift.meta_data.FieldMetaData("sender", org.apache.thrift.TFieldRequirementType.DEFAULT,new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));tmpMap.put(_Fields.ATTACHMENTS, new org.apache.thrift.meta_data.FieldMetaData("attachments", org.apache.thrift.TFieldRequirementType.DEFAULT,new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));tmpMap.put(_Fields.PASSWORD, new org.apache.thrift.meta_data.FieldMetaData("password", org.apache.thrift.TFieldRequirementType.DEFAULT,new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));metaDataMap = Collections.unmodifiableMap(tmpMap);org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Mail.class, metaDataMap);}public Mail() {}public Mail(List<String> to,String subject,String data,String sender,List<String> attachments,String password){this();this.to = to;this.subject = subject;this.data = data;this.sender = sender;this.attachments = attachments;this.password = password;}/*** Performs a deep copy on <i>other</i>.*/public Mail(Mail other) {if (other.isSetTo()) {List<String> __this__to = new ArrayList<String>();for (String other_element : other.to) {__this__to.add(other_element);}this.to = __this__to;}if (other.isSetSubject()) {this.subject = other.subject;}if (other.isSetData()) {this.data = other.data;}if (other.isSetSender()) {this.sender = other.sender;}if (other.isSetAttachments()) {List<String> __this__attachments = new ArrayList<String>();for (String other_element : other.attachments) {__this__attachments.add(other_element);}this.attachments = __this__attachments;}if (other.isSetPassword()) {this.password = other.password;}}public Mail deepCopy() {return new Mail(this);}@Overridepublic void clear() {this.to = null;this.subject = null;this.data = null;this.sender = null;this.attachments = null;this.password = null;}public int getToSize() {return (this.to == null) ? 0 : this.to.size();}public java.util.Iterator<String> getToIterator() {return (this.to == null) ? null : this.to.iterator();}public void addToTo(String elem) {if (this.to == null) {this.to = new ArrayList<String>();}this.to.add(elem);}public List<String> getTo() {return this.to;}public void setTo(List<String> to) {this.to = to;}public void unsetTo() {this.to = null;}/** Returns true if field to is set (has been assigned a value) and false otherwise */public boolean isSetTo() {return this.to != null;}public void setToIsSet(boolean value) {if (!value) {this.to = null;}}public String getSubject() {return this.subject;}public void setSubject(String subject) {this.subject = subject;}public void unsetSubject() {this.subject = null;}/** Returns true if field subject is set (has been assigned a value) and false otherwise */public boolean isSetSubject() {return this.subject != null;}public void setSubjectIsSet(boolean value) {if (!value) {this.subject = null;}}public String getData() {return this.data;}public void setData(String data) {this.data = data;}public void unsetData() {this.data = null;}/** Returns true if field data is set (has been assigned a value) and false otherwise */public boolean isSetData() {return this.data != null;}public void setDataIsSet(boolean value) {if (!value) {this.data = null;}}public String getSender() {return this.sender;}public void setSender(String sender) {this.sender = sender;}public void unsetSender() {this.sender = null;}/** Returns true if field sender is set (has been assigned a value) and false otherwise */public boolean isSetSender() {return this.sender != null;}public void setSenderIsSet(boolean value) {if (!value) {this.sender = null;}}public int getAttachmentsSize() {return (this.attachments == null) ? 0 : this.attachments.size();}public java.util.Iterator<String> getAttachmentsIterator() {return (this.attachments == null) ? null : this.attachments.iterator();}public void addToAttachments(String elem) {if (this.attachments == null) {this.attachments = new ArrayList<String>();}this.attachments.add(elem);}public List<String> getAttachments() {return this.attachments;}public void setAttachments(List<String> attachments) {this.attachments = attachments;}public void unsetAttachments() {this.attachments = null;}/** Returns true if field attachments is set (has been assigned a value) and false otherwise */public boolean isSetAttachments() {return this.attachments != null;}public void setAttachmentsIsSet(boolean value) {if (!value) {this.attachments = null;}}public String getPassword() {return this.password;}public void setPassword(String password) {this.password = password;}public void unsetPassword() {this.password = null;}/** Returns true if field password is set (has been assigned a value) and false otherwise */public boolean isSetPassword() {return this.password != null;}public void setPasswordIsSet(boolean value) {if (!value) {this.password = null;}}public void setFieldValue(_Fields field, Object value) {switch (field) {case TO:if (value == null) {unsetTo();} else {setTo((List<String>)value);}break;case SUBJECT:if (value == null) {unsetSubject();} else {setSubject((String)value);}break;case DATA:if (value == null) {unsetData();} else {setData((String)value);}break;case SENDER:if (value == null) {unsetSender();} else {setSender((String)value);}break;case ATTACHMENTS:if (value == null) {unsetAttachments();} else {setAttachments((List<String>)value);}break;case PASSWORD:if (value == null) {unsetPassword();} else {setPassword((String)value);}break;}}public Object getFieldValue(_Fields field) {switch (field) {case TO:return getTo();case SUBJECT:return getSubject();case DATA:return getData();case SENDER:return getSender();case ATTACHMENTS:return getAttachments();case PASSWORD:return getPassword();}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 TO:return isSetTo();case SUBJECT:return isSetSubject();case DATA:return isSetData();case SENDER:return isSetSender();case ATTACHMENTS:return isSetAttachments();case PASSWORD:return isSetPassword();}throw new IllegalStateException();}@Overridepublic boolean equals(Object that) {if (that == null)return false;if (that instanceof Mail)return this.equals((Mail)that);return false;}public boolean equals(Mail that) {if (that == null)return false;boolean this_present_to = true && this.isSetTo();boolean that_present_to = true && that.isSetTo();if (this_present_to || that_present_to) {if (!(this_present_to && that_present_to))return false;if (!this.to.equals(that.to))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_data = true && this.isSetData();boolean that_present_data = true && that.isSetData();if (this_present_data || that_present_data) {if (!(this_present_data && that_present_data))return false;if (!this.data.equals(that.data))return false;}boolean this_present_sender = true && this.isSetSender();boolean that_present_sender = true && that.isSetSender();if (this_present_sender || that_present_sender) {if (!(this_present_sender && that_present_sender))return false;if (!this.sender.equals(that.sender))return false;}boolean this_present_attachments = true && this.isSetAttachments();boolean that_present_attachments = true && that.isSetAttachments();if (this_present_attachments || that_present_attachments) {if (!(this_present_attachments && that_present_attachments))return false;if (!this.attachments.equals(that.attachments))return false;}boolean this_present_password = true && this.isSetPassword();boolean that_present_password = true && that.isSetPassword();if (this_present_password || that_present_password) {if (!(this_present_password && that_present_password))return false;if (!this.password.equals(that.password))return false;}return true;}@Overridepublic int hashCode() {return 0;}public int compareTo(Mail other) {if (!getClass().equals(other.getClass())) {return getClass().getName().compareTo(other.getClass().getName());}int lastComparison = 0;Mail typedOther = (Mail)other;lastComparison = Boolean.valueOf(isSetTo()).compareTo(typedOther.isSetTo());if (lastComparison != 0) {return lastComparison;}if (isSetTo()) {lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.to, typedOther.to);if (lastComparison != 0) {return lastComparison;}}lastComparison = Boolean.valueOf(isSetSubject()).compareTo(typedOther.isSetSubject());if (lastComparison != 0) {return lastComparison;}if (isSetSubject()) {lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.subject, typedOther.subject);if (lastComparison != 0) {return lastComparison;}}lastComparison = Boolean.valueOf(isSetData()).compareTo(typedOther.isSetData());if (lastComparison != 0) {return lastComparison;}if (isSetData()) {lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.data, typedOther.data);if (lastComparison != 0) {return lastComparison;}}lastComparison = Boolean.valueOf(isSetSender()).compareTo(typedOther.isSetSender());if (lastComparison != 0) {return lastComparison;}if (isSetSender()) {lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sender, typedOther.sender);if (lastComparison != 0) {return lastComparison;}}lastComparison = Boolean.valueOf(isSetAttachments()).compareTo(typedOther.isSetAttachments());if (lastComparison != 0) {return lastComparison;}if (isSetAttachments()) {lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.attachments, typedOther.attachments);if (lastComparison != 0) {return lastComparison;}}lastComparison = Boolean.valueOf(isSetPassword()).compareTo(typedOther.isSetPassword());if (lastComparison != 0) {return lastComparison;}if (isSetPassword()) {lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.password, typedOther.password);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: // TOif (field.type == org.apache.thrift.protocol.TType.LIST) {{org.apache.thrift.protocol.TList _list0 = iprot.readListBegin();this.to = new ArrayList<String>(_list0.size);for (int _i1 = 0; _i1 < _list0.size; ++_i1){String _elem2; // required_elem2 = iprot.readString();this.to.add(_elem2);}iprot.readListEnd();}} else {org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);}break;case 2: // SUBJECTif (field.type == org.apache.thrift.protocol.TType.STRING) {this.subject = iprot.readString();} else {org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);}break;case 3: // DATAif (field.type == org.apache.thrift.protocol.TType.STRING) {this.data = iprot.readString();} else {org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);}break;case 4: // SENDERif (field.type == org.apache.thrift.protocol.TType.STRING) {this.sender = iprot.readString();} else {org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);}break;case 5: // ATTACHMENTSif (field.type == org.apache.thrift.protocol.TType.LIST) {{org.apache.thrift.protocol.TList _list3 = iprot.readListBegin();this.attachments = new ArrayList<String>(_list3.size);for (int _i4 = 0; _i4 < _list3.size; ++_i4){String _elem5; // required_elem5 = iprot.readString();this.attachments.add(_elem5);}iprot.readListEnd();}} else {org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);}break;case 6: // PASSWORDif (field.type == org.apache.thrift.protocol.TType.STRING) {this.password = iprot.readString();} 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);if (this.to != null) {oprot.writeFieldBegin(TO_FIELD_DESC);{oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, this.to.size()));for (String _iter6 : this.to){oprot.writeString(_iter6);}oprot.writeListEnd();}oprot.writeFieldEnd();}if (this.subject != null) {oprot.writeFieldBegin(SUBJECT_FIELD_DESC);oprot.writeString(this.subject);oprot.writeFieldEnd();}if (this.data != null) {oprot.writeFieldBegin(DATA_FIELD_DESC);oprot.writeString(this.data);oprot.writeFieldEnd();}if (this.sender != null) {oprot.writeFieldBegin(SENDER_FIELD_DESC);oprot.writeString(this.sender);oprot.writeFieldEnd();}if (this.attachments != null) {oprot.writeFieldBegin(ATTACHMENTS_FIELD_DESC);{oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, this.attachments.size()));for (String _iter7 : this.attachments){oprot.writeString(_iter7);}oprot.writeListEnd();}oprot.writeFieldEnd();}if (this.password != null) {oprot.writeFieldBegin(PASSWORD_FIELD_DESC);oprot.writeString(this.password);oprot.writeFieldEnd();}oprot.writeFieldStop();oprot.writeStructEnd();}@Overridepublic String toString() {StringBuilder sb = new StringBuilder("Mail(");boolean first = true;sb.append("to:");if (this.to == null) {sb.append("null");} else {sb.append(this.to);}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("data:");if (this.data == null) {sb.append("null");} else {sb.append(this.data);}first = false;if (!first) sb.append(", ");sb.append("sender:");if (this.sender == null) {sb.append("null");} else {sb.append(this.sender);}first = false;if (!first) sb.append(", ");sb.append("attachments:");if (this.attachments == null) {sb.append("null");} else {sb.append(this.attachments);}first = false;if (!first) sb.append(", ");sb.append("password:");if (this.password == null) {sb.append("null");} else {sb.append(this.password);}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 {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);}}}