Subversion Repositories SmartDukaan

Rev

Rev 11653 | 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.user;

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

  private static final org.apache.thrift.protocol.TField CART_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("cartId", 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("itemId", org.apache.thrift.protocol.TType.I64, (short)2);
  private static final org.apache.thrift.protocol.TField QUANTITY_FIELD_DESC = new org.apache.thrift.protocol.TField("quantity", org.apache.thrift.protocol.TType.DOUBLE, (short)3);
  private static final org.apache.thrift.protocol.TField CREATED_ON_FIELD_DESC = new org.apache.thrift.protocol.TField("createdOn", org.apache.thrift.protocol.TType.I64, (short)4);
  private static final org.apache.thrift.protocol.TField UPDATED_ON_FIELD_DESC = new org.apache.thrift.protocol.TField("updatedOn", org.apache.thrift.protocol.TType.I64, (short)5);
  private static final org.apache.thrift.protocol.TField LINE_STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("lineStatus", org.apache.thrift.protocol.TType.I32, (short)6);
  private static final org.apache.thrift.protocol.TField ESTIMATE_FIELD_DESC = new org.apache.thrift.protocol.TField("estimate", org.apache.thrift.protocol.TType.I32, (short)7);
  private static final org.apache.thrift.protocol.TField ACTUAL_PRICE_FIELD_DESC = new org.apache.thrift.protocol.TField("actualPrice", org.apache.thrift.protocol.TType.DOUBLE, (short)8);
  private static final org.apache.thrift.protocol.TField DISCOUNTED_PRICE_FIELD_DESC = new org.apache.thrift.protocol.TField("discountedPrice", org.apache.thrift.protocol.TType.DOUBLE, (short)9);
  private static final org.apache.thrift.protocol.TField DISCOUNTS_FIELD_DESC = new org.apache.thrift.protocol.TField("discounts", org.apache.thrift.protocol.TType.LIST, (short)10);
  private static final org.apache.thrift.protocol.TField INSURER_FIELD_DESC = new org.apache.thrift.protocol.TField("insurer", org.apache.thrift.protocol.TType.I64, (short)11);
  private static final org.apache.thrift.protocol.TField INSURANCE_AMOUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("insuranceAmount", org.apache.thrift.protocol.TType.DOUBLE, (short)12);
  private static final org.apache.thrift.protocol.TField DATA_PROTECTION_INSURER_FIELD_DESC = new org.apache.thrift.protocol.TField("dataProtectionInsurer", org.apache.thrift.protocol.TType.I64, (short)13);
  private static final org.apache.thrift.protocol.TField DATA_PROTECTION_AMOUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("dataProtectionAmount", org.apache.thrift.protocol.TType.DOUBLE, (short)14);
  private static final org.apache.thrift.protocol.TField DEAL_TEXT_FIELD_DESC = new org.apache.thrift.protocol.TField("dealText", org.apache.thrift.protocol.TType.STRING, (short)15);
  private static final org.apache.thrift.protocol.TField FREEBIE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("freebieId", org.apache.thrift.protocol.TType.I64, (short)16);

  private long cartId; // required
  private long itemId; // required
  private double quantity; // required
  private long createdOn; // required
  private long updatedOn; // required
  private LineStatus lineStatus; // required
  private int estimate; // required
  private double actualPrice; // required
  private double discountedPrice; // required
  private List<Discount> discounts; // required
  private long insurer; // required
  private double insuranceAmount; // required
  private long dataProtectionInsurer; // required
  private double dataProtectionAmount; // required
  private String dealText; // required
  private long freebieId; // 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 {
    CART_ID((short)1, "cartId"),
    ITEM_ID((short)2, "itemId"),
    QUANTITY((short)3, "quantity"),
    CREATED_ON((short)4, "createdOn"),
    UPDATED_ON((short)5, "updatedOn"),
    /**
     * 
     * @see LineStatus
     */
    LINE_STATUS((short)6, "lineStatus"),
    ESTIMATE((short)7, "estimate"),
    ACTUAL_PRICE((short)8, "actualPrice"),
    DISCOUNTED_PRICE((short)9, "discountedPrice"),
    DISCOUNTS((short)10, "discounts"),
    INSURER((short)11, "insurer"),
    INSURANCE_AMOUNT((short)12, "insuranceAmount"),
    DATA_PROTECTION_INSURER((short)13, "dataProtectionInsurer"),
    DATA_PROTECTION_AMOUNT((short)14, "dataProtectionAmount"),
    DEAL_TEXT((short)15, "dealText"),
    FREEBIE_ID((short)16, "freebieId");

    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: // CART_ID
          return CART_ID;
        case 2: // ITEM_ID
          return ITEM_ID;
        case 3: // QUANTITY
          return QUANTITY;
        case 4: // CREATED_ON
          return CREATED_ON;
        case 5: // UPDATED_ON
          return UPDATED_ON;
        case 6: // LINE_STATUS
          return LINE_STATUS;
        case 7: // ESTIMATE
          return ESTIMATE;
        case 8: // ACTUAL_PRICE
          return ACTUAL_PRICE;
        case 9: // DISCOUNTED_PRICE
          return DISCOUNTED_PRICE;
        case 10: // DISCOUNTS
          return DISCOUNTS;
        case 11: // INSURER
          return INSURER;
        case 12: // INSURANCE_AMOUNT
          return INSURANCE_AMOUNT;
        case 13: // DATA_PROTECTION_INSURER
          return DATA_PROTECTION_INSURER;
        case 14: // DATA_PROTECTION_AMOUNT
          return DATA_PROTECTION_AMOUNT;
        case 15: // DEAL_TEXT
          return DEAL_TEXT;
        case 16: // FREEBIE_ID
          return FREEBIE_ID;
        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 __CARTID_ISSET_ID = 0;
  private static final int __ITEMID_ISSET_ID = 1;
  private static final int __QUANTITY_ISSET_ID = 2;
  private static final int __CREATEDON_ISSET_ID = 3;
  private static final int __UPDATEDON_ISSET_ID = 4;
  private static final int __ESTIMATE_ISSET_ID = 5;
  private static final int __ACTUALPRICE_ISSET_ID = 6;
  private static final int __DISCOUNTEDPRICE_ISSET_ID = 7;
  private static final int __INSURER_ISSET_ID = 8;
  private static final int __INSURANCEAMOUNT_ISSET_ID = 9;
  private static final int __DATAPROTECTIONINSURER_ISSET_ID = 10;
  private static final int __DATAPROTECTIONAMOUNT_ISSET_ID = 11;
  private static final int __FREEBIEID_ISSET_ID = 12;
  private BitSet __isset_bit_vector = new BitSet(13);

  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.CART_ID, new org.apache.thrift.meta_data.FieldMetaData("cartId", 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("itemId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.QUANTITY, new org.apache.thrift.meta_data.FieldMetaData("quantity", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
    tmpMap.put(_Fields.CREATED_ON, new org.apache.thrift.meta_data.FieldMetaData("createdOn", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.UPDATED_ON, new org.apache.thrift.meta_data.FieldMetaData("updatedOn", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.LINE_STATUS, new org.apache.thrift.meta_data.FieldMetaData("lineStatus", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, LineStatus.class)));
    tmpMap.put(_Fields.ESTIMATE, new org.apache.thrift.meta_data.FieldMetaData("estimate", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
    tmpMap.put(_Fields.ACTUAL_PRICE, new org.apache.thrift.meta_data.FieldMetaData("actualPrice", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
    tmpMap.put(_Fields.DISCOUNTED_PRICE, new org.apache.thrift.meta_data.FieldMetaData("discountedPrice", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
    tmpMap.put(_Fields.DISCOUNTS, new org.apache.thrift.meta_data.FieldMetaData("discounts", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
            new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Discount.class))));
    tmpMap.put(_Fields.INSURER, new org.apache.thrift.meta_data.FieldMetaData("insurer", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.INSURANCE_AMOUNT, new org.apache.thrift.meta_data.FieldMetaData("insuranceAmount", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
    tmpMap.put(_Fields.DATA_PROTECTION_INSURER, new org.apache.thrift.meta_data.FieldMetaData("dataProtectionInsurer", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.DATA_PROTECTION_AMOUNT, new org.apache.thrift.meta_data.FieldMetaData("dataProtectionAmount", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
    tmpMap.put(_Fields.DEAL_TEXT, new org.apache.thrift.meta_data.FieldMetaData("dealText", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.FREEBIE_ID, new org.apache.thrift.meta_data.FieldMetaData("freebieId", 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(Line.class, metaDataMap);
  }

  public Line() {
  }

  public Line(
    long cartId,
    long itemId,
    double quantity,
    long createdOn,
    long updatedOn,
    LineStatus lineStatus,
    int estimate,
    double actualPrice,
    double discountedPrice,
    List<Discount> discounts,
    long insurer,
    double insuranceAmount,
    long dataProtectionInsurer,
    double dataProtectionAmount,
    String dealText,
    long freebieId)
  {
    this();
    this.cartId = cartId;
    setCartIdIsSet(true);
    this.itemId = itemId;
    setItemIdIsSet(true);
    this.quantity = quantity;
    setQuantityIsSet(true);
    this.createdOn = createdOn;
    setCreatedOnIsSet(true);
    this.updatedOn = updatedOn;
    setUpdatedOnIsSet(true);
    this.lineStatus = lineStatus;
    this.estimate = estimate;
    setEstimateIsSet(true);
    this.actualPrice = actualPrice;
    setActualPriceIsSet(true);
    this.discountedPrice = discountedPrice;
    setDiscountedPriceIsSet(true);
    this.discounts = discounts;
    this.insurer = insurer;
    setInsurerIsSet(true);
    this.insuranceAmount = insuranceAmount;
    setInsuranceAmountIsSet(true);
    this.dataProtectionInsurer = dataProtectionInsurer;
    setDataProtectionInsurerIsSet(true);
    this.dataProtectionAmount = dataProtectionAmount;
    setDataProtectionAmountIsSet(true);
    this.dealText = dealText;
    this.freebieId = freebieId;
    setFreebieIdIsSet(true);
  }

  /**
   * Performs a deep copy on <i>other</i>.
   */
  public Line(Line other) {
    __isset_bit_vector.clear();
    __isset_bit_vector.or(other.__isset_bit_vector);
    this.cartId = other.cartId;
    this.itemId = other.itemId;
    this.quantity = other.quantity;
    this.createdOn = other.createdOn;
    this.updatedOn = other.updatedOn;
    if (other.isSetLineStatus()) {
      this.lineStatus = other.lineStatus;
    }
    this.estimate = other.estimate;
    this.actualPrice = other.actualPrice;
    this.discountedPrice = other.discountedPrice;
    if (other.isSetDiscounts()) {
      List<Discount> __this__discounts = new ArrayList<Discount>();
      for (Discount other_element : other.discounts) {
        __this__discounts.add(new Discount(other_element));
      }
      this.discounts = __this__discounts;
    }
    this.insurer = other.insurer;
    this.insuranceAmount = other.insuranceAmount;
    this.dataProtectionInsurer = other.dataProtectionInsurer;
    this.dataProtectionAmount = other.dataProtectionAmount;
    if (other.isSetDealText()) {
      this.dealText = other.dealText;
    }
    this.freebieId = other.freebieId;
  }

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

  @Override
  public void clear() {
    setCartIdIsSet(false);
    this.cartId = 0;
    setItemIdIsSet(false);
    this.itemId = 0;
    setQuantityIsSet(false);
    this.quantity = 0.0;
    setCreatedOnIsSet(false);
    this.createdOn = 0;
    setUpdatedOnIsSet(false);
    this.updatedOn = 0;
    this.lineStatus = null;
    setEstimateIsSet(false);
    this.estimate = 0;
    setActualPriceIsSet(false);
    this.actualPrice = 0.0;
    setDiscountedPriceIsSet(false);
    this.discountedPrice = 0.0;
    this.discounts = null;
    setInsurerIsSet(false);
    this.insurer = 0;
    setInsuranceAmountIsSet(false);
    this.insuranceAmount = 0.0;
    setDataProtectionInsurerIsSet(false);
    this.dataProtectionInsurer = 0;
    setDataProtectionAmountIsSet(false);
    this.dataProtectionAmount = 0.0;
    this.dealText = null;
    setFreebieIdIsSet(false);
    this.freebieId = 0;
  }

  public long getCartId() {
    return this.cartId;
  }

  public void setCartId(long cartId) {
    this.cartId = cartId;
    setCartIdIsSet(true);
  }

  public void unsetCartId() {
    __isset_bit_vector.clear(__CARTID_ISSET_ID);
  }

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

  public void setCartIdIsSet(boolean value) {
    __isset_bit_vector.set(__CARTID_ISSET_ID, value);
  }

  public long getItemId() {
    return this.itemId;
  }

  public void setItemId(long itemId) {
    this.itemId = itemId;
    setItemIdIsSet(true);
  }

  public void unsetItemId() {
    __isset_bit_vector.clear(__ITEMID_ISSET_ID);
  }

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

  public void setItemIdIsSet(boolean value) {
    __isset_bit_vector.set(__ITEMID_ISSET_ID, value);
  }

  public double getQuantity() {
    return this.quantity;
  }

  public void setQuantity(double quantity) {
    this.quantity = quantity;
    setQuantityIsSet(true);
  }

  public void unsetQuantity() {
    __isset_bit_vector.clear(__QUANTITY_ISSET_ID);
  }

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

  public void setQuantityIsSet(boolean value) {
    __isset_bit_vector.set(__QUANTITY_ISSET_ID, value);
  }

  public long getCreatedOn() {
    return this.createdOn;
  }

  public void setCreatedOn(long createdOn) {
    this.createdOn = createdOn;
    setCreatedOnIsSet(true);
  }

  public void unsetCreatedOn() {
    __isset_bit_vector.clear(__CREATEDON_ISSET_ID);
  }

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

  public void setCreatedOnIsSet(boolean value) {
    __isset_bit_vector.set(__CREATEDON_ISSET_ID, value);
  }

  public long getUpdatedOn() {
    return this.updatedOn;
  }

  public void setUpdatedOn(long updatedOn) {
    this.updatedOn = updatedOn;
    setUpdatedOnIsSet(true);
  }

  public void unsetUpdatedOn() {
    __isset_bit_vector.clear(__UPDATEDON_ISSET_ID);
  }

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

  public void setUpdatedOnIsSet(boolean value) {
    __isset_bit_vector.set(__UPDATEDON_ISSET_ID, value);
  }

  /**
   * 
   * @see LineStatus
   */
  public LineStatus getLineStatus() {
    return this.lineStatus;
  }

  /**
   * 
   * @see LineStatus
   */
  public void setLineStatus(LineStatus lineStatus) {
    this.lineStatus = lineStatus;
  }

  public void unsetLineStatus() {
    this.lineStatus = null;
  }

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

  public void setLineStatusIsSet(boolean value) {
    if (!value) {
      this.lineStatus = null;
    }
  }

  public int getEstimate() {
    return this.estimate;
  }

  public void setEstimate(int estimate) {
    this.estimate = estimate;
    setEstimateIsSet(true);
  }

  public void unsetEstimate() {
    __isset_bit_vector.clear(__ESTIMATE_ISSET_ID);
  }

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

  public void setEstimateIsSet(boolean value) {
    __isset_bit_vector.set(__ESTIMATE_ISSET_ID, value);
  }

  public double getActualPrice() {
    return this.actualPrice;
  }

  public void setActualPrice(double actualPrice) {
    this.actualPrice = actualPrice;
    setActualPriceIsSet(true);
  }

  public void unsetActualPrice() {
    __isset_bit_vector.clear(__ACTUALPRICE_ISSET_ID);
  }

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

  public void setActualPriceIsSet(boolean value) {
    __isset_bit_vector.set(__ACTUALPRICE_ISSET_ID, value);
  }

  public double getDiscountedPrice() {
    return this.discountedPrice;
  }

  public void setDiscountedPrice(double discountedPrice) {
    this.discountedPrice = discountedPrice;
    setDiscountedPriceIsSet(true);
  }

  public void unsetDiscountedPrice() {
    __isset_bit_vector.clear(__DISCOUNTEDPRICE_ISSET_ID);
  }

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

  public void setDiscountedPriceIsSet(boolean value) {
    __isset_bit_vector.set(__DISCOUNTEDPRICE_ISSET_ID, value);
  }

  public int getDiscountsSize() {
    return (this.discounts == null) ? 0 : this.discounts.size();
  }

  public java.util.Iterator<Discount> getDiscountsIterator() {
    return (this.discounts == null) ? null : this.discounts.iterator();
  }

  public void addToDiscounts(Discount elem) {
    if (this.discounts == null) {
      this.discounts = new ArrayList<Discount>();
    }
    this.discounts.add(elem);
  }

  public List<Discount> getDiscounts() {
    return this.discounts;
  }

  public void setDiscounts(List<Discount> discounts) {
    this.discounts = discounts;
  }

  public void unsetDiscounts() {
    this.discounts = null;
  }

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

  public void setDiscountsIsSet(boolean value) {
    if (!value) {
      this.discounts = null;
    }
  }

  public long getInsurer() {
    return this.insurer;
  }

  public void setInsurer(long insurer) {
    this.insurer = insurer;
    setInsurerIsSet(true);
  }

  public void unsetInsurer() {
    __isset_bit_vector.clear(__INSURER_ISSET_ID);
  }

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

  public void setInsurerIsSet(boolean value) {
    __isset_bit_vector.set(__INSURER_ISSET_ID, value);
  }

  public double getInsuranceAmount() {
    return this.insuranceAmount;
  }

  public void setInsuranceAmount(double insuranceAmount) {
    this.insuranceAmount = insuranceAmount;
    setInsuranceAmountIsSet(true);
  }

  public void unsetInsuranceAmount() {
    __isset_bit_vector.clear(__INSURANCEAMOUNT_ISSET_ID);
  }

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

  public void setInsuranceAmountIsSet(boolean value) {
    __isset_bit_vector.set(__INSURANCEAMOUNT_ISSET_ID, value);
  }

  public long getDataProtectionInsurer() {
    return this.dataProtectionInsurer;
  }

  public void setDataProtectionInsurer(long dataProtectionInsurer) {
    this.dataProtectionInsurer = dataProtectionInsurer;
    setDataProtectionInsurerIsSet(true);
  }

  public void unsetDataProtectionInsurer() {
    __isset_bit_vector.clear(__DATAPROTECTIONINSURER_ISSET_ID);
  }

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

  public void setDataProtectionInsurerIsSet(boolean value) {
    __isset_bit_vector.set(__DATAPROTECTIONINSURER_ISSET_ID, value);
  }

  public double getDataProtectionAmount() {
    return this.dataProtectionAmount;
  }

  public void setDataProtectionAmount(double dataProtectionAmount) {
    this.dataProtectionAmount = dataProtectionAmount;
    setDataProtectionAmountIsSet(true);
  }

  public void unsetDataProtectionAmount() {
    __isset_bit_vector.clear(__DATAPROTECTIONAMOUNT_ISSET_ID);
  }

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

  public void setDataProtectionAmountIsSet(boolean value) {
    __isset_bit_vector.set(__DATAPROTECTIONAMOUNT_ISSET_ID, value);
  }

  public String getDealText() {
    return this.dealText;
  }

  public void setDealText(String dealText) {
    this.dealText = dealText;
  }

  public void unsetDealText() {
    this.dealText = null;
  }

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

  public void setDealTextIsSet(boolean value) {
    if (!value) {
      this.dealText = null;
    }
  }

  public long getFreebieId() {
    return this.freebieId;
  }

  public void setFreebieId(long freebieId) {
    this.freebieId = freebieId;
    setFreebieIdIsSet(true);
  }

  public void unsetFreebieId() {
    __isset_bit_vector.clear(__FREEBIEID_ISSET_ID);
  }

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

  public void setFreebieIdIsSet(boolean value) {
    __isset_bit_vector.set(__FREEBIEID_ISSET_ID, value);
  }

  public void setFieldValue(_Fields field, Object value) {
    switch (field) {
    case CART_ID:
      if (value == null) {
        unsetCartId();
      } else {
        setCartId((Long)value);
      }
      break;

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

    case QUANTITY:
      if (value == null) {
        unsetQuantity();
      } else {
        setQuantity((Double)value);
      }
      break;

    case CREATED_ON:
      if (value == null) {
        unsetCreatedOn();
      } else {
        setCreatedOn((Long)value);
      }
      break;

    case UPDATED_ON:
      if (value == null) {
        unsetUpdatedOn();
      } else {
        setUpdatedOn((Long)value);
      }
      break;

    case LINE_STATUS:
      if (value == null) {
        unsetLineStatus();
      } else {
        setLineStatus((LineStatus)value);
      }
      break;

    case ESTIMATE:
      if (value == null) {
        unsetEstimate();
      } else {
        setEstimate((Integer)value);
      }
      break;

    case ACTUAL_PRICE:
      if (value == null) {
        unsetActualPrice();
      } else {
        setActualPrice((Double)value);
      }
      break;

    case DISCOUNTED_PRICE:
      if (value == null) {
        unsetDiscountedPrice();
      } else {
        setDiscountedPrice((Double)value);
      }
      break;

    case DISCOUNTS:
      if (value == null) {
        unsetDiscounts();
      } else {
        setDiscounts((List<Discount>)value);
      }
      break;

    case INSURER:
      if (value == null) {
        unsetInsurer();
      } else {
        setInsurer((Long)value);
      }
      break;

    case INSURANCE_AMOUNT:
      if (value == null) {
        unsetInsuranceAmount();
      } else {
        setInsuranceAmount((Double)value);
      }
      break;

    case DATA_PROTECTION_INSURER:
      if (value == null) {
        unsetDataProtectionInsurer();
      } else {
        setDataProtectionInsurer((Long)value);
      }
      break;

    case DATA_PROTECTION_AMOUNT:
      if (value == null) {
        unsetDataProtectionAmount();
      } else {
        setDataProtectionAmount((Double)value);
      }
      break;

    case DEAL_TEXT:
      if (value == null) {
        unsetDealText();
      } else {
        setDealText((String)value);
      }
      break;

    case FREEBIE_ID:
      if (value == null) {
        unsetFreebieId();
      } else {
        setFreebieId((Long)value);
      }
      break;

    }
  }

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

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

    case QUANTITY:
      return Double.valueOf(getQuantity());

    case CREATED_ON:
      return Long.valueOf(getCreatedOn());

    case UPDATED_ON:
      return Long.valueOf(getUpdatedOn());

    case LINE_STATUS:
      return getLineStatus();

    case ESTIMATE:
      return Integer.valueOf(getEstimate());

    case ACTUAL_PRICE:
      return Double.valueOf(getActualPrice());

    case DISCOUNTED_PRICE:
      return Double.valueOf(getDiscountedPrice());

    case DISCOUNTS:
      return getDiscounts();

    case INSURER:
      return Long.valueOf(getInsurer());

    case INSURANCE_AMOUNT:
      return Double.valueOf(getInsuranceAmount());

    case DATA_PROTECTION_INSURER:
      return Long.valueOf(getDataProtectionInsurer());

    case DATA_PROTECTION_AMOUNT:
      return Double.valueOf(getDataProtectionAmount());

    case DEAL_TEXT:
      return getDealText();

    case FREEBIE_ID:
      return Long.valueOf(getFreebieId());

    }
    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 CART_ID:
      return isSetCartId();
    case ITEM_ID:
      return isSetItemId();
    case QUANTITY:
      return isSetQuantity();
    case CREATED_ON:
      return isSetCreatedOn();
    case UPDATED_ON:
      return isSetUpdatedOn();
    case LINE_STATUS:
      return isSetLineStatus();
    case ESTIMATE:
      return isSetEstimate();
    case ACTUAL_PRICE:
      return isSetActualPrice();
    case DISCOUNTED_PRICE:
      return isSetDiscountedPrice();
    case DISCOUNTS:
      return isSetDiscounts();
    case INSURER:
      return isSetInsurer();
    case INSURANCE_AMOUNT:
      return isSetInsuranceAmount();
    case DATA_PROTECTION_INSURER:
      return isSetDataProtectionInsurer();
    case DATA_PROTECTION_AMOUNT:
      return isSetDataProtectionAmount();
    case DEAL_TEXT:
      return isSetDealText();
    case FREEBIE_ID:
      return isSetFreebieId();
    }
    throw new IllegalStateException();
  }

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

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

    boolean this_present_cartId = true;
    boolean that_present_cartId = true;
    if (this_present_cartId || that_present_cartId) {
      if (!(this_present_cartId && that_present_cartId))
        return false;
      if (this.cartId != that.cartId)
        return false;
    }

    boolean this_present_itemId = true;
    boolean that_present_itemId = true;
    if (this_present_itemId || that_present_itemId) {
      if (!(this_present_itemId && that_present_itemId))
        return false;
      if (this.itemId != that.itemId)
        return false;
    }

    boolean this_present_quantity = true;
    boolean that_present_quantity = true;
    if (this_present_quantity || that_present_quantity) {
      if (!(this_present_quantity && that_present_quantity))
        return false;
      if (this.quantity != that.quantity)
        return false;
    }

    boolean this_present_createdOn = true;
    boolean that_present_createdOn = true;
    if (this_present_createdOn || that_present_createdOn) {
      if (!(this_present_createdOn && that_present_createdOn))
        return false;
      if (this.createdOn != that.createdOn)
        return false;
    }

    boolean this_present_updatedOn = true;
    boolean that_present_updatedOn = true;
    if (this_present_updatedOn || that_present_updatedOn) {
      if (!(this_present_updatedOn && that_present_updatedOn))
        return false;
      if (this.updatedOn != that.updatedOn)
        return false;
    }

    boolean this_present_lineStatus = true && this.isSetLineStatus();
    boolean that_present_lineStatus = true && that.isSetLineStatus();
    if (this_present_lineStatus || that_present_lineStatus) {
      if (!(this_present_lineStatus && that_present_lineStatus))
        return false;
      if (!this.lineStatus.equals(that.lineStatus))
        return false;
    }

    boolean this_present_estimate = true;
    boolean that_present_estimate = true;
    if (this_present_estimate || that_present_estimate) {
      if (!(this_present_estimate && that_present_estimate))
        return false;
      if (this.estimate != that.estimate)
        return false;
    }

    boolean this_present_actualPrice = true;
    boolean that_present_actualPrice = true;
    if (this_present_actualPrice || that_present_actualPrice) {
      if (!(this_present_actualPrice && that_present_actualPrice))
        return false;
      if (this.actualPrice != that.actualPrice)
        return false;
    }

    boolean this_present_discountedPrice = true;
    boolean that_present_discountedPrice = true;
    if (this_present_discountedPrice || that_present_discountedPrice) {
      if (!(this_present_discountedPrice && that_present_discountedPrice))
        return false;
      if (this.discountedPrice != that.discountedPrice)
        return false;
    }

    boolean this_present_discounts = true && this.isSetDiscounts();
    boolean that_present_discounts = true && that.isSetDiscounts();
    if (this_present_discounts || that_present_discounts) {
      if (!(this_present_discounts && that_present_discounts))
        return false;
      if (!this.discounts.equals(that.discounts))
        return false;
    }

    boolean this_present_insurer = true;
    boolean that_present_insurer = true;
    if (this_present_insurer || that_present_insurer) {
      if (!(this_present_insurer && that_present_insurer))
        return false;
      if (this.insurer != that.insurer)
        return false;
    }

    boolean this_present_insuranceAmount = true;
    boolean that_present_insuranceAmount = true;
    if (this_present_insuranceAmount || that_present_insuranceAmount) {
      if (!(this_present_insuranceAmount && that_present_insuranceAmount))
        return false;
      if (this.insuranceAmount != that.insuranceAmount)
        return false;
    }

    boolean this_present_dataProtectionInsurer = true;
    boolean that_present_dataProtectionInsurer = true;
    if (this_present_dataProtectionInsurer || that_present_dataProtectionInsurer) {
      if (!(this_present_dataProtectionInsurer && that_present_dataProtectionInsurer))
        return false;
      if (this.dataProtectionInsurer != that.dataProtectionInsurer)
        return false;
    }

    boolean this_present_dataProtectionAmount = true;
    boolean that_present_dataProtectionAmount = true;
    if (this_present_dataProtectionAmount || that_present_dataProtectionAmount) {
      if (!(this_present_dataProtectionAmount && that_present_dataProtectionAmount))
        return false;
      if (this.dataProtectionAmount != that.dataProtectionAmount)
        return false;
    }

    boolean this_present_dealText = true && this.isSetDealText();
    boolean that_present_dealText = true && that.isSetDealText();
    if (this_present_dealText || that_present_dealText) {
      if (!(this_present_dealText && that_present_dealText))
        return false;
      if (!this.dealText.equals(that.dealText))
        return false;
    }

    boolean this_present_freebieId = true;
    boolean that_present_freebieId = true;
    if (this_present_freebieId || that_present_freebieId) {
      if (!(this_present_freebieId && that_present_freebieId))
        return false;
      if (this.freebieId != that.freebieId)
        return false;
    }

    return true;
  }

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

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

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

    lastComparison = Boolean.valueOf(isSetCartId()).compareTo(typedOther.isSetCartId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetCartId()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cartId, typedOther.cartId);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetItemId()).compareTo(typedOther.isSetItemId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetItemId()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.itemId, typedOther.itemId);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetQuantity()).compareTo(typedOther.isSetQuantity());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetQuantity()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.quantity, typedOther.quantity);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetCreatedOn()).compareTo(typedOther.isSetCreatedOn());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetCreatedOn()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.createdOn, typedOther.createdOn);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetUpdatedOn()).compareTo(typedOther.isSetUpdatedOn());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetUpdatedOn()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.updatedOn, typedOther.updatedOn);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetLineStatus()).compareTo(typedOther.isSetLineStatus());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetLineStatus()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.lineStatus, typedOther.lineStatus);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetEstimate()).compareTo(typedOther.isSetEstimate());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetEstimate()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.estimate, typedOther.estimate);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetActualPrice()).compareTo(typedOther.isSetActualPrice());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetActualPrice()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.actualPrice, typedOther.actualPrice);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetDiscountedPrice()).compareTo(typedOther.isSetDiscountedPrice());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetDiscountedPrice()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.discountedPrice, typedOther.discountedPrice);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetDiscounts()).compareTo(typedOther.isSetDiscounts());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetDiscounts()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.discounts, typedOther.discounts);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetInsurer()).compareTo(typedOther.isSetInsurer());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetInsurer()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.insurer, typedOther.insurer);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetInsuranceAmount()).compareTo(typedOther.isSetInsuranceAmount());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetInsuranceAmount()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.insuranceAmount, typedOther.insuranceAmount);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetDataProtectionInsurer()).compareTo(typedOther.isSetDataProtectionInsurer());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetDataProtectionInsurer()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.dataProtectionInsurer, typedOther.dataProtectionInsurer);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetDataProtectionAmount()).compareTo(typedOther.isSetDataProtectionAmount());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetDataProtectionAmount()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.dataProtectionAmount, typedOther.dataProtectionAmount);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetDealText()).compareTo(typedOther.isSetDealText());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetDealText()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.dealText, typedOther.dealText);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetFreebieId()).compareTo(typedOther.isSetFreebieId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetFreebieId()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.freebieId, typedOther.freebieId);
      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: // CART_ID
          if (field.type == org.apache.thrift.protocol.TType.I64) {
            this.cartId = iprot.readI64();
            setCartIdIsSet(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.itemId = iprot.readI64();
            setItemIdIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 3: // QUANTITY
          if (field.type == org.apache.thrift.protocol.TType.DOUBLE) {
            this.quantity = iprot.readDouble();
            setQuantityIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 4: // CREATED_ON
          if (field.type == org.apache.thrift.protocol.TType.I64) {
            this.createdOn = iprot.readI64();
            setCreatedOnIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 5: // UPDATED_ON
          if (field.type == org.apache.thrift.protocol.TType.I64) {
            this.updatedOn = iprot.readI64();
            setUpdatedOnIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 6: // LINE_STATUS
          if (field.type == org.apache.thrift.protocol.TType.I32) {
            this.lineStatus = LineStatus.findByValue(iprot.readI32());
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 7: // ESTIMATE
          if (field.type == org.apache.thrift.protocol.TType.I32) {
            this.estimate = iprot.readI32();
            setEstimateIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 8: // ACTUAL_PRICE
          if (field.type == org.apache.thrift.protocol.TType.DOUBLE) {
            this.actualPrice = iprot.readDouble();
            setActualPriceIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 9: // DISCOUNTED_PRICE
          if (field.type == org.apache.thrift.protocol.TType.DOUBLE) {
            this.discountedPrice = iprot.readDouble();
            setDiscountedPriceIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 10: // DISCOUNTS
          if (field.type == org.apache.thrift.protocol.TType.LIST) {
            {
              org.apache.thrift.protocol.TList _list4 = iprot.readListBegin();
              this.discounts = new ArrayList<Discount>(_list4.size);
              for (int _i5 = 0; _i5 < _list4.size; ++_i5)
              {
                Discount _elem6; // required
                _elem6 = new Discount();
                _elem6.read(iprot);
                this.discounts.add(_elem6);
              }
              iprot.readListEnd();
            }
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 11: // INSURER
          if (field.type == org.apache.thrift.protocol.TType.I64) {
            this.insurer = iprot.readI64();
            setInsurerIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 12: // INSURANCE_AMOUNT
          if (field.type == org.apache.thrift.protocol.TType.DOUBLE) {
            this.insuranceAmount = iprot.readDouble();
            setInsuranceAmountIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 13: // DATA_PROTECTION_INSURER
          if (field.type == org.apache.thrift.protocol.TType.I64) {
            this.dataProtectionInsurer = iprot.readI64();
            setDataProtectionInsurerIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 14: // DATA_PROTECTION_AMOUNT
          if (field.type == org.apache.thrift.protocol.TType.DOUBLE) {
            this.dataProtectionAmount = iprot.readDouble();
            setDataProtectionAmountIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 15: // DEAL_TEXT
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
            this.dealText = iprot.readString();
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 16: // FREEBIE_ID
          if (field.type == org.apache.thrift.protocol.TType.I64) {
            this.freebieId = iprot.readI64();
            setFreebieIdIsSet(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(CART_ID_FIELD_DESC);
    oprot.writeI64(this.cartId);
    oprot.writeFieldEnd();
    oprot.writeFieldBegin(ITEM_ID_FIELD_DESC);
    oprot.writeI64(this.itemId);
    oprot.writeFieldEnd();
    oprot.writeFieldBegin(QUANTITY_FIELD_DESC);
    oprot.writeDouble(this.quantity);
    oprot.writeFieldEnd();
    oprot.writeFieldBegin(CREATED_ON_FIELD_DESC);
    oprot.writeI64(this.createdOn);
    oprot.writeFieldEnd();
    oprot.writeFieldBegin(UPDATED_ON_FIELD_DESC);
    oprot.writeI64(this.updatedOn);
    oprot.writeFieldEnd();
    if (this.lineStatus != null) {
      oprot.writeFieldBegin(LINE_STATUS_FIELD_DESC);
      oprot.writeI32(this.lineStatus.getValue());
      oprot.writeFieldEnd();
    }
    oprot.writeFieldBegin(ESTIMATE_FIELD_DESC);
    oprot.writeI32(this.estimate);
    oprot.writeFieldEnd();
    oprot.writeFieldBegin(ACTUAL_PRICE_FIELD_DESC);
    oprot.writeDouble(this.actualPrice);
    oprot.writeFieldEnd();
    oprot.writeFieldBegin(DISCOUNTED_PRICE_FIELD_DESC);
    oprot.writeDouble(this.discountedPrice);
    oprot.writeFieldEnd();
    if (this.discounts != null) {
      oprot.writeFieldBegin(DISCOUNTS_FIELD_DESC);
      {
        oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.discounts.size()));
        for (Discount _iter7 : this.discounts)
        {
          _iter7.write(oprot);
        }
        oprot.writeListEnd();
      }
      oprot.writeFieldEnd();
    }
    oprot.writeFieldBegin(INSURER_FIELD_DESC);
    oprot.writeI64(this.insurer);
    oprot.writeFieldEnd();
    oprot.writeFieldBegin(INSURANCE_AMOUNT_FIELD_DESC);
    oprot.writeDouble(this.insuranceAmount);
    oprot.writeFieldEnd();
    oprot.writeFieldBegin(DATA_PROTECTION_INSURER_FIELD_DESC);
    oprot.writeI64(this.dataProtectionInsurer);
    oprot.writeFieldEnd();
    oprot.writeFieldBegin(DATA_PROTECTION_AMOUNT_FIELD_DESC);
    oprot.writeDouble(this.dataProtectionAmount);
    oprot.writeFieldEnd();
    if (this.dealText != null) {
      oprot.writeFieldBegin(DEAL_TEXT_FIELD_DESC);
      oprot.writeString(this.dealText);
      oprot.writeFieldEnd();
    }
    oprot.writeFieldBegin(FREEBIE_ID_FIELD_DESC);
    oprot.writeI64(this.freebieId);
    oprot.writeFieldEnd();
    oprot.writeFieldStop();
    oprot.writeStructEnd();
  }

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

    sb.append("cartId:");
    sb.append(this.cartId);
    first = false;
    if (!first) sb.append(", ");
    sb.append("itemId:");
    sb.append(this.itemId);
    first = false;
    if (!first) sb.append(", ");
    sb.append("quantity:");
    sb.append(this.quantity);
    first = false;
    if (!first) sb.append(", ");
    sb.append("createdOn:");
    sb.append(this.createdOn);
    first = false;
    if (!first) sb.append(", ");
    sb.append("updatedOn:");
    sb.append(this.updatedOn);
    first = false;
    if (!first) sb.append(", ");
    sb.append("lineStatus:");
    if (this.lineStatus == null) {
      sb.append("null");
    } else {
      sb.append(this.lineStatus);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("estimate:");
    sb.append(this.estimate);
    first = false;
    if (!first) sb.append(", ");
    sb.append("actualPrice:");
    sb.append(this.actualPrice);
    first = false;
    if (!first) sb.append(", ");
    sb.append("discountedPrice:");
    sb.append(this.discountedPrice);
    first = false;
    if (!first) sb.append(", ");
    sb.append("discounts:");
    if (this.discounts == null) {
      sb.append("null");
    } else {
      sb.append(this.discounts);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("insurer:");
    sb.append(this.insurer);
    first = false;
    if (!first) sb.append(", ");
    sb.append("insuranceAmount:");
    sb.append(this.insuranceAmount);
    first = false;
    if (!first) sb.append(", ");
    sb.append("dataProtectionInsurer:");
    sb.append(this.dataProtectionInsurer);
    first = false;
    if (!first) sb.append(", ");
    sb.append("dataProtectionAmount:");
    sb.append(this.dataProtectionAmount);
    first = false;
    if (!first) sb.append(", ");
    sb.append("dealText:");
    if (this.dealText == null) {
      sb.append("null");
    } else {
      sb.append(this.dealText);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("freebieId:");
    sb.append(this.freebieId);
    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);
    }
  }

}