Subversion Repositories SmartDukaan

Rev

Rev 11905 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

/**
 * Autogenerated by Thrift Compiler (0.7.0)
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 */
package in.shop2020.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 PdPriceComp implements org.apache.thrift.TBase<PdPriceComp, PdPriceComp._Fields>, java.io.Serializable, Cloneable {
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("PdPriceComp");

  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 DEAL_PRICE_FIELD_DESC = new org.apache.thrift.protocol.TField("dealPrice", org.apache.thrift.protocol.TType.DOUBLE, (short)2);
  private static final org.apache.thrift.protocol.TField SAHOLIC_PRICE_FIELD_DESC = new org.apache.thrift.protocol.TField("saholicPrice", org.apache.thrift.protocol.TType.DOUBLE, (short)3);
  private static final org.apache.thrift.protocol.TField SD_PRICE_FIELD_DESC = new org.apache.thrift.protocol.TField("sdPrice", org.apache.thrift.protocol.TType.DOUBLE, (short)4);
  private static final org.apache.thrift.protocol.TField FK_PRICE_FIELD_DESC = new org.apache.thrift.protocol.TField("fkPrice", org.apache.thrift.protocol.TType.DOUBLE, (short)5);
  private static final org.apache.thrift.protocol.TField AMAZON_PRICE_FIELD_DESC = new org.apache.thrift.protocol.TField("amazonPrice", org.apache.thrift.protocol.TType.DOUBLE, (short)6);
  private static final org.apache.thrift.protocol.TField PRODUCT_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("productName", org.apache.thrift.protocol.TType.STRING, (short)7);
  private static final org.apache.thrift.protocol.TField LAST_PROCESSED_TIMESTAMP_FIELD_DESC = new org.apache.thrift.protocol.TField("lastProcessedTimestamp", org.apache.thrift.protocol.TType.I64, (short)8);

  private long item_id; // required
  private double dealPrice; // required
  private double saholicPrice; // required
  private double sdPrice; // required
  private double fkPrice; // required
  private double amazonPrice; // required
  private String productName; // required
  private long lastProcessedTimestamp; // 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"),
    DEAL_PRICE((short)2, "dealPrice"),
    SAHOLIC_PRICE((short)3, "saholicPrice"),
    SD_PRICE((short)4, "sdPrice"),
    FK_PRICE((short)5, "fkPrice"),
    AMAZON_PRICE((short)6, "amazonPrice"),
    PRODUCT_NAME((short)7, "productName"),
    LAST_PROCESSED_TIMESTAMP((short)8, "lastProcessedTimestamp");

    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: // DEAL_PRICE
          return DEAL_PRICE;
        case 3: // SAHOLIC_PRICE
          return SAHOLIC_PRICE;
        case 4: // SD_PRICE
          return SD_PRICE;
        case 5: // FK_PRICE
          return FK_PRICE;
        case 6: // AMAZON_PRICE
          return AMAZON_PRICE;
        case 7: // PRODUCT_NAME
          return PRODUCT_NAME;
        case 8: // LAST_PROCESSED_TIMESTAMP
          return LAST_PROCESSED_TIMESTAMP;
        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 __DEALPRICE_ISSET_ID = 1;
  private static final int __SAHOLICPRICE_ISSET_ID = 2;
  private static final int __SDPRICE_ISSET_ID = 3;
  private static final int __FKPRICE_ISSET_ID = 4;
  private static final int __AMAZONPRICE_ISSET_ID = 5;
  private static final int __LASTPROCESSEDTIMESTAMP_ISSET_ID = 6;
  private BitSet __isset_bit_vector = new BitSet(7);

  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.DEAL_PRICE, new org.apache.thrift.meta_data.FieldMetaData("dealPrice", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
    tmpMap.put(_Fields.SAHOLIC_PRICE, new org.apache.thrift.meta_data.FieldMetaData("saholicPrice", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
    tmpMap.put(_Fields.SD_PRICE, new org.apache.thrift.meta_data.FieldMetaData("sdPrice", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
    tmpMap.put(_Fields.FK_PRICE, new org.apache.thrift.meta_data.FieldMetaData("fkPrice", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
    tmpMap.put(_Fields.AMAZON_PRICE, new org.apache.thrift.meta_data.FieldMetaData("amazonPrice", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
    tmpMap.put(_Fields.PRODUCT_NAME, new org.apache.thrift.meta_data.FieldMetaData("productName", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.LAST_PROCESSED_TIMESTAMP, new org.apache.thrift.meta_data.FieldMetaData("lastProcessedTimestamp", 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(PdPriceComp.class, metaDataMap);
  }

  public PdPriceComp() {
  }

  public PdPriceComp(
    long item_id,
    double dealPrice,
    double saholicPrice,
    double sdPrice,
    double fkPrice,
    double amazonPrice,
    String productName,
    long lastProcessedTimestamp)
  {
    this();
    this.item_id = item_id;
    setItem_idIsSet(true);
    this.dealPrice = dealPrice;
    setDealPriceIsSet(true);
    this.saholicPrice = saholicPrice;
    setSaholicPriceIsSet(true);
    this.sdPrice = sdPrice;
    setSdPriceIsSet(true);
    this.fkPrice = fkPrice;
    setFkPriceIsSet(true);
    this.amazonPrice = amazonPrice;
    setAmazonPriceIsSet(true);
    this.productName = productName;
    this.lastProcessedTimestamp = lastProcessedTimestamp;
    setLastProcessedTimestampIsSet(true);
  }

  /**
   * Performs a deep copy on <i>other</i>.
   */
  public PdPriceComp(PdPriceComp other) {
    __isset_bit_vector.clear();
    __isset_bit_vector.or(other.__isset_bit_vector);
    this.item_id = other.item_id;
    this.dealPrice = other.dealPrice;
    this.saholicPrice = other.saholicPrice;
    this.sdPrice = other.sdPrice;
    this.fkPrice = other.fkPrice;
    this.amazonPrice = other.amazonPrice;
    if (other.isSetProductName()) {
      this.productName = other.productName;
    }
    this.lastProcessedTimestamp = other.lastProcessedTimestamp;
  }

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

  @Override
  public void clear() {
    setItem_idIsSet(false);
    this.item_id = 0;
    setDealPriceIsSet(false);
    this.dealPrice = 0.0;
    setSaholicPriceIsSet(false);
    this.saholicPrice = 0.0;
    setSdPriceIsSet(false);
    this.sdPrice = 0.0;
    setFkPriceIsSet(false);
    this.fkPrice = 0.0;
    setAmazonPriceIsSet(false);
    this.amazonPrice = 0.0;
    this.productName = null;
    setLastProcessedTimestampIsSet(false);
    this.lastProcessedTimestamp = 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 getDealPrice() {
    return this.dealPrice;
  }

  public void setDealPrice(double dealPrice) {
    this.dealPrice = dealPrice;
    setDealPriceIsSet(true);
  }

  public void unsetDealPrice() {
    __isset_bit_vector.clear(__DEALPRICE_ISSET_ID);
  }

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

  public void setDealPriceIsSet(boolean value) {
    __isset_bit_vector.set(__DEALPRICE_ISSET_ID, value);
  }

  public double getSaholicPrice() {
    return this.saholicPrice;
  }

  public void setSaholicPrice(double saholicPrice) {
    this.saholicPrice = saholicPrice;
    setSaholicPriceIsSet(true);
  }

  public void unsetSaholicPrice() {
    __isset_bit_vector.clear(__SAHOLICPRICE_ISSET_ID);
  }

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

  public void setSaholicPriceIsSet(boolean value) {
    __isset_bit_vector.set(__SAHOLICPRICE_ISSET_ID, value);
  }

  public double getSdPrice() {
    return this.sdPrice;
  }

  public void setSdPrice(double sdPrice) {
    this.sdPrice = sdPrice;
    setSdPriceIsSet(true);
  }

  public void unsetSdPrice() {
    __isset_bit_vector.clear(__SDPRICE_ISSET_ID);
  }

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

  public void setSdPriceIsSet(boolean value) {
    __isset_bit_vector.set(__SDPRICE_ISSET_ID, value);
  }

  public double getFkPrice() {
    return this.fkPrice;
  }

  public void setFkPrice(double fkPrice) {
    this.fkPrice = fkPrice;
    setFkPriceIsSet(true);
  }

  public void unsetFkPrice() {
    __isset_bit_vector.clear(__FKPRICE_ISSET_ID);
  }

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

  public void setFkPriceIsSet(boolean value) {
    __isset_bit_vector.set(__FKPRICE_ISSET_ID, value);
  }

  public double getAmazonPrice() {
    return this.amazonPrice;
  }

  public void setAmazonPrice(double amazonPrice) {
    this.amazonPrice = amazonPrice;
    setAmazonPriceIsSet(true);
  }

  public void unsetAmazonPrice() {
    __isset_bit_vector.clear(__AMAZONPRICE_ISSET_ID);
  }

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

  public void setAmazonPriceIsSet(boolean value) {
    __isset_bit_vector.set(__AMAZONPRICE_ISSET_ID, value);
  }

  public String getProductName() {
    return this.productName;
  }

  public void setProductName(String productName) {
    this.productName = productName;
  }

  public void unsetProductName() {
    this.productName = null;
  }

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

  public void setProductNameIsSet(boolean value) {
    if (!value) {
      this.productName = null;
    }
  }

  public long getLastProcessedTimestamp() {
    return this.lastProcessedTimestamp;
  }

  public void setLastProcessedTimestamp(long lastProcessedTimestamp) {
    this.lastProcessedTimestamp = lastProcessedTimestamp;
    setLastProcessedTimestampIsSet(true);
  }

  public void unsetLastProcessedTimestamp() {
    __isset_bit_vector.clear(__LASTPROCESSEDTIMESTAMP_ISSET_ID);
  }

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

  public void setLastProcessedTimestampIsSet(boolean value) {
    __isset_bit_vector.set(__LASTPROCESSEDTIMESTAMP_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 DEAL_PRICE:
      if (value == null) {
        unsetDealPrice();
      } else {
        setDealPrice((Double)value);
      }
      break;

    case SAHOLIC_PRICE:
      if (value == null) {
        unsetSaholicPrice();
      } else {
        setSaholicPrice((Double)value);
      }
      break;

    case SD_PRICE:
      if (value == null) {
        unsetSdPrice();
      } else {
        setSdPrice((Double)value);
      }
      break;

    case FK_PRICE:
      if (value == null) {
        unsetFkPrice();
      } else {
        setFkPrice((Double)value);
      }
      break;

    case AMAZON_PRICE:
      if (value == null) {
        unsetAmazonPrice();
      } else {
        setAmazonPrice((Double)value);
      }
      break;

    case PRODUCT_NAME:
      if (value == null) {
        unsetProductName();
      } else {
        setProductName((String)value);
      }
      break;

    case LAST_PROCESSED_TIMESTAMP:
      if (value == null) {
        unsetLastProcessedTimestamp();
      } else {
        setLastProcessedTimestamp((Long)value);
      }
      break;

    }
  }

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

    case DEAL_PRICE:
      return Double.valueOf(getDealPrice());

    case SAHOLIC_PRICE:
      return Double.valueOf(getSaholicPrice());

    case SD_PRICE:
      return Double.valueOf(getSdPrice());

    case FK_PRICE:
      return Double.valueOf(getFkPrice());

    case AMAZON_PRICE:
      return Double.valueOf(getAmazonPrice());

    case PRODUCT_NAME:
      return getProductName();

    case LAST_PROCESSED_TIMESTAMP:
      return Long.valueOf(getLastProcessedTimestamp());

    }
    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 DEAL_PRICE:
      return isSetDealPrice();
    case SAHOLIC_PRICE:
      return isSetSaholicPrice();
    case SD_PRICE:
      return isSetSdPrice();
    case FK_PRICE:
      return isSetFkPrice();
    case AMAZON_PRICE:
      return isSetAmazonPrice();
    case PRODUCT_NAME:
      return isSetProductName();
    case LAST_PROCESSED_TIMESTAMP:
      return isSetLastProcessedTimestamp();
    }
    throw new IllegalStateException();
  }

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

  public boolean equals(PdPriceComp 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_dealPrice = true;
    boolean that_present_dealPrice = true;
    if (this_present_dealPrice || that_present_dealPrice) {
      if (!(this_present_dealPrice && that_present_dealPrice))
        return false;
      if (this.dealPrice != that.dealPrice)
        return false;
    }

    boolean this_present_saholicPrice = true;
    boolean that_present_saholicPrice = true;
    if (this_present_saholicPrice || that_present_saholicPrice) {
      if (!(this_present_saholicPrice && that_present_saholicPrice))
        return false;
      if (this.saholicPrice != that.saholicPrice)
        return false;
    }

    boolean this_present_sdPrice = true;
    boolean that_present_sdPrice = true;
    if (this_present_sdPrice || that_present_sdPrice) {
      if (!(this_present_sdPrice && that_present_sdPrice))
        return false;
      if (this.sdPrice != that.sdPrice)
        return false;
    }

    boolean this_present_fkPrice = true;
    boolean that_present_fkPrice = true;
    if (this_present_fkPrice || that_present_fkPrice) {
      if (!(this_present_fkPrice && that_present_fkPrice))
        return false;
      if (this.fkPrice != that.fkPrice)
        return false;
    }

    boolean this_present_amazonPrice = true;
    boolean that_present_amazonPrice = true;
    if (this_present_amazonPrice || that_present_amazonPrice) {
      if (!(this_present_amazonPrice && that_present_amazonPrice))
        return false;
      if (this.amazonPrice != that.amazonPrice)
        return false;
    }

    boolean this_present_productName = true && this.isSetProductName();
    boolean that_present_productName = true && that.isSetProductName();
    if (this_present_productName || that_present_productName) {
      if (!(this_present_productName && that_present_productName))
        return false;
      if (!this.productName.equals(that.productName))
        return false;
    }

    boolean this_present_lastProcessedTimestamp = true;
    boolean that_present_lastProcessedTimestamp = true;
    if (this_present_lastProcessedTimestamp || that_present_lastProcessedTimestamp) {
      if (!(this_present_lastProcessedTimestamp && that_present_lastProcessedTimestamp))
        return false;
      if (this.lastProcessedTimestamp != that.lastProcessedTimestamp)
        return false;
    }

    return true;
  }

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

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

    int lastComparison = 0;
    PdPriceComp typedOther = (PdPriceComp)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(isSetDealPrice()).compareTo(typedOther.isSetDealPrice());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetDealPrice()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.dealPrice, typedOther.dealPrice);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetSaholicPrice()).compareTo(typedOther.isSetSaholicPrice());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSaholicPrice()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.saholicPrice, typedOther.saholicPrice);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetSdPrice()).compareTo(typedOther.isSetSdPrice());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSdPrice()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sdPrice, typedOther.sdPrice);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetFkPrice()).compareTo(typedOther.isSetFkPrice());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetFkPrice()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.fkPrice, typedOther.fkPrice);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetAmazonPrice()).compareTo(typedOther.isSetAmazonPrice());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetAmazonPrice()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.amazonPrice, typedOther.amazonPrice);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetProductName()).compareTo(typedOther.isSetProductName());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetProductName()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.productName, typedOther.productName);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetLastProcessedTimestamp()).compareTo(typedOther.isSetLastProcessedTimestamp());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetLastProcessedTimestamp()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.lastProcessedTimestamp, typedOther.lastProcessedTimestamp);
      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: // DEAL_PRICE
          if (field.type == org.apache.thrift.protocol.TType.DOUBLE) {
            this.dealPrice = iprot.readDouble();
            setDealPriceIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 3: // SAHOLIC_PRICE
          if (field.type == org.apache.thrift.protocol.TType.DOUBLE) {
            this.saholicPrice = iprot.readDouble();
            setSaholicPriceIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 4: // SD_PRICE
          if (field.type == org.apache.thrift.protocol.TType.DOUBLE) {
            this.sdPrice = iprot.readDouble();
            setSdPriceIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 5: // FK_PRICE
          if (field.type == org.apache.thrift.protocol.TType.DOUBLE) {
            this.fkPrice = iprot.readDouble();
            setFkPriceIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 6: // AMAZON_PRICE
          if (field.type == org.apache.thrift.protocol.TType.DOUBLE) {
            this.amazonPrice = iprot.readDouble();
            setAmazonPriceIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 7: // PRODUCT_NAME
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
            this.productName = iprot.readString();
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 8: // LAST_PROCESSED_TIMESTAMP
          if (field.type == org.apache.thrift.protocol.TType.I64) {
            this.lastProcessedTimestamp = iprot.readI64();
            setLastProcessedTimestampIsSet(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(DEAL_PRICE_FIELD_DESC);
    oprot.writeDouble(this.dealPrice);
    oprot.writeFieldEnd();
    oprot.writeFieldBegin(SAHOLIC_PRICE_FIELD_DESC);
    oprot.writeDouble(this.saholicPrice);
    oprot.writeFieldEnd();
    oprot.writeFieldBegin(SD_PRICE_FIELD_DESC);
    oprot.writeDouble(this.sdPrice);
    oprot.writeFieldEnd();
    oprot.writeFieldBegin(FK_PRICE_FIELD_DESC);
    oprot.writeDouble(this.fkPrice);
    oprot.writeFieldEnd();
    oprot.writeFieldBegin(AMAZON_PRICE_FIELD_DESC);
    oprot.writeDouble(this.amazonPrice);
    oprot.writeFieldEnd();
    if (this.productName != null) {
      oprot.writeFieldBegin(PRODUCT_NAME_FIELD_DESC);
      oprot.writeString(this.productName);
      oprot.writeFieldEnd();
    }
    oprot.writeFieldBegin(LAST_PROCESSED_TIMESTAMP_FIELD_DESC);
    oprot.writeI64(this.lastProcessedTimestamp);
    oprot.writeFieldEnd();
    oprot.writeFieldStop();
    oprot.writeStructEnd();
  }

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

    sb.append("item_id:");
    sb.append(this.item_id);
    first = false;
    if (!first) sb.append(", ");
    sb.append("dealPrice:");
    sb.append(this.dealPrice);
    first = false;
    if (!first) sb.append(", ");
    sb.append("saholicPrice:");
    sb.append(this.saholicPrice);
    first = false;
    if (!first) sb.append(", ");
    sb.append("sdPrice:");
    sb.append(this.sdPrice);
    first = false;
    if (!first) sb.append(", ");
    sb.append("fkPrice:");
    sb.append(this.fkPrice);
    first = false;
    if (!first) sb.append(", ");
    sb.append("amazonPrice:");
    sb.append(this.amazonPrice);
    first = false;
    if (!first) sb.append(", ");
    sb.append("productName:");
    if (this.productName == null) {
      sb.append("null");
    } else {
      sb.append(this.productName);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("lastProcessedTimestamp:");
    sb.append(this.lastProcessedTimestamp);
    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);
    }
  }

}