Rev 8915 | Go to most recent revision | 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.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 Banner implements org.apache.thrift.TBase<Banner, Banner._Fields>, java.io.Serializable, Cloneable {private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Banner");private static final org.apache.thrift.protocol.TField BANNER_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("bannerName", org.apache.thrift.protocol.TType.STRING, (short)1);private static final org.apache.thrift.protocol.TField IMAGE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("imageName", org.apache.thrift.protocol.TType.STRING, (short)2);private static final org.apache.thrift.protocol.TField LINK_FIELD_DESC = new org.apache.thrift.protocol.TField("link", org.apache.thrift.protocol.TType.STRING, (short)3);private static final org.apache.thrift.protocol.TField HAS_MAP_FIELD_DESC = new org.apache.thrift.protocol.TField("hasMap", org.apache.thrift.protocol.TType.BOOL, (short)4);private static final org.apache.thrift.protocol.TField PRIORITY_FIELD_DESC = new org.apache.thrift.protocol.TField("priority", org.apache.thrift.protocol.TType.I64, (short)5);private static final org.apache.thrift.protocol.TField BANNER_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("bannerType", org.apache.thrift.protocol.TType.I32, (short)6);private String bannerName; // requiredprivate String imageName; // requiredprivate String link; // requiredprivate boolean hasMap; // requiredprivate long priority; // requiredprivate BannerType bannerType; // 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 {BANNER_NAME((short)1, "bannerName"),IMAGE_NAME((short)2, "imageName"),LINK((short)3, "link"),HAS_MAP((short)4, "hasMap"),PRIORITY((short)5, "priority"),/**** @see BannerType*/BANNER_TYPE((short)6, "bannerType");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: // BANNER_NAMEreturn BANNER_NAME;case 2: // IMAGE_NAMEreturn IMAGE_NAME;case 3: // LINKreturn LINK;case 4: // HAS_MAPreturn HAS_MAP;case 5: // PRIORITYreturn PRIORITY;case 6: // BANNER_TYPEreturn BANNER_TYPE;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 __HASMAP_ISSET_ID = 0;private static final int __PRIORITY_ISSET_ID = 1;private BitSet __isset_bit_vector = new BitSet(2);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.BANNER_NAME, new org.apache.thrift.meta_data.FieldMetaData("bannerName", org.apache.thrift.TFieldRequirementType.DEFAULT,new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));tmpMap.put(_Fields.IMAGE_NAME, new org.apache.thrift.meta_data.FieldMetaData("imageName", org.apache.thrift.TFieldRequirementType.DEFAULT,new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));tmpMap.put(_Fields.LINK, new org.apache.thrift.meta_data.FieldMetaData("link", org.apache.thrift.TFieldRequirementType.DEFAULT,new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));tmpMap.put(_Fields.HAS_MAP, new org.apache.thrift.meta_data.FieldMetaData("hasMap", org.apache.thrift.TFieldRequirementType.DEFAULT,new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));tmpMap.put(_Fields.PRIORITY, new org.apache.thrift.meta_data.FieldMetaData("priority", org.apache.thrift.TFieldRequirementType.DEFAULT,new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));tmpMap.put(_Fields.BANNER_TYPE, new org.apache.thrift.meta_data.FieldMetaData("bannerType", org.apache.thrift.TFieldRequirementType.DEFAULT,new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, BannerType.class)));metaDataMap = Collections.unmodifiableMap(tmpMap);org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Banner.class, metaDataMap);}public Banner() {}public Banner(String bannerName,String imageName,String link,boolean hasMap,long priority,BannerType bannerType){this();this.bannerName = bannerName;this.imageName = imageName;this.link = link;this.hasMap = hasMap;setHasMapIsSet(true);this.priority = priority;setPriorityIsSet(true);this.bannerType = bannerType;}/*** Performs a deep copy on <i>other</i>.*/public Banner(Banner other) {__isset_bit_vector.clear();__isset_bit_vector.or(other.__isset_bit_vector);if (other.isSetBannerName()) {this.bannerName = other.bannerName;}if (other.isSetImageName()) {this.imageName = other.imageName;}if (other.isSetLink()) {this.link = other.link;}this.hasMap = other.hasMap;this.priority = other.priority;if (other.isSetBannerType()) {this.bannerType = other.bannerType;}}public Banner deepCopy() {return new Banner(this);}@Overridepublic void clear() {this.bannerName = null;this.imageName = null;this.link = null;setHasMapIsSet(false);this.hasMap = false;setPriorityIsSet(false);this.priority = 0;this.bannerType = null;}public String getBannerName() {return this.bannerName;}public void setBannerName(String bannerName) {this.bannerName = bannerName;}public void unsetBannerName() {this.bannerName = null;}/** Returns true if field bannerName is set (has been assigned a value) and false otherwise */public boolean isSetBannerName() {return this.bannerName != null;}public void setBannerNameIsSet(boolean value) {if (!value) {this.bannerName = null;}}public String getImageName() {return this.imageName;}public void setImageName(String imageName) {this.imageName = imageName;}public void unsetImageName() {this.imageName = null;}/** Returns true if field imageName is set (has been assigned a value) and false otherwise */public boolean isSetImageName() {return this.imageName != null;}public void setImageNameIsSet(boolean value) {if (!value) {this.imageName = null;}}public String getLink() {return this.link;}public void setLink(String link) {this.link = link;}public void unsetLink() {this.link = null;}/** Returns true if field link is set (has been assigned a value) and false otherwise */public boolean isSetLink() {return this.link != null;}public void setLinkIsSet(boolean value) {if (!value) {this.link = null;}}public boolean isHasMap() {return this.hasMap;}public void setHasMap(boolean hasMap) {this.hasMap = hasMap;setHasMapIsSet(true);}public void unsetHasMap() {__isset_bit_vector.clear(__HASMAP_ISSET_ID);}/** Returns true if field hasMap is set (has been assigned a value) and false otherwise */public boolean isSetHasMap() {return __isset_bit_vector.get(__HASMAP_ISSET_ID);}public void setHasMapIsSet(boolean value) {__isset_bit_vector.set(__HASMAP_ISSET_ID, value);}public long getPriority() {return this.priority;}public void setPriority(long priority) {this.priority = priority;setPriorityIsSet(true);}public void unsetPriority() {__isset_bit_vector.clear(__PRIORITY_ISSET_ID);}/** Returns true if field priority is set (has been assigned a value) and false otherwise */public boolean isSetPriority() {return __isset_bit_vector.get(__PRIORITY_ISSET_ID);}public void setPriorityIsSet(boolean value) {__isset_bit_vector.set(__PRIORITY_ISSET_ID, value);}/**** @see BannerType*/public BannerType getBannerType() {return this.bannerType;}/**** @see BannerType*/public void setBannerType(BannerType bannerType) {this.bannerType = bannerType;}public void unsetBannerType() {this.bannerType = null;}/** Returns true if field bannerType is set (has been assigned a value) and false otherwise */public boolean isSetBannerType() {return this.bannerType != null;}public void setBannerTypeIsSet(boolean value) {if (!value) {this.bannerType = null;}}public void setFieldValue(_Fields field, Object value) {switch (field) {case BANNER_NAME:if (value == null) {unsetBannerName();} else {setBannerName((String)value);}break;case IMAGE_NAME:if (value == null) {unsetImageName();} else {setImageName((String)value);}break;case LINK:if (value == null) {unsetLink();} else {setLink((String)value);}break;case HAS_MAP:if (value == null) {unsetHasMap();} else {setHasMap((Boolean)value);}break;case PRIORITY:if (value == null) {unsetPriority();} else {setPriority((Long)value);}break;case BANNER_TYPE:if (value == null) {unsetBannerType();} else {setBannerType((BannerType)value);}break;}}public Object getFieldValue(_Fields field) {switch (field) {case BANNER_NAME:return getBannerName();case IMAGE_NAME:return getImageName();case LINK:return getLink();case HAS_MAP:return Boolean.valueOf(isHasMap());case PRIORITY:return Long.valueOf(getPriority());case BANNER_TYPE:return getBannerType();}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 BANNER_NAME:return isSetBannerName();case IMAGE_NAME:return isSetImageName();case LINK:return isSetLink();case HAS_MAP:return isSetHasMap();case PRIORITY:return isSetPriority();case BANNER_TYPE:return isSetBannerType();}throw new IllegalStateException();}@Overridepublic boolean equals(Object that) {if (that == null)return false;if (that instanceof Banner)return this.equals((Banner)that);return false;}public boolean equals(Banner that) {if (that == null)return false;boolean this_present_bannerName = true && this.isSetBannerName();boolean that_present_bannerName = true && that.isSetBannerName();if (this_present_bannerName || that_present_bannerName) {if (!(this_present_bannerName && that_present_bannerName))return false;if (!this.bannerName.equals(that.bannerName))return false;}boolean this_present_imageName = true && this.isSetImageName();boolean that_present_imageName = true && that.isSetImageName();if (this_present_imageName || that_present_imageName) {if (!(this_present_imageName && that_present_imageName))return false;if (!this.imageName.equals(that.imageName))return false;}boolean this_present_link = true && this.isSetLink();boolean that_present_link = true && that.isSetLink();if (this_present_link || that_present_link) {if (!(this_present_link && that_present_link))return false;if (!this.link.equals(that.link))return false;}boolean this_present_hasMap = true;boolean that_present_hasMap = true;if (this_present_hasMap || that_present_hasMap) {if (!(this_present_hasMap && that_present_hasMap))return false;if (this.hasMap != that.hasMap)return false;}boolean this_present_priority = true;boolean that_present_priority = true;if (this_present_priority || that_present_priority) {if (!(this_present_priority && that_present_priority))return false;if (this.priority != that.priority)return false;}boolean this_present_bannerType = true && this.isSetBannerType();boolean that_present_bannerType = true && that.isSetBannerType();if (this_present_bannerType || that_present_bannerType) {if (!(this_present_bannerType && that_present_bannerType))return false;if (!this.bannerType.equals(that.bannerType))return false;}return true;}@Overridepublic int hashCode() {return 0;}public int compareTo(Banner other) {if (!getClass().equals(other.getClass())) {return getClass().getName().compareTo(other.getClass().getName());}int lastComparison = 0;Banner typedOther = (Banner)other;lastComparison = Boolean.valueOf(isSetBannerName()).compareTo(typedOther.isSetBannerName());if (lastComparison != 0) {return lastComparison;}if (isSetBannerName()) {lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.bannerName, typedOther.bannerName);if (lastComparison != 0) {return lastComparison;}}lastComparison = Boolean.valueOf(isSetImageName()).compareTo(typedOther.isSetImageName());if (lastComparison != 0) {return lastComparison;}if (isSetImageName()) {lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.imageName, typedOther.imageName);if (lastComparison != 0) {return lastComparison;}}lastComparison = Boolean.valueOf(isSetLink()).compareTo(typedOther.isSetLink());if (lastComparison != 0) {return lastComparison;}if (isSetLink()) {lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.link, typedOther.link);if (lastComparison != 0) {return lastComparison;}}lastComparison = Boolean.valueOf(isSetHasMap()).compareTo(typedOther.isSetHasMap());if (lastComparison != 0) {return lastComparison;}if (isSetHasMap()) {lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.hasMap, typedOther.hasMap);if (lastComparison != 0) {return lastComparison;}}lastComparison = Boolean.valueOf(isSetPriority()).compareTo(typedOther.isSetPriority());if (lastComparison != 0) {return lastComparison;}if (isSetPriority()) {lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.priority, typedOther.priority);if (lastComparison != 0) {return lastComparison;}}lastComparison = Boolean.valueOf(isSetBannerType()).compareTo(typedOther.isSetBannerType());if (lastComparison != 0) {return lastComparison;}if (isSetBannerType()) {lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.bannerType, typedOther.bannerType);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: // BANNER_NAMEif (field.type == org.apache.thrift.protocol.TType.STRING) {this.bannerName = iprot.readString();} else {org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);}break;case 2: // IMAGE_NAMEif (field.type == org.apache.thrift.protocol.TType.STRING) {this.imageName = iprot.readString();} else {org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);}break;case 3: // LINKif (field.type == org.apache.thrift.protocol.TType.STRING) {this.link = iprot.readString();} else {org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);}break;case 4: // HAS_MAPif (field.type == org.apache.thrift.protocol.TType.BOOL) {this.hasMap = iprot.readBool();setHasMapIsSet(true);} else {org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);}break;case 5: // PRIORITYif (field.type == org.apache.thrift.protocol.TType.I64) {this.priority = iprot.readI64();setPriorityIsSet(true);} else {org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);}break;case 6: // BANNER_TYPEif (field.type == org.apache.thrift.protocol.TType.I32) {this.bannerType = BannerType.findByValue(iprot.readI32());} 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.bannerName != null) {oprot.writeFieldBegin(BANNER_NAME_FIELD_DESC);oprot.writeString(this.bannerName);oprot.writeFieldEnd();}if (this.imageName != null) {oprot.writeFieldBegin(IMAGE_NAME_FIELD_DESC);oprot.writeString(this.imageName);oprot.writeFieldEnd();}if (this.link != null) {oprot.writeFieldBegin(LINK_FIELD_DESC);oprot.writeString(this.link);oprot.writeFieldEnd();}oprot.writeFieldBegin(HAS_MAP_FIELD_DESC);oprot.writeBool(this.hasMap);oprot.writeFieldEnd();oprot.writeFieldBegin(PRIORITY_FIELD_DESC);oprot.writeI64(this.priority);oprot.writeFieldEnd();if (this.bannerType != null) {oprot.writeFieldBegin(BANNER_TYPE_FIELD_DESC);oprot.writeI32(this.bannerType.getValue());oprot.writeFieldEnd();}oprot.writeFieldStop();oprot.writeStructEnd();}@Overridepublic String toString() {StringBuilder sb = new StringBuilder("Banner(");boolean first = true;sb.append("bannerName:");if (this.bannerName == null) {sb.append("null");} else {sb.append(this.bannerName);}first = false;if (!first) sb.append(", ");sb.append("imageName:");if (this.imageName == null) {sb.append("null");} else {sb.append(this.imageName);}first = false;if (!first) sb.append(", ");sb.append("link:");if (this.link == null) {sb.append("null");} else {sb.append(this.link);}first = false;if (!first) sb.append(", ");sb.append("hasMap:");sb.append(this.hasMap);first = false;if (!first) sb.append(", ");sb.append("priority:");sb.append(this.priority);first = false;if (!first) sb.append(", ");sb.append("bannerType:");if (this.bannerType == null) {sb.append("null");} else {sb.append(this.bannerType);}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);}}}