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.order;

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

  private static final org.apache.thrift.protocol.TField ITEM_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("item_id", org.apache.thrift.protocol.TType.I64, (short)1);
  private static final org.apache.thrift.protocol.TField MIN_FBA_PRICE_FIELD_DESC = new org.apache.thrift.protocol.TField("minFbaPrice", org.apache.thrift.protocol.TType.DOUBLE, (short)2);
  private static final org.apache.thrift.protocol.TField MIN_MFN_PRICE_FIELD_DESC = new org.apache.thrift.protocol.TField("minMfnPrice", org.apache.thrift.protocol.TType.DOUBLE, (short)3);
  private static final org.apache.thrift.protocol.TField OUR_PRICE_FIELD_DESC = new org.apache.thrift.protocol.TField("ourPrice", org.apache.thrift.protocol.TType.DOUBLE, (short)4);
  private static final org.apache.thrift.protocol.TField SALE_PRICE_FIELD_DESC = new org.apache.thrift.protocol.TField("salePrice", org.apache.thrift.protocol.TType.DOUBLE, (short)5);
  private static final org.apache.thrift.protocol.TField MIN_FBA_PRICE_SNAPSHOT_DATE_FIELD_DESC = new org.apache.thrift.protocol.TField("minFbaPriceSnapshotDate", org.apache.thrift.protocol.TType.I64, (short)6);
  private static final org.apache.thrift.protocol.TField MIN_MFN_PRICE_SNAPSHOT_DATE_FIELD_DESC = new org.apache.thrift.protocol.TField("minMfnPriceSnapshotDate", org.apache.thrift.protocol.TType.I64, (short)7);
  private static final org.apache.thrift.protocol.TField OUR_PRICE_SNAPSHOT_DATE_FIELD_DESC = new org.apache.thrift.protocol.TField("ourPriceSnapshotDate", org.apache.thrift.protocol.TType.I64, (short)8);
  private static final org.apache.thrift.protocol.TField SALE_PRICE_SNAPSHOT_DATE_FIELD_DESC = new org.apache.thrift.protocol.TField("salePriceSnapshotDate", org.apache.thrift.protocol.TType.I64, (short)9);

  private long item_id; // required
  private double minFbaPrice; // required
  private double minMfnPrice; // required
  private double ourPrice; // required
  private double salePrice; // required
  private long minFbaPriceSnapshotDate; // required
  private long minMfnPriceSnapshotDate; // required
  private long ourPriceSnapshotDate; // required
  private long salePriceSnapshotDate; // required

  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
    ITEM_ID((short)1, "item_id"),
    MIN_FBA_PRICE((short)2, "minFbaPrice"),
    MIN_MFN_PRICE((short)3, "minMfnPrice"),
    OUR_PRICE((short)4, "ourPrice"),
    SALE_PRICE((short)5, "salePrice"),
    MIN_FBA_PRICE_SNAPSHOT_DATE((short)6, "minFbaPriceSnapshotDate"),
    MIN_MFN_PRICE_SNAPSHOT_DATE((short)7, "minMfnPriceSnapshotDate"),
    OUR_PRICE_SNAPSHOT_DATE((short)8, "ourPriceSnapshotDate"),
    SALE_PRICE_SNAPSHOT_DATE((short)9, "salePriceSnapshotDate");

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

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

    /**
     * Find the _Fields constant that matches fieldId, or null if its not found.
     */
    public static _Fields findByThriftId(int fieldId) {
      switch(fieldId) {
        case 1: // ITEM_ID
          return ITEM_ID;
        case 2: // MIN_FBA_PRICE
          return MIN_FBA_PRICE;
        case 3: // MIN_MFN_PRICE
          return MIN_MFN_PRICE;
        case 4: // OUR_PRICE
          return OUR_PRICE;
        case 5: // SALE_PRICE
          return SALE_PRICE;
        case 6: // MIN_FBA_PRICE_SNAPSHOT_DATE
          return MIN_FBA_PRICE_SNAPSHOT_DATE;
        case 7: // MIN_MFN_PRICE_SNAPSHOT_DATE
          return MIN_MFN_PRICE_SNAPSHOT_DATE;
        case 8: // OUR_PRICE_SNAPSHOT_DATE
          return OUR_PRICE_SNAPSHOT_DATE;
        case 9: // SALE_PRICE_SNAPSHOT_DATE
          return SALE_PRICE_SNAPSHOT_DATE;
        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 __ITEM_ID_ISSET_ID = 0;
  private static final int __MINFBAPRICE_ISSET_ID = 1;
  private static final int __MINMFNPRICE_ISSET_ID = 2;
  private static final int __OURPRICE_ISSET_ID = 3;
  private static final int __SALEPRICE_ISSET_ID = 4;
  private static final int __MINFBAPRICESNAPSHOTDATE_ISSET_ID = 5;
  private static final int __MINMFNPRICESNAPSHOTDATE_ISSET_ID = 6;
  private static final int __OURPRICESNAPSHOTDATE_ISSET_ID = 7;
  private static final int __SALEPRICESNAPSHOTDATE_ISSET_ID = 8;
  private BitSet __isset_bit_vector = new BitSet(9);

  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
  static {
    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
    tmpMap.put(_Fields.ITEM_ID, new org.apache.thrift.meta_data.FieldMetaData("item_id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.MIN_FBA_PRICE, new org.apache.thrift.meta_data.FieldMetaData("minFbaPrice", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
    tmpMap.put(_Fields.MIN_MFN_PRICE, new org.apache.thrift.meta_data.FieldMetaData("minMfnPrice", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
    tmpMap.put(_Fields.OUR_PRICE, new org.apache.thrift.meta_data.FieldMetaData("ourPrice", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
    tmpMap.put(_Fields.SALE_PRICE, new org.apache.thrift.meta_data.FieldMetaData("salePrice", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
    tmpMap.put(_Fields.MIN_FBA_PRICE_SNAPSHOT_DATE, new org.apache.thrift.meta_data.FieldMetaData("minFbaPriceSnapshotDate", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.MIN_MFN_PRICE_SNAPSHOT_DATE, new org.apache.thrift.meta_data.FieldMetaData("minMfnPriceSnapshotDate", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.OUR_PRICE_SNAPSHOT_DATE, new org.apache.thrift.meta_data.FieldMetaData("ourPriceSnapshotDate", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.SALE_PRICE_SNAPSHOT_DATE, new org.apache.thrift.meta_data.FieldMetaData("salePriceSnapshotDate", 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(FbaItemPrices.class, metaDataMap);
  }

  public FbaItemPrices() {
  }

  public FbaItemPrices(
    long item_id,
    double minFbaPrice,
    double minMfnPrice,
    double ourPrice,
    double salePrice,
    long minFbaPriceSnapshotDate,
    long minMfnPriceSnapshotDate,
    long ourPriceSnapshotDate,
    long salePriceSnapshotDate)
  {
    this();
    this.item_id = item_id;
    setItem_idIsSet(true);
    this.minFbaPrice = minFbaPrice;
    setMinFbaPriceIsSet(true);
    this.minMfnPrice = minMfnPrice;
    setMinMfnPriceIsSet(true);
    this.ourPrice = ourPrice;
    setOurPriceIsSet(true);
    this.salePrice = salePrice;
    setSalePriceIsSet(true);
    this.minFbaPriceSnapshotDate = minFbaPriceSnapshotDate;
    setMinFbaPriceSnapshotDateIsSet(true);
    this.minMfnPriceSnapshotDate = minMfnPriceSnapshotDate;
    setMinMfnPriceSnapshotDateIsSet(true);
    this.ourPriceSnapshotDate = ourPriceSnapshotDate;
    setOurPriceSnapshotDateIsSet(true);
    this.salePriceSnapshotDate = salePriceSnapshotDate;
    setSalePriceSnapshotDateIsSet(true);
  }

  /**
   * Performs a deep copy on <i>other</i>.
   */
  public FbaItemPrices(FbaItemPrices other) {
    __isset_bit_vector.clear();
    __isset_bit_vector.or(other.__isset_bit_vector);
    this.item_id = other.item_id;
    this.minFbaPrice = other.minFbaPrice;
    this.minMfnPrice = other.minMfnPrice;
    this.ourPrice = other.ourPrice;
    this.salePrice = other.salePrice;
    this.minFbaPriceSnapshotDate = other.minFbaPriceSnapshotDate;
    this.minMfnPriceSnapshotDate = other.minMfnPriceSnapshotDate;
    this.ourPriceSnapshotDate = other.ourPriceSnapshotDate;
    this.salePriceSnapshotDate = other.salePriceSnapshotDate;
  }

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

  @Override
  public void clear() {
    setItem_idIsSet(false);
    this.item_id = 0;
    setMinFbaPriceIsSet(false);
    this.minFbaPrice = 0.0;
    setMinMfnPriceIsSet(false);
    this.minMfnPrice = 0.0;
    setOurPriceIsSet(false);
    this.ourPrice = 0.0;
    setSalePriceIsSet(false);
    this.salePrice = 0.0;
    setMinFbaPriceSnapshotDateIsSet(false);
    this.minFbaPriceSnapshotDate = 0;
    setMinMfnPriceSnapshotDateIsSet(false);
    this.minMfnPriceSnapshotDate = 0;
    setOurPriceSnapshotDateIsSet(false);
    this.ourPriceSnapshotDate = 0;
    setSalePriceSnapshotDateIsSet(false);
    this.salePriceSnapshotDate = 0;
  }

  public long getItem_id() {
    return this.item_id;
  }

  public void setItem_id(long item_id) {
    this.item_id = item_id;
    setItem_idIsSet(true);
  }

  public void unsetItem_id() {
    __isset_bit_vector.clear(__ITEM_ID_ISSET_ID);
  }

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

  public void setItem_idIsSet(boolean value) {
    __isset_bit_vector.set(__ITEM_ID_ISSET_ID, value);
  }

  public double getMinFbaPrice() {
    return this.minFbaPrice;
  }

  public void setMinFbaPrice(double minFbaPrice) {
    this.minFbaPrice = minFbaPrice;
    setMinFbaPriceIsSet(true);
  }

  public void unsetMinFbaPrice() {
    __isset_bit_vector.clear(__MINFBAPRICE_ISSET_ID);
  }

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

  public void setMinFbaPriceIsSet(boolean value) {
    __isset_bit_vector.set(__MINFBAPRICE_ISSET_ID, value);
  }

  public double getMinMfnPrice() {
    return this.minMfnPrice;
  }

  public void setMinMfnPrice(double minMfnPrice) {
    this.minMfnPrice = minMfnPrice;
    setMinMfnPriceIsSet(true);
  }

  public void unsetMinMfnPrice() {
    __isset_bit_vector.clear(__MINMFNPRICE_ISSET_ID);
  }

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

  public void setMinMfnPriceIsSet(boolean value) {
    __isset_bit_vector.set(__MINMFNPRICE_ISSET_ID, value);
  }

  public double getOurPrice() {
    return this.ourPrice;
  }

  public void setOurPrice(double ourPrice) {
    this.ourPrice = ourPrice;
    setOurPriceIsSet(true);
  }

  public void unsetOurPrice() {
    __isset_bit_vector.clear(__OURPRICE_ISSET_ID);
  }

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

  public void setOurPriceIsSet(boolean value) {
    __isset_bit_vector.set(__OURPRICE_ISSET_ID, value);
  }

  public double getSalePrice() {
    return this.salePrice;
  }

  public void setSalePrice(double salePrice) {
    this.salePrice = salePrice;
    setSalePriceIsSet(true);
  }

  public void unsetSalePrice() {
    __isset_bit_vector.clear(__SALEPRICE_ISSET_ID);
  }

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

  public void setSalePriceIsSet(boolean value) {
    __isset_bit_vector.set(__SALEPRICE_ISSET_ID, value);
  }

  public long getMinFbaPriceSnapshotDate() {
    return this.minFbaPriceSnapshotDate;
  }

  public void setMinFbaPriceSnapshotDate(long minFbaPriceSnapshotDate) {
    this.minFbaPriceSnapshotDate = minFbaPriceSnapshotDate;
    setMinFbaPriceSnapshotDateIsSet(true);
  }

  public void unsetMinFbaPriceSnapshotDate() {
    __isset_bit_vector.clear(__MINFBAPRICESNAPSHOTDATE_ISSET_ID);
  }

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

  public void setMinFbaPriceSnapshotDateIsSet(boolean value) {
    __isset_bit_vector.set(__MINFBAPRICESNAPSHOTDATE_ISSET_ID, value);
  }

  public long getMinMfnPriceSnapshotDate() {
    return this.minMfnPriceSnapshotDate;
  }

  public void setMinMfnPriceSnapshotDate(long minMfnPriceSnapshotDate) {
    this.minMfnPriceSnapshotDate = minMfnPriceSnapshotDate;
    setMinMfnPriceSnapshotDateIsSet(true);
  }

  public void unsetMinMfnPriceSnapshotDate() {
    __isset_bit_vector.clear(__MINMFNPRICESNAPSHOTDATE_ISSET_ID);
  }

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

  public void setMinMfnPriceSnapshotDateIsSet(boolean value) {
    __isset_bit_vector.set(__MINMFNPRICESNAPSHOTDATE_ISSET_ID, value);
  }

  public long getOurPriceSnapshotDate() {
    return this.ourPriceSnapshotDate;
  }

  public void setOurPriceSnapshotDate(long ourPriceSnapshotDate) {
    this.ourPriceSnapshotDate = ourPriceSnapshotDate;
    setOurPriceSnapshotDateIsSet(true);
  }

  public void unsetOurPriceSnapshotDate() {
    __isset_bit_vector.clear(__OURPRICESNAPSHOTDATE_ISSET_ID);
  }

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

  public void setOurPriceSnapshotDateIsSet(boolean value) {
    __isset_bit_vector.set(__OURPRICESNAPSHOTDATE_ISSET_ID, value);
  }

  public long getSalePriceSnapshotDate() {
    return this.salePriceSnapshotDate;
  }

  public void setSalePriceSnapshotDate(long salePriceSnapshotDate) {
    this.salePriceSnapshotDate = salePriceSnapshotDate;
    setSalePriceSnapshotDateIsSet(true);
  }

  public void unsetSalePriceSnapshotDate() {
    __isset_bit_vector.clear(__SALEPRICESNAPSHOTDATE_ISSET_ID);
  }

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

  public void setSalePriceSnapshotDateIsSet(boolean value) {
    __isset_bit_vector.set(__SALEPRICESNAPSHOTDATE_ISSET_ID, value);
  }

  public void setFieldValue(_Fields field, Object value) {
    switch (field) {
    case ITEM_ID:
      if (value == null) {
        unsetItem_id();
      } else {
        setItem_id((Long)value);
      }
      break;

    case MIN_FBA_PRICE:
      if (value == null) {
        unsetMinFbaPrice();
      } else {
        setMinFbaPrice((Double)value);
      }
      break;

    case MIN_MFN_PRICE:
      if (value == null) {
        unsetMinMfnPrice();
      } else {
        setMinMfnPrice((Double)value);
      }
      break;

    case OUR_PRICE:
      if (value == null) {
        unsetOurPrice();
      } else {
        setOurPrice((Double)value);
      }
      break;

    case SALE_PRICE:
      if (value == null) {
        unsetSalePrice();
      } else {
        setSalePrice((Double)value);
      }
      break;

    case MIN_FBA_PRICE_SNAPSHOT_DATE:
      if (value == null) {
        unsetMinFbaPriceSnapshotDate();
      } else {
        setMinFbaPriceSnapshotDate((Long)value);
      }
      break;

    case MIN_MFN_PRICE_SNAPSHOT_DATE:
      if (value == null) {
        unsetMinMfnPriceSnapshotDate();
      } else {
        setMinMfnPriceSnapshotDate((Long)value);
      }
      break;

    case OUR_PRICE_SNAPSHOT_DATE:
      if (value == null) {
        unsetOurPriceSnapshotDate();
      } else {
        setOurPriceSnapshotDate((Long)value);
      }
      break;

    case SALE_PRICE_SNAPSHOT_DATE:
      if (value == null) {
        unsetSalePriceSnapshotDate();
      } else {
        setSalePriceSnapshotDate((Long)value);
      }
      break;

    }
  }

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

    case MIN_FBA_PRICE:
      return Double.valueOf(getMinFbaPrice());

    case MIN_MFN_PRICE:
      return Double.valueOf(getMinMfnPrice());

    case OUR_PRICE:
      return Double.valueOf(getOurPrice());

    case SALE_PRICE:
      return Double.valueOf(getSalePrice());

    case MIN_FBA_PRICE_SNAPSHOT_DATE:
      return Long.valueOf(getMinFbaPriceSnapshotDate());

    case MIN_MFN_PRICE_SNAPSHOT_DATE:
      return Long.valueOf(getMinMfnPriceSnapshotDate());

    case OUR_PRICE_SNAPSHOT_DATE:
      return Long.valueOf(getOurPriceSnapshotDate());

    case SALE_PRICE_SNAPSHOT_DATE:
      return Long.valueOf(getSalePriceSnapshotDate());

    }
    throw new IllegalStateException();
  }

  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
  public boolean isSet(_Fields field) {
    if (field == null) {
      throw new IllegalArgumentException();
    }

    switch (field) {
    case ITEM_ID:
      return isSetItem_id();
    case MIN_FBA_PRICE:
      return isSetMinFbaPrice();
    case MIN_MFN_PRICE:
      return isSetMinMfnPrice();
    case OUR_PRICE:
      return isSetOurPrice();
    case SALE_PRICE:
      return isSetSalePrice();
    case MIN_FBA_PRICE_SNAPSHOT_DATE:
      return isSetMinFbaPriceSnapshotDate();
    case MIN_MFN_PRICE_SNAPSHOT_DATE:
      return isSetMinMfnPriceSnapshotDate();
    case OUR_PRICE_SNAPSHOT_DATE:
      return isSetOurPriceSnapshotDate();
    case SALE_PRICE_SNAPSHOT_DATE:
      return isSetSalePriceSnapshotDate();
    }
    throw new IllegalStateException();
  }

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

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

    boolean this_present_item_id = true;
    boolean that_present_item_id = true;
    if (this_present_item_id || that_present_item_id) {
      if (!(this_present_item_id && that_present_item_id))
        return false;
      if (this.item_id != that.item_id)
        return false;
    }

    boolean this_present_minFbaPrice = true;
    boolean that_present_minFbaPrice = true;
    if (this_present_minFbaPrice || that_present_minFbaPrice) {
      if (!(this_present_minFbaPrice && that_present_minFbaPrice))
        return false;
      if (this.minFbaPrice != that.minFbaPrice)
        return false;
    }

    boolean this_present_minMfnPrice = true;
    boolean that_present_minMfnPrice = true;
    if (this_present_minMfnPrice || that_present_minMfnPrice) {
      if (!(this_present_minMfnPrice && that_present_minMfnPrice))
        return false;
      if (this.minMfnPrice != that.minMfnPrice)
        return false;
    }

    boolean this_present_ourPrice = true;
    boolean that_present_ourPrice = true;
    if (this_present_ourPrice || that_present_ourPrice) {
      if (!(this_present_ourPrice && that_present_ourPrice))
        return false;
      if (this.ourPrice != that.ourPrice)
        return false;
    }

    boolean this_present_salePrice = true;
    boolean that_present_salePrice = true;
    if (this_present_salePrice || that_present_salePrice) {
      if (!(this_present_salePrice && that_present_salePrice))
        return false;
      if (this.salePrice != that.salePrice)
        return false;
    }

    boolean this_present_minFbaPriceSnapshotDate = true;
    boolean that_present_minFbaPriceSnapshotDate = true;
    if (this_present_minFbaPriceSnapshotDate || that_present_minFbaPriceSnapshotDate) {
      if (!(this_present_minFbaPriceSnapshotDate && that_present_minFbaPriceSnapshotDate))
        return false;
      if (this.minFbaPriceSnapshotDate != that.minFbaPriceSnapshotDate)
        return false;
    }

    boolean this_present_minMfnPriceSnapshotDate = true;
    boolean that_present_minMfnPriceSnapshotDate = true;
    if (this_present_minMfnPriceSnapshotDate || that_present_minMfnPriceSnapshotDate) {
      if (!(this_present_minMfnPriceSnapshotDate && that_present_minMfnPriceSnapshotDate))
        return false;
      if (this.minMfnPriceSnapshotDate != that.minMfnPriceSnapshotDate)
        return false;
    }

    boolean this_present_ourPriceSnapshotDate = true;
    boolean that_present_ourPriceSnapshotDate = true;
    if (this_present_ourPriceSnapshotDate || that_present_ourPriceSnapshotDate) {
      if (!(this_present_ourPriceSnapshotDate && that_present_ourPriceSnapshotDate))
        return false;
      if (this.ourPriceSnapshotDate != that.ourPriceSnapshotDate)
        return false;
    }

    boolean this_present_salePriceSnapshotDate = true;
    boolean that_present_salePriceSnapshotDate = true;
    if (this_present_salePriceSnapshotDate || that_present_salePriceSnapshotDate) {
      if (!(this_present_salePriceSnapshotDate && that_present_salePriceSnapshotDate))
        return false;
      if (this.salePriceSnapshotDate != that.salePriceSnapshotDate)
        return false;
    }

    return true;
  }

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

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

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

    lastComparison = Boolean.valueOf(isSetItem_id()).compareTo(typedOther.isSetItem_id());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetItem_id()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.item_id, typedOther.item_id);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetMinFbaPrice()).compareTo(typedOther.isSetMinFbaPrice());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMinFbaPrice()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.minFbaPrice, typedOther.minFbaPrice);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetMinMfnPrice()).compareTo(typedOther.isSetMinMfnPrice());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMinMfnPrice()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.minMfnPrice, typedOther.minMfnPrice);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetOurPrice()).compareTo(typedOther.isSetOurPrice());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetOurPrice()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ourPrice, typedOther.ourPrice);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetSalePrice()).compareTo(typedOther.isSetSalePrice());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSalePrice()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.salePrice, typedOther.salePrice);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetMinFbaPriceSnapshotDate()).compareTo(typedOther.isSetMinFbaPriceSnapshotDate());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMinFbaPriceSnapshotDate()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.minFbaPriceSnapshotDate, typedOther.minFbaPriceSnapshotDate);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetMinMfnPriceSnapshotDate()).compareTo(typedOther.isSetMinMfnPriceSnapshotDate());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMinMfnPriceSnapshotDate()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.minMfnPriceSnapshotDate, typedOther.minMfnPriceSnapshotDate);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetOurPriceSnapshotDate()).compareTo(typedOther.isSetOurPriceSnapshotDate());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetOurPriceSnapshotDate()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ourPriceSnapshotDate, typedOther.ourPriceSnapshotDate);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetSalePriceSnapshotDate()).compareTo(typedOther.isSetSalePriceSnapshotDate());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSalePriceSnapshotDate()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.salePriceSnapshotDate, typedOther.salePriceSnapshotDate);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }

  public _Fields fieldForId(int fieldId) {
    return _Fields.findByThriftId(fieldId);
  }

  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
    org.apache.thrift.protocol.TField field;
    iprot.readStructBegin();
    while (true)
    {
      field = iprot.readFieldBegin();
      if (field.type == org.apache.thrift.protocol.TType.STOP) { 
        break;
      }
      switch (field.id) {
        case 1: // ITEM_ID
          if (field.type == org.apache.thrift.protocol.TType.I64) {
            this.item_id = iprot.readI64();
            setItem_idIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 2: // MIN_FBA_PRICE
          if (field.type == org.apache.thrift.protocol.TType.DOUBLE) {
            this.minFbaPrice = iprot.readDouble();
            setMinFbaPriceIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 3: // MIN_MFN_PRICE
          if (field.type == org.apache.thrift.protocol.TType.DOUBLE) {
            this.minMfnPrice = iprot.readDouble();
            setMinMfnPriceIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 4: // OUR_PRICE
          if (field.type == org.apache.thrift.protocol.TType.DOUBLE) {
            this.ourPrice = iprot.readDouble();
            setOurPriceIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 5: // SALE_PRICE
          if (field.type == org.apache.thrift.protocol.TType.DOUBLE) {
            this.salePrice = iprot.readDouble();
            setSalePriceIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 6: // MIN_FBA_PRICE_SNAPSHOT_DATE
          if (field.type == org.apache.thrift.protocol.TType.I64) {
            this.minFbaPriceSnapshotDate = iprot.readI64();
            setMinFbaPriceSnapshotDateIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 7: // MIN_MFN_PRICE_SNAPSHOT_DATE
          if (field.type == org.apache.thrift.protocol.TType.I64) {
            this.minMfnPriceSnapshotDate = iprot.readI64();
            setMinMfnPriceSnapshotDateIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 8: // OUR_PRICE_SNAPSHOT_DATE
          if (field.type == org.apache.thrift.protocol.TType.I64) {
            this.ourPriceSnapshotDate = iprot.readI64();
            setOurPriceSnapshotDateIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 9: // SALE_PRICE_SNAPSHOT_DATE
          if (field.type == org.apache.thrift.protocol.TType.I64) {
            this.salePriceSnapshotDate = iprot.readI64();
            setSalePriceSnapshotDateIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        default:
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
      }
      iprot.readFieldEnd();
    }
    iprot.readStructEnd();
    validate();
  }

  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
    validate();

    oprot.writeStructBegin(STRUCT_DESC);
    oprot.writeFieldBegin(ITEM_ID_FIELD_DESC);
    oprot.writeI64(this.item_id);
    oprot.writeFieldEnd();
    oprot.writeFieldBegin(MIN_FBA_PRICE_FIELD_DESC);
    oprot.writeDouble(this.minFbaPrice);
    oprot.writeFieldEnd();
    oprot.writeFieldBegin(MIN_MFN_PRICE_FIELD_DESC);
    oprot.writeDouble(this.minMfnPrice);
    oprot.writeFieldEnd();
    oprot.writeFieldBegin(OUR_PRICE_FIELD_DESC);
    oprot.writeDouble(this.ourPrice);
    oprot.writeFieldEnd();
    oprot.writeFieldBegin(SALE_PRICE_FIELD_DESC);
    oprot.writeDouble(this.salePrice);
    oprot.writeFieldEnd();
    oprot.writeFieldBegin(MIN_FBA_PRICE_SNAPSHOT_DATE_FIELD_DESC);
    oprot.writeI64(this.minFbaPriceSnapshotDate);
    oprot.writeFieldEnd();
    oprot.writeFieldBegin(MIN_MFN_PRICE_SNAPSHOT_DATE_FIELD_DESC);
    oprot.writeI64(this.minMfnPriceSnapshotDate);
    oprot.writeFieldEnd();
    oprot.writeFieldBegin(OUR_PRICE_SNAPSHOT_DATE_FIELD_DESC);
    oprot.writeI64(this.ourPriceSnapshotDate);
    oprot.writeFieldEnd();
    oprot.writeFieldBegin(SALE_PRICE_SNAPSHOT_DATE_FIELD_DESC);
    oprot.writeI64(this.salePriceSnapshotDate);
    oprot.writeFieldEnd();
    oprot.writeFieldStop();
    oprot.writeStructEnd();
  }

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

    sb.append("item_id:");
    sb.append(this.item_id);
    first = false;
    if (!first) sb.append(", ");
    sb.append("minFbaPrice:");
    sb.append(this.minFbaPrice);
    first = false;
    if (!first) sb.append(", ");
    sb.append("minMfnPrice:");
    sb.append(this.minMfnPrice);
    first = false;
    if (!first) sb.append(", ");
    sb.append("ourPrice:");
    sb.append(this.ourPrice);
    first = false;
    if (!first) sb.append(", ");
    sb.append("salePrice:");
    sb.append(this.salePrice);
    first = false;
    if (!first) sb.append(", ");
    sb.append("minFbaPriceSnapshotDate:");
    sb.append(this.minFbaPriceSnapshotDate);
    first = false;
    if (!first) sb.append(", ");
    sb.append("minMfnPriceSnapshotDate:");
    sb.append(this.minMfnPriceSnapshotDate);
    first = false;
    if (!first) sb.append(", ");
    sb.append("ourPriceSnapshotDate:");
    sb.append(this.ourPriceSnapshotDate);
    first = false;
    if (!first) sb.append(", ");
    sb.append("salePriceSnapshotDate:");
    sb.append(this.salePriceSnapshotDate);
    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);
    }
  }

}