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.inventory;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 StockWeightedNlcInfo implements org.apache.thrift.TBase<StockWeightedNlcInfo, StockWeightedNlcInfo._Fields>, java.io.Serializable, Cloneable {private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("StockWeightedNlcInfo");private static final org.apache.thrift.protocol.TField ITEM_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("itemId", org.apache.thrift.protocol.TType.I64, (short)1);private static final org.apache.thrift.protocol.TField SOURCE_FIELD_DESC = new org.apache.thrift.protocol.TField("source", org.apache.thrift.protocol.TType.I64, (short)2);private static final org.apache.thrift.protocol.TField UPDATED_TIMESTAMP_FIELD_DESC = new org.apache.thrift.protocol.TField("updatedTimestamp", org.apache.thrift.protocol.TType.I64, (short)3);private static final org.apache.thrift.protocol.TField STOCK_QUANTITY_FIELD_DESC = new org.apache.thrift.protocol.TField("stockQuantity", org.apache.thrift.protocol.TType.I64, (short)4);private static final org.apache.thrift.protocol.TField GRN_DETAIL_FIELD_DESC = new org.apache.thrift.protocol.TField("grnDetail", org.apache.thrift.protocol.TType.STRING, (short)5);private static final org.apache.thrift.protocol.TField AVG_WEIGHTED_NLC_FIELD_DESC = new org.apache.thrift.protocol.TField("avgWeightedNlc", org.apache.thrift.protocol.TType.DOUBLE, (short)6);private long itemId; // requiredprivate long source; // requiredprivate long updatedTimestamp; // requiredprivate long stockQuantity; // requiredprivate String grnDetail; // requiredprivate double avgWeightedNlc; // 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 {ITEM_ID((short)1, "itemId"),SOURCE((short)2, "source"),UPDATED_TIMESTAMP((short)3, "updatedTimestamp"),STOCK_QUANTITY((short)4, "stockQuantity"),GRN_DETAIL((short)5, "grnDetail"),AVG_WEIGHTED_NLC((short)6, "avgWeightedNlc");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: // ITEM_IDreturn ITEM_ID;case 2: // SOURCEreturn SOURCE;case 3: // UPDATED_TIMESTAMPreturn UPDATED_TIMESTAMP;case 4: // STOCK_QUANTITYreturn STOCK_QUANTITY;case 5: // GRN_DETAILreturn GRN_DETAIL;case 6: // AVG_WEIGHTED_NLCreturn AVG_WEIGHTED_NLC;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 __ITEMID_ISSET_ID = 0;private static final int __SOURCE_ISSET_ID = 1;private static final int __UPDATEDTIMESTAMP_ISSET_ID = 2;private static final int __STOCKQUANTITY_ISSET_ID = 3;private static final int __AVGWEIGHTEDNLC_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.ITEM_ID, new org.apache.thrift.meta_data.FieldMetaData("itemId", org.apache.thrift.TFieldRequirementType.DEFAULT,new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));tmpMap.put(_Fields.SOURCE, new org.apache.thrift.meta_data.FieldMetaData("source", org.apache.thrift.TFieldRequirementType.DEFAULT,new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));tmpMap.put(_Fields.UPDATED_TIMESTAMP, new org.apache.thrift.meta_data.FieldMetaData("updatedTimestamp", org.apache.thrift.TFieldRequirementType.DEFAULT,new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));tmpMap.put(_Fields.STOCK_QUANTITY, new org.apache.thrift.meta_data.FieldMetaData("stockQuantity", org.apache.thrift.TFieldRequirementType.DEFAULT,new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));tmpMap.put(_Fields.GRN_DETAIL, new org.apache.thrift.meta_data.FieldMetaData("grnDetail", org.apache.thrift.TFieldRequirementType.DEFAULT,new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));tmpMap.put(_Fields.AVG_WEIGHTED_NLC, new org.apache.thrift.meta_data.FieldMetaData("avgWeightedNlc", org.apache.thrift.TFieldRequirementType.DEFAULT,new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));metaDataMap = Collections.unmodifiableMap(tmpMap);org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(StockWeightedNlcInfo.class, metaDataMap);}public StockWeightedNlcInfo() {}public StockWeightedNlcInfo(long itemId,long source,long updatedTimestamp,long stockQuantity,String grnDetail,double avgWeightedNlc){this();this.itemId = itemId;setItemIdIsSet(true);this.source = source;setSourceIsSet(true);this.updatedTimestamp = updatedTimestamp;setUpdatedTimestampIsSet(true);this.stockQuantity = stockQuantity;setStockQuantityIsSet(true);this.grnDetail = grnDetail;this.avgWeightedNlc = avgWeightedNlc;setAvgWeightedNlcIsSet(true);}/*** Performs a deep copy on <i>other</i>.*/public StockWeightedNlcInfo(StockWeightedNlcInfo other) {__isset_bit_vector.clear();__isset_bit_vector.or(other.__isset_bit_vector);this.itemId = other.itemId;this.source = other.source;this.updatedTimestamp = other.updatedTimestamp;this.stockQuantity = other.stockQuantity;if (other.isSetGrnDetail()) {this.grnDetail = other.grnDetail;}this.avgWeightedNlc = other.avgWeightedNlc;}public StockWeightedNlcInfo deepCopy() {return new StockWeightedNlcInfo(this);}@Overridepublic void clear() {setItemIdIsSet(false);this.itemId = 0;setSourceIsSet(false);this.source = 0;setUpdatedTimestampIsSet(false);this.updatedTimestamp = 0;setStockQuantityIsSet(false);this.stockQuantity = 0;this.grnDetail = null;setAvgWeightedNlcIsSet(false);this.avgWeightedNlc = 0.0;}public long getItemId() {return this.itemId;}public void setItemId(long itemId) {this.itemId = itemId;setItemIdIsSet(true);}public void unsetItemId() {__isset_bit_vector.clear(__ITEMID_ISSET_ID);}/** Returns true if field itemId is set (has been assigned a value) and false otherwise */public boolean isSetItemId() {return __isset_bit_vector.get(__ITEMID_ISSET_ID);}public void setItemIdIsSet(boolean value) {__isset_bit_vector.set(__ITEMID_ISSET_ID, value);}public long getSource() {return this.source;}public void setSource(long source) {this.source = source;setSourceIsSet(true);}public void unsetSource() {__isset_bit_vector.clear(__SOURCE_ISSET_ID);}/** Returns true if field source is set (has been assigned a value) and false otherwise */public boolean isSetSource() {return __isset_bit_vector.get(__SOURCE_ISSET_ID);}public void setSourceIsSet(boolean value) {__isset_bit_vector.set(__SOURCE_ISSET_ID, value);}public long getUpdatedTimestamp() {return this.updatedTimestamp;}public void setUpdatedTimestamp(long updatedTimestamp) {this.updatedTimestamp = updatedTimestamp;setUpdatedTimestampIsSet(true);}public void unsetUpdatedTimestamp() {__isset_bit_vector.clear(__UPDATEDTIMESTAMP_ISSET_ID);}/** Returns true if field updatedTimestamp is set (has been assigned a value) and false otherwise */public boolean isSetUpdatedTimestamp() {return __isset_bit_vector.get(__UPDATEDTIMESTAMP_ISSET_ID);}public void setUpdatedTimestampIsSet(boolean value) {__isset_bit_vector.set(__UPDATEDTIMESTAMP_ISSET_ID, value);}public long getStockQuantity() {return this.stockQuantity;}public void setStockQuantity(long stockQuantity) {this.stockQuantity = stockQuantity;setStockQuantityIsSet(true);}public void unsetStockQuantity() {__isset_bit_vector.clear(__STOCKQUANTITY_ISSET_ID);}/** Returns true if field stockQuantity is set (has been assigned a value) and false otherwise */public boolean isSetStockQuantity() {return __isset_bit_vector.get(__STOCKQUANTITY_ISSET_ID);}public void setStockQuantityIsSet(boolean value) {__isset_bit_vector.set(__STOCKQUANTITY_ISSET_ID, value);}public String getGrnDetail() {return this.grnDetail;}public void setGrnDetail(String grnDetail) {this.grnDetail = grnDetail;}public void unsetGrnDetail() {this.grnDetail = null;}/** Returns true if field grnDetail is set (has been assigned a value) and false otherwise */public boolean isSetGrnDetail() {return this.grnDetail != null;}public void setGrnDetailIsSet(boolean value) {if (!value) {this.grnDetail = null;}}public double getAvgWeightedNlc() {return this.avgWeightedNlc;}public void setAvgWeightedNlc(double avgWeightedNlc) {this.avgWeightedNlc = avgWeightedNlc;setAvgWeightedNlcIsSet(true);}public void unsetAvgWeightedNlc() {__isset_bit_vector.clear(__AVGWEIGHTEDNLC_ISSET_ID);}/** Returns true if field avgWeightedNlc is set (has been assigned a value) and false otherwise */public boolean isSetAvgWeightedNlc() {return __isset_bit_vector.get(__AVGWEIGHTEDNLC_ISSET_ID);}public void setAvgWeightedNlcIsSet(boolean value) {__isset_bit_vector.set(__AVGWEIGHTEDNLC_ISSET_ID, value);}public void setFieldValue(_Fields field, Object value) {switch (field) {case ITEM_ID:if (value == null) {unsetItemId();} else {setItemId((Long)value);}break;case SOURCE:if (value == null) {unsetSource();} else {setSource((Long)value);}break;case UPDATED_TIMESTAMP:if (value == null) {unsetUpdatedTimestamp();} else {setUpdatedTimestamp((Long)value);}break;case STOCK_QUANTITY:if (value == null) {unsetStockQuantity();} else {setStockQuantity((Long)value);}break;case GRN_DETAIL:if (value == null) {unsetGrnDetail();} else {setGrnDetail((String)value);}break;case AVG_WEIGHTED_NLC:if (value == null) {unsetAvgWeightedNlc();} else {setAvgWeightedNlc((Double)value);}break;}}public Object getFieldValue(_Fields field) {switch (field) {case ITEM_ID:return Long.valueOf(getItemId());case SOURCE:return Long.valueOf(getSource());case UPDATED_TIMESTAMP:return Long.valueOf(getUpdatedTimestamp());case STOCK_QUANTITY:return Long.valueOf(getStockQuantity());case GRN_DETAIL:return getGrnDetail();case AVG_WEIGHTED_NLC:return Double.valueOf(getAvgWeightedNlc());}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 ITEM_ID:return isSetItemId();case SOURCE:return isSetSource();case UPDATED_TIMESTAMP:return isSetUpdatedTimestamp();case STOCK_QUANTITY:return isSetStockQuantity();case GRN_DETAIL:return isSetGrnDetail();case AVG_WEIGHTED_NLC:return isSetAvgWeightedNlc();}throw new IllegalStateException();}@Overridepublic boolean equals(Object that) {if (that == null)return false;if (that instanceof StockWeightedNlcInfo)return this.equals((StockWeightedNlcInfo)that);return false;}public boolean equals(StockWeightedNlcInfo that) {if (that == null)return false;boolean this_present_itemId = true;boolean that_present_itemId = true;if (this_present_itemId || that_present_itemId) {if (!(this_present_itemId && that_present_itemId))return false;if (this.itemId != that.itemId)return false;}boolean this_present_source = true;boolean that_present_source = true;if (this_present_source || that_present_source) {if (!(this_present_source && that_present_source))return false;if (this.source != that.source)return false;}boolean this_present_updatedTimestamp = true;boolean that_present_updatedTimestamp = true;if (this_present_updatedTimestamp || that_present_updatedTimestamp) {if (!(this_present_updatedTimestamp && that_present_updatedTimestamp))return false;if (this.updatedTimestamp != that.updatedTimestamp)return false;}boolean this_present_stockQuantity = true;boolean that_present_stockQuantity = true;if (this_present_stockQuantity || that_present_stockQuantity) {if (!(this_present_stockQuantity && that_present_stockQuantity))return false;if (this.stockQuantity != that.stockQuantity)return false;}boolean this_present_grnDetail = true && this.isSetGrnDetail();boolean that_present_grnDetail = true && that.isSetGrnDetail();if (this_present_grnDetail || that_present_grnDetail) {if (!(this_present_grnDetail && that_present_grnDetail))return false;if (!this.grnDetail.equals(that.grnDetail))return false;}boolean this_present_avgWeightedNlc = true;boolean that_present_avgWeightedNlc = true;if (this_present_avgWeightedNlc || that_present_avgWeightedNlc) {if (!(this_present_avgWeightedNlc && that_present_avgWeightedNlc))return false;if (this.avgWeightedNlc != that.avgWeightedNlc)return false;}return true;}@Overridepublic int hashCode() {return 0;}public int compareTo(StockWeightedNlcInfo other) {if (!getClass().equals(other.getClass())) {return getClass().getName().compareTo(other.getClass().getName());}int lastComparison = 0;StockWeightedNlcInfo typedOther = (StockWeightedNlcInfo)other;lastComparison = Boolean.valueOf(isSetItemId()).compareTo(typedOther.isSetItemId());if (lastComparison != 0) {return lastComparison;}if (isSetItemId()) {lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.itemId, typedOther.itemId);if (lastComparison != 0) {return lastComparison;}}lastComparison = Boolean.valueOf(isSetSource()).compareTo(typedOther.isSetSource());if (lastComparison != 0) {return lastComparison;}if (isSetSource()) {lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.source, typedOther.source);if (lastComparison != 0) {return lastComparison;}}lastComparison = Boolean.valueOf(isSetUpdatedTimestamp()).compareTo(typedOther.isSetUpdatedTimestamp());if (lastComparison != 0) {return lastComparison;}if (isSetUpdatedTimestamp()) {lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.updatedTimestamp, typedOther.updatedTimestamp);if (lastComparison != 0) {return lastComparison;}}lastComparison = Boolean.valueOf(isSetStockQuantity()).compareTo(typedOther.isSetStockQuantity());if (lastComparison != 0) {return lastComparison;}if (isSetStockQuantity()) {lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.stockQuantity, typedOther.stockQuantity);if (lastComparison != 0) {return lastComparison;}}lastComparison = Boolean.valueOf(isSetGrnDetail()).compareTo(typedOther.isSetGrnDetail());if (lastComparison != 0) {return lastComparison;}if (isSetGrnDetail()) {lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.grnDetail, typedOther.grnDetail);if (lastComparison != 0) {return lastComparison;}}lastComparison = Boolean.valueOf(isSetAvgWeightedNlc()).compareTo(typedOther.isSetAvgWeightedNlc());if (lastComparison != 0) {return lastComparison;}if (isSetAvgWeightedNlc()) {lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.avgWeightedNlc, typedOther.avgWeightedNlc);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: // ITEM_IDif (field.type == org.apache.thrift.protocol.TType.I64) {this.itemId = iprot.readI64();setItemIdIsSet(true);} else {org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);}break;case 2: // SOURCEif (field.type == org.apache.thrift.protocol.TType.I64) {this.source = iprot.readI64();setSourceIsSet(true);} else {org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);}break;case 3: // UPDATED_TIMESTAMPif (field.type == org.apache.thrift.protocol.TType.I64) {this.updatedTimestamp = iprot.readI64();setUpdatedTimestampIsSet(true);} else {org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);}break;case 4: // STOCK_QUANTITYif (field.type == org.apache.thrift.protocol.TType.I64) {this.stockQuantity = iprot.readI64();setStockQuantityIsSet(true);} else {org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);}break;case 5: // GRN_DETAILif (field.type == org.apache.thrift.protocol.TType.STRING) {this.grnDetail = iprot.readString();} else {org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);}break;case 6: // AVG_WEIGHTED_NLCif (field.type == org.apache.thrift.protocol.TType.DOUBLE) {this.avgWeightedNlc = iprot.readDouble();setAvgWeightedNlcIsSet(true);} 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(ITEM_ID_FIELD_DESC);oprot.writeI64(this.itemId);oprot.writeFieldEnd();oprot.writeFieldBegin(SOURCE_FIELD_DESC);oprot.writeI64(this.source);oprot.writeFieldEnd();oprot.writeFieldBegin(UPDATED_TIMESTAMP_FIELD_DESC);oprot.writeI64(this.updatedTimestamp);oprot.writeFieldEnd();oprot.writeFieldBegin(STOCK_QUANTITY_FIELD_DESC);oprot.writeI64(this.stockQuantity);oprot.writeFieldEnd();if (this.grnDetail != null) {oprot.writeFieldBegin(GRN_DETAIL_FIELD_DESC);oprot.writeString(this.grnDetail);oprot.writeFieldEnd();}oprot.writeFieldBegin(AVG_WEIGHTED_NLC_FIELD_DESC);oprot.writeDouble(this.avgWeightedNlc);oprot.writeFieldEnd();oprot.writeFieldStop();oprot.writeStructEnd();}@Overridepublic String toString() {StringBuilder sb = new StringBuilder("StockWeightedNlcInfo(");boolean first = true;sb.append("itemId:");sb.append(this.itemId);first = false;if (!first) sb.append(", ");sb.append("source:");sb.append(this.source);first = false;if (!first) sb.append(", ");sb.append("updatedTimestamp:");sb.append(this.updatedTimestamp);first = false;if (!first) sb.append(", ");sb.append("stockQuantity:");sb.append(this.stockQuantity);first = false;if (!first) sb.append(", ");sb.append("grnDetail:");if (this.grnDetail == null) {sb.append("null");} else {sb.append(this.grnDetail);}first = false;if (!first) sb.append(", ");sb.append("avgWeightedNlc:");sb.append(this.avgWeightedNlc);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);}}}