Subversion Repositories SmartDukaan

Rev

Rev 1013 | Blame | Last modification | View Log | RSS feed

/**
 * Autogenerated by Thrift
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 */
package in.shop2020.model.v1.catalog;

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.util.Arrays;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import org.apache.thrift.*;
import org.apache.thrift.meta_data.*;
import org.apache.thrift.protocol.*;

public class Warehouse implements TBase<Warehouse._Fields>, java.io.Serializable, Cloneable, Comparable<Warehouse> {
  private static final TStruct STRUCT_DESC = new TStruct("Warehouse");

  private static final TField ID_FIELD_DESC = new TField("id", TType.I64, (short)1);
  private static final TField DISPLAY_NAME_FIELD_DESC = new TField("displayName", TType.STRING, (short)2);
  private static final TField LOCATION_FIELD_DESC = new TField("location", TType.STRING, (short)3);
  private static final TField WAREHOUSE_STATUS_FIELD_DESC = new TField("warehouseStatus", TType.I32, (short)4);
  private static final TField ADDED_ON_FIELD_DESC = new TField("addedOn", TType.I64, (short)5);
  private static final TField LAST_CHECKED_ON_FIELD_DESC = new TField("lastCheckedOn", TType.I64, (short)6);
  private static final TField TIN_NUMBER_FIELD_DESC = new TField("tinNumber", TType.STRING, (short)7);
  private static final TField PINCODE_FIELD_DESC = new TField("pincode", TType.STRING, (short)8);
  private static final TField VENDOR_STRING_FIELD_DESC = new TField("vendorString", TType.STRING, (short)9);
  private static final TField LOGISTICS_LOCATION_FIELD_DESC = new TField("logisticsLocation", TType.I32, (short)10);
  private static final TField VENDOR_FIELD_DESC = new TField("vendor", TType.STRING, (short)11);

  private long id;
  private String displayName;
  private String location;
  private status warehouseStatus;
  private long addedOn;
  private long lastCheckedOn;
  private String tinNumber;
  private String pincode;
  private String vendorString;
  private WarehouseLocation logisticsLocation;
  private String vendor;

  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
  public enum _Fields implements TFieldIdEnum {
    ID((short)1, "id"),
    DISPLAY_NAME((short)2, "displayName"),
    LOCATION((short)3, "location"),
    /**
     * 
     * @see status
     */
    WAREHOUSE_STATUS((short)4, "warehouseStatus"),
    ADDED_ON((short)5, "addedOn"),
    LAST_CHECKED_ON((short)6, "lastCheckedOn"),
    TIN_NUMBER((short)7, "tinNumber"),
    PINCODE((short)8, "pincode"),
    VENDOR_STRING((short)9, "vendorString"),
    /**
     * 
     * @see WarehouseLocation
     */
    LOGISTICS_LOCATION((short)10, "logisticsLocation"),
    VENDOR((short)11, "vendor");

    private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

    static {
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
        byId.put((int)field._thriftId, field);
        byName.put(field.getFieldName(), field);
      }
    }

    /**
     * Find the _Fields constant that matches fieldId, or null if its not found.
     */
    public static _Fields findByThriftId(int fieldId) {
      return byId.get(fieldId);
    }

    /**
     * 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 __ADDEDON_ISSET_ID = 1;
  private static final int __LASTCHECKEDON_ISSET_ID = 2;
  private BitSet __isset_bit_vector = new BitSet(3);

  public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
    put(_Fields.ID, new FieldMetaData("id", TFieldRequirementType.DEFAULT, 
        new FieldValueMetaData(TType.I64)));
    put(_Fields.DISPLAY_NAME, new FieldMetaData("displayName", TFieldRequirementType.DEFAULT, 
        new FieldValueMetaData(TType.STRING)));
    put(_Fields.LOCATION, new FieldMetaData("location", TFieldRequirementType.DEFAULT, 
        new FieldValueMetaData(TType.STRING)));
    put(_Fields.WAREHOUSE_STATUS, new FieldMetaData("warehouseStatus", TFieldRequirementType.DEFAULT, 
        new EnumMetaData(TType.ENUM, status.class)));
    put(_Fields.ADDED_ON, new FieldMetaData("addedOn", TFieldRequirementType.DEFAULT, 
        new FieldValueMetaData(TType.I64)));
    put(_Fields.LAST_CHECKED_ON, new FieldMetaData("lastCheckedOn", TFieldRequirementType.DEFAULT, 
        new FieldValueMetaData(TType.I64)));
    put(_Fields.TIN_NUMBER, new FieldMetaData("tinNumber", TFieldRequirementType.DEFAULT, 
        new FieldValueMetaData(TType.STRING)));
    put(_Fields.PINCODE, new FieldMetaData("pincode", TFieldRequirementType.DEFAULT, 
        new FieldValueMetaData(TType.STRING)));
    put(_Fields.VENDOR_STRING, new FieldMetaData("vendorString", TFieldRequirementType.DEFAULT, 
        new FieldValueMetaData(TType.STRING)));
    put(_Fields.LOGISTICS_LOCATION, new FieldMetaData("logisticsLocation", TFieldRequirementType.DEFAULT, 
        new EnumMetaData(TType.ENUM, WarehouseLocation.class)));
    put(_Fields.VENDOR, new FieldMetaData("vendor", TFieldRequirementType.DEFAULT, 
        new FieldValueMetaData(TType.STRING)));
  }});

  static {
    FieldMetaData.addStructMetaDataMap(Warehouse.class, metaDataMap);
  }

  public Warehouse() {
  }

  public Warehouse(
    long id,
    String displayName,
    String location,
    status warehouseStatus,
    long addedOn,
    long lastCheckedOn,
    String tinNumber,
    String pincode,
    String vendorString,
    WarehouseLocation logisticsLocation,
    String vendor)
  {
    this();
    this.id = id;
    setIdIsSet(true);
    this.displayName = displayName;
    this.location = location;
    this.warehouseStatus = warehouseStatus;
    this.addedOn = addedOn;
    setAddedOnIsSet(true);
    this.lastCheckedOn = lastCheckedOn;
    setLastCheckedOnIsSet(true);
    this.tinNumber = tinNumber;
    this.pincode = pincode;
    this.vendorString = vendorString;
    this.logisticsLocation = logisticsLocation;
    this.vendor = vendor;
  }

  /**
   * Performs a deep copy on <i>other</i>.
   */
  public Warehouse(Warehouse other) {
    __isset_bit_vector.clear();
    __isset_bit_vector.or(other.__isset_bit_vector);
    this.id = other.id;
    if (other.isSetDisplayName()) {
      this.displayName = other.displayName;
    }
    if (other.isSetLocation()) {
      this.location = other.location;
    }
    if (other.isSetWarehouseStatus()) {
      this.warehouseStatus = other.warehouseStatus;
    }
    this.addedOn = other.addedOn;
    this.lastCheckedOn = other.lastCheckedOn;
    if (other.isSetTinNumber()) {
      this.tinNumber = other.tinNumber;
    }
    if (other.isSetPincode()) {
      this.pincode = other.pincode;
    }
    if (other.isSetVendorString()) {
      this.vendorString = other.vendorString;
    }
    if (other.isSetLogisticsLocation()) {
      this.logisticsLocation = other.logisticsLocation;
    }
    if (other.isSetVendor()) {
      this.vendor = other.vendor;
    }
  }

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

  @Deprecated
  public Warehouse clone() {
    return new Warehouse(this);
  }

  public long getId() {
    return this.id;
  }

  public Warehouse setId(long id) {
    this.id = id;
    setIdIsSet(true);
    return this;
  }

  public void unsetId() {
    __isset_bit_vector.clear(__ID_ISSET_ID);
  }

  /** Returns true if field id is set (has been asigned 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 String getDisplayName() {
    return this.displayName;
  }

  public Warehouse setDisplayName(String displayName) {
    this.displayName = displayName;
    return this;
  }

  public void unsetDisplayName() {
    this.displayName = null;
  }

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

  public void setDisplayNameIsSet(boolean value) {
    if (!value) {
      this.displayName = null;
    }
  }

  public String getLocation() {
    return this.location;
  }

  public Warehouse setLocation(String location) {
    this.location = location;
    return this;
  }

  public void unsetLocation() {
    this.location = null;
  }

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

  public void setLocationIsSet(boolean value) {
    if (!value) {
      this.location = null;
    }
  }

  /**
   * 
   * @see status
   */
  public status getWarehouseStatus() {
    return this.warehouseStatus;
  }

  /**
   * 
   * @see status
   */
  public Warehouse setWarehouseStatus(status warehouseStatus) {
    this.warehouseStatus = warehouseStatus;
    return this;
  }

  public void unsetWarehouseStatus() {
    this.warehouseStatus = null;
  }

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

  public void setWarehouseStatusIsSet(boolean value) {
    if (!value) {
      this.warehouseStatus = null;
    }
  }

  public long getAddedOn() {
    return this.addedOn;
  }

  public Warehouse setAddedOn(long addedOn) {
    this.addedOn = addedOn;
    setAddedOnIsSet(true);
    return this;
  }

  public void unsetAddedOn() {
    __isset_bit_vector.clear(__ADDEDON_ISSET_ID);
  }

  /** Returns true if field addedOn is set (has been asigned a value) and false otherwise */
  public boolean isSetAddedOn() {
    return __isset_bit_vector.get(__ADDEDON_ISSET_ID);
  }

  public void setAddedOnIsSet(boolean value) {
    __isset_bit_vector.set(__ADDEDON_ISSET_ID, value);
  }

  public long getLastCheckedOn() {
    return this.lastCheckedOn;
  }

  public Warehouse setLastCheckedOn(long lastCheckedOn) {
    this.lastCheckedOn = lastCheckedOn;
    setLastCheckedOnIsSet(true);
    return this;
  }

  public void unsetLastCheckedOn() {
    __isset_bit_vector.clear(__LASTCHECKEDON_ISSET_ID);
  }

  /** Returns true if field lastCheckedOn is set (has been asigned a value) and false otherwise */
  public boolean isSetLastCheckedOn() {
    return __isset_bit_vector.get(__LASTCHECKEDON_ISSET_ID);
  }

  public void setLastCheckedOnIsSet(boolean value) {
    __isset_bit_vector.set(__LASTCHECKEDON_ISSET_ID, value);
  }

  public String getTinNumber() {
    return this.tinNumber;
  }

  public Warehouse setTinNumber(String tinNumber) {
    this.tinNumber = tinNumber;
    return this;
  }

  public void unsetTinNumber() {
    this.tinNumber = null;
  }

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

  public void setTinNumberIsSet(boolean value) {
    if (!value) {
      this.tinNumber = null;
    }
  }

  public String getPincode() {
    return this.pincode;
  }

  public Warehouse setPincode(String pincode) {
    this.pincode = pincode;
    return this;
  }

  public void unsetPincode() {
    this.pincode = null;
  }

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

  public void setPincodeIsSet(boolean value) {
    if (!value) {
      this.pincode = null;
    }
  }

  public String getVendorString() {
    return this.vendorString;
  }

  public Warehouse setVendorString(String vendorString) {
    this.vendorString = vendorString;
    return this;
  }

  public void unsetVendorString() {
    this.vendorString = null;
  }

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

  public void setVendorStringIsSet(boolean value) {
    if (!value) {
      this.vendorString = null;
    }
  }

  /**
   * 
   * @see WarehouseLocation
   */
  public WarehouseLocation getLogisticsLocation() {
    return this.logisticsLocation;
  }

  /**
   * 
   * @see WarehouseLocation
   */
  public Warehouse setLogisticsLocation(WarehouseLocation logisticsLocation) {
    this.logisticsLocation = logisticsLocation;
    return this;
  }

  public void unsetLogisticsLocation() {
    this.logisticsLocation = null;
  }

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

  public void setLogisticsLocationIsSet(boolean value) {
    if (!value) {
      this.logisticsLocation = null;
    }
  }

  public String getVendor() {
    return this.vendor;
  }

  public Warehouse setVendor(String vendor) {
    this.vendor = vendor;
    return this;
  }

  public void unsetVendor() {
    this.vendor = null;
  }

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

  public void setVendorIsSet(boolean value) {
    if (!value) {
      this.vendor = null;
    }
  }

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

    case DISPLAY_NAME:
      if (value == null) {
        unsetDisplayName();
      } else {
        setDisplayName((String)value);
      }
      break;

    case LOCATION:
      if (value == null) {
        unsetLocation();
      } else {
        setLocation((String)value);
      }
      break;

    case WAREHOUSE_STATUS:
      if (value == null) {
        unsetWarehouseStatus();
      } else {
        setWarehouseStatus((status)value);
      }
      break;

    case ADDED_ON:
      if (value == null) {
        unsetAddedOn();
      } else {
        setAddedOn((Long)value);
      }
      break;

    case LAST_CHECKED_ON:
      if (value == null) {
        unsetLastCheckedOn();
      } else {
        setLastCheckedOn((Long)value);
      }
      break;

    case TIN_NUMBER:
      if (value == null) {
        unsetTinNumber();
      } else {
        setTinNumber((String)value);
      }
      break;

    case PINCODE:
      if (value == null) {
        unsetPincode();
      } else {
        setPincode((String)value);
      }
      break;

    case VENDOR_STRING:
      if (value == null) {
        unsetVendorString();
      } else {
        setVendorString((String)value);
      }
      break;

    case LOGISTICS_LOCATION:
      if (value == null) {
        unsetLogisticsLocation();
      } else {
        setLogisticsLocation((WarehouseLocation)value);
      }
      break;

    case VENDOR:
      if (value == null) {
        unsetVendor();
      } else {
        setVendor((String)value);
      }
      break;

    }
  }

  public void setFieldValue(int fieldID, Object value) {
    setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
  }

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

    case DISPLAY_NAME:
      return getDisplayName();

    case LOCATION:
      return getLocation();

    case WAREHOUSE_STATUS:
      return getWarehouseStatus();

    case ADDED_ON:
      return new Long(getAddedOn());

    case LAST_CHECKED_ON:
      return new Long(getLastCheckedOn());

    case TIN_NUMBER:
      return getTinNumber();

    case PINCODE:
      return getPincode();

    case VENDOR_STRING:
      return getVendorString();

    case LOGISTICS_LOCATION:
      return getLogisticsLocation();

    case VENDOR:
      return getVendor();

    }
    throw new IllegalStateException();
  }

  public Object getFieldValue(int fieldId) {
    return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
  }

  /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
  public boolean isSet(_Fields field) {
    switch (field) {
    case ID:
      return isSetId();
    case DISPLAY_NAME:
      return isSetDisplayName();
    case LOCATION:
      return isSetLocation();
    case WAREHOUSE_STATUS:
      return isSetWarehouseStatus();
    case ADDED_ON:
      return isSetAddedOn();
    case LAST_CHECKED_ON:
      return isSetLastCheckedOn();
    case TIN_NUMBER:
      return isSetTinNumber();
    case PINCODE:
      return isSetPincode();
    case VENDOR_STRING:
      return isSetVendorString();
    case LOGISTICS_LOCATION:
      return isSetLogisticsLocation();
    case VENDOR:
      return isSetVendor();
    }
    throw new IllegalStateException();
  }

  public boolean isSet(int fieldID) {
    return isSet(_Fields.findByThriftIdOrThrow(fieldID));
  }

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

  public boolean equals(Warehouse 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_displayName = true && this.isSetDisplayName();
    boolean that_present_displayName = true && that.isSetDisplayName();
    if (this_present_displayName || that_present_displayName) {
      if (!(this_present_displayName && that_present_displayName))
        return false;
      if (!this.displayName.equals(that.displayName))
        return false;
    }

    boolean this_present_location = true && this.isSetLocation();
    boolean that_present_location = true && that.isSetLocation();
    if (this_present_location || that_present_location) {
      if (!(this_present_location && that_present_location))
        return false;
      if (!this.location.equals(that.location))
        return false;
    }

    boolean this_present_warehouseStatus = true && this.isSetWarehouseStatus();
    boolean that_present_warehouseStatus = true && that.isSetWarehouseStatus();
    if (this_present_warehouseStatus || that_present_warehouseStatus) {
      if (!(this_present_warehouseStatus && that_present_warehouseStatus))
        return false;
      if (!this.warehouseStatus.equals(that.warehouseStatus))
        return false;
    }

    boolean this_present_addedOn = true;
    boolean that_present_addedOn = true;
    if (this_present_addedOn || that_present_addedOn) {
      if (!(this_present_addedOn && that_present_addedOn))
        return false;
      if (this.addedOn != that.addedOn)
        return false;
    }

    boolean this_present_lastCheckedOn = true;
    boolean that_present_lastCheckedOn = true;
    if (this_present_lastCheckedOn || that_present_lastCheckedOn) {
      if (!(this_present_lastCheckedOn && that_present_lastCheckedOn))
        return false;
      if (this.lastCheckedOn != that.lastCheckedOn)
        return false;
    }

    boolean this_present_tinNumber = true && this.isSetTinNumber();
    boolean that_present_tinNumber = true && that.isSetTinNumber();
    if (this_present_tinNumber || that_present_tinNumber) {
      if (!(this_present_tinNumber && that_present_tinNumber))
        return false;
      if (!this.tinNumber.equals(that.tinNumber))
        return false;
    }

    boolean this_present_pincode = true && this.isSetPincode();
    boolean that_present_pincode = true && that.isSetPincode();
    if (this_present_pincode || that_present_pincode) {
      if (!(this_present_pincode && that_present_pincode))
        return false;
      if (!this.pincode.equals(that.pincode))
        return false;
    }

    boolean this_present_vendorString = true && this.isSetVendorString();
    boolean that_present_vendorString = true && that.isSetVendorString();
    if (this_present_vendorString || that_present_vendorString) {
      if (!(this_present_vendorString && that_present_vendorString))
        return false;
      if (!this.vendorString.equals(that.vendorString))
        return false;
    }

    boolean this_present_logisticsLocation = true && this.isSetLogisticsLocation();
    boolean that_present_logisticsLocation = true && that.isSetLogisticsLocation();
    if (this_present_logisticsLocation || that_present_logisticsLocation) {
      if (!(this_present_logisticsLocation && that_present_logisticsLocation))
        return false;
      if (!this.logisticsLocation.equals(that.logisticsLocation))
        return false;
    }

    boolean this_present_vendor = true && this.isSetVendor();
    boolean that_present_vendor = true && that.isSetVendor();
    if (this_present_vendor || that_present_vendor) {
      if (!(this_present_vendor && that_present_vendor))
        return false;
      if (!this.vendor.equals(that.vendor))
        return false;
    }

    return true;
  }

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

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

    int lastComparison = 0;
    Warehouse typedOther = (Warehouse)other;

    lastComparison = Boolean.valueOf(isSetId()).compareTo(isSetId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    lastComparison = TBaseHelper.compareTo(id, typedOther.id);
    if (lastComparison != 0) {
      return lastComparison;
    }
    lastComparison = Boolean.valueOf(isSetDisplayName()).compareTo(isSetDisplayName());
    if (lastComparison != 0) {
      return lastComparison;
    }
    lastComparison = TBaseHelper.compareTo(displayName, typedOther.displayName);
    if (lastComparison != 0) {
      return lastComparison;
    }
    lastComparison = Boolean.valueOf(isSetLocation()).compareTo(isSetLocation());
    if (lastComparison != 0) {
      return lastComparison;
    }
    lastComparison = TBaseHelper.compareTo(location, typedOther.location);
    if (lastComparison != 0) {
      return lastComparison;
    }
    lastComparison = Boolean.valueOf(isSetWarehouseStatus()).compareTo(isSetWarehouseStatus());
    if (lastComparison != 0) {
      return lastComparison;
    }
    lastComparison = TBaseHelper.compareTo(warehouseStatus, typedOther.warehouseStatus);
    if (lastComparison != 0) {
      return lastComparison;
    }
    lastComparison = Boolean.valueOf(isSetAddedOn()).compareTo(isSetAddedOn());
    if (lastComparison != 0) {
      return lastComparison;
    }
    lastComparison = TBaseHelper.compareTo(addedOn, typedOther.addedOn);
    if (lastComparison != 0) {
      return lastComparison;
    }
    lastComparison = Boolean.valueOf(isSetLastCheckedOn()).compareTo(isSetLastCheckedOn());
    if (lastComparison != 0) {
      return lastComparison;
    }
    lastComparison = TBaseHelper.compareTo(lastCheckedOn, typedOther.lastCheckedOn);
    if (lastComparison != 0) {
      return lastComparison;
    }
    lastComparison = Boolean.valueOf(isSetTinNumber()).compareTo(isSetTinNumber());
    if (lastComparison != 0) {
      return lastComparison;
    }
    lastComparison = TBaseHelper.compareTo(tinNumber, typedOther.tinNumber);
    if (lastComparison != 0) {
      return lastComparison;
    }
    lastComparison = Boolean.valueOf(isSetPincode()).compareTo(isSetPincode());
    if (lastComparison != 0) {
      return lastComparison;
    }
    lastComparison = TBaseHelper.compareTo(pincode, typedOther.pincode);
    if (lastComparison != 0) {
      return lastComparison;
    }
    lastComparison = Boolean.valueOf(isSetVendorString()).compareTo(isSetVendorString());
    if (lastComparison != 0) {
      return lastComparison;
    }
    lastComparison = TBaseHelper.compareTo(vendorString, typedOther.vendorString);
    if (lastComparison != 0) {
      return lastComparison;
    }
    lastComparison = Boolean.valueOf(isSetLogisticsLocation()).compareTo(isSetLogisticsLocation());
    if (lastComparison != 0) {
      return lastComparison;
    }
    lastComparison = TBaseHelper.compareTo(logisticsLocation, typedOther.logisticsLocation);
    if (lastComparison != 0) {
      return lastComparison;
    }
    lastComparison = Boolean.valueOf(isSetVendor()).compareTo(isSetVendor());
    if (lastComparison != 0) {
      return lastComparison;
    }
    lastComparison = TBaseHelper.compareTo(vendor, typedOther.vendor);
    if (lastComparison != 0) {
      return lastComparison;
    }
    return 0;
  }

  public void read(TProtocol iprot) throws TException {
    TField field;
    iprot.readStructBegin();
    while (true)
    {
      field = iprot.readFieldBegin();
      if (field.type == TType.STOP) { 
        break;
      }
      _Fields fieldId = _Fields.findByThriftId(field.id);
      if (fieldId == null) {
        TProtocolUtil.skip(iprot, field.type);
      } else {
        switch (fieldId) {
          case ID:
            if (field.type == TType.I64) {
              this.id = iprot.readI64();
              setIdIsSet(true);
            } else { 
              TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case DISPLAY_NAME:
            if (field.type == TType.STRING) {
              this.displayName = iprot.readString();
            } else { 
              TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case LOCATION:
            if (field.type == TType.STRING) {
              this.location = iprot.readString();
            } else { 
              TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case WAREHOUSE_STATUS:
            if (field.type == TType.I32) {
              this.warehouseStatus = status.findByValue(iprot.readI32());
            } else { 
              TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case ADDED_ON:
            if (field.type == TType.I64) {
              this.addedOn = iprot.readI64();
              setAddedOnIsSet(true);
            } else { 
              TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case LAST_CHECKED_ON:
            if (field.type == TType.I64) {
              this.lastCheckedOn = iprot.readI64();
              setLastCheckedOnIsSet(true);
            } else { 
              TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case TIN_NUMBER:
            if (field.type == TType.STRING) {
              this.tinNumber = iprot.readString();
            } else { 
              TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case PINCODE:
            if (field.type == TType.STRING) {
              this.pincode = iprot.readString();
            } else { 
              TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case VENDOR_STRING:
            if (field.type == TType.STRING) {
              this.vendorString = iprot.readString();
            } else { 
              TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case LOGISTICS_LOCATION:
            if (field.type == TType.I32) {
              this.logisticsLocation = WarehouseLocation.findByValue(iprot.readI32());
            } else { 
              TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case VENDOR:
            if (field.type == TType.STRING) {
              this.vendor = iprot.readString();
            } else { 
              TProtocolUtil.skip(iprot, field.type);
            }
            break;
        }
        iprot.readFieldEnd();
      }
    }
    iprot.readStructEnd();
    validate();
  }

  public void write(TProtocol oprot) throws TException {
    validate();

    oprot.writeStructBegin(STRUCT_DESC);
    oprot.writeFieldBegin(ID_FIELD_DESC);
    oprot.writeI64(this.id);
    oprot.writeFieldEnd();
    if (this.displayName != null) {
      oprot.writeFieldBegin(DISPLAY_NAME_FIELD_DESC);
      oprot.writeString(this.displayName);
      oprot.writeFieldEnd();
    }
    if (this.location != null) {
      oprot.writeFieldBegin(LOCATION_FIELD_DESC);
      oprot.writeString(this.location);
      oprot.writeFieldEnd();
    }
    if (this.warehouseStatus != null) {
      oprot.writeFieldBegin(WAREHOUSE_STATUS_FIELD_DESC);
      oprot.writeI32(this.warehouseStatus.getValue());
      oprot.writeFieldEnd();
    }
    oprot.writeFieldBegin(ADDED_ON_FIELD_DESC);
    oprot.writeI64(this.addedOn);
    oprot.writeFieldEnd();
    oprot.writeFieldBegin(LAST_CHECKED_ON_FIELD_DESC);
    oprot.writeI64(this.lastCheckedOn);
    oprot.writeFieldEnd();
    if (this.tinNumber != null) {
      oprot.writeFieldBegin(TIN_NUMBER_FIELD_DESC);
      oprot.writeString(this.tinNumber);
      oprot.writeFieldEnd();
    }
    if (this.pincode != null) {
      oprot.writeFieldBegin(PINCODE_FIELD_DESC);
      oprot.writeString(this.pincode);
      oprot.writeFieldEnd();
    }
    if (this.vendorString != null) {
      oprot.writeFieldBegin(VENDOR_STRING_FIELD_DESC);
      oprot.writeString(this.vendorString);
      oprot.writeFieldEnd();
    }
    if (this.logisticsLocation != null) {
      oprot.writeFieldBegin(LOGISTICS_LOCATION_FIELD_DESC);
      oprot.writeI32(this.logisticsLocation.getValue());
      oprot.writeFieldEnd();
    }
    if (this.vendor != null) {
      oprot.writeFieldBegin(VENDOR_FIELD_DESC);
      oprot.writeString(this.vendor);
      oprot.writeFieldEnd();
    }
    oprot.writeFieldStop();
    oprot.writeStructEnd();
  }

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

    sb.append("id:");
    sb.append(this.id);
    first = false;
    if (!first) sb.append(", ");
    sb.append("displayName:");
    if (this.displayName == null) {
      sb.append("null");
    } else {
      sb.append(this.displayName);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("location:");
    if (this.location == null) {
      sb.append("null");
    } else {
      sb.append(this.location);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("warehouseStatus:");
    if (this.warehouseStatus == null) {
      sb.append("null");
    } else {
      String warehouseStatus_name = warehouseStatus.name();
      if (warehouseStatus_name != null) {
        sb.append(warehouseStatus_name);
        sb.append(" (");
      }
      sb.append(this.warehouseStatus);
      if (warehouseStatus_name != null) {
        sb.append(")");
      }
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("addedOn:");
    sb.append(this.addedOn);
    first = false;
    if (!first) sb.append(", ");
    sb.append("lastCheckedOn:");
    sb.append(this.lastCheckedOn);
    first = false;
    if (!first) sb.append(", ");
    sb.append("tinNumber:");
    if (this.tinNumber == null) {
      sb.append("null");
    } else {
      sb.append(this.tinNumber);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("pincode:");
    if (this.pincode == null) {
      sb.append("null");
    } else {
      sb.append(this.pincode);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("vendorString:");
    if (this.vendorString == null) {
      sb.append("null");
    } else {
      sb.append(this.vendorString);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("logisticsLocation:");
    if (this.logisticsLocation == null) {
      sb.append("null");
    } else {
      String logisticsLocation_name = logisticsLocation.name();
      if (logisticsLocation_name != null) {
        sb.append(logisticsLocation_name);
        sb.append(" (");
      }
      sb.append(this.logisticsLocation);
      if (logisticsLocation_name != null) {
        sb.append(")");
      }
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("vendor:");
    if (this.vendor == null) {
      sb.append("null");
    } else {
      sb.append(this.vendor);
    }
    first = false;
    sb.append(")");
    return sb.toString();
  }

  public void validate() throws TException {
    // check for required fields
  }

}