Subversion Repositories SmartDukaan

Rev

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

  private static final org.apache.thrift.protocol.TField DATE_OF_SALE_FIELD_DESC = new org.apache.thrift.protocol.TField("dateOfSale", org.apache.thrift.protocol.TType.I64, (short)1);
  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)2);
  private static final org.apache.thrift.protocol.TField TOTAL_ORDER_COUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("totalOrderCount", org.apache.thrift.protocol.TType.I32, (short)3);
  private static final org.apache.thrift.protocol.TField IS_OUT_OF_STOCK_FIELD_DESC = new org.apache.thrift.protocol.TField("isOutOfStock", org.apache.thrift.protocol.TType.BOOL, (short)4);
  private static final org.apache.thrift.protocol.TField TOTAL_SALE_FIELD_DESC = new org.apache.thrift.protocol.TField("totalSale", org.apache.thrift.protocol.TType.DOUBLE, (short)5);
  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)6);
  private static final org.apache.thrift.protocol.TField FC_LOCATION_FIELD_DESC = new org.apache.thrift.protocol.TField("fcLocation", org.apache.thrift.protocol.TType.I32, (short)7);
  private static final org.apache.thrift.protocol.TField RETURN_QUANTITY_FIELD_DESC = new org.apache.thrift.protocol.TField("returnQuantity", org.apache.thrift.protocol.TType.I32, (short)8);
  private static final org.apache.thrift.protocol.TField RETURN_VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("returnValue", org.apache.thrift.protocol.TType.DOUBLE, (short)9);

  private long dateOfSale; // required
  private long item_id; // required
  private int totalOrderCount; // required
  private boolean isOutOfStock; // required
  private double totalSale; // required
  private double ourPrice; // required
  private FlipkartFCWarehouseLocation fcLocation; // required
  private int returnQuantity; // required
  private double returnValue; // 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 {
    DATE_OF_SALE((short)1, "dateOfSale"),
    ITEM_ID((short)2, "item_id"),
    TOTAL_ORDER_COUNT((short)3, "totalOrderCount"),
    IS_OUT_OF_STOCK((short)4, "isOutOfStock"),
    TOTAL_SALE((short)5, "totalSale"),
    OUR_PRICE((short)6, "ourPrice"),
    /**
     * 
     * @see FlipkartFCWarehouseLocation
     */
    FC_LOCATION((short)7, "fcLocation"),
    RETURN_QUANTITY((short)8, "returnQuantity"),
    RETURN_VALUE((short)9, "returnValue");

    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: // DATE_OF_SALE
          return DATE_OF_SALE;
        case 2: // ITEM_ID
          return ITEM_ID;
        case 3: // TOTAL_ORDER_COUNT
          return TOTAL_ORDER_COUNT;
        case 4: // IS_OUT_OF_STOCK
          return IS_OUT_OF_STOCK;
        case 5: // TOTAL_SALE
          return TOTAL_SALE;
        case 6: // OUR_PRICE
          return OUR_PRICE;
        case 7: // FC_LOCATION
          return FC_LOCATION;
        case 8: // RETURN_QUANTITY
          return RETURN_QUANTITY;
        case 9: // RETURN_VALUE
          return RETURN_VALUE;
        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 __DATEOFSALE_ISSET_ID = 0;
  private static final int __ITEM_ID_ISSET_ID = 1;
  private static final int __TOTALORDERCOUNT_ISSET_ID = 2;
  private static final int __ISOUTOFSTOCK_ISSET_ID = 3;
  private static final int __TOTALSALE_ISSET_ID = 4;
  private static final int __OURPRICE_ISSET_ID = 5;
  private static final int __RETURNQUANTITY_ISSET_ID = 6;
  private static final int __RETURNVALUE_ISSET_ID = 7;
  private BitSet __isset_bit_vector = new BitSet(8);

  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.DATE_OF_SALE, new org.apache.thrift.meta_data.FieldMetaData("dateOfSale", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    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.TOTAL_ORDER_COUNT, new org.apache.thrift.meta_data.FieldMetaData("totalOrderCount", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
    tmpMap.put(_Fields.IS_OUT_OF_STOCK, new org.apache.thrift.meta_data.FieldMetaData("isOutOfStock", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
    tmpMap.put(_Fields.TOTAL_SALE, new org.apache.thrift.meta_data.FieldMetaData("totalSale", 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.FC_LOCATION, new org.apache.thrift.meta_data.FieldMetaData("fcLocation", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, FlipkartFCWarehouseLocation.class)));
    tmpMap.put(_Fields.RETURN_QUANTITY, new org.apache.thrift.meta_data.FieldMetaData("returnQuantity", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
    tmpMap.put(_Fields.RETURN_VALUE, new org.apache.thrift.meta_data.FieldMetaData("returnValue", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
    metaDataMap = Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(FlipkartFaSalesSnapshot.class, metaDataMap);
  }

  public FlipkartFaSalesSnapshot() {
  }

  public FlipkartFaSalesSnapshot(
    long dateOfSale,
    long item_id,
    int totalOrderCount,
    boolean isOutOfStock,
    double totalSale,
    double ourPrice,
    FlipkartFCWarehouseLocation fcLocation,
    int returnQuantity,
    double returnValue)
  {
    this();
    this.dateOfSale = dateOfSale;
    setDateOfSaleIsSet(true);
    this.item_id = item_id;
    setItem_idIsSet(true);
    this.totalOrderCount = totalOrderCount;
    setTotalOrderCountIsSet(true);
    this.isOutOfStock = isOutOfStock;
    setIsOutOfStockIsSet(true);
    this.totalSale = totalSale;
    setTotalSaleIsSet(true);
    this.ourPrice = ourPrice;
    setOurPriceIsSet(true);
    this.fcLocation = fcLocation;
    this.returnQuantity = returnQuantity;
    setReturnQuantityIsSet(true);
    this.returnValue = returnValue;
    setReturnValueIsSet(true);
  }

  /**
   * Performs a deep copy on <i>other</i>.
   */
  public FlipkartFaSalesSnapshot(FlipkartFaSalesSnapshot other) {
    __isset_bit_vector.clear();
    __isset_bit_vector.or(other.__isset_bit_vector);
    this.dateOfSale = other.dateOfSale;
    this.item_id = other.item_id;
    this.totalOrderCount = other.totalOrderCount;
    this.isOutOfStock = other.isOutOfStock;
    this.totalSale = other.totalSale;
    this.ourPrice = other.ourPrice;
    if (other.isSetFcLocation()) {
      this.fcLocation = other.fcLocation;
    }
    this.returnQuantity = other.returnQuantity;
    this.returnValue = other.returnValue;
  }

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

  @Override
  public void clear() {
    setDateOfSaleIsSet(false);
    this.dateOfSale = 0;
    setItem_idIsSet(false);
    this.item_id = 0;
    setTotalOrderCountIsSet(false);
    this.totalOrderCount = 0;
    setIsOutOfStockIsSet(false);
    this.isOutOfStock = false;
    setTotalSaleIsSet(false);
    this.totalSale = 0.0;
    setOurPriceIsSet(false);
    this.ourPrice = 0.0;
    this.fcLocation = null;
    setReturnQuantityIsSet(false);
    this.returnQuantity = 0;
    setReturnValueIsSet(false);
    this.returnValue = 0.0;
  }

  public long getDateOfSale() {
    return this.dateOfSale;
  }

  public void setDateOfSale(long dateOfSale) {
    this.dateOfSale = dateOfSale;
    setDateOfSaleIsSet(true);
  }

  public void unsetDateOfSale() {
    __isset_bit_vector.clear(__DATEOFSALE_ISSET_ID);
  }

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

  public void setDateOfSaleIsSet(boolean value) {
    __isset_bit_vector.set(__DATEOFSALE_ISSET_ID, value);
  }

  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 int getTotalOrderCount() {
    return this.totalOrderCount;
  }

  public void setTotalOrderCount(int totalOrderCount) {
    this.totalOrderCount = totalOrderCount;
    setTotalOrderCountIsSet(true);
  }

  public void unsetTotalOrderCount() {
    __isset_bit_vector.clear(__TOTALORDERCOUNT_ISSET_ID);
  }

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

  public void setTotalOrderCountIsSet(boolean value) {
    __isset_bit_vector.set(__TOTALORDERCOUNT_ISSET_ID, value);
  }

  public boolean isIsOutOfStock() {
    return this.isOutOfStock;
  }

  public void setIsOutOfStock(boolean isOutOfStock) {
    this.isOutOfStock = isOutOfStock;
    setIsOutOfStockIsSet(true);
  }

  public void unsetIsOutOfStock() {
    __isset_bit_vector.clear(__ISOUTOFSTOCK_ISSET_ID);
  }

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

  public void setIsOutOfStockIsSet(boolean value) {
    __isset_bit_vector.set(__ISOUTOFSTOCK_ISSET_ID, value);
  }

  public double getTotalSale() {
    return this.totalSale;
  }

  public void setTotalSale(double totalSale) {
    this.totalSale = totalSale;
    setTotalSaleIsSet(true);
  }

  public void unsetTotalSale() {
    __isset_bit_vector.clear(__TOTALSALE_ISSET_ID);
  }

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

  public void setTotalSaleIsSet(boolean value) {
    __isset_bit_vector.set(__TOTALSALE_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);
  }

  /**
   * 
   * @see FlipkartFCWarehouseLocation
   */
  public FlipkartFCWarehouseLocation getFcLocation() {
    return this.fcLocation;
  }

  /**
   * 
   * @see FlipkartFCWarehouseLocation
   */
  public void setFcLocation(FlipkartFCWarehouseLocation fcLocation) {
    this.fcLocation = fcLocation;
  }

  public void unsetFcLocation() {
    this.fcLocation = null;
  }

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

  public void setFcLocationIsSet(boolean value) {
    if (!value) {
      this.fcLocation = null;
    }
  }

  public int getReturnQuantity() {
    return this.returnQuantity;
  }

  public void setReturnQuantity(int returnQuantity) {
    this.returnQuantity = returnQuantity;
    setReturnQuantityIsSet(true);
  }

  public void unsetReturnQuantity() {
    __isset_bit_vector.clear(__RETURNQUANTITY_ISSET_ID);
  }

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

  public void setReturnQuantityIsSet(boolean value) {
    __isset_bit_vector.set(__RETURNQUANTITY_ISSET_ID, value);
  }

  public double getReturnValue() {
    return this.returnValue;
  }

  public void setReturnValue(double returnValue) {
    this.returnValue = returnValue;
    setReturnValueIsSet(true);
  }

  public void unsetReturnValue() {
    __isset_bit_vector.clear(__RETURNVALUE_ISSET_ID);
  }

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

  public void setReturnValueIsSet(boolean value) {
    __isset_bit_vector.set(__RETURNVALUE_ISSET_ID, value);
  }

  public void setFieldValue(_Fields field, Object value) {
    switch (field) {
    case DATE_OF_SALE:
      if (value == null) {
        unsetDateOfSale();
      } else {
        setDateOfSale((Long)value);
      }
      break;

    case ITEM_ID:
      if (value == null) {
        unsetItem_id();
      } else {
        setItem_id((Long)value);
      }
      break;

    case TOTAL_ORDER_COUNT:
      if (value == null) {
        unsetTotalOrderCount();
      } else {
        setTotalOrderCount((Integer)value);
      }
      break;

    case IS_OUT_OF_STOCK:
      if (value == null) {
        unsetIsOutOfStock();
      } else {
        setIsOutOfStock((Boolean)value);
      }
      break;

    case TOTAL_SALE:
      if (value == null) {
        unsetTotalSale();
      } else {
        setTotalSale((Double)value);
      }
      break;

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

    case FC_LOCATION:
      if (value == null) {
        unsetFcLocation();
      } else {
        setFcLocation((FlipkartFCWarehouseLocation)value);
      }
      break;

    case RETURN_QUANTITY:
      if (value == null) {
        unsetReturnQuantity();
      } else {
        setReturnQuantity((Integer)value);
      }
      break;

    case RETURN_VALUE:
      if (value == null) {
        unsetReturnValue();
      } else {
        setReturnValue((Double)value);
      }
      break;

    }
  }

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

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

    case TOTAL_ORDER_COUNT:
      return Integer.valueOf(getTotalOrderCount());

    case IS_OUT_OF_STOCK:
      return Boolean.valueOf(isIsOutOfStock());

    case TOTAL_SALE:
      return Double.valueOf(getTotalSale());

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

    case FC_LOCATION:
      return getFcLocation();

    case RETURN_QUANTITY:
      return Integer.valueOf(getReturnQuantity());

    case RETURN_VALUE:
      return Double.valueOf(getReturnValue());

    }
    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 DATE_OF_SALE:
      return isSetDateOfSale();
    case ITEM_ID:
      return isSetItem_id();
    case TOTAL_ORDER_COUNT:
      return isSetTotalOrderCount();
    case IS_OUT_OF_STOCK:
      return isSetIsOutOfStock();
    case TOTAL_SALE:
      return isSetTotalSale();
    case OUR_PRICE:
      return isSetOurPrice();
    case FC_LOCATION:
      return isSetFcLocation();
    case RETURN_QUANTITY:
      return isSetReturnQuantity();
    case RETURN_VALUE:
      return isSetReturnValue();
    }
    throw new IllegalStateException();
  }

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

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

    boolean this_present_dateOfSale = true;
    boolean that_present_dateOfSale = true;
    if (this_present_dateOfSale || that_present_dateOfSale) {
      if (!(this_present_dateOfSale && that_present_dateOfSale))
        return false;
      if (this.dateOfSale != that.dateOfSale)
        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_totalOrderCount = true;
    boolean that_present_totalOrderCount = true;
    if (this_present_totalOrderCount || that_present_totalOrderCount) {
      if (!(this_present_totalOrderCount && that_present_totalOrderCount))
        return false;
      if (this.totalOrderCount != that.totalOrderCount)
        return false;
    }

    boolean this_present_isOutOfStock = true;
    boolean that_present_isOutOfStock = true;
    if (this_present_isOutOfStock || that_present_isOutOfStock) {
      if (!(this_present_isOutOfStock && that_present_isOutOfStock))
        return false;
      if (this.isOutOfStock != that.isOutOfStock)
        return false;
    }

    boolean this_present_totalSale = true;
    boolean that_present_totalSale = true;
    if (this_present_totalSale || that_present_totalSale) {
      if (!(this_present_totalSale && that_present_totalSale))
        return false;
      if (this.totalSale != that.totalSale)
        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_fcLocation = true && this.isSetFcLocation();
    boolean that_present_fcLocation = true && that.isSetFcLocation();
    if (this_present_fcLocation || that_present_fcLocation) {
      if (!(this_present_fcLocation && that_present_fcLocation))
        return false;
      if (!this.fcLocation.equals(that.fcLocation))
        return false;
    }

    boolean this_present_returnQuantity = true;
    boolean that_present_returnQuantity = true;
    if (this_present_returnQuantity || that_present_returnQuantity) {
      if (!(this_present_returnQuantity && that_present_returnQuantity))
        return false;
      if (this.returnQuantity != that.returnQuantity)
        return false;
    }

    boolean this_present_returnValue = true;
    boolean that_present_returnValue = true;
    if (this_present_returnValue || that_present_returnValue) {
      if (!(this_present_returnValue && that_present_returnValue))
        return false;
      if (this.returnValue != that.returnValue)
        return false;
    }

    return true;
  }

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

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

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

    lastComparison = Boolean.valueOf(isSetDateOfSale()).compareTo(typedOther.isSetDateOfSale());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetDateOfSale()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.dateOfSale, typedOther.dateOfSale);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    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(isSetTotalOrderCount()).compareTo(typedOther.isSetTotalOrderCount());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetTotalOrderCount()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.totalOrderCount, typedOther.totalOrderCount);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetIsOutOfStock()).compareTo(typedOther.isSetIsOutOfStock());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetIsOutOfStock()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.isOutOfStock, typedOther.isOutOfStock);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetTotalSale()).compareTo(typedOther.isSetTotalSale());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetTotalSale()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.totalSale, typedOther.totalSale);
      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(isSetFcLocation()).compareTo(typedOther.isSetFcLocation());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetFcLocation()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.fcLocation, typedOther.fcLocation);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetReturnQuantity()).compareTo(typedOther.isSetReturnQuantity());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetReturnQuantity()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.returnQuantity, typedOther.returnQuantity);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetReturnValue()).compareTo(typedOther.isSetReturnValue());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetReturnValue()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.returnValue, typedOther.returnValue);
      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: // DATE_OF_SALE
          if (field.type == org.apache.thrift.protocol.TType.I64) {
            this.dateOfSale = iprot.readI64();
            setDateOfSaleIsSet(true);
          } 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.item_id = iprot.readI64();
            setItem_idIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 3: // TOTAL_ORDER_COUNT
          if (field.type == org.apache.thrift.protocol.TType.I32) {
            this.totalOrderCount = iprot.readI32();
            setTotalOrderCountIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 4: // IS_OUT_OF_STOCK
          if (field.type == org.apache.thrift.protocol.TType.BOOL) {
            this.isOutOfStock = iprot.readBool();
            setIsOutOfStockIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 5: // TOTAL_SALE
          if (field.type == org.apache.thrift.protocol.TType.DOUBLE) {
            this.totalSale = iprot.readDouble();
            setTotalSaleIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 6: // 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 7: // FC_LOCATION
          if (field.type == org.apache.thrift.protocol.TType.I32) {
            this.fcLocation = FlipkartFCWarehouseLocation.findByValue(iprot.readI32());
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 8: // RETURN_QUANTITY
          if (field.type == org.apache.thrift.protocol.TType.I32) {
            this.returnQuantity = iprot.readI32();
            setReturnQuantityIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 9: // RETURN_VALUE
          if (field.type == org.apache.thrift.protocol.TType.DOUBLE) {
            this.returnValue = iprot.readDouble();
            setReturnValueIsSet(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(DATE_OF_SALE_FIELD_DESC);
    oprot.writeI64(this.dateOfSale);
    oprot.writeFieldEnd();
    oprot.writeFieldBegin(ITEM_ID_FIELD_DESC);
    oprot.writeI64(this.item_id);
    oprot.writeFieldEnd();
    oprot.writeFieldBegin(TOTAL_ORDER_COUNT_FIELD_DESC);
    oprot.writeI32(this.totalOrderCount);
    oprot.writeFieldEnd();
    oprot.writeFieldBegin(IS_OUT_OF_STOCK_FIELD_DESC);
    oprot.writeBool(this.isOutOfStock);
    oprot.writeFieldEnd();
    oprot.writeFieldBegin(TOTAL_SALE_FIELD_DESC);
    oprot.writeDouble(this.totalSale);
    oprot.writeFieldEnd();
    oprot.writeFieldBegin(OUR_PRICE_FIELD_DESC);
    oprot.writeDouble(this.ourPrice);
    oprot.writeFieldEnd();
    if (this.fcLocation != null) {
      oprot.writeFieldBegin(FC_LOCATION_FIELD_DESC);
      oprot.writeI32(this.fcLocation.getValue());
      oprot.writeFieldEnd();
    }
    oprot.writeFieldBegin(RETURN_QUANTITY_FIELD_DESC);
    oprot.writeI32(this.returnQuantity);
    oprot.writeFieldEnd();
    oprot.writeFieldBegin(RETURN_VALUE_FIELD_DESC);
    oprot.writeDouble(this.returnValue);
    oprot.writeFieldEnd();
    oprot.writeFieldStop();
    oprot.writeStructEnd();
  }

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

    sb.append("dateOfSale:");
    sb.append(this.dateOfSale);
    first = false;
    if (!first) sb.append(", ");
    sb.append("item_id:");
    sb.append(this.item_id);
    first = false;
    if (!first) sb.append(", ");
    sb.append("totalOrderCount:");
    sb.append(this.totalOrderCount);
    first = false;
    if (!first) sb.append(", ");
    sb.append("isOutOfStock:");
    sb.append(this.isOutOfStock);
    first = false;
    if (!first) sb.append(", ");
    sb.append("totalSale:");
    sb.append(this.totalSale);
    first = false;
    if (!first) sb.append(", ");
    sb.append("ourPrice:");
    sb.append(this.ourPrice);
    first = false;
    if (!first) sb.append(", ");
    sb.append("fcLocation:");
    if (this.fcLocation == null) {
      sb.append("null");
    } else {
      sb.append(this.fcLocation);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("returnQuantity:");
    sb.append(this.returnQuantity);
    first = false;
    if (!first) sb.append(", ");
    sb.append("returnValue:");
    sb.append(this.returnValue);
    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);
    }
  }

}