Subversion Repositories SmartDukaan

Rev

Rev 7410 | 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.warehouse;

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 TransferLot implements org.apache.thrift.TBase<TransferLot, TransferLot._Fields>, java.io.Serializable, Cloneable {
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TransferLot");

  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 ORIGIN_WAREHOUSE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("originWarehouseId", org.apache.thrift.protocol.TType.I64, (short)2);
  private static final org.apache.thrift.protocol.TField DESTINATION_WAREHOUSE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("destinationWarehouseId", org.apache.thrift.protocol.TType.I64, (short)3);
  private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status", org.apache.thrift.protocol.TType.I32, (short)4);
  private static final org.apache.thrift.protocol.TField TRANSFER_DATE_FIELD_DESC = new org.apache.thrift.protocol.TField("transferDate", org.apache.thrift.protocol.TType.I64, (short)5);
  private static final org.apache.thrift.protocol.TField TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("type", org.apache.thrift.protocol.TType.I32, (short)6);
  private static final org.apache.thrift.protocol.TField TRANSIT_COMPLETION_REFERENCE_NUMBER_FIELD_DESC = new org.apache.thrift.protocol.TField("transitCompletionReferenceNumber", org.apache.thrift.protocol.TType.STRING, (short)7);
  private static final org.apache.thrift.protocol.TField REFERENCE_UPDATION_DATE_FIELD_DESC = new org.apache.thrift.protocol.TField("referenceUpdationDate", org.apache.thrift.protocol.TType.I64, (short)8);
  private static final org.apache.thrift.protocol.TField REMARKS_FIELD_DESC = new org.apache.thrift.protocol.TField("remarks", org.apache.thrift.protocol.TType.STRING, (short)9);
  private static final org.apache.thrift.protocol.TField SHIPMENT_REFERENCE_FIELD_DESC = new org.apache.thrift.protocol.TField("shipmentReference", org.apache.thrift.protocol.TType.I64, (short)10);

  private long id; // required
  private long originWarehouseId; // required
  private long destinationWarehouseId; // required
  private TransferLotStatus status; // required
  private long transferDate; // required
  private TransferType type; // required
  private String transitCompletionReferenceNumber; // required
  private long referenceUpdationDate; // required
  private String remarks; // required
  private long shipmentReference; // 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"),
    ORIGIN_WAREHOUSE_ID((short)2, "originWarehouseId"),
    DESTINATION_WAREHOUSE_ID((short)3, "destinationWarehouseId"),
    /**
     * 
     * @see TransferLotStatus
     */
    STATUS((short)4, "status"),
    TRANSFER_DATE((short)5, "transferDate"),
    /**
     * 
     * @see TransferType
     */
    TYPE((short)6, "type"),
    TRANSIT_COMPLETION_REFERENCE_NUMBER((short)7, "transitCompletionReferenceNumber"),
    REFERENCE_UPDATION_DATE((short)8, "referenceUpdationDate"),
    REMARKS((short)9, "remarks"),
    SHIPMENT_REFERENCE((short)10, "shipmentReference");

    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: // ID
          return ID;
        case 2: // ORIGIN_WAREHOUSE_ID
          return ORIGIN_WAREHOUSE_ID;
        case 3: // DESTINATION_WAREHOUSE_ID
          return DESTINATION_WAREHOUSE_ID;
        case 4: // STATUS
          return STATUS;
        case 5: // TRANSFER_DATE
          return TRANSFER_DATE;
        case 6: // TYPE
          return TYPE;
        case 7: // TRANSIT_COMPLETION_REFERENCE_NUMBER
          return TRANSIT_COMPLETION_REFERENCE_NUMBER;
        case 8: // REFERENCE_UPDATION_DATE
          return REFERENCE_UPDATION_DATE;
        case 9: // REMARKS
          return REMARKS;
        case 10: // SHIPMENT_REFERENCE
          return SHIPMENT_REFERENCE;
        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 assignments
  private static final int __ID_ISSET_ID = 0;
  private static final int __ORIGINWAREHOUSEID_ISSET_ID = 1;
  private static final int __DESTINATIONWAREHOUSEID_ISSET_ID = 2;
  private static final int __TRANSFERDATE_ISSET_ID = 3;
  private static final int __REFERENCEUPDATIONDATE_ISSET_ID = 4;
  private static final int __SHIPMENTREFERENCE_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.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.ORIGIN_WAREHOUSE_ID, new org.apache.thrift.meta_data.FieldMetaData("originWarehouseId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.DESTINATION_WAREHOUSE_ID, new org.apache.thrift.meta_data.FieldMetaData("destinationWarehouseId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.STATUS, new org.apache.thrift.meta_data.FieldMetaData("status", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TransferLotStatus.class)));
    tmpMap.put(_Fields.TRANSFER_DATE, new org.apache.thrift.meta_data.FieldMetaData("transferDate", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.TYPE, new org.apache.thrift.meta_data.FieldMetaData("type", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TransferType.class)));
    tmpMap.put(_Fields.TRANSIT_COMPLETION_REFERENCE_NUMBER, new org.apache.thrift.meta_data.FieldMetaData("transitCompletionReferenceNumber", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.REFERENCE_UPDATION_DATE, new org.apache.thrift.meta_data.FieldMetaData("referenceUpdationDate", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.REMARKS, new org.apache.thrift.meta_data.FieldMetaData("remarks", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.SHIPMENT_REFERENCE, new org.apache.thrift.meta_data.FieldMetaData("shipmentReference", 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(TransferLot.class, metaDataMap);
  }

  public TransferLot() {
  }

  public TransferLot(
    long id,
    long originWarehouseId,
    long destinationWarehouseId,
    TransferLotStatus status,
    long transferDate,
    TransferType type,
    String transitCompletionReferenceNumber,
    long referenceUpdationDate,
    String remarks,
    long shipmentReference)
  {
    this();
    this.id = id;
    setIdIsSet(true);
    this.originWarehouseId = originWarehouseId;
    setOriginWarehouseIdIsSet(true);
    this.destinationWarehouseId = destinationWarehouseId;
    setDestinationWarehouseIdIsSet(true);
    this.status = status;
    this.transferDate = transferDate;
    setTransferDateIsSet(true);
    this.type = type;
    this.transitCompletionReferenceNumber = transitCompletionReferenceNumber;
    this.referenceUpdationDate = referenceUpdationDate;
    setReferenceUpdationDateIsSet(true);
    this.remarks = remarks;
    this.shipmentReference = shipmentReference;
    setShipmentReferenceIsSet(true);
  }

  /**
   * Performs a deep copy on <i>other</i>.
   */
  public TransferLot(TransferLot other) {
    __isset_bit_vector.clear();
    __isset_bit_vector.or(other.__isset_bit_vector);
    this.id = other.id;
    this.originWarehouseId = other.originWarehouseId;
    this.destinationWarehouseId = other.destinationWarehouseId;
    if (other.isSetStatus()) {
      this.status = other.status;
    }
    this.transferDate = other.transferDate;
    if (other.isSetType()) {
      this.type = other.type;
    }
    if (other.isSetTransitCompletionReferenceNumber()) {
      this.transitCompletionReferenceNumber = other.transitCompletionReferenceNumber;
    }
    this.referenceUpdationDate = other.referenceUpdationDate;
    if (other.isSetRemarks()) {
      this.remarks = other.remarks;
    }
    this.shipmentReference = other.shipmentReference;
  }

  public TransferLot deepCopy() {
    return new TransferLot(this);
  }

  @Override
  public void clear() {
    setIdIsSet(false);
    this.id = 0;
    setOriginWarehouseIdIsSet(false);
    this.originWarehouseId = 0;
    setDestinationWarehouseIdIsSet(false);
    this.destinationWarehouseId = 0;
    this.status = null;
    setTransferDateIsSet(false);
    this.transferDate = 0;
    this.type = null;
    this.transitCompletionReferenceNumber = null;
    setReferenceUpdationDateIsSet(false);
    this.referenceUpdationDate = 0;
    this.remarks = null;
    setShipmentReferenceIsSet(false);
    this.shipmentReference = 0;
  }

  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 long getOriginWarehouseId() {
    return this.originWarehouseId;
  }

  public void setOriginWarehouseId(long originWarehouseId) {
    this.originWarehouseId = originWarehouseId;
    setOriginWarehouseIdIsSet(true);
  }

  public void unsetOriginWarehouseId() {
    __isset_bit_vector.clear(__ORIGINWAREHOUSEID_ISSET_ID);
  }

  /** Returns true if field originWarehouseId is set (has been assigned a value) and false otherwise */
  public boolean isSetOriginWarehouseId() {
    return __isset_bit_vector.get(__ORIGINWAREHOUSEID_ISSET_ID);
  }

  public void setOriginWarehouseIdIsSet(boolean value) {
    __isset_bit_vector.set(__ORIGINWAREHOUSEID_ISSET_ID, value);
  }

  public long getDestinationWarehouseId() {
    return this.destinationWarehouseId;
  }

  public void setDestinationWarehouseId(long destinationWarehouseId) {
    this.destinationWarehouseId = destinationWarehouseId;
    setDestinationWarehouseIdIsSet(true);
  }

  public void unsetDestinationWarehouseId() {
    __isset_bit_vector.clear(__DESTINATIONWAREHOUSEID_ISSET_ID);
  }

  /** Returns true if field destinationWarehouseId is set (has been assigned a value) and false otherwise */
  public boolean isSetDestinationWarehouseId() {
    return __isset_bit_vector.get(__DESTINATIONWAREHOUSEID_ISSET_ID);
  }

  public void setDestinationWarehouseIdIsSet(boolean value) {
    __isset_bit_vector.set(__DESTINATIONWAREHOUSEID_ISSET_ID, value);
  }

  /**
   * 
   * @see TransferLotStatus
   */
  public TransferLotStatus getStatus() {
    return this.status;
  }

  /**
   * 
   * @see TransferLotStatus
   */
  public void setStatus(TransferLotStatus status) {
    this.status = status;
  }

  public void unsetStatus() {
    this.status = null;
  }

  /** Returns true if field status is set (has been assigned a value) and false otherwise */
  public boolean isSetStatus() {
    return this.status != null;
  }

  public void setStatusIsSet(boolean value) {
    if (!value) {
      this.status = null;
    }
  }

  public long getTransferDate() {
    return this.transferDate;
  }

  public void setTransferDate(long transferDate) {
    this.transferDate = transferDate;
    setTransferDateIsSet(true);
  }

  public void unsetTransferDate() {
    __isset_bit_vector.clear(__TRANSFERDATE_ISSET_ID);
  }

  /** Returns true if field transferDate is set (has been assigned a value) and false otherwise */
  public boolean isSetTransferDate() {
    return __isset_bit_vector.get(__TRANSFERDATE_ISSET_ID);
  }

  public void setTransferDateIsSet(boolean value) {
    __isset_bit_vector.set(__TRANSFERDATE_ISSET_ID, value);
  }

  /**
   * 
   * @see TransferType
   */
  public TransferType getType() {
    return this.type;
  }

  /**
   * 
   * @see TransferType
   */
  public void setType(TransferType type) {
    this.type = type;
  }

  public void unsetType() {
    this.type = null;
  }

  /** Returns true if field type is set (has been assigned a value) and false otherwise */
  public boolean isSetType() {
    return this.type != null;
  }

  public void setTypeIsSet(boolean value) {
    if (!value) {
      this.type = null;
    }
  }

  public String getTransitCompletionReferenceNumber() {
    return this.transitCompletionReferenceNumber;
  }

  public void setTransitCompletionReferenceNumber(String transitCompletionReferenceNumber) {
    this.transitCompletionReferenceNumber = transitCompletionReferenceNumber;
  }

  public void unsetTransitCompletionReferenceNumber() {
    this.transitCompletionReferenceNumber = null;
  }

  /** Returns true if field transitCompletionReferenceNumber is set (has been assigned a value) and false otherwise */
  public boolean isSetTransitCompletionReferenceNumber() {
    return this.transitCompletionReferenceNumber != null;
  }

  public void setTransitCompletionReferenceNumberIsSet(boolean value) {
    if (!value) {
      this.transitCompletionReferenceNumber = null;
    }
  }

  public long getReferenceUpdationDate() {
    return this.referenceUpdationDate;
  }

  public void setReferenceUpdationDate(long referenceUpdationDate) {
    this.referenceUpdationDate = referenceUpdationDate;
    setReferenceUpdationDateIsSet(true);
  }

  public void unsetReferenceUpdationDate() {
    __isset_bit_vector.clear(__REFERENCEUPDATIONDATE_ISSET_ID);
  }

  /** Returns true if field referenceUpdationDate is set (has been assigned a value) and false otherwise */
  public boolean isSetReferenceUpdationDate() {
    return __isset_bit_vector.get(__REFERENCEUPDATIONDATE_ISSET_ID);
  }

  public void setReferenceUpdationDateIsSet(boolean value) {
    __isset_bit_vector.set(__REFERENCEUPDATIONDATE_ISSET_ID, value);
  }

  public String getRemarks() {
    return this.remarks;
  }

  public void setRemarks(String remarks) {
    this.remarks = remarks;
  }

  public void unsetRemarks() {
    this.remarks = null;
  }

  /** Returns true if field remarks is set (has been assigned a value) and false otherwise */
  public boolean isSetRemarks() {
    return this.remarks != null;
  }

  public void setRemarksIsSet(boolean value) {
    if (!value) {
      this.remarks = null;
    }
  }

  public long getShipmentReference() {
    return this.shipmentReference;
  }

  public void setShipmentReference(long shipmentReference) {
    this.shipmentReference = shipmentReference;
    setShipmentReferenceIsSet(true);
  }

  public void unsetShipmentReference() {
    __isset_bit_vector.clear(__SHIPMENTREFERENCE_ISSET_ID);
  }

  /** Returns true if field shipmentReference is set (has been assigned a value) and false otherwise */
  public boolean isSetShipmentReference() {
    return __isset_bit_vector.get(__SHIPMENTREFERENCE_ISSET_ID);
  }

  public void setShipmentReferenceIsSet(boolean value) {
    __isset_bit_vector.set(__SHIPMENTREFERENCE_ISSET_ID, value);
  }

  public void setFieldValue(_Fields field, Object value) {
    switch (field) {
    case ID:
      if (value == null) {
        unsetId();
      } else {
        setId((Long)value);
      }
      break;

    case ORIGIN_WAREHOUSE_ID:
      if (value == null) {
        unsetOriginWarehouseId();
      } else {
        setOriginWarehouseId((Long)value);
      }
      break;

    case DESTINATION_WAREHOUSE_ID:
      if (value == null) {
        unsetDestinationWarehouseId();
      } else {
        setDestinationWarehouseId((Long)value);
      }
      break;

    case STATUS:
      if (value == null) {
        unsetStatus();
      } else {
        setStatus((TransferLotStatus)value);
      }
      break;

    case TRANSFER_DATE:
      if (value == null) {
        unsetTransferDate();
      } else {
        setTransferDate((Long)value);
      }
      break;

    case TYPE:
      if (value == null) {
        unsetType();
      } else {
        setType((TransferType)value);
      }
      break;

    case TRANSIT_COMPLETION_REFERENCE_NUMBER:
      if (value == null) {
        unsetTransitCompletionReferenceNumber();
      } else {
        setTransitCompletionReferenceNumber((String)value);
      }
      break;

    case REFERENCE_UPDATION_DATE:
      if (value == null) {
        unsetReferenceUpdationDate();
      } else {
        setReferenceUpdationDate((Long)value);
      }
      break;

    case REMARKS:
      if (value == null) {
        unsetRemarks();
      } else {
        setRemarks((String)value);
      }
      break;

    case SHIPMENT_REFERENCE:
      if (value == null) {
        unsetShipmentReference();
      } else {
        setShipmentReference((Long)value);
      }
      break;

    }
  }

  public Object getFieldValue(_Fields field) {
    switch (field) {
    case ID:
      return Long.valueOf(getId());

    case ORIGIN_WAREHOUSE_ID:
      return Long.valueOf(getOriginWarehouseId());

    case DESTINATION_WAREHOUSE_ID:
      return Long.valueOf(getDestinationWarehouseId());

    case STATUS:
      return getStatus();

    case TRANSFER_DATE:
      return Long.valueOf(getTransferDate());

    case TYPE:
      return getType();

    case TRANSIT_COMPLETION_REFERENCE_NUMBER:
      return getTransitCompletionReferenceNumber();

    case REFERENCE_UPDATION_DATE:
      return Long.valueOf(getReferenceUpdationDate());

    case REMARKS:
      return getRemarks();

    case SHIPMENT_REFERENCE:
      return Long.valueOf(getShipmentReference());

    }
    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 ORIGIN_WAREHOUSE_ID:
      return isSetOriginWarehouseId();
    case DESTINATION_WAREHOUSE_ID:
      return isSetDestinationWarehouseId();
    case STATUS:
      return isSetStatus();
    case TRANSFER_DATE:
      return isSetTransferDate();
    case TYPE:
      return isSetType();
    case TRANSIT_COMPLETION_REFERENCE_NUMBER:
      return isSetTransitCompletionReferenceNumber();
    case REFERENCE_UPDATION_DATE:
      return isSetReferenceUpdationDate();
    case REMARKS:
      return isSetRemarks();
    case SHIPMENT_REFERENCE:
      return isSetShipmentReference();
    }
    throw new IllegalStateException();
  }

  @Override
  public boolean equals(Object that) {
    if (that == null)
      return false;
    if (that instanceof TransferLot)
      return this.equals((TransferLot)that);
    return false;
  }

  public boolean equals(TransferLot 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_originWarehouseId = true;
    boolean that_present_originWarehouseId = true;
    if (this_present_originWarehouseId || that_present_originWarehouseId) {
      if (!(this_present_originWarehouseId && that_present_originWarehouseId))
        return false;
      if (this.originWarehouseId != that.originWarehouseId)
        return false;
    }

    boolean this_present_destinationWarehouseId = true;
    boolean that_present_destinationWarehouseId = true;
    if (this_present_destinationWarehouseId || that_present_destinationWarehouseId) {
      if (!(this_present_destinationWarehouseId && that_present_destinationWarehouseId))
        return false;
      if (this.destinationWarehouseId != that.destinationWarehouseId)
        return false;
    }

    boolean this_present_status = true && this.isSetStatus();
    boolean that_present_status = true && that.isSetStatus();
    if (this_present_status || that_present_status) {
      if (!(this_present_status && that_present_status))
        return false;
      if (!this.status.equals(that.status))
        return false;
    }

    boolean this_present_transferDate = true;
    boolean that_present_transferDate = true;
    if (this_present_transferDate || that_present_transferDate) {
      if (!(this_present_transferDate && that_present_transferDate))
        return false;
      if (this.transferDate != that.transferDate)
        return false;
    }

    boolean this_present_type = true && this.isSetType();
    boolean that_present_type = true && that.isSetType();
    if (this_present_type || that_present_type) {
      if (!(this_present_type && that_present_type))
        return false;
      if (!this.type.equals(that.type))
        return false;
    }

    boolean this_present_transitCompletionReferenceNumber = true && this.isSetTransitCompletionReferenceNumber();
    boolean that_present_transitCompletionReferenceNumber = true && that.isSetTransitCompletionReferenceNumber();
    if (this_present_transitCompletionReferenceNumber || that_present_transitCompletionReferenceNumber) {
      if (!(this_present_transitCompletionReferenceNumber && that_present_transitCompletionReferenceNumber))
        return false;
      if (!this.transitCompletionReferenceNumber.equals(that.transitCompletionReferenceNumber))
        return false;
    }

    boolean this_present_referenceUpdationDate = true;
    boolean that_present_referenceUpdationDate = true;
    if (this_present_referenceUpdationDate || that_present_referenceUpdationDate) {
      if (!(this_present_referenceUpdationDate && that_present_referenceUpdationDate))
        return false;
      if (this.referenceUpdationDate != that.referenceUpdationDate)
        return false;
    }

    boolean this_present_remarks = true && this.isSetRemarks();
    boolean that_present_remarks = true && that.isSetRemarks();
    if (this_present_remarks || that_present_remarks) {
      if (!(this_present_remarks && that_present_remarks))
        return false;
      if (!this.remarks.equals(that.remarks))
        return false;
    }

    boolean this_present_shipmentReference = true;
    boolean that_present_shipmentReference = true;
    if (this_present_shipmentReference || that_present_shipmentReference) {
      if (!(this_present_shipmentReference && that_present_shipmentReference))
        return false;
      if (this.shipmentReference != that.shipmentReference)
        return false;
    }

    return true;
  }

  @Override
  public int hashCode() {
    return 0;
  }

  public int compareTo(TransferLot other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

    int lastComparison = 0;
    TransferLot typedOther = (TransferLot)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(isSetOriginWarehouseId()).compareTo(typedOther.isSetOriginWarehouseId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetOriginWarehouseId()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.originWarehouseId, typedOther.originWarehouseId);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetDestinationWarehouseId()).compareTo(typedOther.isSetDestinationWarehouseId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetDestinationWarehouseId()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.destinationWarehouseId, typedOther.destinationWarehouseId);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetStatus()).compareTo(typedOther.isSetStatus());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetStatus()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, typedOther.status);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetTransferDate()).compareTo(typedOther.isSetTransferDate());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetTransferDate()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.transferDate, typedOther.transferDate);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetType()).compareTo(typedOther.isSetType());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetType()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.type, typedOther.type);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetTransitCompletionReferenceNumber()).compareTo(typedOther.isSetTransitCompletionReferenceNumber());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetTransitCompletionReferenceNumber()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.transitCompletionReferenceNumber, typedOther.transitCompletionReferenceNumber);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetReferenceUpdationDate()).compareTo(typedOther.isSetReferenceUpdationDate());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetReferenceUpdationDate()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.referenceUpdationDate, typedOther.referenceUpdationDate);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetRemarks()).compareTo(typedOther.isSetRemarks());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetRemarks()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.remarks, typedOther.remarks);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetShipmentReference()).compareTo(typedOther.isSetShipmentReference());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetShipmentReference()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.shipmentReference, typedOther.shipmentReference);
      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: // ID
          if (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: // ORIGIN_WAREHOUSE_ID
          if (field.type == org.apache.thrift.protocol.TType.I64) {
            this.originWarehouseId = iprot.readI64();
            setOriginWarehouseIdIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 3: // DESTINATION_WAREHOUSE_ID
          if (field.type == org.apache.thrift.protocol.TType.I64) {
            this.destinationWarehouseId = iprot.readI64();
            setDestinationWarehouseIdIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 4: // STATUS
          if (field.type == org.apache.thrift.protocol.TType.I32) {
            this.status = TransferLotStatus.findByValue(iprot.readI32());
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 5: // TRANSFER_DATE
          if (field.type == org.apache.thrift.protocol.TType.I64) {
            this.transferDate = iprot.readI64();
            setTransferDateIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 6: // TYPE
          if (field.type == org.apache.thrift.protocol.TType.I32) {
            this.type = TransferType.findByValue(iprot.readI32());
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 7: // TRANSIT_COMPLETION_REFERENCE_NUMBER
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
            this.transitCompletionReferenceNumber = iprot.readString();
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 8: // REFERENCE_UPDATION_DATE
          if (field.type == org.apache.thrift.protocol.TType.I64) {
            this.referenceUpdationDate = iprot.readI64();
            setReferenceUpdationDateIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 9: // REMARKS
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
            this.remarks = iprot.readString();
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 10: // SHIPMENT_REFERENCE
          if (field.type == org.apache.thrift.protocol.TType.I64) {
            this.shipmentReference = iprot.readI64();
            setShipmentReferenceIsSet(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(ID_FIELD_DESC);
    oprot.writeI64(this.id);
    oprot.writeFieldEnd();
    oprot.writeFieldBegin(ORIGIN_WAREHOUSE_ID_FIELD_DESC);
    oprot.writeI64(this.originWarehouseId);
    oprot.writeFieldEnd();
    oprot.writeFieldBegin(DESTINATION_WAREHOUSE_ID_FIELD_DESC);
    oprot.writeI64(this.destinationWarehouseId);
    oprot.writeFieldEnd();
    if (this.status != null) {
      oprot.writeFieldBegin(STATUS_FIELD_DESC);
      oprot.writeI32(this.status.getValue());
      oprot.writeFieldEnd();
    }
    oprot.writeFieldBegin(TRANSFER_DATE_FIELD_DESC);
    oprot.writeI64(this.transferDate);
    oprot.writeFieldEnd();
    if (this.type != null) {
      oprot.writeFieldBegin(TYPE_FIELD_DESC);
      oprot.writeI32(this.type.getValue());
      oprot.writeFieldEnd();
    }
    if (this.transitCompletionReferenceNumber != null) {
      oprot.writeFieldBegin(TRANSIT_COMPLETION_REFERENCE_NUMBER_FIELD_DESC);
      oprot.writeString(this.transitCompletionReferenceNumber);
      oprot.writeFieldEnd();
    }
    oprot.writeFieldBegin(REFERENCE_UPDATION_DATE_FIELD_DESC);
    oprot.writeI64(this.referenceUpdationDate);
    oprot.writeFieldEnd();
    if (this.remarks != null) {
      oprot.writeFieldBegin(REMARKS_FIELD_DESC);
      oprot.writeString(this.remarks);
      oprot.writeFieldEnd();
    }
    oprot.writeFieldBegin(SHIPMENT_REFERENCE_FIELD_DESC);
    oprot.writeI64(this.shipmentReference);
    oprot.writeFieldEnd();
    oprot.writeFieldStop();
    oprot.writeStructEnd();
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder("TransferLot(");
    boolean first = true;

    sb.append("id:");
    sb.append(this.id);
    first = false;
    if (!first) sb.append(", ");
    sb.append("originWarehouseId:");
    sb.append(this.originWarehouseId);
    first = false;
    if (!first) sb.append(", ");
    sb.append("destinationWarehouseId:");
    sb.append(this.destinationWarehouseId);
    first = false;
    if (!first) sb.append(", ");
    sb.append("status:");
    if (this.status == null) {
      sb.append("null");
    } else {
      sb.append(this.status);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("transferDate:");
    sb.append(this.transferDate);
    first = false;
    if (!first) sb.append(", ");
    sb.append("type:");
    if (this.type == null) {
      sb.append("null");
    } else {
      sb.append(this.type);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("transitCompletionReferenceNumber:");
    if (this.transitCompletionReferenceNumber == null) {
      sb.append("null");
    } else {
      sb.append(this.transitCompletionReferenceNumber);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("referenceUpdationDate:");
    sb.append(this.referenceUpdationDate);
    first = false;
    if (!first) sb.append(", ");
    sb.append("remarks:");
    if (this.remarks == null) {
      sb.append("null");
    } else {
      sb.append(this.remarks);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("shipmentReference:");
    sb.append(this.shipmentReference);
    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);
    }
  }

}