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

  private static final org.apache.thrift.protocol.TField HOTSPOT_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("hotspotId", org.apache.thrift.protocol.TType.STRING, (short)1);
  private static final org.apache.thrift.protocol.TField ORDER_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("orderId", org.apache.thrift.protocol.TType.I64, (short)2);
  private static final org.apache.thrift.protocol.TField COLLECTION_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("collectionType", org.apache.thrift.protocol.TType.STRING, (short)3);
  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)4);
  private static final org.apache.thrift.protocol.TField ADVANCE_AMOUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("advanceAmount", org.apache.thrift.protocol.TType.I64, (short)5);
  private static final org.apache.thrift.protocol.TField CASH_FIELD_DESC = new org.apache.thrift.protocol.TField("cash", org.apache.thrift.protocol.TType.I64, (short)6);
  private static final org.apache.thrift.protocol.TField CARD_FIELD_DESC = new org.apache.thrift.protocol.TField("card", org.apache.thrift.protocol.TType.I64, (short)7);
  private static final org.apache.thrift.protocol.TField ADDED_AT_FIELD_DESC = new org.apache.thrift.protocol.TField("addedAt", org.apache.thrift.protocol.TType.I64, (short)8);
  private static final org.apache.thrift.protocol.TField PUSHED_AT_FIELD_DESC = new org.apache.thrift.protocol.TField("pushedAt", org.apache.thrift.protocol.TType.I64, (short)9);
  private static final org.apache.thrift.protocol.TField PUSHED_TO_OCR_FIELD_DESC = new org.apache.thrift.protocol.TField("pushedToOcr", org.apache.thrift.protocol.TType.BOOL, (short)10);

  private String hotspotId; // required
  private long orderId; // required
  private String collectionType; // required
  private String productName; // required
  private long advanceAmount; // required
  private long cash; // required
  private long card; // required
  private long addedAt; // required
  private long pushedAt; // required
  private boolean pushedToOcr; // 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 {
    HOTSPOT_ID((short)1, "hotspotId"),
    ORDER_ID((short)2, "orderId"),
    COLLECTION_TYPE((short)3, "collectionType"),
    PRODUCT_NAME((short)4, "productName"),
    ADVANCE_AMOUNT((short)5, "advanceAmount"),
    CASH((short)6, "cash"),
    CARD((short)7, "card"),
    ADDED_AT((short)8, "addedAt"),
    PUSHED_AT((short)9, "pushedAt"),
    PUSHED_TO_OCR((short)10, "pushedToOcr");

    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: // HOTSPOT_ID
          return HOTSPOT_ID;
        case 2: // ORDER_ID
          return ORDER_ID;
        case 3: // COLLECTION_TYPE
          return COLLECTION_TYPE;
        case 4: // PRODUCT_NAME
          return PRODUCT_NAME;
        case 5: // ADVANCE_AMOUNT
          return ADVANCE_AMOUNT;
        case 6: // CASH
          return CASH;
        case 7: // CARD
          return CARD;
        case 8: // ADDED_AT
          return ADDED_AT;
        case 9: // PUSHED_AT
          return PUSHED_AT;
        case 10: // PUSHED_TO_OCR
          return PUSHED_TO_OCR;
        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 __ORDERID_ISSET_ID = 0;
  private static final int __ADVANCEAMOUNT_ISSET_ID = 1;
  private static final int __CASH_ISSET_ID = 2;
  private static final int __CARD_ISSET_ID = 3;
  private static final int __ADDEDAT_ISSET_ID = 4;
  private static final int __PUSHEDAT_ISSET_ID = 5;
  private static final int __PUSHEDTOOCR_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.HOTSPOT_ID, new org.apache.thrift.meta_data.FieldMetaData("hotspotId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.ORDER_ID, new org.apache.thrift.meta_data.FieldMetaData("orderId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.COLLECTION_TYPE, new org.apache.thrift.meta_data.FieldMetaData("collectionType", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    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.ADVANCE_AMOUNT, new org.apache.thrift.meta_data.FieldMetaData("advanceAmount", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.CASH, new org.apache.thrift.meta_data.FieldMetaData("cash", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.CARD, new org.apache.thrift.meta_data.FieldMetaData("card", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.ADDED_AT, new org.apache.thrift.meta_data.FieldMetaData("addedAt", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.PUSHED_AT, new org.apache.thrift.meta_data.FieldMetaData("pushedAt", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.PUSHED_TO_OCR, new org.apache.thrift.meta_data.FieldMetaData("pushedToOcr", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
    metaDataMap = Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(StoreOrderCollection.class, metaDataMap);
  }

  public StoreOrderCollection() {
  }

  public StoreOrderCollection(
    String hotspotId,
    long orderId,
    String collectionType,
    String productName,
    long advanceAmount,
    long cash,
    long card,
    long addedAt,
    long pushedAt,
    boolean pushedToOcr)
  {
    this();
    this.hotspotId = hotspotId;
    this.orderId = orderId;
    setOrderIdIsSet(true);
    this.collectionType = collectionType;
    this.productName = productName;
    this.advanceAmount = advanceAmount;
    setAdvanceAmountIsSet(true);
    this.cash = cash;
    setCashIsSet(true);
    this.card = card;
    setCardIsSet(true);
    this.addedAt = addedAt;
    setAddedAtIsSet(true);
    this.pushedAt = pushedAt;
    setPushedAtIsSet(true);
    this.pushedToOcr = pushedToOcr;
    setPushedToOcrIsSet(true);
  }

  /**
   * Performs a deep copy on <i>other</i>.
   */
  public StoreOrderCollection(StoreOrderCollection other) {
    __isset_bit_vector.clear();
    __isset_bit_vector.or(other.__isset_bit_vector);
    if (other.isSetHotspotId()) {
      this.hotspotId = other.hotspotId;
    }
    this.orderId = other.orderId;
    if (other.isSetCollectionType()) {
      this.collectionType = other.collectionType;
    }
    if (other.isSetProductName()) {
      this.productName = other.productName;
    }
    this.advanceAmount = other.advanceAmount;
    this.cash = other.cash;
    this.card = other.card;
    this.addedAt = other.addedAt;
    this.pushedAt = other.pushedAt;
    this.pushedToOcr = other.pushedToOcr;
  }

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

  @Override
  public void clear() {
    this.hotspotId = null;
    setOrderIdIsSet(false);
    this.orderId = 0;
    this.collectionType = null;
    this.productName = null;
    setAdvanceAmountIsSet(false);
    this.advanceAmount = 0;
    setCashIsSet(false);
    this.cash = 0;
    setCardIsSet(false);
    this.card = 0;
    setAddedAtIsSet(false);
    this.addedAt = 0;
    setPushedAtIsSet(false);
    this.pushedAt = 0;
    setPushedToOcrIsSet(false);
    this.pushedToOcr = false;
  }

  public String getHotspotId() {
    return this.hotspotId;
  }

  public void setHotspotId(String hotspotId) {
    this.hotspotId = hotspotId;
  }

  public void unsetHotspotId() {
    this.hotspotId = null;
  }

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

  public void setHotspotIdIsSet(boolean value) {
    if (!value) {
      this.hotspotId = null;
    }
  }

  public long getOrderId() {
    return this.orderId;
  }

  public void setOrderId(long orderId) {
    this.orderId = orderId;
    setOrderIdIsSet(true);
  }

  public void unsetOrderId() {
    __isset_bit_vector.clear(__ORDERID_ISSET_ID);
  }

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

  public void setOrderIdIsSet(boolean value) {
    __isset_bit_vector.set(__ORDERID_ISSET_ID, value);
  }

  public String getCollectionType() {
    return this.collectionType;
  }

  public void setCollectionType(String collectionType) {
    this.collectionType = collectionType;
  }

  public void unsetCollectionType() {
    this.collectionType = null;
  }

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

  public void setCollectionTypeIsSet(boolean value) {
    if (!value) {
      this.collectionType = null;
    }
  }

  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 getAdvanceAmount() {
    return this.advanceAmount;
  }

  public void setAdvanceAmount(long advanceAmount) {
    this.advanceAmount = advanceAmount;
    setAdvanceAmountIsSet(true);
  }

  public void unsetAdvanceAmount() {
    __isset_bit_vector.clear(__ADVANCEAMOUNT_ISSET_ID);
  }

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

  public void setAdvanceAmountIsSet(boolean value) {
    __isset_bit_vector.set(__ADVANCEAMOUNT_ISSET_ID, value);
  }

  public long getCash() {
    return this.cash;
  }

  public void setCash(long cash) {
    this.cash = cash;
    setCashIsSet(true);
  }

  public void unsetCash() {
    __isset_bit_vector.clear(__CASH_ISSET_ID);
  }

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

  public void setCashIsSet(boolean value) {
    __isset_bit_vector.set(__CASH_ISSET_ID, value);
  }

  public long getCard() {
    return this.card;
  }

  public void setCard(long card) {
    this.card = card;
    setCardIsSet(true);
  }

  public void unsetCard() {
    __isset_bit_vector.clear(__CARD_ISSET_ID);
  }

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

  public void setCardIsSet(boolean value) {
    __isset_bit_vector.set(__CARD_ISSET_ID, value);
  }

  public long getAddedAt() {
    return this.addedAt;
  }

  public void setAddedAt(long addedAt) {
    this.addedAt = addedAt;
    setAddedAtIsSet(true);
  }

  public void unsetAddedAt() {
    __isset_bit_vector.clear(__ADDEDAT_ISSET_ID);
  }

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

  public void setAddedAtIsSet(boolean value) {
    __isset_bit_vector.set(__ADDEDAT_ISSET_ID, value);
  }

  public long getPushedAt() {
    return this.pushedAt;
  }

  public void setPushedAt(long pushedAt) {
    this.pushedAt = pushedAt;
    setPushedAtIsSet(true);
  }

  public void unsetPushedAt() {
    __isset_bit_vector.clear(__PUSHEDAT_ISSET_ID);
  }

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

  public void setPushedAtIsSet(boolean value) {
    __isset_bit_vector.set(__PUSHEDAT_ISSET_ID, value);
  }

  public boolean isPushedToOcr() {
    return this.pushedToOcr;
  }

  public void setPushedToOcr(boolean pushedToOcr) {
    this.pushedToOcr = pushedToOcr;
    setPushedToOcrIsSet(true);
  }

  public void unsetPushedToOcr() {
    __isset_bit_vector.clear(__PUSHEDTOOCR_ISSET_ID);
  }

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

  public void setPushedToOcrIsSet(boolean value) {
    __isset_bit_vector.set(__PUSHEDTOOCR_ISSET_ID, value);
  }

  public void setFieldValue(_Fields field, Object value) {
    switch (field) {
    case HOTSPOT_ID:
      if (value == null) {
        unsetHotspotId();
      } else {
        setHotspotId((String)value);
      }
      break;

    case ORDER_ID:
      if (value == null) {
        unsetOrderId();
      } else {
        setOrderId((Long)value);
      }
      break;

    case COLLECTION_TYPE:
      if (value == null) {
        unsetCollectionType();
      } else {
        setCollectionType((String)value);
      }
      break;

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

    case ADVANCE_AMOUNT:
      if (value == null) {
        unsetAdvanceAmount();
      } else {
        setAdvanceAmount((Long)value);
      }
      break;

    case CASH:
      if (value == null) {
        unsetCash();
      } else {
        setCash((Long)value);
      }
      break;

    case CARD:
      if (value == null) {
        unsetCard();
      } else {
        setCard((Long)value);
      }
      break;

    case ADDED_AT:
      if (value == null) {
        unsetAddedAt();
      } else {
        setAddedAt((Long)value);
      }
      break;

    case PUSHED_AT:
      if (value == null) {
        unsetPushedAt();
      } else {
        setPushedAt((Long)value);
      }
      break;

    case PUSHED_TO_OCR:
      if (value == null) {
        unsetPushedToOcr();
      } else {
        setPushedToOcr((Boolean)value);
      }
      break;

    }
  }

  public Object getFieldValue(_Fields field) {
    switch (field) {
    case HOTSPOT_ID:
      return getHotspotId();

    case ORDER_ID:
      return Long.valueOf(getOrderId());

    case COLLECTION_TYPE:
      return getCollectionType();

    case PRODUCT_NAME:
      return getProductName();

    case ADVANCE_AMOUNT:
      return Long.valueOf(getAdvanceAmount());

    case CASH:
      return Long.valueOf(getCash());

    case CARD:
      return Long.valueOf(getCard());

    case ADDED_AT:
      return Long.valueOf(getAddedAt());

    case PUSHED_AT:
      return Long.valueOf(getPushedAt());

    case PUSHED_TO_OCR:
      return Boolean.valueOf(isPushedToOcr());

    }
    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 HOTSPOT_ID:
      return isSetHotspotId();
    case ORDER_ID:
      return isSetOrderId();
    case COLLECTION_TYPE:
      return isSetCollectionType();
    case PRODUCT_NAME:
      return isSetProductName();
    case ADVANCE_AMOUNT:
      return isSetAdvanceAmount();
    case CASH:
      return isSetCash();
    case CARD:
      return isSetCard();
    case ADDED_AT:
      return isSetAddedAt();
    case PUSHED_AT:
      return isSetPushedAt();
    case PUSHED_TO_OCR:
      return isSetPushedToOcr();
    }
    throw new IllegalStateException();
  }

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

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

    boolean this_present_hotspotId = true && this.isSetHotspotId();
    boolean that_present_hotspotId = true && that.isSetHotspotId();
    if (this_present_hotspotId || that_present_hotspotId) {
      if (!(this_present_hotspotId && that_present_hotspotId))
        return false;
      if (!this.hotspotId.equals(that.hotspotId))
        return false;
    }

    boolean this_present_orderId = true;
    boolean that_present_orderId = true;
    if (this_present_orderId || that_present_orderId) {
      if (!(this_present_orderId && that_present_orderId))
        return false;
      if (this.orderId != that.orderId)
        return false;
    }

    boolean this_present_collectionType = true && this.isSetCollectionType();
    boolean that_present_collectionType = true && that.isSetCollectionType();
    if (this_present_collectionType || that_present_collectionType) {
      if (!(this_present_collectionType && that_present_collectionType))
        return false;
      if (!this.collectionType.equals(that.collectionType))
        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_advanceAmount = true;
    boolean that_present_advanceAmount = true;
    if (this_present_advanceAmount || that_present_advanceAmount) {
      if (!(this_present_advanceAmount && that_present_advanceAmount))
        return false;
      if (this.advanceAmount != that.advanceAmount)
        return false;
    }

    boolean this_present_cash = true;
    boolean that_present_cash = true;
    if (this_present_cash || that_present_cash) {
      if (!(this_present_cash && that_present_cash))
        return false;
      if (this.cash != that.cash)
        return false;
    }

    boolean this_present_card = true;
    boolean that_present_card = true;
    if (this_present_card || that_present_card) {
      if (!(this_present_card && that_present_card))
        return false;
      if (this.card != that.card)
        return false;
    }

    boolean this_present_addedAt = true;
    boolean that_present_addedAt = true;
    if (this_present_addedAt || that_present_addedAt) {
      if (!(this_present_addedAt && that_present_addedAt))
        return false;
      if (this.addedAt != that.addedAt)
        return false;
    }

    boolean this_present_pushedAt = true;
    boolean that_present_pushedAt = true;
    if (this_present_pushedAt || that_present_pushedAt) {
      if (!(this_present_pushedAt && that_present_pushedAt))
        return false;
      if (this.pushedAt != that.pushedAt)
        return false;
    }

    boolean this_present_pushedToOcr = true;
    boolean that_present_pushedToOcr = true;
    if (this_present_pushedToOcr || that_present_pushedToOcr) {
      if (!(this_present_pushedToOcr && that_present_pushedToOcr))
        return false;
      if (this.pushedToOcr != that.pushedToOcr)
        return false;
    }

    return true;
  }

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

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

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

    lastComparison = Boolean.valueOf(isSetHotspotId()).compareTo(typedOther.isSetHotspotId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetHotspotId()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.hotspotId, typedOther.hotspotId);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetOrderId()).compareTo(typedOther.isSetOrderId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetOrderId()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.orderId, typedOther.orderId);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetCollectionType()).compareTo(typedOther.isSetCollectionType());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetCollectionType()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.collectionType, typedOther.collectionType);
      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(isSetAdvanceAmount()).compareTo(typedOther.isSetAdvanceAmount());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetAdvanceAmount()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.advanceAmount, typedOther.advanceAmount);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetCash()).compareTo(typedOther.isSetCash());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetCash()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cash, typedOther.cash);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetCard()).compareTo(typedOther.isSetCard());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetCard()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.card, typedOther.card);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetAddedAt()).compareTo(typedOther.isSetAddedAt());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetAddedAt()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.addedAt, typedOther.addedAt);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetPushedAt()).compareTo(typedOther.isSetPushedAt());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetPushedAt()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pushedAt, typedOther.pushedAt);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetPushedToOcr()).compareTo(typedOther.isSetPushedToOcr());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetPushedToOcr()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pushedToOcr, typedOther.pushedToOcr);
      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: // HOTSPOT_ID
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
            this.hotspotId = iprot.readString();
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 2: // ORDER_ID
          if (field.type == org.apache.thrift.protocol.TType.I64) {
            this.orderId = iprot.readI64();
            setOrderIdIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 3: // COLLECTION_TYPE
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
            this.collectionType = iprot.readString();
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 4: // 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 5: // ADVANCE_AMOUNT
          if (field.type == org.apache.thrift.protocol.TType.I64) {
            this.advanceAmount = iprot.readI64();
            setAdvanceAmountIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 6: // CASH
          if (field.type == org.apache.thrift.protocol.TType.I64) {
            this.cash = iprot.readI64();
            setCashIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 7: // CARD
          if (field.type == org.apache.thrift.protocol.TType.I64) {
            this.card = iprot.readI64();
            setCardIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 8: // ADDED_AT
          if (field.type == org.apache.thrift.protocol.TType.I64) {
            this.addedAt = iprot.readI64();
            setAddedAtIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 9: // PUSHED_AT
          if (field.type == org.apache.thrift.protocol.TType.I64) {
            this.pushedAt = iprot.readI64();
            setPushedAtIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 10: // PUSHED_TO_OCR
          if (field.type == org.apache.thrift.protocol.TType.BOOL) {
            this.pushedToOcr = iprot.readBool();
            setPushedToOcrIsSet(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);
    if (this.hotspotId != null) {
      oprot.writeFieldBegin(HOTSPOT_ID_FIELD_DESC);
      oprot.writeString(this.hotspotId);
      oprot.writeFieldEnd();
    }
    oprot.writeFieldBegin(ORDER_ID_FIELD_DESC);
    oprot.writeI64(this.orderId);
    oprot.writeFieldEnd();
    if (this.collectionType != null) {
      oprot.writeFieldBegin(COLLECTION_TYPE_FIELD_DESC);
      oprot.writeString(this.collectionType);
      oprot.writeFieldEnd();
    }
    if (this.productName != null) {
      oprot.writeFieldBegin(PRODUCT_NAME_FIELD_DESC);
      oprot.writeString(this.productName);
      oprot.writeFieldEnd();
    }
    oprot.writeFieldBegin(ADVANCE_AMOUNT_FIELD_DESC);
    oprot.writeI64(this.advanceAmount);
    oprot.writeFieldEnd();
    oprot.writeFieldBegin(CASH_FIELD_DESC);
    oprot.writeI64(this.cash);
    oprot.writeFieldEnd();
    oprot.writeFieldBegin(CARD_FIELD_DESC);
    oprot.writeI64(this.card);
    oprot.writeFieldEnd();
    oprot.writeFieldBegin(ADDED_AT_FIELD_DESC);
    oprot.writeI64(this.addedAt);
    oprot.writeFieldEnd();
    oprot.writeFieldBegin(PUSHED_AT_FIELD_DESC);
    oprot.writeI64(this.pushedAt);
    oprot.writeFieldEnd();
    oprot.writeFieldBegin(PUSHED_TO_OCR_FIELD_DESC);
    oprot.writeBool(this.pushedToOcr);
    oprot.writeFieldEnd();
    oprot.writeFieldStop();
    oprot.writeStructEnd();
  }

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

    sb.append("hotspotId:");
    if (this.hotspotId == null) {
      sb.append("null");
    } else {
      sb.append(this.hotspotId);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("orderId:");
    sb.append(this.orderId);
    first = false;
    if (!first) sb.append(", ");
    sb.append("collectionType:");
    if (this.collectionType == null) {
      sb.append("null");
    } else {
      sb.append(this.collectionType);
    }
    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("advanceAmount:");
    sb.append(this.advanceAmount);
    first = false;
    if (!first) sb.append(", ");
    sb.append("cash:");
    sb.append(this.cash);
    first = false;
    if (!first) sb.append(", ");
    sb.append("card:");
    sb.append(this.card);
    first = false;
    if (!first) sb.append(", ");
    sb.append("addedAt:");
    sb.append(this.addedAt);
    first = false;
    if (!first) sb.append(", ");
    sb.append("pushedAt:");
    sb.append(this.pushedAt);
    first = false;
    if (!first) sb.append(", ");
    sb.append("pushedToOcr:");
    sb.append(this.pushedToOcr);
    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);
    }
  }

}