Rev 20818 | 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.order;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 WarehouseAddress implements org.apache.thrift.TBase<WarehouseAddress, WarehouseAddress._Fields>, java.io.Serializable, Cloneable {private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("WarehouseAddress");private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.I64, (short)1);private static final org.apache.thrift.protocol.TField ADDRESS_FIELD_DESC = new org.apache.thrift.protocol.TField("address", org.apache.thrift.protocol.TType.STRING, (short)2);private static final org.apache.thrift.protocol.TField PIN_FIELD_DESC = new org.apache.thrift.protocol.TField("pin", org.apache.thrift.protocol.TType.STRING, (short)3);private static final org.apache.thrift.protocol.TField STATE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("state_id", org.apache.thrift.protocol.TType.I64, (short)4);private static final org.apache.thrift.protocol.TField CREATED_FIELD_DESC = new org.apache.thrift.protocol.TField("created", org.apache.thrift.protocol.TType.I64, (short)5);private static final org.apache.thrift.protocol.TField CONTACT_NUMBER_FIELD_DESC = new org.apache.thrift.protocol.TField("contact_number", org.apache.thrift.protocol.TType.STRING, (short)6);private static final org.apache.thrift.protocol.TField CONTACT_PERSON_FIELD_DESC = new org.apache.thrift.protocol.TField("contact_person", org.apache.thrift.protocol.TType.STRING, (short)7);private long id; // requiredprivate String address; // requiredprivate String pin; // requiredprivate long state_id; // requiredprivate long created; // requiredprivate String contact_number; // requiredprivate String contact_person; // 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 {ID((short)1, "id"),ADDRESS((short)2, "address"),PIN((short)3, "pin"),STATE_ID((short)4, "state_id"),CREATED((short)5, "created"),CONTACT_NUMBER((short)6, "contact_number"),CONTACT_PERSON((short)7, "contact_person");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: // IDreturn ID;case 2: // ADDRESSreturn ADDRESS;case 3: // PINreturn PIN;case 4: // STATE_IDreturn STATE_ID;case 5: // CREATEDreturn CREATED;case 6: // CONTACT_NUMBERreturn CONTACT_NUMBER;case 7: // CONTACT_PERSONreturn CONTACT_PERSON;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 __ID_ISSET_ID = 0;private static final int __STATE_ID_ISSET_ID = 1;private static final int __CREATED_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.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT,new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));tmpMap.put(_Fields.ADDRESS, new org.apache.thrift.meta_data.FieldMetaData("address", org.apache.thrift.TFieldRequirementType.DEFAULT,new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));tmpMap.put(_Fields.PIN, new org.apache.thrift.meta_data.FieldMetaData("pin", org.apache.thrift.TFieldRequirementType.DEFAULT,new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));tmpMap.put(_Fields.STATE_ID, new org.apache.thrift.meta_data.FieldMetaData("state_id", org.apache.thrift.TFieldRequirementType.DEFAULT,new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));tmpMap.put(_Fields.CREATED, new org.apache.thrift.meta_data.FieldMetaData("created", org.apache.thrift.TFieldRequirementType.DEFAULT,new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));tmpMap.put(_Fields.CONTACT_NUMBER, new org.apache.thrift.meta_data.FieldMetaData("contact_number", org.apache.thrift.TFieldRequirementType.DEFAULT,new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));tmpMap.put(_Fields.CONTACT_PERSON, new org.apache.thrift.meta_data.FieldMetaData("contact_person", 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(WarehouseAddress.class, metaDataMap);}public WarehouseAddress() {}public WarehouseAddress(long id,String address,String pin,long state_id,long created,String contact_number,String contact_person){this();this.id = id;setIdIsSet(true);this.address = address;this.pin = pin;this.state_id = state_id;setState_idIsSet(true);this.created = created;setCreatedIsSet(true);this.contact_number = contact_number;this.contact_person = contact_person;}/*** Performs a deep copy on <i>other</i>.*/public WarehouseAddress(WarehouseAddress other) {__isset_bit_vector.clear();__isset_bit_vector.or(other.__isset_bit_vector);this.id = other.id;if (other.isSetAddress()) {this.address = other.address;}if (other.isSetPin()) {this.pin = other.pin;}this.state_id = other.state_id;this.created = other.created;if (other.isSetContact_number()) {this.contact_number = other.contact_number;}if (other.isSetContact_person()) {this.contact_person = other.contact_person;}}public WarehouseAddress deepCopy() {return new WarehouseAddress(this);}@Overridepublic void clear() {setIdIsSet(false);this.id = 0;this.address = null;this.pin = null;setState_idIsSet(false);this.state_id = 0;setCreatedIsSet(false);this.created = 0;this.contact_number = null;this.contact_person = null;}public long getId() {return this.id;}public void setId(long id) {this.id = id;setIdIsSet(true);}public void unsetId() {__isset_bit_vector.clear(__ID_ISSET_ID);}/** Returns true if field id is set (has been assigned a value) and false otherwise */public boolean isSetId() {return __isset_bit_vector.get(__ID_ISSET_ID);}public void setIdIsSet(boolean value) {__isset_bit_vector.set(__ID_ISSET_ID, value);}public String getAddress() {return this.address;}public void setAddress(String address) {this.address = address;}public void unsetAddress() {this.address = null;}/** Returns true if field address is set (has been assigned a value) and false otherwise */public boolean isSetAddress() {return this.address != null;}public void setAddressIsSet(boolean value) {if (!value) {this.address = null;}}public String getPin() {return this.pin;}public void setPin(String pin) {this.pin = pin;}public void unsetPin() {this.pin = null;}/** Returns true if field pin is set (has been assigned a value) and false otherwise */public boolean isSetPin() {return this.pin != null;}public void setPinIsSet(boolean value) {if (!value) {this.pin = null;}}public long getState_id() {return this.state_id;}public void setState_id(long state_id) {this.state_id = state_id;setState_idIsSet(true);}public void unsetState_id() {__isset_bit_vector.clear(__STATE_ID_ISSET_ID);}/** Returns true if field state_id is set (has been assigned a value) and false otherwise */public boolean isSetState_id() {return __isset_bit_vector.get(__STATE_ID_ISSET_ID);}public void setState_idIsSet(boolean value) {__isset_bit_vector.set(__STATE_ID_ISSET_ID, value);}public long getCreated() {return this.created;}public void setCreated(long created) {this.created = created;setCreatedIsSet(true);}public void unsetCreated() {__isset_bit_vector.clear(__CREATED_ISSET_ID);}/** Returns true if field created is set (has been assigned a value) and false otherwise */public boolean isSetCreated() {return __isset_bit_vector.get(__CREATED_ISSET_ID);}public void setCreatedIsSet(boolean value) {__isset_bit_vector.set(__CREATED_ISSET_ID, value);}public String getContact_number() {return this.contact_number;}public void setContact_number(String contact_number) {this.contact_number = contact_number;}public void unsetContact_number() {this.contact_number = null;}/** Returns true if field contact_number is set (has been assigned a value) and false otherwise */public boolean isSetContact_number() {return this.contact_number != null;}public void setContact_numberIsSet(boolean value) {if (!value) {this.contact_number = null;}}public String getContact_person() {return this.contact_person;}public void setContact_person(String contact_person) {this.contact_person = contact_person;}public void unsetContact_person() {this.contact_person = null;}/** Returns true if field contact_person is set (has been assigned a value) and false otherwise */public boolean isSetContact_person() {return this.contact_person != null;}public void setContact_personIsSet(boolean value) {if (!value) {this.contact_person = null;}}public void setFieldValue(_Fields field, Object value) {switch (field) {case ID:if (value == null) {unsetId();} else {setId((Long)value);}break;case ADDRESS:if (value == null) {unsetAddress();} else {setAddress((String)value);}break;case PIN:if (value == null) {unsetPin();} else {setPin((String)value);}break;case STATE_ID:if (value == null) {unsetState_id();} else {setState_id((Long)value);}break;case CREATED:if (value == null) {unsetCreated();} else {setCreated((Long)value);}break;case CONTACT_NUMBER:if (value == null) {unsetContact_number();} else {setContact_number((String)value);}break;case CONTACT_PERSON:if (value == null) {unsetContact_person();} else {setContact_person((String)value);}break;}}public Object getFieldValue(_Fields field) {switch (field) {case ID:return Long.valueOf(getId());case ADDRESS:return getAddress();case PIN:return getPin();case STATE_ID:return Long.valueOf(getState_id());case CREATED:return Long.valueOf(getCreated());case CONTACT_NUMBER:return getContact_number();case CONTACT_PERSON:return getContact_person();}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 ID:return isSetId();case ADDRESS:return isSetAddress();case PIN:return isSetPin();case STATE_ID:return isSetState_id();case CREATED:return isSetCreated();case CONTACT_NUMBER:return isSetContact_number();case CONTACT_PERSON:return isSetContact_person();}throw new IllegalStateException();}@Overridepublic boolean equals(Object that) {if (that == null)return false;if (that instanceof WarehouseAddress)return this.equals((WarehouseAddress)that);return false;}public boolean equals(WarehouseAddress that) {if (that == null)return false;boolean this_present_id = true;boolean that_present_id = true;if (this_present_id || that_present_id) {if (!(this_present_id && that_present_id))return false;if (this.id != that.id)return false;}boolean this_present_address = true && this.isSetAddress();boolean that_present_address = true && that.isSetAddress();if (this_present_address || that_present_address) {if (!(this_present_address && that_present_address))return false;if (!this.address.equals(that.address))return false;}boolean this_present_pin = true && this.isSetPin();boolean that_present_pin = true && that.isSetPin();if (this_present_pin || that_present_pin) {if (!(this_present_pin && that_present_pin))return false;if (!this.pin.equals(that.pin))return false;}boolean this_present_state_id = true;boolean that_present_state_id = true;if (this_present_state_id || that_present_state_id) {if (!(this_present_state_id && that_present_state_id))return false;if (this.state_id != that.state_id)return false;}boolean this_present_created = true;boolean that_present_created = true;if (this_present_created || that_present_created) {if (!(this_present_created && that_present_created))return false;if (this.created != that.created)return false;}boolean this_present_contact_number = true && this.isSetContact_number();boolean that_present_contact_number = true && that.isSetContact_number();if (this_present_contact_number || that_present_contact_number) {if (!(this_present_contact_number && that_present_contact_number))return false;if (!this.contact_number.equals(that.contact_number))return false;}boolean this_present_contact_person = true && this.isSetContact_person();boolean that_present_contact_person = true && that.isSetContact_person();if (this_present_contact_person || that_present_contact_person) {if (!(this_present_contact_person && that_present_contact_person))return false;if (!this.contact_person.equals(that.contact_person))return false;}return true;}@Overridepublic int hashCode() {return 0;}public int compareTo(WarehouseAddress other) {if (!getClass().equals(other.getClass())) {return getClass().getName().compareTo(other.getClass().getName());}int lastComparison = 0;WarehouseAddress typedOther = (WarehouseAddress)other;lastComparison = Boolean.valueOf(isSetId()).compareTo(typedOther.isSetId());if (lastComparison != 0) {return lastComparison;}if (isSetId()) {lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, typedOther.id);if (lastComparison != 0) {return lastComparison;}}lastComparison = Boolean.valueOf(isSetAddress()).compareTo(typedOther.isSetAddress());if (lastComparison != 0) {return lastComparison;}if (isSetAddress()) {lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.address, typedOther.address);if (lastComparison != 0) {return lastComparison;}}lastComparison = Boolean.valueOf(isSetPin()).compareTo(typedOther.isSetPin());if (lastComparison != 0) {return lastComparison;}if (isSetPin()) {lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pin, typedOther.pin);if (lastComparison != 0) {return lastComparison;}}lastComparison = Boolean.valueOf(isSetState_id()).compareTo(typedOther.isSetState_id());if (lastComparison != 0) {return lastComparison;}if (isSetState_id()) {lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.state_id, typedOther.state_id);if (lastComparison != 0) {return lastComparison;}}lastComparison = Boolean.valueOf(isSetCreated()).compareTo(typedOther.isSetCreated());if (lastComparison != 0) {return lastComparison;}if (isSetCreated()) {lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.created, typedOther.created);if (lastComparison != 0) {return lastComparison;}}lastComparison = Boolean.valueOf(isSetContact_number()).compareTo(typedOther.isSetContact_number());if (lastComparison != 0) {return lastComparison;}if (isSetContact_number()) {lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.contact_number, typedOther.contact_number);if (lastComparison != 0) {return lastComparison;}}lastComparison = Boolean.valueOf(isSetContact_person()).compareTo(typedOther.isSetContact_person());if (lastComparison != 0) {return lastComparison;}if (isSetContact_person()) {lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.contact_person, typedOther.contact_person);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: // IDif (field.type == org.apache.thrift.protocol.TType.I64) {this.id = iprot.readI64();setIdIsSet(true);} else {org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);}break;case 2: // ADDRESSif (field.type == org.apache.thrift.protocol.TType.STRING) {this.address = iprot.readString();} else {org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);}break;case 3: // PINif (field.type == org.apache.thrift.protocol.TType.STRING) {this.pin = iprot.readString();} else {org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);}break;case 4: // STATE_IDif (field.type == org.apache.thrift.protocol.TType.I64) {this.state_id = iprot.readI64();setState_idIsSet(true);} else {org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);}break;case 5: // CREATEDif (field.type == org.apache.thrift.protocol.TType.I64) {this.created = iprot.readI64();setCreatedIsSet(true);} else {org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);}break;case 6: // CONTACT_NUMBERif (field.type == org.apache.thrift.protocol.TType.STRING) {this.contact_number = iprot.readString();} else {org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);}break;case 7: // CONTACT_PERSONif (field.type == org.apache.thrift.protocol.TType.STRING) {this.contact_person = 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);oprot.writeFieldBegin(ID_FIELD_DESC);oprot.writeI64(this.id);oprot.writeFieldEnd();if (this.address != null) {oprot.writeFieldBegin(ADDRESS_FIELD_DESC);oprot.writeString(this.address);oprot.writeFieldEnd();}if (this.pin != null) {oprot.writeFieldBegin(PIN_FIELD_DESC);oprot.writeString(this.pin);oprot.writeFieldEnd();}oprot.writeFieldBegin(STATE_ID_FIELD_DESC);oprot.writeI64(this.state_id);oprot.writeFieldEnd();oprot.writeFieldBegin(CREATED_FIELD_DESC);oprot.writeI64(this.created);oprot.writeFieldEnd();if (this.contact_number != null) {oprot.writeFieldBegin(CONTACT_NUMBER_FIELD_DESC);oprot.writeString(this.contact_number);oprot.writeFieldEnd();}if (this.contact_person != null) {oprot.writeFieldBegin(CONTACT_PERSON_FIELD_DESC);oprot.writeString(this.contact_person);oprot.writeFieldEnd();}oprot.writeFieldStop();oprot.writeStructEnd();}@Overridepublic String toString() {StringBuilder sb = new StringBuilder("WarehouseAddress(");boolean first = true;sb.append("id:");sb.append(this.id);first = false;if (!first) sb.append(", ");sb.append("address:");if (this.address == null) {sb.append("null");} else {sb.append(this.address);}first = false;if (!first) sb.append(", ");sb.append("pin:");if (this.pin == null) {sb.append("null");} else {sb.append(this.pin);}first = false;if (!first) sb.append(", ");sb.append("state_id:");sb.append(this.state_id);first = false;if (!first) sb.append(", ");sb.append("created:");sb.append(this.created);first = false;if (!first) sb.append(", ");sb.append("contact_number:");if (this.contact_number == null) {sb.append("null");} else {sb.append(this.contact_number);}first = false;if (!first) sb.append(", ");sb.append("contact_person:");if (this.contact_person == null) {sb.append("null");} else {sb.append(this.contact_person);}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);}}}