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 BannerMap implements org.apache.thrift.TBase<BannerMap, BannerMap._Fields>, java.io.Serializable, Cloneable {private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("BannerMap");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 MAP_LINK_FIELD_DESC = new org.apache.thrift.protocol.TField("mapLink", org.apache.thrift.protocol.TType.STRING, (short)2);private static final org.apache.thrift.protocol.TField COORDINATES_FIELD_DESC = new org.apache.thrift.protocol.TField("coordinates", org.apache.thrift.protocol.TType.STRING, (short)3);private String bannerName; // requiredprivate String mapLink; // requiredprivate String coordinates; // 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"),MAP_LINK((short)2, "mapLink"),COORDINATES((short)3, "coordinates");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: // MAP_LINKreturn MAP_LINK;case 3: // COORDINATESreturn COORDINATES;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.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.MAP_LINK, new org.apache.thrift.meta_data.FieldMetaData("mapLink", org.apache.thrift.TFieldRequirementType.DEFAULT,new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));tmpMap.put(_Fields.COORDINATES, new org.apache.thrift.meta_data.FieldMetaData("coordinates", 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(BannerMap.class, metaDataMap);}public BannerMap() {}public BannerMap(String bannerName,String mapLink,String coordinates){this();this.bannerName = bannerName;this.mapLink = mapLink;this.coordinates = coordinates;}/*** Performs a deep copy on <i>other</i>.*/public BannerMap(BannerMap other) {if (other.isSetBannerName()) {this.bannerName = other.bannerName;}if (other.isSetMapLink()) {this.mapLink = other.mapLink;}if (other.isSetCoordinates()) {this.coordinates = other.coordinates;}}public BannerMap deepCopy() {return new BannerMap(this);}@Overridepublic void clear() {this.bannerName = null;this.mapLink = null;this.coordinates = 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 getMapLink() {return this.mapLink;}public void setMapLink(String mapLink) {this.mapLink = mapLink;}public void unsetMapLink() {this.mapLink = null;}/** Returns true if field mapLink is set (has been assigned a value) and false otherwise */public boolean isSetMapLink() {return this.mapLink != null;}public void setMapLinkIsSet(boolean value) {if (!value) {this.mapLink = null;}}public String getCoordinates() {return this.coordinates;}public void setCoordinates(String coordinates) {this.coordinates = coordinates;}public void unsetCoordinates() {this.coordinates = null;}/** Returns true if field coordinates is set (has been assigned a value) and false otherwise */public boolean isSetCoordinates() {return this.coordinates != null;}public void setCoordinatesIsSet(boolean value) {if (!value) {this.coordinates = null;}}public void setFieldValue(_Fields field, Object value) {switch (field) {case BANNER_NAME:if (value == null) {unsetBannerName();} else {setBannerName((String)value);}break;case MAP_LINK:if (value == null) {unsetMapLink();} else {setMapLink((String)value);}break;case COORDINATES:if (value == null) {unsetCoordinates();} else {setCoordinates((String)value);}break;}}public Object getFieldValue(_Fields field) {switch (field) {case BANNER_NAME:return getBannerName();case MAP_LINK:return getMapLink();case COORDINATES:return getCoordinates();}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 MAP_LINK:return isSetMapLink();case COORDINATES:return isSetCoordinates();}throw new IllegalStateException();}@Overridepublic boolean equals(Object that) {if (that == null)return false;if (that instanceof BannerMap)return this.equals((BannerMap)that);return false;}public boolean equals(BannerMap 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_mapLink = true && this.isSetMapLink();boolean that_present_mapLink = true && that.isSetMapLink();if (this_present_mapLink || that_present_mapLink) {if (!(this_present_mapLink && that_present_mapLink))return false;if (!this.mapLink.equals(that.mapLink))return false;}boolean this_present_coordinates = true && this.isSetCoordinates();boolean that_present_coordinates = true && that.isSetCoordinates();if (this_present_coordinates || that_present_coordinates) {if (!(this_present_coordinates && that_present_coordinates))return false;if (!this.coordinates.equals(that.coordinates))return false;}return true;}@Overridepublic int hashCode() {return 0;}public int compareTo(BannerMap other) {if (!getClass().equals(other.getClass())) {return getClass().getName().compareTo(other.getClass().getName());}int lastComparison = 0;BannerMap typedOther = (BannerMap)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(isSetMapLink()).compareTo(typedOther.isSetMapLink());if (lastComparison != 0) {return lastComparison;}if (isSetMapLink()) {lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.mapLink, typedOther.mapLink);if (lastComparison != 0) {return lastComparison;}}lastComparison = Boolean.valueOf(isSetCoordinates()).compareTo(typedOther.isSetCoordinates());if (lastComparison != 0) {return lastComparison;}if (isSetCoordinates()) {lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.coordinates, typedOther.coordinates);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: // MAP_LINKif (field.type == org.apache.thrift.protocol.TType.STRING) {this.mapLink = iprot.readString();} else {org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);}break;case 3: // COORDINATESif (field.type == org.apache.thrift.protocol.TType.STRING) {this.coordinates = 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.bannerName != null) {oprot.writeFieldBegin(BANNER_NAME_FIELD_DESC);oprot.writeString(this.bannerName);oprot.writeFieldEnd();}if (this.mapLink != null) {oprot.writeFieldBegin(MAP_LINK_FIELD_DESC);oprot.writeString(this.mapLink);oprot.writeFieldEnd();}if (this.coordinates != null) {oprot.writeFieldBegin(COORDINATES_FIELD_DESC);oprot.writeString(this.coordinates);oprot.writeFieldEnd();}oprot.writeFieldStop();oprot.writeStructEnd();}@Overridepublic String toString() {StringBuilder sb = new StringBuilder("BannerMap(");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("mapLink:");if (this.mapLink == null) {sb.append("null");} else {sb.append(this.mapLink);}first = false;if (!first) sb.append(", ");sb.append("coordinates:");if (this.coordinates == null) {sb.append("null");} else {sb.append(this.coordinates);}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);}}}