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 ItemLocationAvailability implements org.apache.thrift.TBase<ItemLocationAvailability, ItemLocationAvailability._Fields>, java.io.Serializable, Cloneable {private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ItemLocationAvailability");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 LOCATION_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("locationId", org.apache.thrift.protocol.TType.I64, (short)2);private static final org.apache.thrift.protocol.TField PHYSICAL_QTY_FIELD_DESC = new org.apache.thrift.protocol.TField("physicalQty", org.apache.thrift.protocol.TType.I64, (short)3);private static final org.apache.thrift.protocol.TField VIRTUAL_QTY_FIELD_DESC = new org.apache.thrift.protocol.TField("virtualQty", org.apache.thrift.protocol.TType.I64, (short)4);private static final org.apache.thrift.protocol.TField MIN_TRANSFER_DELAY_FIELD_DESC = new org.apache.thrift.protocol.TField("minTransferDelay", org.apache.thrift.protocol.TType.I64, (short)5);private static final org.apache.thrift.protocol.TField MAX_TRANSFER_DELAY_FIELD_DESC = new org.apache.thrift.protocol.TField("maxTransferDelay", org.apache.thrift.protocol.TType.I64, (short)6);private long itemId; // requiredprivate long locationId; // requiredprivate long physicalQty; // requiredprivate long virtualQty; // requiredprivate long minTransferDelay; // requiredprivate long maxTransferDelay; // 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"),LOCATION_ID((short)2, "locationId"),PHYSICAL_QTY((short)3, "physicalQty"),VIRTUAL_QTY((short)4, "virtualQty"),MIN_TRANSFER_DELAY((short)5, "minTransferDelay"),MAX_TRANSFER_DELAY((short)6, "maxTransferDelay");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: // LOCATION_IDreturn LOCATION_ID;case 3: // PHYSICAL_QTYreturn PHYSICAL_QTY;case 4: // VIRTUAL_QTYreturn VIRTUAL_QTY;case 5: // MIN_TRANSFER_DELAYreturn MIN_TRANSFER_DELAY;case 6: // MAX_TRANSFER_DELAYreturn MAX_TRANSFER_DELAY;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 __LOCATIONID_ISSET_ID = 1;private static final int __PHYSICALQTY_ISSET_ID = 2;private static final int __VIRTUALQTY_ISSET_ID = 3;private static final int __MINTRANSFERDELAY_ISSET_ID = 4;private static final int __MAXTRANSFERDELAY_ISSET_ID = 5;private BitSet __isset_bit_vector = new BitSet(6);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.LOCATION_ID, new org.apache.thrift.meta_data.FieldMetaData("locationId", org.apache.thrift.TFieldRequirementType.DEFAULT,new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));tmpMap.put(_Fields.PHYSICAL_QTY, new org.apache.thrift.meta_data.FieldMetaData("physicalQty", org.apache.thrift.TFieldRequirementType.DEFAULT,new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));tmpMap.put(_Fields.VIRTUAL_QTY, new org.apache.thrift.meta_data.FieldMetaData("virtualQty", org.apache.thrift.TFieldRequirementType.DEFAULT,new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));tmpMap.put(_Fields.MIN_TRANSFER_DELAY, new org.apache.thrift.meta_data.FieldMetaData("minTransferDelay", org.apache.thrift.TFieldRequirementType.DEFAULT,new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));tmpMap.put(_Fields.MAX_TRANSFER_DELAY, new org.apache.thrift.meta_data.FieldMetaData("maxTransferDelay", org.apache.thrift.TFieldRequirementType.DEFAULT,new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));metaDataMap = Collections.unmodifiableMap(tmpMap);org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ItemLocationAvailability.class, metaDataMap);}public ItemLocationAvailability() {}public ItemLocationAvailability(long itemId,long locationId,long physicalQty,long virtualQty,long minTransferDelay,long maxTransferDelay){this();this.itemId = itemId;setItemIdIsSet(true);this.locationId = locationId;setLocationIdIsSet(true);this.physicalQty = physicalQty;setPhysicalQtyIsSet(true);this.virtualQty = virtualQty;setVirtualQtyIsSet(true);this.minTransferDelay = minTransferDelay;setMinTransferDelayIsSet(true);this.maxTransferDelay = maxTransferDelay;setMaxTransferDelayIsSet(true);}/*** Performs a deep copy on <i>other</i>.*/public ItemLocationAvailability(ItemLocationAvailability other) {__isset_bit_vector.clear();__isset_bit_vector.or(other.__isset_bit_vector);this.itemId = other.itemId;this.locationId = other.locationId;this.physicalQty = other.physicalQty;this.virtualQty = other.virtualQty;this.minTransferDelay = other.minTransferDelay;this.maxTransferDelay = other.maxTransferDelay;}public ItemLocationAvailability deepCopy() {return new ItemLocationAvailability(this);}@Overridepublic void clear() {setItemIdIsSet(false);this.itemId = 0;setLocationIdIsSet(false);this.locationId = 0;setPhysicalQtyIsSet(false);this.physicalQty = 0;setVirtualQtyIsSet(false);this.virtualQty = 0;setMinTransferDelayIsSet(false);this.minTransferDelay = 0;setMaxTransferDelayIsSet(false);this.maxTransferDelay = 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 getLocationId() {return this.locationId;}public void setLocationId(long locationId) {this.locationId = locationId;setLocationIdIsSet(true);}public void unsetLocationId() {__isset_bit_vector.clear(__LOCATIONID_ISSET_ID);}/** Returns true if field locationId is set (has been assigned a value) and false otherwise */public boolean isSetLocationId() {return __isset_bit_vector.get(__LOCATIONID_ISSET_ID);}public void setLocationIdIsSet(boolean value) {__isset_bit_vector.set(__LOCATIONID_ISSET_ID, value);}public long getPhysicalQty() {return this.physicalQty;}public void setPhysicalQty(long physicalQty) {this.physicalQty = physicalQty;setPhysicalQtyIsSet(true);}public void unsetPhysicalQty() {__isset_bit_vector.clear(__PHYSICALQTY_ISSET_ID);}/** Returns true if field physicalQty is set (has been assigned a value) and false otherwise */public boolean isSetPhysicalQty() {return __isset_bit_vector.get(__PHYSICALQTY_ISSET_ID);}public void setPhysicalQtyIsSet(boolean value) {__isset_bit_vector.set(__PHYSICALQTY_ISSET_ID, value);}public long getVirtualQty() {return this.virtualQty;}public void setVirtualQty(long virtualQty) {this.virtualQty = virtualQty;setVirtualQtyIsSet(true);}public void unsetVirtualQty() {__isset_bit_vector.clear(__VIRTUALQTY_ISSET_ID);}/** Returns true if field virtualQty is set (has been assigned a value) and false otherwise */public boolean isSetVirtualQty() {return __isset_bit_vector.get(__VIRTUALQTY_ISSET_ID);}public void setVirtualQtyIsSet(boolean value) {__isset_bit_vector.set(__VIRTUALQTY_ISSET_ID, value);}public long getMinTransferDelay() {return this.minTransferDelay;}public void setMinTransferDelay(long minTransferDelay) {this.minTransferDelay = minTransferDelay;setMinTransferDelayIsSet(true);}public void unsetMinTransferDelay() {__isset_bit_vector.clear(__MINTRANSFERDELAY_ISSET_ID);}/** Returns true if field minTransferDelay is set (has been assigned a value) and false otherwise */public boolean isSetMinTransferDelay() {return __isset_bit_vector.get(__MINTRANSFERDELAY_ISSET_ID);}public void setMinTransferDelayIsSet(boolean value) {__isset_bit_vector.set(__MINTRANSFERDELAY_ISSET_ID, value);}public long getMaxTransferDelay() {return this.maxTransferDelay;}public void setMaxTransferDelay(long maxTransferDelay) {this.maxTransferDelay = maxTransferDelay;setMaxTransferDelayIsSet(true);}public void unsetMaxTransferDelay() {__isset_bit_vector.clear(__MAXTRANSFERDELAY_ISSET_ID);}/** Returns true if field maxTransferDelay is set (has been assigned a value) and false otherwise */public boolean isSetMaxTransferDelay() {return __isset_bit_vector.get(__MAXTRANSFERDELAY_ISSET_ID);}public void setMaxTransferDelayIsSet(boolean value) {__isset_bit_vector.set(__MAXTRANSFERDELAY_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 LOCATION_ID:if (value == null) {unsetLocationId();} else {setLocationId((Long)value);}break;case PHYSICAL_QTY:if (value == null) {unsetPhysicalQty();} else {setPhysicalQty((Long)value);}break;case VIRTUAL_QTY:if (value == null) {unsetVirtualQty();} else {setVirtualQty((Long)value);}break;case MIN_TRANSFER_DELAY:if (value == null) {unsetMinTransferDelay();} else {setMinTransferDelay((Long)value);}break;case MAX_TRANSFER_DELAY:if (value == null) {unsetMaxTransferDelay();} else {setMaxTransferDelay((Long)value);}break;}}public Object getFieldValue(_Fields field) {switch (field) {case ITEM_ID:return Long.valueOf(getItemId());case LOCATION_ID:return Long.valueOf(getLocationId());case PHYSICAL_QTY:return Long.valueOf(getPhysicalQty());case VIRTUAL_QTY:return Long.valueOf(getVirtualQty());case MIN_TRANSFER_DELAY:return Long.valueOf(getMinTransferDelay());case MAX_TRANSFER_DELAY:return Long.valueOf(getMaxTransferDelay());}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 LOCATION_ID:return isSetLocationId();case PHYSICAL_QTY:return isSetPhysicalQty();case VIRTUAL_QTY:return isSetVirtualQty();case MIN_TRANSFER_DELAY:return isSetMinTransferDelay();case MAX_TRANSFER_DELAY:return isSetMaxTransferDelay();}throw new IllegalStateException();}@Overridepublic boolean equals(Object that) {if (that == null)return false;if (that instanceof ItemLocationAvailability)return this.equals((ItemLocationAvailability)that);return false;}public boolean equals(ItemLocationAvailability 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_locationId = true;boolean that_present_locationId = true;if (this_present_locationId || that_present_locationId) {if (!(this_present_locationId && that_present_locationId))return false;if (this.locationId != that.locationId)return false;}boolean this_present_physicalQty = true;boolean that_present_physicalQty = true;if (this_present_physicalQty || that_present_physicalQty) {if (!(this_present_physicalQty && that_present_physicalQty))return false;if (this.physicalQty != that.physicalQty)return false;}boolean this_present_virtualQty = true;boolean that_present_virtualQty = true;if (this_present_virtualQty || that_present_virtualQty) {if (!(this_present_virtualQty && that_present_virtualQty))return false;if (this.virtualQty != that.virtualQty)return false;}boolean this_present_minTransferDelay = true;boolean that_present_minTransferDelay = true;if (this_present_minTransferDelay || that_present_minTransferDelay) {if (!(this_present_minTransferDelay && that_present_minTransferDelay))return false;if (this.minTransferDelay != that.minTransferDelay)return false;}boolean this_present_maxTransferDelay = true;boolean that_present_maxTransferDelay = true;if (this_present_maxTransferDelay || that_present_maxTransferDelay) {if (!(this_present_maxTransferDelay && that_present_maxTransferDelay))return false;if (this.maxTransferDelay != that.maxTransferDelay)return false;}return true;}@Overridepublic int hashCode() {return 0;}public int compareTo(ItemLocationAvailability other) {if (!getClass().equals(other.getClass())) {return getClass().getName().compareTo(other.getClass().getName());}int lastComparison = 0;ItemLocationAvailability typedOther = (ItemLocationAvailability)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(isSetLocationId()).compareTo(typedOther.isSetLocationId());if (lastComparison != 0) {return lastComparison;}if (isSetLocationId()) {lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.locationId, typedOther.locationId);if (lastComparison != 0) {return lastComparison;}}lastComparison = Boolean.valueOf(isSetPhysicalQty()).compareTo(typedOther.isSetPhysicalQty());if (lastComparison != 0) {return lastComparison;}if (isSetPhysicalQty()) {lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.physicalQty, typedOther.physicalQty);if (lastComparison != 0) {return lastComparison;}}lastComparison = Boolean.valueOf(isSetVirtualQty()).compareTo(typedOther.isSetVirtualQty());if (lastComparison != 0) {return lastComparison;}if (isSetVirtualQty()) {lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.virtualQty, typedOther.virtualQty);if (lastComparison != 0) {return lastComparison;}}lastComparison = Boolean.valueOf(isSetMinTransferDelay()).compareTo(typedOther.isSetMinTransferDelay());if (lastComparison != 0) {return lastComparison;}if (isSetMinTransferDelay()) {lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.minTransferDelay, typedOther.minTransferDelay);if (lastComparison != 0) {return lastComparison;}}lastComparison = Boolean.valueOf(isSetMaxTransferDelay()).compareTo(typedOther.isSetMaxTransferDelay());if (lastComparison != 0) {return lastComparison;}if (isSetMaxTransferDelay()) {lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.maxTransferDelay, typedOther.maxTransferDelay);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: // LOCATION_IDif (field.type == org.apache.thrift.protocol.TType.I64) {this.locationId = iprot.readI64();setLocationIdIsSet(true);} else {org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);}break;case 3: // PHYSICAL_QTYif (field.type == org.apache.thrift.protocol.TType.I64) {this.physicalQty = iprot.readI64();setPhysicalQtyIsSet(true);} else {org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);}break;case 4: // VIRTUAL_QTYif (field.type == org.apache.thrift.protocol.TType.I64) {this.virtualQty = iprot.readI64();setVirtualQtyIsSet(true);} else {org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);}break;case 5: // MIN_TRANSFER_DELAYif (field.type == org.apache.thrift.protocol.TType.I64) {this.minTransferDelay = iprot.readI64();setMinTransferDelayIsSet(true);} else {org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);}break;case 6: // MAX_TRANSFER_DELAYif (field.type == org.apache.thrift.protocol.TType.I64) {this.maxTransferDelay = iprot.readI64();setMaxTransferDelayIsSet(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(LOCATION_ID_FIELD_DESC);oprot.writeI64(this.locationId);oprot.writeFieldEnd();oprot.writeFieldBegin(PHYSICAL_QTY_FIELD_DESC);oprot.writeI64(this.physicalQty);oprot.writeFieldEnd();oprot.writeFieldBegin(VIRTUAL_QTY_FIELD_DESC);oprot.writeI64(this.virtualQty);oprot.writeFieldEnd();oprot.writeFieldBegin(MIN_TRANSFER_DELAY_FIELD_DESC);oprot.writeI64(this.minTransferDelay);oprot.writeFieldEnd();oprot.writeFieldBegin(MAX_TRANSFER_DELAY_FIELD_DESC);oprot.writeI64(this.maxTransferDelay);oprot.writeFieldEnd();oprot.writeFieldStop();oprot.writeStructEnd();}@Overridepublic String toString() {StringBuilder sb = new StringBuilder("ItemLocationAvailability(");boolean first = true;sb.append("itemId:");sb.append(this.itemId);first = false;if (!first) sb.append(", ");sb.append("locationId:");sb.append(this.locationId);first = false;if (!first) sb.append(", ");sb.append("physicalQty:");sb.append(this.physicalQty);first = false;if (!first) sb.append(", ");sb.append("virtualQty:");sb.append(this.virtualQty);first = false;if (!first) sb.append(", ");sb.append("minTransferDelay:");sb.append(this.minTransferDelay);first = false;if (!first) sb.append(", ");sb.append("maxTransferDelay:");sb.append(this.maxTransferDelay);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);}}}