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.catalog;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 ExclusiveItemInfo implements org.apache.thrift.TBase<ExclusiveItemInfo, ExclusiveItemInfo._Fields>, java.io.Serializable, Cloneable {private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ExclusiveItemInfo");private static final org.apache.thrift.protocol.TField ITEM_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("itemId", org.apache.thrift.protocol.TType.I64, (short)1);private static final org.apache.thrift.protocol.TField AFFILIATE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("affiliateId", org.apache.thrift.protocol.TType.I64, (short)2);private static final org.apache.thrift.protocol.TField AFFILIATE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("affiliateName", org.apache.thrift.protocol.TType.STRING, (short)3);private static final org.apache.thrift.protocol.TField OFFER_TEXT_FIELD_DESC = new org.apache.thrift.protocol.TField("offerText", org.apache.thrift.protocol.TType.STRING, (short)4);private static final org.apache.thrift.protocol.TField OFFER_IMAGE_URL_FIELD_DESC = new org.apache.thrift.protocol.TField("offerImageUrl", org.apache.thrift.protocol.TType.STRING, (short)5);private static final org.apache.thrift.protocol.TField ACTIVE_FIELD_DESC = new org.apache.thrift.protocol.TField("active", org.apache.thrift.protocol.TType.BOOL, (short)6);private long itemId; // requiredprivate long affiliateId; // requiredprivate String affiliateName; // requiredprivate String offerText; // requiredprivate String offerImageUrl; // requiredprivate boolean active; // 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 {ITEM_ID((short)1, "itemId"),AFFILIATE_ID((short)2, "affiliateId"),AFFILIATE_NAME((short)3, "affiliateName"),OFFER_TEXT((short)4, "offerText"),OFFER_IMAGE_URL((short)5, "offerImageUrl"),ACTIVE((short)6, "active");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: // ITEM_IDreturn ITEM_ID;case 2: // AFFILIATE_IDreturn AFFILIATE_ID;case 3: // AFFILIATE_NAMEreturn AFFILIATE_NAME;case 4: // OFFER_TEXTreturn OFFER_TEXT;case 5: // OFFER_IMAGE_URLreturn OFFER_IMAGE_URL;case 6: // ACTIVEreturn ACTIVE;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 __ITEMID_ISSET_ID = 0;private static final int __AFFILIATEID_ISSET_ID = 1;private static final int __ACTIVE_ISSET_ID = 2;private BitSet __isset_bit_vector = new BitSet(3);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.ITEM_ID, new org.apache.thrift.meta_data.FieldMetaData("itemId", org.apache.thrift.TFieldRequirementType.DEFAULT,new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));tmpMap.put(_Fields.AFFILIATE_ID, new org.apache.thrift.meta_data.FieldMetaData("affiliateId", org.apache.thrift.TFieldRequirementType.DEFAULT,new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));tmpMap.put(_Fields.AFFILIATE_NAME, new org.apache.thrift.meta_data.FieldMetaData("affiliateName", org.apache.thrift.TFieldRequirementType.DEFAULT,new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));tmpMap.put(_Fields.OFFER_TEXT, new org.apache.thrift.meta_data.FieldMetaData("offerText", org.apache.thrift.TFieldRequirementType.DEFAULT,new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));tmpMap.put(_Fields.OFFER_IMAGE_URL, new org.apache.thrift.meta_data.FieldMetaData("offerImageUrl", org.apache.thrift.TFieldRequirementType.DEFAULT,new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));tmpMap.put(_Fields.ACTIVE, new org.apache.thrift.meta_data.FieldMetaData("active", org.apache.thrift.TFieldRequirementType.DEFAULT,new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));metaDataMap = Collections.unmodifiableMap(tmpMap);org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ExclusiveItemInfo.class, metaDataMap);}public ExclusiveItemInfo() {}public ExclusiveItemInfo(long itemId,long affiliateId,String affiliateName,String offerText,String offerImageUrl,boolean active){this();this.itemId = itemId;setItemIdIsSet(true);this.affiliateId = affiliateId;setAffiliateIdIsSet(true);this.affiliateName = affiliateName;this.offerText = offerText;this.offerImageUrl = offerImageUrl;this.active = active;setActiveIsSet(true);}/*** Performs a deep copy on <i>other</i>.*/public ExclusiveItemInfo(ExclusiveItemInfo other) {__isset_bit_vector.clear();__isset_bit_vector.or(other.__isset_bit_vector);this.itemId = other.itemId;this.affiliateId = other.affiliateId;if (other.isSetAffiliateName()) {this.affiliateName = other.affiliateName;}if (other.isSetOfferText()) {this.offerText = other.offerText;}if (other.isSetOfferImageUrl()) {this.offerImageUrl = other.offerImageUrl;}this.active = other.active;}public ExclusiveItemInfo deepCopy() {return new ExclusiveItemInfo(this);}@Overridepublic void clear() {setItemIdIsSet(false);this.itemId = 0;setAffiliateIdIsSet(false);this.affiliateId = 0;this.affiliateName = null;this.offerText = null;this.offerImageUrl = null;setActiveIsSet(false);this.active = false;}public long getItemId() {return this.itemId;}public void setItemId(long itemId) {this.itemId = itemId;setItemIdIsSet(true);}public void unsetItemId() {__isset_bit_vector.clear(__ITEMID_ISSET_ID);}/** Returns true if field itemId is set (has been assigned a value) and false otherwise */public boolean isSetItemId() {return __isset_bit_vector.get(__ITEMID_ISSET_ID);}public void setItemIdIsSet(boolean value) {__isset_bit_vector.set(__ITEMID_ISSET_ID, value);}public long getAffiliateId() {return this.affiliateId;}public void setAffiliateId(long affiliateId) {this.affiliateId = affiliateId;setAffiliateIdIsSet(true);}public void unsetAffiliateId() {__isset_bit_vector.clear(__AFFILIATEID_ISSET_ID);}/** Returns true if field affiliateId is set (has been assigned a value) and false otherwise */public boolean isSetAffiliateId() {return __isset_bit_vector.get(__AFFILIATEID_ISSET_ID);}public void setAffiliateIdIsSet(boolean value) {__isset_bit_vector.set(__AFFILIATEID_ISSET_ID, value);}public String getAffiliateName() {return this.affiliateName;}public void setAffiliateName(String affiliateName) {this.affiliateName = affiliateName;}public void unsetAffiliateName() {this.affiliateName = null;}/** Returns true if field affiliateName is set (has been assigned a value) and false otherwise */public boolean isSetAffiliateName() {return this.affiliateName != null;}public void setAffiliateNameIsSet(boolean value) {if (!value) {this.affiliateName = null;}}public String getOfferText() {return this.offerText;}public void setOfferText(String offerText) {this.offerText = offerText;}public void unsetOfferText() {this.offerText = null;}/** Returns true if field offerText is set (has been assigned a value) and false otherwise */public boolean isSetOfferText() {return this.offerText != null;}public void setOfferTextIsSet(boolean value) {if (!value) {this.offerText = null;}}public String getOfferImageUrl() {return this.offerImageUrl;}public void setOfferImageUrl(String offerImageUrl) {this.offerImageUrl = offerImageUrl;}public void unsetOfferImageUrl() {this.offerImageUrl = null;}/** Returns true if field offerImageUrl is set (has been assigned a value) and false otherwise */public boolean isSetOfferImageUrl() {return this.offerImageUrl != null;}public void setOfferImageUrlIsSet(boolean value) {if (!value) {this.offerImageUrl = null;}}public boolean isActive() {return this.active;}public void setActive(boolean active) {this.active = active;setActiveIsSet(true);}public void unsetActive() {__isset_bit_vector.clear(__ACTIVE_ISSET_ID);}/** Returns true if field active is set (has been assigned a value) and false otherwise */public boolean isSetActive() {return __isset_bit_vector.get(__ACTIVE_ISSET_ID);}public void setActiveIsSet(boolean value) {__isset_bit_vector.set(__ACTIVE_ISSET_ID, value);}public void setFieldValue(_Fields field, Object value) {switch (field) {case ITEM_ID:if (value == null) {unsetItemId();} else {setItemId((Long)value);}break;case AFFILIATE_ID:if (value == null) {unsetAffiliateId();} else {setAffiliateId((Long)value);}break;case AFFILIATE_NAME:if (value == null) {unsetAffiliateName();} else {setAffiliateName((String)value);}break;case OFFER_TEXT:if (value == null) {unsetOfferText();} else {setOfferText((String)value);}break;case OFFER_IMAGE_URL:if (value == null) {unsetOfferImageUrl();} else {setOfferImageUrl((String)value);}break;case ACTIVE:if (value == null) {unsetActive();} else {setActive((Boolean)value);}break;}}public Object getFieldValue(_Fields field) {switch (field) {case ITEM_ID:return Long.valueOf(getItemId());case AFFILIATE_ID:return Long.valueOf(getAffiliateId());case AFFILIATE_NAME:return getAffiliateName();case OFFER_TEXT:return getOfferText();case OFFER_IMAGE_URL:return getOfferImageUrl();case ACTIVE:return Boolean.valueOf(isActive());}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 ITEM_ID:return isSetItemId();case AFFILIATE_ID:return isSetAffiliateId();case AFFILIATE_NAME:return isSetAffiliateName();case OFFER_TEXT:return isSetOfferText();case OFFER_IMAGE_URL:return isSetOfferImageUrl();case ACTIVE:return isSetActive();}throw new IllegalStateException();}@Overridepublic boolean equals(Object that) {if (that == null)return false;if (that instanceof ExclusiveItemInfo)return this.equals((ExclusiveItemInfo)that);return false;}public boolean equals(ExclusiveItemInfo that) {if (that == null)return false;boolean this_present_itemId = true;boolean that_present_itemId = true;if (this_present_itemId || that_present_itemId) {if (!(this_present_itemId && that_present_itemId))return false;if (this.itemId != that.itemId)return false;}boolean this_present_affiliateId = true;boolean that_present_affiliateId = true;if (this_present_affiliateId || that_present_affiliateId) {if (!(this_present_affiliateId && that_present_affiliateId))return false;if (this.affiliateId != that.affiliateId)return false;}boolean this_present_affiliateName = true && this.isSetAffiliateName();boolean that_present_affiliateName = true && that.isSetAffiliateName();if (this_present_affiliateName || that_present_affiliateName) {if (!(this_present_affiliateName && that_present_affiliateName))return false;if (!this.affiliateName.equals(that.affiliateName))return false;}boolean this_present_offerText = true && this.isSetOfferText();boolean that_present_offerText = true && that.isSetOfferText();if (this_present_offerText || that_present_offerText) {if (!(this_present_offerText && that_present_offerText))return false;if (!this.offerText.equals(that.offerText))return false;}boolean this_present_offerImageUrl = true && this.isSetOfferImageUrl();boolean that_present_offerImageUrl = true && that.isSetOfferImageUrl();if (this_present_offerImageUrl || that_present_offerImageUrl) {if (!(this_present_offerImageUrl && that_present_offerImageUrl))return false;if (!this.offerImageUrl.equals(that.offerImageUrl))return false;}boolean this_present_active = true;boolean that_present_active = true;if (this_present_active || that_present_active) {if (!(this_present_active && that_present_active))return false;if (this.active != that.active)return false;}return true;}@Overridepublic int hashCode() {return 0;}public int compareTo(ExclusiveItemInfo other) {if (!getClass().equals(other.getClass())) {return getClass().getName().compareTo(other.getClass().getName());}int lastComparison = 0;ExclusiveItemInfo typedOther = (ExclusiveItemInfo)other;lastComparison = Boolean.valueOf(isSetItemId()).compareTo(typedOther.isSetItemId());if (lastComparison != 0) {return lastComparison;}if (isSetItemId()) {lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.itemId, typedOther.itemId);if (lastComparison != 0) {return lastComparison;}}lastComparison = Boolean.valueOf(isSetAffiliateId()).compareTo(typedOther.isSetAffiliateId());if (lastComparison != 0) {return lastComparison;}if (isSetAffiliateId()) {lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.affiliateId, typedOther.affiliateId);if (lastComparison != 0) {return lastComparison;}}lastComparison = Boolean.valueOf(isSetAffiliateName()).compareTo(typedOther.isSetAffiliateName());if (lastComparison != 0) {return lastComparison;}if (isSetAffiliateName()) {lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.affiliateName, typedOther.affiliateName);if (lastComparison != 0) {return lastComparison;}}lastComparison = Boolean.valueOf(isSetOfferText()).compareTo(typedOther.isSetOfferText());if (lastComparison != 0) {return lastComparison;}if (isSetOfferText()) {lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.offerText, typedOther.offerText);if (lastComparison != 0) {return lastComparison;}}lastComparison = Boolean.valueOf(isSetOfferImageUrl()).compareTo(typedOther.isSetOfferImageUrl());if (lastComparison != 0) {return lastComparison;}if (isSetOfferImageUrl()) {lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.offerImageUrl, typedOther.offerImageUrl);if (lastComparison != 0) {return lastComparison;}}lastComparison = Boolean.valueOf(isSetActive()).compareTo(typedOther.isSetActive());if (lastComparison != 0) {return lastComparison;}if (isSetActive()) {lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.active, typedOther.active);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: // ITEM_IDif (field.type == org.apache.thrift.protocol.TType.I64) {this.itemId = iprot.readI64();setItemIdIsSet(true);} else {org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);}break;case 2: // AFFILIATE_IDif (field.type == org.apache.thrift.protocol.TType.I64) {this.affiliateId = iprot.readI64();setAffiliateIdIsSet(true);} else {org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);}break;case 3: // AFFILIATE_NAMEif (field.type == org.apache.thrift.protocol.TType.STRING) {this.affiliateName = iprot.readString();} else {org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);}break;case 4: // OFFER_TEXTif (field.type == org.apache.thrift.protocol.TType.STRING) {this.offerText = iprot.readString();} else {org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);}break;case 5: // OFFER_IMAGE_URLif (field.type == org.apache.thrift.protocol.TType.STRING) {this.offerImageUrl = iprot.readString();} else {org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);}break;case 6: // ACTIVEif (field.type == org.apache.thrift.protocol.TType.BOOL) {this.active = iprot.readBool();setActiveIsSet(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(ITEM_ID_FIELD_DESC);oprot.writeI64(this.itemId);oprot.writeFieldEnd();oprot.writeFieldBegin(AFFILIATE_ID_FIELD_DESC);oprot.writeI64(this.affiliateId);oprot.writeFieldEnd();if (this.affiliateName != null) {oprot.writeFieldBegin(AFFILIATE_NAME_FIELD_DESC);oprot.writeString(this.affiliateName);oprot.writeFieldEnd();}if (this.offerText != null) {oprot.writeFieldBegin(OFFER_TEXT_FIELD_DESC);oprot.writeString(this.offerText);oprot.writeFieldEnd();}if (this.offerImageUrl != null) {oprot.writeFieldBegin(OFFER_IMAGE_URL_FIELD_DESC);oprot.writeString(this.offerImageUrl);oprot.writeFieldEnd();}oprot.writeFieldBegin(ACTIVE_FIELD_DESC);oprot.writeBool(this.active);oprot.writeFieldEnd();oprot.writeFieldStop();oprot.writeStructEnd();}@Overridepublic String toString() {StringBuilder sb = new StringBuilder("ExclusiveItemInfo(");boolean first = true;sb.append("itemId:");sb.append(this.itemId);first = false;if (!first) sb.append(", ");sb.append("affiliateId:");sb.append(this.affiliateId);first = false;if (!first) sb.append(", ");sb.append("affiliateName:");if (this.affiliateName == null) {sb.append("null");} else {sb.append(this.affiliateName);}first = false;if (!first) sb.append(", ");sb.append("offerText:");if (this.offerText == null) {sb.append("null");} else {sb.append(this.offerText);}first = false;if (!first) sb.append(", ");sb.append("offerImageUrl:");if (this.offerImageUrl == null) {sb.append("null");} else {sb.append(this.offerImageUrl);}first = false;if (!first) sb.append(", ");sb.append("active:");sb.append(this.active);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);}}}