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.logistics;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 BluedartAttributes implements org.apache.thrift.TBase<BluedartAttributes, BluedartAttributes._Fields>, java.io.Serializable, Cloneable {private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("BluedartAttributes");private static final org.apache.thrift.protocol.TField LOGISTICS_TRANSACTION_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("logisticsTransactionId", org.apache.thrift.protocol.TType.STRING, (short)1);private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)2);private static final org.apache.thrift.protocol.TField VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("value", org.apache.thrift.protocol.TType.STRING, (short)3);private String logisticsTransactionId; // requiredprivate String name; // requiredprivate String value; // 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 {LOGISTICS_TRANSACTION_ID((short)1, "logisticsTransactionId"),NAME((short)2, "name"),VALUE((short)3, "value");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: // LOGISTICS_TRANSACTION_IDreturn LOGISTICS_TRANSACTION_ID;case 2: // NAMEreturn NAME;case 3: // VALUEreturn VALUE;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.LOGISTICS_TRANSACTION_ID, new org.apache.thrift.meta_data.FieldMetaData("logisticsTransactionId", org.apache.thrift.TFieldRequirementType.DEFAULT,new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));tmpMap.put(_Fields.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.DEFAULT,new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));tmpMap.put(_Fields.VALUE, new org.apache.thrift.meta_data.FieldMetaData("value", 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(BluedartAttributes.class, metaDataMap);}public BluedartAttributes() {}public BluedartAttributes(String logisticsTransactionId,String name,String value){this();this.logisticsTransactionId = logisticsTransactionId;this.name = name;this.value = value;}/*** Performs a deep copy on <i>other</i>.*/public BluedartAttributes(BluedartAttributes other) {if (other.isSetLogisticsTransactionId()) {this.logisticsTransactionId = other.logisticsTransactionId;}if (other.isSetName()) {this.name = other.name;}if (other.isSetValue()) {this.value = other.value;}}public BluedartAttributes deepCopy() {return new BluedartAttributes(this);}@Overridepublic void clear() {this.logisticsTransactionId = null;this.name = null;this.value = null;}public String getLogisticsTransactionId() {return this.logisticsTransactionId;}public void setLogisticsTransactionId(String logisticsTransactionId) {this.logisticsTransactionId = logisticsTransactionId;}public void unsetLogisticsTransactionId() {this.logisticsTransactionId = null;}/** Returns true if field logisticsTransactionId is set (has been assigned a value) and false otherwise */public boolean isSetLogisticsTransactionId() {return this.logisticsTransactionId != null;}public void setLogisticsTransactionIdIsSet(boolean value) {if (!value) {this.logisticsTransactionId = null;}}public String getName() {return this.name;}public void setName(String name) {this.name = name;}public void unsetName() {this.name = null;}/** Returns true if field name is set (has been assigned a value) and false otherwise */public boolean isSetName() {return this.name != null;}public void setNameIsSet(boolean value) {if (!value) {this.name = null;}}public String getValue() {return this.value;}public void setValue(String value) {this.value = value;}public void unsetValue() {this.value = null;}/** Returns true if field value is set (has been assigned a value) and false otherwise */public boolean isSetValue() {return this.value != null;}public void setValueIsSet(boolean value) {if (!value) {this.value = null;}}public void setFieldValue(_Fields field, Object value) {switch (field) {case LOGISTICS_TRANSACTION_ID:if (value == null) {unsetLogisticsTransactionId();} else {setLogisticsTransactionId((String)value);}break;case NAME:if (value == null) {unsetName();} else {setName((String)value);}break;case VALUE:if (value == null) {unsetValue();} else {setValue((String)value);}break;}}public Object getFieldValue(_Fields field) {switch (field) {case LOGISTICS_TRANSACTION_ID:return getLogisticsTransactionId();case NAME:return getName();case VALUE:return getValue();}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 LOGISTICS_TRANSACTION_ID:return isSetLogisticsTransactionId();case NAME:return isSetName();case VALUE:return isSetValue();}throw new IllegalStateException();}@Overridepublic boolean equals(Object that) {if (that == null)return false;if (that instanceof BluedartAttributes)return this.equals((BluedartAttributes)that);return false;}public boolean equals(BluedartAttributes that) {if (that == null)return false;boolean this_present_logisticsTransactionId = true && this.isSetLogisticsTransactionId();boolean that_present_logisticsTransactionId = true && that.isSetLogisticsTransactionId();if (this_present_logisticsTransactionId || that_present_logisticsTransactionId) {if (!(this_present_logisticsTransactionId && that_present_logisticsTransactionId))return false;if (!this.logisticsTransactionId.equals(that.logisticsTransactionId))return false;}boolean this_present_name = true && this.isSetName();boolean that_present_name = true && that.isSetName();if (this_present_name || that_present_name) {if (!(this_present_name && that_present_name))return false;if (!this.name.equals(that.name))return false;}boolean this_present_value = true && this.isSetValue();boolean that_present_value = true && that.isSetValue();if (this_present_value || that_present_value) {if (!(this_present_value && that_present_value))return false;if (!this.value.equals(that.value))return false;}return true;}@Overridepublic int hashCode() {return 0;}public int compareTo(BluedartAttributes other) {if (!getClass().equals(other.getClass())) {return getClass().getName().compareTo(other.getClass().getName());}int lastComparison = 0;BluedartAttributes typedOther = (BluedartAttributes)other;lastComparison = Boolean.valueOf(isSetLogisticsTransactionId()).compareTo(typedOther.isSetLogisticsTransactionId());if (lastComparison != 0) {return lastComparison;}if (isSetLogisticsTransactionId()) {lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.logisticsTransactionId, typedOther.logisticsTransactionId);if (lastComparison != 0) {return lastComparison;}}lastComparison = Boolean.valueOf(isSetName()).compareTo(typedOther.isSetName());if (lastComparison != 0) {return lastComparison;}if (isSetName()) {lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, typedOther.name);if (lastComparison != 0) {return lastComparison;}}lastComparison = Boolean.valueOf(isSetValue()).compareTo(typedOther.isSetValue());if (lastComparison != 0) {return lastComparison;}if (isSetValue()) {lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.value, typedOther.value);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: // LOGISTICS_TRANSACTION_IDif (field.type == org.apache.thrift.protocol.TType.STRING) {this.logisticsTransactionId = iprot.readString();} else {org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);}break;case 2: // NAMEif (field.type == org.apache.thrift.protocol.TType.STRING) {this.name = iprot.readString();} else {org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);}break;case 3: // VALUEif (field.type == org.apache.thrift.protocol.TType.STRING) {this.value = 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.logisticsTransactionId != null) {oprot.writeFieldBegin(LOGISTICS_TRANSACTION_ID_FIELD_DESC);oprot.writeString(this.logisticsTransactionId);oprot.writeFieldEnd();}if (this.name != null) {oprot.writeFieldBegin(NAME_FIELD_DESC);oprot.writeString(this.name);oprot.writeFieldEnd();}if (this.value != null) {oprot.writeFieldBegin(VALUE_FIELD_DESC);oprot.writeString(this.value);oprot.writeFieldEnd();}oprot.writeFieldStop();oprot.writeStructEnd();}@Overridepublic String toString() {StringBuilder sb = new StringBuilder("BluedartAttributes(");boolean first = true;sb.append("logisticsTransactionId:");if (this.logisticsTransactionId == null) {sb.append("null");} else {sb.append(this.logisticsTransactionId);}first = false;if (!first) sb.append(", ");sb.append("name:");if (this.name == null) {sb.append("null");} else {sb.append(this.name);}first = false;if (!first) sb.append(", ");sb.append("value:");if (this.value == null) {sb.append("null");} else {sb.append(this.value);}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);}}}