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.alert;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 AlertMapper implements org.apache.thrift.TBase<AlertMapper, AlertMapper._Fields>, java.io.Serializable, Cloneable {private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("AlertMapper");private static final org.apache.thrift.protocol.TField ENTITY_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("entityType", org.apache.thrift.protocol.TType.I32, (short)1);private static final org.apache.thrift.protocol.TField EVENT_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("eventType", org.apache.thrift.protocol.TType.I32, (short)2);private static final org.apache.thrift.protocol.TField EVENTDESCIPTION_FIELD_DESC = new org.apache.thrift.protocol.TField("eventdesciption", org.apache.thrift.protocol.TType.STRING, (short)3);private static final org.apache.thrift.protocol.TField ALERT_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("alertType", org.apache.thrift.protocol.TType.I32, (short)4);private static final org.apache.thrift.protocol.TField USER_IDS_FIELD_DESC = new org.apache.thrift.protocol.TField("userIds", org.apache.thrift.protocol.TType.STRING, (short)5);private EntityType entityType; // requiredprivate int eventType; // requiredprivate String eventdesciption; // requiredprivate AlertType alertType; // requiredprivate String userIds; // 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 {/**** @see EntityType*/ENTITY_TYPE((short)1, "entityType"),EVENT_TYPE((short)2, "eventType"),EVENTDESCIPTION((short)3, "eventdesciption"),/**** @see AlertType*/ALERT_TYPE((short)4, "alertType"),USER_IDS((short)5, "userIds");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: // ENTITY_TYPEreturn ENTITY_TYPE;case 2: // EVENT_TYPEreturn EVENT_TYPE;case 3: // EVENTDESCIPTIONreturn EVENTDESCIPTION;case 4: // ALERT_TYPEreturn ALERT_TYPE;case 5: // USER_IDSreturn USER_IDS;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 assignmentsprivate static final int __EVENTTYPE_ISSET_ID = 0;private BitSet __isset_bit_vector = new BitSet(1);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.ENTITY_TYPE, new org.apache.thrift.meta_data.FieldMetaData("entityType", org.apache.thrift.TFieldRequirementType.DEFAULT,new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, EntityType.class)));tmpMap.put(_Fields.EVENT_TYPE, new org.apache.thrift.meta_data.FieldMetaData("eventType", org.apache.thrift.TFieldRequirementType.DEFAULT,new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));tmpMap.put(_Fields.EVENTDESCIPTION, new org.apache.thrift.meta_data.FieldMetaData("eventdesciption", org.apache.thrift.TFieldRequirementType.DEFAULT,new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));tmpMap.put(_Fields.ALERT_TYPE, new org.apache.thrift.meta_data.FieldMetaData("alertType", org.apache.thrift.TFieldRequirementType.DEFAULT,new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, AlertType.class)));tmpMap.put(_Fields.USER_IDS, new org.apache.thrift.meta_data.FieldMetaData("userIds", 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(AlertMapper.class, metaDataMap);}public AlertMapper() {}public AlertMapper(EntityType entityType,int eventType,String eventdesciption,AlertType alertType,String userIds){this();this.entityType = entityType;this.eventType = eventType;setEventTypeIsSet(true);this.eventdesciption = eventdesciption;this.alertType = alertType;this.userIds = userIds;}/*** Performs a deep copy on <i>other</i>.*/public AlertMapper(AlertMapper other) {__isset_bit_vector.clear();__isset_bit_vector.or(other.__isset_bit_vector);if (other.isSetEntityType()) {this.entityType = other.entityType;}this.eventType = other.eventType;if (other.isSetEventdesciption()) {this.eventdesciption = other.eventdesciption;}if (other.isSetAlertType()) {this.alertType = other.alertType;}if (other.isSetUserIds()) {this.userIds = other.userIds;}}public AlertMapper deepCopy() {return new AlertMapper(this);}@Overridepublic void clear() {this.entityType = null;setEventTypeIsSet(false);this.eventType = 0;this.eventdesciption = null;this.alertType = null;this.userIds = null;}/**** @see EntityType*/public EntityType getEntityType() {return this.entityType;}/**** @see EntityType*/public void setEntityType(EntityType entityType) {this.entityType = entityType;}public void unsetEntityType() {this.entityType = null;}/** Returns true if field entityType is set (has been assigned a value) and false otherwise */public boolean isSetEntityType() {return this.entityType != null;}public void setEntityTypeIsSet(boolean value) {if (!value) {this.entityType = null;}}public int getEventType() {return this.eventType;}public void setEventType(int eventType) {this.eventType = eventType;setEventTypeIsSet(true);}public void unsetEventType() {__isset_bit_vector.clear(__EVENTTYPE_ISSET_ID);}/** Returns true if field eventType is set (has been assigned a value) and false otherwise */public boolean isSetEventType() {return __isset_bit_vector.get(__EVENTTYPE_ISSET_ID);}public void setEventTypeIsSet(boolean value) {__isset_bit_vector.set(__EVENTTYPE_ISSET_ID, value);}public String getEventdesciption() {return this.eventdesciption;}public void setEventdesciption(String eventdesciption) {this.eventdesciption = eventdesciption;}public void unsetEventdesciption() {this.eventdesciption = null;}/** Returns true if field eventdesciption is set (has been assigned a value) and false otherwise */public boolean isSetEventdesciption() {return this.eventdesciption != null;}public void setEventdesciptionIsSet(boolean value) {if (!value) {this.eventdesciption = null;}}/**** @see AlertType*/public AlertType getAlertType() {return this.alertType;}/**** @see AlertType*/public void setAlertType(AlertType alertType) {this.alertType = alertType;}public void unsetAlertType() {this.alertType = null;}/** Returns true if field alertType is set (has been assigned a value) and false otherwise */public boolean isSetAlertType() {return this.alertType != null;}public void setAlertTypeIsSet(boolean value) {if (!value) {this.alertType = null;}}public String getUserIds() {return this.userIds;}public void setUserIds(String userIds) {this.userIds = userIds;}public void unsetUserIds() {this.userIds = null;}/** Returns true if field userIds is set (has been assigned a value) and false otherwise */public boolean isSetUserIds() {return this.userIds != null;}public void setUserIdsIsSet(boolean value) {if (!value) {this.userIds = null;}}public void setFieldValue(_Fields field, Object value) {switch (field) {case ENTITY_TYPE:if (value == null) {unsetEntityType();} else {setEntityType((EntityType)value);}break;case EVENT_TYPE:if (value == null) {unsetEventType();} else {setEventType((Integer)value);}break;case EVENTDESCIPTION:if (value == null) {unsetEventdesciption();} else {setEventdesciption((String)value);}break;case ALERT_TYPE:if (value == null) {unsetAlertType();} else {setAlertType((AlertType)value);}break;case USER_IDS:if (value == null) {unsetUserIds();} else {setUserIds((String)value);}break;}}public Object getFieldValue(_Fields field) {switch (field) {case ENTITY_TYPE:return getEntityType();case EVENT_TYPE:return Integer.valueOf(getEventType());case EVENTDESCIPTION:return getEventdesciption();case ALERT_TYPE:return getAlertType();case USER_IDS:return getUserIds();}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 ENTITY_TYPE:return isSetEntityType();case EVENT_TYPE:return isSetEventType();case EVENTDESCIPTION:return isSetEventdesciption();case ALERT_TYPE:return isSetAlertType();case USER_IDS:return isSetUserIds();}throw new IllegalStateException();}@Overridepublic boolean equals(Object that) {if (that == null)return false;if (that instanceof AlertMapper)return this.equals((AlertMapper)that);return false;}public boolean equals(AlertMapper that) {if (that == null)return false;boolean this_present_entityType = true && this.isSetEntityType();boolean that_present_entityType = true && that.isSetEntityType();if (this_present_entityType || that_present_entityType) {if (!(this_present_entityType && that_present_entityType))return false;if (!this.entityType.equals(that.entityType))return false;}boolean this_present_eventType = true;boolean that_present_eventType = true;if (this_present_eventType || that_present_eventType) {if (!(this_present_eventType && that_present_eventType))return false;if (this.eventType != that.eventType)return false;}boolean this_present_eventdesciption = true && this.isSetEventdesciption();boolean that_present_eventdesciption = true && that.isSetEventdesciption();if (this_present_eventdesciption || that_present_eventdesciption) {if (!(this_present_eventdesciption && that_present_eventdesciption))return false;if (!this.eventdesciption.equals(that.eventdesciption))return false;}boolean this_present_alertType = true && this.isSetAlertType();boolean that_present_alertType = true && that.isSetAlertType();if (this_present_alertType || that_present_alertType) {if (!(this_present_alertType && that_present_alertType))return false;if (!this.alertType.equals(that.alertType))return false;}boolean this_present_userIds = true && this.isSetUserIds();boolean that_present_userIds = true && that.isSetUserIds();if (this_present_userIds || that_present_userIds) {if (!(this_present_userIds && that_present_userIds))return false;if (!this.userIds.equals(that.userIds))return false;}return true;}@Overridepublic int hashCode() {return 0;}public int compareTo(AlertMapper other) {if (!getClass().equals(other.getClass())) {return getClass().getName().compareTo(other.getClass().getName());}int lastComparison = 0;AlertMapper typedOther = (AlertMapper)other;lastComparison = Boolean.valueOf(isSetEntityType()).compareTo(typedOther.isSetEntityType());if (lastComparison != 0) {return lastComparison;}if (isSetEntityType()) {lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.entityType, typedOther.entityType);if (lastComparison != 0) {return lastComparison;}}lastComparison = Boolean.valueOf(isSetEventType()).compareTo(typedOther.isSetEventType());if (lastComparison != 0) {return lastComparison;}if (isSetEventType()) {lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.eventType, typedOther.eventType);if (lastComparison != 0) {return lastComparison;}}lastComparison = Boolean.valueOf(isSetEventdesciption()).compareTo(typedOther.isSetEventdesciption());if (lastComparison != 0) {return lastComparison;}if (isSetEventdesciption()) {lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.eventdesciption, typedOther.eventdesciption);if (lastComparison != 0) {return lastComparison;}}lastComparison = Boolean.valueOf(isSetAlertType()).compareTo(typedOther.isSetAlertType());if (lastComparison != 0) {return lastComparison;}if (isSetAlertType()) {lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.alertType, typedOther.alertType);if (lastComparison != 0) {return lastComparison;}}lastComparison = Boolean.valueOf(isSetUserIds()).compareTo(typedOther.isSetUserIds());if (lastComparison != 0) {return lastComparison;}if (isSetUserIds()) {lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userIds, typedOther.userIds);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: // ENTITY_TYPEif (field.type == org.apache.thrift.protocol.TType.I32) {this.entityType = EntityType.findByValue(iprot.readI32());} else {org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);}break;case 2: // EVENT_TYPEif (field.type == org.apache.thrift.protocol.TType.I32) {this.eventType = iprot.readI32();setEventTypeIsSet(true);} else {org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);}break;case 3: // EVENTDESCIPTIONif (field.type == org.apache.thrift.protocol.TType.STRING) {this.eventdesciption = iprot.readString();} else {org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);}break;case 4: // ALERT_TYPEif (field.type == org.apache.thrift.protocol.TType.I32) {this.alertType = AlertType.findByValue(iprot.readI32());} else {org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);}break;case 5: // USER_IDSif (field.type == org.apache.thrift.protocol.TType.STRING) {this.userIds = 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.entityType != null) {oprot.writeFieldBegin(ENTITY_TYPE_FIELD_DESC);oprot.writeI32(this.entityType.getValue());oprot.writeFieldEnd();}oprot.writeFieldBegin(EVENT_TYPE_FIELD_DESC);oprot.writeI32(this.eventType);oprot.writeFieldEnd();if (this.eventdesciption != null) {oprot.writeFieldBegin(EVENTDESCIPTION_FIELD_DESC);oprot.writeString(this.eventdesciption);oprot.writeFieldEnd();}if (this.alertType != null) {oprot.writeFieldBegin(ALERT_TYPE_FIELD_DESC);oprot.writeI32(this.alertType.getValue());oprot.writeFieldEnd();}if (this.userIds != null) {oprot.writeFieldBegin(USER_IDS_FIELD_DESC);oprot.writeString(this.userIds);oprot.writeFieldEnd();}oprot.writeFieldStop();oprot.writeStructEnd();}@Overridepublic String toString() {StringBuilder sb = new StringBuilder("AlertMapper(");boolean first = true;sb.append("entityType:");if (this.entityType == null) {sb.append("null");} else {sb.append(this.entityType);}first = false;if (!first) sb.append(", ");sb.append("eventType:");sb.append(this.eventType);first = false;if (!first) sb.append(", ");sb.append("eventdesciption:");if (this.eventdesciption == null) {sb.append("null");} else {sb.append(this.eventdesciption);}first = false;if (!first) sb.append(", ");sb.append("alertType:");if (this.alertType == null) {sb.append("null");} else {sb.append(this.alertType);}first = false;if (!first) sb.append(", ");sb.append("userIds:");if (this.userIds == null) {sb.append("null");} else {sb.append(this.userIds);}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);}}}