Subversion Repositories SmartDukaan

Rev

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

public class HsItem implements org.apache.thrift.TBase<HsItem, HsItem._Fields>, java.io.Serializable, Cloneable {
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("HsItem");

  private static final org.apache.thrift.protocol.TField HS_ITEM_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("hsItemId", org.apache.thrift.protocol.TType.STRING, (short)1);
  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)2);
  private static final org.apache.thrift.protocol.TField HS_PRODUCT_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("hsProductId", org.apache.thrift.protocol.TType.STRING, (short)3);
  private static final org.apache.thrift.protocol.TField LISTING_PRICE_FIELD_DESC = new org.apache.thrift.protocol.TField("listingPrice", org.apache.thrift.protocol.TType.I64, (short)4);
  private static final org.apache.thrift.protocol.TField DEFAULT_WAREHOUSE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("defaultWarehouseId", org.apache.thrift.protocol.TType.I64, (short)5);
  private static final org.apache.thrift.protocol.TField ADDED_TIMESTAMP_FIELD_DESC = new org.apache.thrift.protocol.TField("addedTimestamp", org.apache.thrift.protocol.TType.I64, (short)6);
  private static final org.apache.thrift.protocol.TField ADDED_BY_FIELD_DESC = new org.apache.thrift.protocol.TField("addedBy", org.apache.thrift.protocol.TType.STRING, (short)7);

  private String hsItemId; // required
  private long itemId; // required
  private String hsProductId; // required
  private long listingPrice; // required
  private long defaultWarehouseId; // required
  private long addedTimestamp; // required
  private String addedBy; // 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 {
    HS_ITEM_ID((short)1, "hsItemId"),
    ITEM_ID((short)2, "itemId"),
    HS_PRODUCT_ID((short)3, "hsProductId"),
    LISTING_PRICE((short)4, "listingPrice"),
    DEFAULT_WAREHOUSE_ID((short)5, "defaultWarehouseId"),
    ADDED_TIMESTAMP((short)6, "addedTimestamp"),
    ADDED_BY((short)7, "addedBy");

    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: // HS_ITEM_ID
          return HS_ITEM_ID;
        case 2: // ITEM_ID
          return ITEM_ID;
        case 3: // HS_PRODUCT_ID
          return HS_PRODUCT_ID;
        case 4: // LISTING_PRICE
          return LISTING_PRICE;
        case 5: // DEFAULT_WAREHOUSE_ID
          return DEFAULT_WAREHOUSE_ID;
        case 6: // ADDED_TIMESTAMP
          return ADDED_TIMESTAMP;
        case 7: // ADDED_BY
          return ADDED_BY;
        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 __ITEMID_ISSET_ID = 0;
  private static final int __LISTINGPRICE_ISSET_ID = 1;
  private static final int __DEFAULTWAREHOUSEID_ISSET_ID = 2;
  private static final int __ADDEDTIMESTAMP_ISSET_ID = 3;
  private BitSet __isset_bit_vector = new BitSet(4);

  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.HS_ITEM_ID, new org.apache.thrift.meta_data.FieldMetaData("hsItemId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    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.HS_PRODUCT_ID, new org.apache.thrift.meta_data.FieldMetaData("hsProductId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.LISTING_PRICE, new org.apache.thrift.meta_data.FieldMetaData("listingPrice", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.DEFAULT_WAREHOUSE_ID, new org.apache.thrift.meta_data.FieldMetaData("defaultWarehouseId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.ADDED_TIMESTAMP, new org.apache.thrift.meta_data.FieldMetaData("addedTimestamp", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.ADDED_BY, new org.apache.thrift.meta_data.FieldMetaData("addedBy", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    metaDataMap = Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(HsItem.class, metaDataMap);
  }

  public HsItem() {
  }

  public HsItem(
    String hsItemId,
    long itemId,
    String hsProductId,
    long listingPrice,
    long defaultWarehouseId,
    long addedTimestamp,
    String addedBy)
  {
    this();
    this.hsItemId = hsItemId;
    this.itemId = itemId;
    setItemIdIsSet(true);
    this.hsProductId = hsProductId;
    this.listingPrice = listingPrice;
    setListingPriceIsSet(true);
    this.defaultWarehouseId = defaultWarehouseId;
    setDefaultWarehouseIdIsSet(true);
    this.addedTimestamp = addedTimestamp;
    setAddedTimestampIsSet(true);
    this.addedBy = addedBy;
  }

  /**
   * Performs a deep copy on <i>other</i>.
   */
  public HsItem(HsItem other) {
    __isset_bit_vector.clear();
    __isset_bit_vector.or(other.__isset_bit_vector);
    if (other.isSetHsItemId()) {
      this.hsItemId = other.hsItemId;
    }
    this.itemId = other.itemId;
    if (other.isSetHsProductId()) {
      this.hsProductId = other.hsProductId;
    }
    this.listingPrice = other.listingPrice;
    this.defaultWarehouseId = other.defaultWarehouseId;
    this.addedTimestamp = other.addedTimestamp;
    if (other.isSetAddedBy()) {
      this.addedBy = other.addedBy;
    }
  }

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

  @Override
  public void clear() {
    this.hsItemId = null;
    setItemIdIsSet(false);
    this.itemId = 0;
    this.hsProductId = null;
    setListingPriceIsSet(false);
    this.listingPrice = 0;
    setDefaultWarehouseIdIsSet(false);
    this.defaultWarehouseId = 0;
    setAddedTimestampIsSet(false);
    this.addedTimestamp = 0;
    this.addedBy = null;
  }

  public String getHsItemId() {
    return this.hsItemId;
  }

  public void setHsItemId(String hsItemId) {
    this.hsItemId = hsItemId;
  }

  public void unsetHsItemId() {
    this.hsItemId = null;
  }

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

  public void setHsItemIdIsSet(boolean value) {
    if (!value) {
      this.hsItemId = null;
    }
  }

  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 String getHsProductId() {
    return this.hsProductId;
  }

  public void setHsProductId(String hsProductId) {
    this.hsProductId = hsProductId;
  }

  public void unsetHsProductId() {
    this.hsProductId = null;
  }

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

  public void setHsProductIdIsSet(boolean value) {
    if (!value) {
      this.hsProductId = null;
    }
  }

  public long getListingPrice() {
    return this.listingPrice;
  }

  public void setListingPrice(long listingPrice) {
    this.listingPrice = listingPrice;
    setListingPriceIsSet(true);
  }

  public void unsetListingPrice() {
    __isset_bit_vector.clear(__LISTINGPRICE_ISSET_ID);
  }

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

  public void setListingPriceIsSet(boolean value) {
    __isset_bit_vector.set(__LISTINGPRICE_ISSET_ID, value);
  }

  public long getDefaultWarehouseId() {
    return this.defaultWarehouseId;
  }

  public void setDefaultWarehouseId(long defaultWarehouseId) {
    this.defaultWarehouseId = defaultWarehouseId;
    setDefaultWarehouseIdIsSet(true);
  }

  public void unsetDefaultWarehouseId() {
    __isset_bit_vector.clear(__DEFAULTWAREHOUSEID_ISSET_ID);
  }

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

  public void setDefaultWarehouseIdIsSet(boolean value) {
    __isset_bit_vector.set(__DEFAULTWAREHOUSEID_ISSET_ID, value);
  }

  public long getAddedTimestamp() {
    return this.addedTimestamp;
  }

  public void setAddedTimestamp(long addedTimestamp) {
    this.addedTimestamp = addedTimestamp;
    setAddedTimestampIsSet(true);
  }

  public void unsetAddedTimestamp() {
    __isset_bit_vector.clear(__ADDEDTIMESTAMP_ISSET_ID);
  }

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

  public void setAddedTimestampIsSet(boolean value) {
    __isset_bit_vector.set(__ADDEDTIMESTAMP_ISSET_ID, value);
  }

  public String getAddedBy() {
    return this.addedBy;
  }

  public void setAddedBy(String addedBy) {
    this.addedBy = addedBy;
  }

  public void unsetAddedBy() {
    this.addedBy = null;
  }

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

  public void setAddedByIsSet(boolean value) {
    if (!value) {
      this.addedBy = null;
    }
  }

  public void setFieldValue(_Fields field, Object value) {
    switch (field) {
    case HS_ITEM_ID:
      if (value == null) {
        unsetHsItemId();
      } else {
        setHsItemId((String)value);
      }
      break;

    case ITEM_ID:
      if (value == null) {
        unsetItemId();
      } else {
        setItemId((Long)value);
      }
      break;

    case HS_PRODUCT_ID:
      if (value == null) {
        unsetHsProductId();
      } else {
        setHsProductId((String)value);
      }
      break;

    case LISTING_PRICE:
      if (value == null) {
        unsetListingPrice();
      } else {
        setListingPrice((Long)value);
      }
      break;

    case DEFAULT_WAREHOUSE_ID:
      if (value == null) {
        unsetDefaultWarehouseId();
      } else {
        setDefaultWarehouseId((Long)value);
      }
      break;

    case ADDED_TIMESTAMP:
      if (value == null) {
        unsetAddedTimestamp();
      } else {
        setAddedTimestamp((Long)value);
      }
      break;

    case ADDED_BY:
      if (value == null) {
        unsetAddedBy();
      } else {
        setAddedBy((String)value);
      }
      break;

    }
  }

  public Object getFieldValue(_Fields field) {
    switch (field) {
    case HS_ITEM_ID:
      return getHsItemId();

    case ITEM_ID:
      return Long.valueOf(getItemId());

    case HS_PRODUCT_ID:
      return getHsProductId();

    case LISTING_PRICE:
      return Long.valueOf(getListingPrice());

    case DEFAULT_WAREHOUSE_ID:
      return Long.valueOf(getDefaultWarehouseId());

    case ADDED_TIMESTAMP:
      return Long.valueOf(getAddedTimestamp());

    case ADDED_BY:
      return getAddedBy();

    }
    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 HS_ITEM_ID:
      return isSetHsItemId();
    case ITEM_ID:
      return isSetItemId();
    case HS_PRODUCT_ID:
      return isSetHsProductId();
    case LISTING_PRICE:
      return isSetListingPrice();
    case DEFAULT_WAREHOUSE_ID:
      return isSetDefaultWarehouseId();
    case ADDED_TIMESTAMP:
      return isSetAddedTimestamp();
    case ADDED_BY:
      return isSetAddedBy();
    }
    throw new IllegalStateException();
  }

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

  public boolean equals(HsItem that) {
    if (that == null)
      return false;

    boolean this_present_hsItemId = true && this.isSetHsItemId();
    boolean that_present_hsItemId = true && that.isSetHsItemId();
    if (this_present_hsItemId || that_present_hsItemId) {
      if (!(this_present_hsItemId && that_present_hsItemId))
        return false;
      if (!this.hsItemId.equals(that.hsItemId))
        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_hsProductId = true && this.isSetHsProductId();
    boolean that_present_hsProductId = true && that.isSetHsProductId();
    if (this_present_hsProductId || that_present_hsProductId) {
      if (!(this_present_hsProductId && that_present_hsProductId))
        return false;
      if (!this.hsProductId.equals(that.hsProductId))
        return false;
    }

    boolean this_present_listingPrice = true;
    boolean that_present_listingPrice = true;
    if (this_present_listingPrice || that_present_listingPrice) {
      if (!(this_present_listingPrice && that_present_listingPrice))
        return false;
      if (this.listingPrice != that.listingPrice)
        return false;
    }

    boolean this_present_defaultWarehouseId = true;
    boolean that_present_defaultWarehouseId = true;
    if (this_present_defaultWarehouseId || that_present_defaultWarehouseId) {
      if (!(this_present_defaultWarehouseId && that_present_defaultWarehouseId))
        return false;
      if (this.defaultWarehouseId != that.defaultWarehouseId)
        return false;
    }

    boolean this_present_addedTimestamp = true;
    boolean that_present_addedTimestamp = true;
    if (this_present_addedTimestamp || that_present_addedTimestamp) {
      if (!(this_present_addedTimestamp && that_present_addedTimestamp))
        return false;
      if (this.addedTimestamp != that.addedTimestamp)
        return false;
    }

    boolean this_present_addedBy = true && this.isSetAddedBy();
    boolean that_present_addedBy = true && that.isSetAddedBy();
    if (this_present_addedBy || that_present_addedBy) {
      if (!(this_present_addedBy && that_present_addedBy))
        return false;
      if (!this.addedBy.equals(that.addedBy))
        return false;
    }

    return true;
  }

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

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

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

    lastComparison = Boolean.valueOf(isSetHsItemId()).compareTo(typedOther.isSetHsItemId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetHsItemId()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.hsItemId, typedOther.hsItemId);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    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(isSetHsProductId()).compareTo(typedOther.isSetHsProductId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetHsProductId()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.hsProductId, typedOther.hsProductId);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetListingPrice()).compareTo(typedOther.isSetListingPrice());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetListingPrice()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.listingPrice, typedOther.listingPrice);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetDefaultWarehouseId()).compareTo(typedOther.isSetDefaultWarehouseId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetDefaultWarehouseId()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.defaultWarehouseId, typedOther.defaultWarehouseId);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetAddedTimestamp()).compareTo(typedOther.isSetAddedTimestamp());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetAddedTimestamp()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.addedTimestamp, typedOther.addedTimestamp);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetAddedBy()).compareTo(typedOther.isSetAddedBy());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetAddedBy()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.addedBy, typedOther.addedBy);
      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: // HS_ITEM_ID
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
            this.hsItemId = iprot.readString();
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 2: // ITEM_ID
          if (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 3: // HS_PRODUCT_ID
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
            this.hsProductId = iprot.readString();
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 4: // LISTING_PRICE
          if (field.type == org.apache.thrift.protocol.TType.I64) {
            this.listingPrice = iprot.readI64();
            setListingPriceIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 5: // DEFAULT_WAREHOUSE_ID
          if (field.type == org.apache.thrift.protocol.TType.I64) {
            this.defaultWarehouseId = iprot.readI64();
            setDefaultWarehouseIdIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 6: // ADDED_TIMESTAMP
          if (field.type == org.apache.thrift.protocol.TType.I64) {
            this.addedTimestamp = iprot.readI64();
            setAddedTimestampIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 7: // ADDED_BY
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
            this.addedBy = iprot.readString();
          } 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);
    if (this.hsItemId != null) {
      oprot.writeFieldBegin(HS_ITEM_ID_FIELD_DESC);
      oprot.writeString(this.hsItemId);
      oprot.writeFieldEnd();
    }
    oprot.writeFieldBegin(ITEM_ID_FIELD_DESC);
    oprot.writeI64(this.itemId);
    oprot.writeFieldEnd();
    if (this.hsProductId != null) {
      oprot.writeFieldBegin(HS_PRODUCT_ID_FIELD_DESC);
      oprot.writeString(this.hsProductId);
      oprot.writeFieldEnd();
    }
    oprot.writeFieldBegin(LISTING_PRICE_FIELD_DESC);
    oprot.writeI64(this.listingPrice);
    oprot.writeFieldEnd();
    oprot.writeFieldBegin(DEFAULT_WAREHOUSE_ID_FIELD_DESC);
    oprot.writeI64(this.defaultWarehouseId);
    oprot.writeFieldEnd();
    oprot.writeFieldBegin(ADDED_TIMESTAMP_FIELD_DESC);
    oprot.writeI64(this.addedTimestamp);
    oprot.writeFieldEnd();
    if (this.addedBy != null) {
      oprot.writeFieldBegin(ADDED_BY_FIELD_DESC);
      oprot.writeString(this.addedBy);
      oprot.writeFieldEnd();
    }
    oprot.writeFieldStop();
    oprot.writeStructEnd();
  }

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

    sb.append("hsItemId:");
    if (this.hsItemId == null) {
      sb.append("null");
    } else {
      sb.append(this.hsItemId);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("itemId:");
    sb.append(this.itemId);
    first = false;
    if (!first) sb.append(", ");
    sb.append("hsProductId:");
    if (this.hsProductId == null) {
      sb.append("null");
    } else {
      sb.append(this.hsProductId);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("listingPrice:");
    sb.append(this.listingPrice);
    first = false;
    if (!first) sb.append(", ");
    sb.append("defaultWarehouseId:");
    sb.append(this.defaultWarehouseId);
    first = false;
    if (!first) sb.append(", ");
    sb.append("addedTimestamp:");
    sb.append(this.addedTimestamp);
    first = false;
    if (!first) sb.append(", ");
    sb.append("addedBy:");
    if (this.addedBy == null) {
      sb.append("null");
    } else {
      sb.append(this.addedBy);
    }
    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);
    }
  }

}