Rev 1013 | 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.model.v1.user;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;/*** Internal information to be used by system. various variables which aid in serving the user are identified and put here* **/public class UserInternalInfo implements org.apache.thrift.TBase<UserInternalInfo, UserInternalInfo._Fields>, java.io.Serializable, Cloneable {private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("UserInternalInfo");private static final org.apache.thrift.protocol.TField USER_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("userId", org.apache.thrift.protocol.TType.I64, (short)1);private static final org.apache.thrift.protocol.TField GEO_ZONE_FIELD_DESC = new org.apache.thrift.protocol.TField("geoZone", org.apache.thrift.protocol.TType.I64, (short)2);private static final org.apache.thrift.protocol.TField SHIPMENT_ZONE_FIELD_DESC = new org.apache.thrift.protocol.TField("shipmentZone", org.apache.thrift.protocol.TType.I64, (short)3);private static final org.apache.thrift.protocol.TField TAX_ZONE_FIELD_DESC = new org.apache.thrift.protocol.TField("taxZone", org.apache.thrift.protocol.TType.I64, (short)4);private static final org.apache.thrift.protocol.TField USER_RANK_SCORE_FIELD_DESC = new org.apache.thrift.protocol.TField("userRankScore", org.apache.thrift.protocol.TType.DOUBLE, (short)5);private long userId; // requiredprivate long geoZone; // requiredprivate long shipmentZone; // requiredprivate long taxZone; // requiredprivate double userRankScore; // required/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */public enum _Fields implements org.apache.thrift.TFieldIdEnum {USER_ID((short)1, "userId"),GEO_ZONE((short)2, "geoZone"),SHIPMENT_ZONE((short)3, "shipmentZone"),TAX_ZONE((short)4, "taxZone"),USER_RANK_SCORE((short)5, "userRankScore");private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();static {for (_Fields field : EnumSet.allOf(_Fields.class)) {byName.put(field.getFieldName(), field);}}/*** Find the _Fields constant that matches fieldId, or null if its not found.*/public static _Fields findByThriftId(int fieldId) {switch(fieldId) {case 1: // USER_IDreturn USER_ID;case 2: // GEO_ZONEreturn GEO_ZONE;case 3: // SHIPMENT_ZONEreturn SHIPMENT_ZONE;case 4: // TAX_ZONEreturn TAX_ZONE;case 5: // USER_RANK_SCOREreturn USER_RANK_SCORE;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 __USERID_ISSET_ID = 0;private static final int __GEOZONE_ISSET_ID = 1;private static final int __SHIPMENTZONE_ISSET_ID = 2;private static final int __TAXZONE_ISSET_ID = 3;private static final int __USERRANKSCORE_ISSET_ID = 4;private BitSet __isset_bit_vector = new BitSet(5);public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;static {Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);tmpMap.put(_Fields.USER_ID, new org.apache.thrift.meta_data.FieldMetaData("userId", org.apache.thrift.TFieldRequirementType.DEFAULT,new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));tmpMap.put(_Fields.GEO_ZONE, new org.apache.thrift.meta_data.FieldMetaData("geoZone", org.apache.thrift.TFieldRequirementType.DEFAULT,new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));tmpMap.put(_Fields.SHIPMENT_ZONE, new org.apache.thrift.meta_data.FieldMetaData("shipmentZone", org.apache.thrift.TFieldRequirementType.DEFAULT,new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));tmpMap.put(_Fields.TAX_ZONE, new org.apache.thrift.meta_data.FieldMetaData("taxZone", org.apache.thrift.TFieldRequirementType.DEFAULT,new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));tmpMap.put(_Fields.USER_RANK_SCORE, new org.apache.thrift.meta_data.FieldMetaData("userRankScore", org.apache.thrift.TFieldRequirementType.DEFAULT,new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));metaDataMap = Collections.unmodifiableMap(tmpMap);org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(UserInternalInfo.class, metaDataMap);}public UserInternalInfo() {}public UserInternalInfo(long userId,long geoZone,long shipmentZone,long taxZone,double userRankScore){this();this.userId = userId;setUserIdIsSet(true);this.geoZone = geoZone;setGeoZoneIsSet(true);this.shipmentZone = shipmentZone;setShipmentZoneIsSet(true);this.taxZone = taxZone;setTaxZoneIsSet(true);this.userRankScore = userRankScore;setUserRankScoreIsSet(true);}/*** Performs a deep copy on <i>other</i>.*/public UserInternalInfo(UserInternalInfo other) {__isset_bit_vector.clear();__isset_bit_vector.or(other.__isset_bit_vector);this.userId = other.userId;this.geoZone = other.geoZone;this.shipmentZone = other.shipmentZone;this.taxZone = other.taxZone;this.userRankScore = other.userRankScore;}public UserInternalInfo deepCopy() {return new UserInternalInfo(this);}@Overridepublic void clear() {setUserIdIsSet(false);this.userId = 0;setGeoZoneIsSet(false);this.geoZone = 0;setShipmentZoneIsSet(false);this.shipmentZone = 0;setTaxZoneIsSet(false);this.taxZone = 0;setUserRankScoreIsSet(false);this.userRankScore = 0.0;}public long getUserId() {return this.userId;}public void setUserId(long userId) {this.userId = userId;setUserIdIsSet(true);}public void unsetUserId() {__isset_bit_vector.clear(__USERID_ISSET_ID);}/** Returns true if field userId is set (has been assigned a value) and false otherwise */public boolean isSetUserId() {return __isset_bit_vector.get(__USERID_ISSET_ID);}public void setUserIdIsSet(boolean value) {__isset_bit_vector.set(__USERID_ISSET_ID, value);}public long getGeoZone() {return this.geoZone;}public void setGeoZone(long geoZone) {this.geoZone = geoZone;setGeoZoneIsSet(true);}public void unsetGeoZone() {__isset_bit_vector.clear(__GEOZONE_ISSET_ID);}/** Returns true if field geoZone is set (has been assigned a value) and false otherwise */public boolean isSetGeoZone() {return __isset_bit_vector.get(__GEOZONE_ISSET_ID);}public void setGeoZoneIsSet(boolean value) {__isset_bit_vector.set(__GEOZONE_ISSET_ID, value);}public long getShipmentZone() {return this.shipmentZone;}public void setShipmentZone(long shipmentZone) {this.shipmentZone = shipmentZone;setShipmentZoneIsSet(true);}public void unsetShipmentZone() {__isset_bit_vector.clear(__SHIPMENTZONE_ISSET_ID);}/** Returns true if field shipmentZone is set (has been assigned a value) and false otherwise */public boolean isSetShipmentZone() {return __isset_bit_vector.get(__SHIPMENTZONE_ISSET_ID);}public void setShipmentZoneIsSet(boolean value) {__isset_bit_vector.set(__SHIPMENTZONE_ISSET_ID, value);}public long getTaxZone() {return this.taxZone;}public void setTaxZone(long taxZone) {this.taxZone = taxZone;setTaxZoneIsSet(true);}public void unsetTaxZone() {__isset_bit_vector.clear(__TAXZONE_ISSET_ID);}/** Returns true if field taxZone is set (has been assigned a value) and false otherwise */public boolean isSetTaxZone() {return __isset_bit_vector.get(__TAXZONE_ISSET_ID);}public void setTaxZoneIsSet(boolean value) {__isset_bit_vector.set(__TAXZONE_ISSET_ID, value);}public double getUserRankScore() {return this.userRankScore;}public void setUserRankScore(double userRankScore) {this.userRankScore = userRankScore;setUserRankScoreIsSet(true);}public void unsetUserRankScore() {__isset_bit_vector.clear(__USERRANKSCORE_ISSET_ID);}/** Returns true if field userRankScore is set (has been assigned a value) and false otherwise */public boolean isSetUserRankScore() {return __isset_bit_vector.get(__USERRANKSCORE_ISSET_ID);}public void setUserRankScoreIsSet(boolean value) {__isset_bit_vector.set(__USERRANKSCORE_ISSET_ID, value);}public void setFieldValue(_Fields field, Object value) {switch (field) {case USER_ID:if (value == null) {unsetUserId();} else {setUserId((Long)value);}break;case GEO_ZONE:if (value == null) {unsetGeoZone();} else {setGeoZone((Long)value);}break;case SHIPMENT_ZONE:if (value == null) {unsetShipmentZone();} else {setShipmentZone((Long)value);}break;case TAX_ZONE:if (value == null) {unsetTaxZone();} else {setTaxZone((Long)value);}break;case USER_RANK_SCORE:if (value == null) {unsetUserRankScore();} else {setUserRankScore((Double)value);}break;}}public Object getFieldValue(_Fields field) {switch (field) {case USER_ID:return Long.valueOf(getUserId());case GEO_ZONE:return Long.valueOf(getGeoZone());case SHIPMENT_ZONE:return Long.valueOf(getShipmentZone());case TAX_ZONE:return Long.valueOf(getTaxZone());case USER_RANK_SCORE:return Double.valueOf(getUserRankScore());}throw new IllegalStateException();}/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */public boolean isSet(_Fields field) {if (field == null) {throw new IllegalArgumentException();}switch (field) {case USER_ID:return isSetUserId();case GEO_ZONE:return isSetGeoZone();case SHIPMENT_ZONE:return isSetShipmentZone();case TAX_ZONE:return isSetTaxZone();case USER_RANK_SCORE:return isSetUserRankScore();}throw new IllegalStateException();}@Overridepublic boolean equals(Object that) {if (that == null)return false;if (that instanceof UserInternalInfo)return this.equals((UserInternalInfo)that);return false;}public boolean equals(UserInternalInfo that) {if (that == null)return false;boolean this_present_userId = true;boolean that_present_userId = true;if (this_present_userId || that_present_userId) {if (!(this_present_userId && that_present_userId))return false;if (this.userId != that.userId)return false;}boolean this_present_geoZone = true;boolean that_present_geoZone = true;if (this_present_geoZone || that_present_geoZone) {if (!(this_present_geoZone && that_present_geoZone))return false;if (this.geoZone != that.geoZone)return false;}boolean this_present_shipmentZone = true;boolean that_present_shipmentZone = true;if (this_present_shipmentZone || that_present_shipmentZone) {if (!(this_present_shipmentZone && that_present_shipmentZone))return false;if (this.shipmentZone != that.shipmentZone)return false;}boolean this_present_taxZone = true;boolean that_present_taxZone = true;if (this_present_taxZone || that_present_taxZone) {if (!(this_present_taxZone && that_present_taxZone))return false;if (this.taxZone != that.taxZone)return false;}boolean this_present_userRankScore = true;boolean that_present_userRankScore = true;if (this_present_userRankScore || that_present_userRankScore) {if (!(this_present_userRankScore && that_present_userRankScore))return false;if (this.userRankScore != that.userRankScore)return false;}return true;}@Overridepublic int hashCode() {return 0;}public int compareTo(UserInternalInfo other) {if (!getClass().equals(other.getClass())) {return getClass().getName().compareTo(other.getClass().getName());}int lastComparison = 0;UserInternalInfo typedOther = (UserInternalInfo)other;lastComparison = Boolean.valueOf(isSetUserId()).compareTo(typedOther.isSetUserId());if (lastComparison != 0) {return lastComparison;}if (isSetUserId()) {lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userId, typedOther.userId);if (lastComparison != 0) {return lastComparison;}}lastComparison = Boolean.valueOf(isSetGeoZone()).compareTo(typedOther.isSetGeoZone());if (lastComparison != 0) {return lastComparison;}if (isSetGeoZone()) {lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.geoZone, typedOther.geoZone);if (lastComparison != 0) {return lastComparison;}}lastComparison = Boolean.valueOf(isSetShipmentZone()).compareTo(typedOther.isSetShipmentZone());if (lastComparison != 0) {return lastComparison;}if (isSetShipmentZone()) {lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.shipmentZone, typedOther.shipmentZone);if (lastComparison != 0) {return lastComparison;}}lastComparison = Boolean.valueOf(isSetTaxZone()).compareTo(typedOther.isSetTaxZone());if (lastComparison != 0) {return lastComparison;}if (isSetTaxZone()) {lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.taxZone, typedOther.taxZone);if (lastComparison != 0) {return lastComparison;}}lastComparison = Boolean.valueOf(isSetUserRankScore()).compareTo(typedOther.isSetUserRankScore());if (lastComparison != 0) {return lastComparison;}if (isSetUserRankScore()) {lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userRankScore, typedOther.userRankScore);if (lastComparison != 0) {return lastComparison;}}return 0;}public _Fields fieldForId(int fieldId) {return _Fields.findByThriftId(fieldId);}public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {org.apache.thrift.protocol.TField field;iprot.readStructBegin();while (true){field = iprot.readFieldBegin();if (field.type == org.apache.thrift.protocol.TType.STOP) {break;}switch (field.id) {case 1: // USER_IDif (field.type == org.apache.thrift.protocol.TType.I64) {this.userId = iprot.readI64();setUserIdIsSet(true);} else {org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);}break;case 2: // GEO_ZONEif (field.type == org.apache.thrift.protocol.TType.I64) {this.geoZone = iprot.readI64();setGeoZoneIsSet(true);} else {org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);}break;case 3: // SHIPMENT_ZONEif (field.type == org.apache.thrift.protocol.TType.I64) {this.shipmentZone = iprot.readI64();setShipmentZoneIsSet(true);} else {org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);}break;case 4: // TAX_ZONEif (field.type == org.apache.thrift.protocol.TType.I64) {this.taxZone = iprot.readI64();setTaxZoneIsSet(true);} else {org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);}break;case 5: // USER_RANK_SCOREif (field.type == org.apache.thrift.protocol.TType.DOUBLE) {this.userRankScore = iprot.readDouble();setUserRankScoreIsSet(true);} else {org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);}break;default:org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);}iprot.readFieldEnd();}iprot.readStructEnd();validate();}public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {validate();oprot.writeStructBegin(STRUCT_DESC);oprot.writeFieldBegin(USER_ID_FIELD_DESC);oprot.writeI64(this.userId);oprot.writeFieldEnd();oprot.writeFieldBegin(GEO_ZONE_FIELD_DESC);oprot.writeI64(this.geoZone);oprot.writeFieldEnd();oprot.writeFieldBegin(SHIPMENT_ZONE_FIELD_DESC);oprot.writeI64(this.shipmentZone);oprot.writeFieldEnd();oprot.writeFieldBegin(TAX_ZONE_FIELD_DESC);oprot.writeI64(this.taxZone);oprot.writeFieldEnd();oprot.writeFieldBegin(USER_RANK_SCORE_FIELD_DESC);oprot.writeDouble(this.userRankScore);oprot.writeFieldEnd();oprot.writeFieldStop();oprot.writeStructEnd();}@Overridepublic String toString() {StringBuilder sb = new StringBuilder("UserInternalInfo(");boolean first = true;sb.append("userId:");sb.append(this.userId);first = false;if (!first) sb.append(", ");sb.append("geoZone:");sb.append(this.geoZone);first = false;if (!first) sb.append(", ");sb.append("shipmentZone:");sb.append(this.shipmentZone);first = false;if (!first) sb.append(", ");sb.append("taxZone:");sb.append(this.taxZone);first = false;if (!first) sb.append(", ");sb.append("userRankScore:");sb.append(this.userRankScore);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);}}}