Rev 7393 | 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.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 StoreOrderDetail implements org.apache.thrift.TBase<StoreOrderDetail, StoreOrderDetail._Fields>, java.io.Serializable, Cloneable {private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("StoreOrderDetail");private static final org.apache.thrift.protocol.TField ORDER_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("orderId", org.apache.thrift.protocol.TType.I64, (short)1);private static final org.apache.thrift.protocol.TField STORE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("storeId", org.apache.thrift.protocol.TType.I64, (short)2);private static final org.apache.thrift.protocol.TField ADVANCE_AMOUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("advanceAmount", org.apache.thrift.protocol.TType.DOUBLE, (short)3);private static final org.apache.thrift.protocol.TField CASH_AMOUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("cashAmount", org.apache.thrift.protocol.TType.DOUBLE, (short)4);private static final org.apache.thrift.protocol.TField CARD_AMOUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("cardAmount", org.apache.thrift.protocol.TType.DOUBLE, (short)5);private static final org.apache.thrift.protocol.TField PAY_STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("payStatus", org.apache.thrift.protocol.TType.I32, (short)6);private long orderId; // requiredprivate long storeId; // requiredprivate double advanceAmount; // requiredprivate double cashAmount; // requiredprivate double cardAmount; // requiredprivate StorePaymentStatus payStatus; // 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 {ORDER_ID((short)1, "orderId"),STORE_ID((short)2, "storeId"),ADVANCE_AMOUNT((short)3, "advanceAmount"),CASH_AMOUNT((short)4, "cashAmount"),CARD_AMOUNT((short)5, "cardAmount"),/**** @see StorePaymentStatus*/PAY_STATUS((short)6, "payStatus");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: // ORDER_IDreturn ORDER_ID;case 2: // STORE_IDreturn STORE_ID;case 3: // ADVANCE_AMOUNTreturn ADVANCE_AMOUNT;case 4: // CASH_AMOUNTreturn CASH_AMOUNT;case 5: // CARD_AMOUNTreturn CARD_AMOUNT;case 6: // PAY_STATUSreturn PAY_STATUS;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 __ORDERID_ISSET_ID = 0;private static final int __STOREID_ISSET_ID = 1;private static final int __ADVANCEAMOUNT_ISSET_ID = 2;private static final int __CASHAMOUNT_ISSET_ID = 3;private static final int __CARDAMOUNT_ISSET_ID = 4;private BitSet __isset_bit_vector = new BitSet(5);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.ORDER_ID, new org.apache.thrift.meta_data.FieldMetaData("orderId", org.apache.thrift.TFieldRequirementType.DEFAULT,new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));tmpMap.put(_Fields.STORE_ID, new org.apache.thrift.meta_data.FieldMetaData("storeId", org.apache.thrift.TFieldRequirementType.DEFAULT,new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));tmpMap.put(_Fields.ADVANCE_AMOUNT, new org.apache.thrift.meta_data.FieldMetaData("advanceAmount", org.apache.thrift.TFieldRequirementType.DEFAULT,new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));tmpMap.put(_Fields.CASH_AMOUNT, new org.apache.thrift.meta_data.FieldMetaData("cashAmount", org.apache.thrift.TFieldRequirementType.DEFAULT,new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));tmpMap.put(_Fields.CARD_AMOUNT, new org.apache.thrift.meta_data.FieldMetaData("cardAmount", org.apache.thrift.TFieldRequirementType.DEFAULT,new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));tmpMap.put(_Fields.PAY_STATUS, new org.apache.thrift.meta_data.FieldMetaData("payStatus", org.apache.thrift.TFieldRequirementType.DEFAULT,new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, StorePaymentStatus.class)));metaDataMap = Collections.unmodifiableMap(tmpMap);org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(StoreOrderDetail.class, metaDataMap);}public StoreOrderDetail() {}public StoreOrderDetail(long orderId,long storeId,double advanceAmount,double cashAmount,double cardAmount,StorePaymentStatus payStatus){this();this.orderId = orderId;setOrderIdIsSet(true);this.storeId = storeId;setStoreIdIsSet(true);this.advanceAmount = advanceAmount;setAdvanceAmountIsSet(true);this.cashAmount = cashAmount;setCashAmountIsSet(true);this.cardAmount = cardAmount;setCardAmountIsSet(true);this.payStatus = payStatus;}/*** Performs a deep copy on <i>other</i>.*/public StoreOrderDetail(StoreOrderDetail other) {__isset_bit_vector.clear();__isset_bit_vector.or(other.__isset_bit_vector);this.orderId = other.orderId;this.storeId = other.storeId;this.advanceAmount = other.advanceAmount;this.cashAmount = other.cashAmount;this.cardAmount = other.cardAmount;if (other.isSetPayStatus()) {this.payStatus = other.payStatus;}}public StoreOrderDetail deepCopy() {return new StoreOrderDetail(this);}@Overridepublic void clear() {setOrderIdIsSet(false);this.orderId = 0;setStoreIdIsSet(false);this.storeId = 0;setAdvanceAmountIsSet(false);this.advanceAmount = 0.0;setCashAmountIsSet(false);this.cashAmount = 0.0;setCardAmountIsSet(false);this.cardAmount = 0.0;this.payStatus = null;}public long getOrderId() {return this.orderId;}public void setOrderId(long orderId) {this.orderId = orderId;setOrderIdIsSet(true);}public void unsetOrderId() {__isset_bit_vector.clear(__ORDERID_ISSET_ID);}/** Returns true if field orderId is set (has been assigned a value) and false otherwise */public boolean isSetOrderId() {return __isset_bit_vector.get(__ORDERID_ISSET_ID);}public void setOrderIdIsSet(boolean value) {__isset_bit_vector.set(__ORDERID_ISSET_ID, value);}public long getStoreId() {return this.storeId;}public void setStoreId(long storeId) {this.storeId = storeId;setStoreIdIsSet(true);}public void unsetStoreId() {__isset_bit_vector.clear(__STOREID_ISSET_ID);}/** Returns true if field storeId is set (has been assigned a value) and false otherwise */public boolean isSetStoreId() {return __isset_bit_vector.get(__STOREID_ISSET_ID);}public void setStoreIdIsSet(boolean value) {__isset_bit_vector.set(__STOREID_ISSET_ID, value);}public double getAdvanceAmount() {return this.advanceAmount;}public void setAdvanceAmount(double advanceAmount) {this.advanceAmount = advanceAmount;setAdvanceAmountIsSet(true);}public void unsetAdvanceAmount() {__isset_bit_vector.clear(__ADVANCEAMOUNT_ISSET_ID);}/** Returns true if field advanceAmount is set (has been assigned a value) and false otherwise */public boolean isSetAdvanceAmount() {return __isset_bit_vector.get(__ADVANCEAMOUNT_ISSET_ID);}public void setAdvanceAmountIsSet(boolean value) {__isset_bit_vector.set(__ADVANCEAMOUNT_ISSET_ID, value);}public double getCashAmount() {return this.cashAmount;}public void setCashAmount(double cashAmount) {this.cashAmount = cashAmount;setCashAmountIsSet(true);}public void unsetCashAmount() {__isset_bit_vector.clear(__CASHAMOUNT_ISSET_ID);}/** Returns true if field cashAmount is set (has been assigned a value) and false otherwise */public boolean isSetCashAmount() {return __isset_bit_vector.get(__CASHAMOUNT_ISSET_ID);}public void setCashAmountIsSet(boolean value) {__isset_bit_vector.set(__CASHAMOUNT_ISSET_ID, value);}public double getCardAmount() {return this.cardAmount;}public void setCardAmount(double cardAmount) {this.cardAmount = cardAmount;setCardAmountIsSet(true);}public void unsetCardAmount() {__isset_bit_vector.clear(__CARDAMOUNT_ISSET_ID);}/** Returns true if field cardAmount is set (has been assigned a value) and false otherwise */public boolean isSetCardAmount() {return __isset_bit_vector.get(__CARDAMOUNT_ISSET_ID);}public void setCardAmountIsSet(boolean value) {__isset_bit_vector.set(__CARDAMOUNT_ISSET_ID, value);}/**** @see StorePaymentStatus*/public StorePaymentStatus getPayStatus() {return this.payStatus;}/**** @see StorePaymentStatus*/public void setPayStatus(StorePaymentStatus payStatus) {this.payStatus = payStatus;}public void unsetPayStatus() {this.payStatus = null;}/** Returns true if field payStatus is set (has been assigned a value) and false otherwise */public boolean isSetPayStatus() {return this.payStatus != null;}public void setPayStatusIsSet(boolean value) {if (!value) {this.payStatus = null;}}public void setFieldValue(_Fields field, Object value) {switch (field) {case ORDER_ID:if (value == null) {unsetOrderId();} else {setOrderId((Long)value);}break;case STORE_ID:if (value == null) {unsetStoreId();} else {setStoreId((Long)value);}break;case ADVANCE_AMOUNT:if (value == null) {unsetAdvanceAmount();} else {setAdvanceAmount((Double)value);}break;case CASH_AMOUNT:if (value == null) {unsetCashAmount();} else {setCashAmount((Double)value);}break;case CARD_AMOUNT:if (value == null) {unsetCardAmount();} else {setCardAmount((Double)value);}break;case PAY_STATUS:if (value == null) {unsetPayStatus();} else {setPayStatus((StorePaymentStatus)value);}break;}}public Object getFieldValue(_Fields field) {switch (field) {case ORDER_ID:return Long.valueOf(getOrderId());case STORE_ID:return Long.valueOf(getStoreId());case ADVANCE_AMOUNT:return Double.valueOf(getAdvanceAmount());case CASH_AMOUNT:return Double.valueOf(getCashAmount());case CARD_AMOUNT:return Double.valueOf(getCardAmount());case PAY_STATUS:return getPayStatus();}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 ORDER_ID:return isSetOrderId();case STORE_ID:return isSetStoreId();case ADVANCE_AMOUNT:return isSetAdvanceAmount();case CASH_AMOUNT:return isSetCashAmount();case CARD_AMOUNT:return isSetCardAmount();case PAY_STATUS:return isSetPayStatus();}throw new IllegalStateException();}@Overridepublic boolean equals(Object that) {if (that == null)return false;if (that instanceof StoreOrderDetail)return this.equals((StoreOrderDetail)that);return false;}public boolean equals(StoreOrderDetail that) {if (that == null)return false;boolean this_present_orderId = true;boolean that_present_orderId = true;if (this_present_orderId || that_present_orderId) {if (!(this_present_orderId && that_present_orderId))return false;if (this.orderId != that.orderId)return false;}boolean this_present_storeId = true;boolean that_present_storeId = true;if (this_present_storeId || that_present_storeId) {if (!(this_present_storeId && that_present_storeId))return false;if (this.storeId != that.storeId)return false;}boolean this_present_advanceAmount = true;boolean that_present_advanceAmount = true;if (this_present_advanceAmount || that_present_advanceAmount) {if (!(this_present_advanceAmount && that_present_advanceAmount))return false;if (this.advanceAmount != that.advanceAmount)return false;}boolean this_present_cashAmount = true;boolean that_present_cashAmount = true;if (this_present_cashAmount || that_present_cashAmount) {if (!(this_present_cashAmount && that_present_cashAmount))return false;if (this.cashAmount != that.cashAmount)return false;}boolean this_present_cardAmount = true;boolean that_present_cardAmount = true;if (this_present_cardAmount || that_present_cardAmount) {if (!(this_present_cardAmount && that_present_cardAmount))return false;if (this.cardAmount != that.cardAmount)return false;}boolean this_present_payStatus = true && this.isSetPayStatus();boolean that_present_payStatus = true && that.isSetPayStatus();if (this_present_payStatus || that_present_payStatus) {if (!(this_present_payStatus && that_present_payStatus))return false;if (!this.payStatus.equals(that.payStatus))return false;}return true;}@Overridepublic int hashCode() {return 0;}public int compareTo(StoreOrderDetail other) {if (!getClass().equals(other.getClass())) {return getClass().getName().compareTo(other.getClass().getName());}int lastComparison = 0;StoreOrderDetail typedOther = (StoreOrderDetail)other;lastComparison = Boolean.valueOf(isSetOrderId()).compareTo(typedOther.isSetOrderId());if (lastComparison != 0) {return lastComparison;}if (isSetOrderId()) {lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.orderId, typedOther.orderId);if (lastComparison != 0) {return lastComparison;}}lastComparison = Boolean.valueOf(isSetStoreId()).compareTo(typedOther.isSetStoreId());if (lastComparison != 0) {return lastComparison;}if (isSetStoreId()) {lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.storeId, typedOther.storeId);if (lastComparison != 0) {return lastComparison;}}lastComparison = Boolean.valueOf(isSetAdvanceAmount()).compareTo(typedOther.isSetAdvanceAmount());if (lastComparison != 0) {return lastComparison;}if (isSetAdvanceAmount()) {lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.advanceAmount, typedOther.advanceAmount);if (lastComparison != 0) {return lastComparison;}}lastComparison = Boolean.valueOf(isSetCashAmount()).compareTo(typedOther.isSetCashAmount());if (lastComparison != 0) {return lastComparison;}if (isSetCashAmount()) {lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cashAmount, typedOther.cashAmount);if (lastComparison != 0) {return lastComparison;}}lastComparison = Boolean.valueOf(isSetCardAmount()).compareTo(typedOther.isSetCardAmount());if (lastComparison != 0) {return lastComparison;}if (isSetCardAmount()) {lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cardAmount, typedOther.cardAmount);if (lastComparison != 0) {return lastComparison;}}lastComparison = Boolean.valueOf(isSetPayStatus()).compareTo(typedOther.isSetPayStatus());if (lastComparison != 0) {return lastComparison;}if (isSetPayStatus()) {lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.payStatus, typedOther.payStatus);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: // ORDER_IDif (field.type == org.apache.thrift.protocol.TType.I64) {this.orderId = iprot.readI64();setOrderIdIsSet(true);} else {org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);}break;case 2: // STORE_IDif (field.type == org.apache.thrift.protocol.TType.I64) {this.storeId = iprot.readI64();setStoreIdIsSet(true);} else {org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);}break;case 3: // ADVANCE_AMOUNTif (field.type == org.apache.thrift.protocol.TType.DOUBLE) {this.advanceAmount = iprot.readDouble();setAdvanceAmountIsSet(true);} else {org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);}break;case 4: // CASH_AMOUNTif (field.type == org.apache.thrift.protocol.TType.DOUBLE) {this.cashAmount = iprot.readDouble();setCashAmountIsSet(true);} else {org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);}break;case 5: // CARD_AMOUNTif (field.type == org.apache.thrift.protocol.TType.DOUBLE) {this.cardAmount = iprot.readDouble();setCardAmountIsSet(true);} else {org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);}break;case 6: // PAY_STATUSif (field.type == org.apache.thrift.protocol.TType.I32) {this.payStatus = StorePaymentStatus.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);oprot.writeFieldBegin(ORDER_ID_FIELD_DESC);oprot.writeI64(this.orderId);oprot.writeFieldEnd();oprot.writeFieldBegin(STORE_ID_FIELD_DESC);oprot.writeI64(this.storeId);oprot.writeFieldEnd();oprot.writeFieldBegin(ADVANCE_AMOUNT_FIELD_DESC);oprot.writeDouble(this.advanceAmount);oprot.writeFieldEnd();oprot.writeFieldBegin(CASH_AMOUNT_FIELD_DESC);oprot.writeDouble(this.cashAmount);oprot.writeFieldEnd();oprot.writeFieldBegin(CARD_AMOUNT_FIELD_DESC);oprot.writeDouble(this.cardAmount);oprot.writeFieldEnd();if (this.payStatus != null) {oprot.writeFieldBegin(PAY_STATUS_FIELD_DESC);oprot.writeI32(this.payStatus.getValue());oprot.writeFieldEnd();}oprot.writeFieldStop();oprot.writeStructEnd();}@Overridepublic String toString() {StringBuilder sb = new StringBuilder("StoreOrderDetail(");boolean first = true;sb.append("orderId:");sb.append(this.orderId);first = false;if (!first) sb.append(", ");sb.append("storeId:");sb.append(this.storeId);first = false;if (!first) sb.append(", ");sb.append("advanceAmount:");sb.append(this.advanceAmount);first = false;if (!first) sb.append(", ");sb.append("cashAmount:");sb.append(this.cashAmount);first = false;if (!first) sb.append(", ");sb.append("cardAmount:");sb.append(this.cardAmount);first = false;if (!first) sb.append(", ");sb.append("payStatus:");if (this.payStatus == null) {sb.append("null");} else {sb.append(this.payStatus);}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);}}}