Subversion Repositories SmartDukaan

Rev

Rev 18719 | Blame | Compare with Previous | Last modification | View Log | RSS feed

/**
 * Autogenerated by Thrift Compiler (0.7.0)
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 */
package in.shop2020.model.v1.catalog;

import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;
import java.util.EnumMap;
import java.util.Set;
import java.util.HashSet;
import java.util.EnumSet;
import java.util.Collections;
import java.util.BitSet;
import java.nio.ByteBuffer;
import java.util.Arrays;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class DtrPricing implements org.apache.thrift.TBase<DtrPricing, DtrPricing._Fields>, java.io.Serializable, Cloneable {
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("DtrPricing");

  private static final org.apache.thrift.protocol.TField SELLING_PRICE_FIELD_DESC = new org.apache.thrift.protocol.TField("sellingPrice", org.apache.thrift.protocol.TType.DOUBLE, (short)1);
  private static final org.apache.thrift.protocol.TField BULK_PRICING_FIELD_DESC = new org.apache.thrift.protocol.TField("bulkPricing", org.apache.thrift.protocol.TType.MAP, (short)2);
  private static final org.apache.thrift.protocol.TField CATALOG_ITEM_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("catalog_item_id", org.apache.thrift.protocol.TType.I64, (short)3);
  private static final org.apache.thrift.protocol.TField MINIMUM_BUY_QUANTITY_FIELD_DESC = new org.apache.thrift.protocol.TField("minimumBuyQuantity", org.apache.thrift.protocol.TType.I64, (short)4);
  private static final org.apache.thrift.protocol.TField MAXIMUM_BUY_QUANTITY_FIELD_DESC = new org.apache.thrift.protocol.TField("maximumBuyQuantity", org.apache.thrift.protocol.TType.I64, (short)5);

  private double sellingPrice; // required
  private Map<Long,Double> bulkPricing; // required
  private long catalog_item_id; // required
  private long minimumBuyQuantity; // required
  private long maximumBuyQuantity; // 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 {
    SELLING_PRICE((short)1, "sellingPrice"),
    BULK_PRICING((short)2, "bulkPricing"),
    CATALOG_ITEM_ID((short)3, "catalog_item_id"),
    MINIMUM_BUY_QUANTITY((short)4, "minimumBuyQuantity"),
    MAXIMUM_BUY_QUANTITY((short)5, "maximumBuyQuantity");

    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: // SELLING_PRICE
          return SELLING_PRICE;
        case 2: // BULK_PRICING
          return BULK_PRICING;
        case 3: // CATALOG_ITEM_ID
          return CATALOG_ITEM_ID;
        case 4: // MINIMUM_BUY_QUANTITY
          return MINIMUM_BUY_QUANTITY;
        case 5: // MAXIMUM_BUY_QUANTITY
          return MAXIMUM_BUY_QUANTITY;
        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 __SELLINGPRICE_ISSET_ID = 0;
  private static final int __CATALOG_ITEM_ID_ISSET_ID = 1;
  private static final int __MINIMUMBUYQUANTITY_ISSET_ID = 2;
  private static final int __MAXIMUMBUYQUANTITY_ISSET_ID = 3;
  private BitSet __isset_bit_vector = new BitSet(4);

  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.SELLING_PRICE, new org.apache.thrift.meta_data.FieldMetaData("sellingPrice", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
    tmpMap.put(_Fields.BULK_PRICING, new org.apache.thrift.meta_data.FieldMetaData("bulkPricing", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, 
            new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64), 
            new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE))));
    tmpMap.put(_Fields.CATALOG_ITEM_ID, new org.apache.thrift.meta_data.FieldMetaData("catalog_item_id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.MINIMUM_BUY_QUANTITY, new org.apache.thrift.meta_data.FieldMetaData("minimumBuyQuantity", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.MAXIMUM_BUY_QUANTITY, new org.apache.thrift.meta_data.FieldMetaData("maximumBuyQuantity", 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(DtrPricing.class, metaDataMap);
  }

  public DtrPricing() {
  }

  public DtrPricing(
    double sellingPrice,
    Map<Long,Double> bulkPricing,
    long catalog_item_id,
    long minimumBuyQuantity,
    long maximumBuyQuantity)
  {
    this();
    this.sellingPrice = sellingPrice;
    setSellingPriceIsSet(true);
    this.bulkPricing = bulkPricing;
    this.catalog_item_id = catalog_item_id;
    setCatalog_item_idIsSet(true);
    this.minimumBuyQuantity = minimumBuyQuantity;
    setMinimumBuyQuantityIsSet(true);
    this.maximumBuyQuantity = maximumBuyQuantity;
    setMaximumBuyQuantityIsSet(true);
  }

  /**
   * Performs a deep copy on <i>other</i>.
   */
  public DtrPricing(DtrPricing other) {
    __isset_bit_vector.clear();
    __isset_bit_vector.or(other.__isset_bit_vector);
    this.sellingPrice = other.sellingPrice;
    if (other.isSetBulkPricing()) {
      Map<Long,Double> __this__bulkPricing = new HashMap<Long,Double>();
      for (Map.Entry<Long, Double> other_element : other.bulkPricing.entrySet()) {

        Long other_element_key = other_element.getKey();
        Double other_element_value = other_element.getValue();

        Long __this__bulkPricing_copy_key = other_element_key;

        Double __this__bulkPricing_copy_value = other_element_value;

        __this__bulkPricing.put(__this__bulkPricing_copy_key, __this__bulkPricing_copy_value);
      }
      this.bulkPricing = __this__bulkPricing;
    }
    this.catalog_item_id = other.catalog_item_id;
    this.minimumBuyQuantity = other.minimumBuyQuantity;
    this.maximumBuyQuantity = other.maximumBuyQuantity;
  }

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

  @Override
  public void clear() {
    setSellingPriceIsSet(false);
    this.sellingPrice = 0.0;
    this.bulkPricing = null;
    setCatalog_item_idIsSet(false);
    this.catalog_item_id = 0;
    setMinimumBuyQuantityIsSet(false);
    this.minimumBuyQuantity = 0;
    setMaximumBuyQuantityIsSet(false);
    this.maximumBuyQuantity = 0;
  }

  public double getSellingPrice() {
    return this.sellingPrice;
  }

  public void setSellingPrice(double sellingPrice) {
    this.sellingPrice = sellingPrice;
    setSellingPriceIsSet(true);
  }

  public void unsetSellingPrice() {
    __isset_bit_vector.clear(__SELLINGPRICE_ISSET_ID);
  }

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

  public void setSellingPriceIsSet(boolean value) {
    __isset_bit_vector.set(__SELLINGPRICE_ISSET_ID, value);
  }

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

  public void putToBulkPricing(long key, double val) {
    if (this.bulkPricing == null) {
      this.bulkPricing = new HashMap<Long,Double>();
    }
    this.bulkPricing.put(key, val);
  }

  public Map<Long,Double> getBulkPricing() {
    return this.bulkPricing;
  }

  public void setBulkPricing(Map<Long,Double> bulkPricing) {
    this.bulkPricing = bulkPricing;
  }

  public void unsetBulkPricing() {
    this.bulkPricing = null;
  }

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

  public void setBulkPricingIsSet(boolean value) {
    if (!value) {
      this.bulkPricing = null;
    }
  }

  public long getCatalog_item_id() {
    return this.catalog_item_id;
  }

  public void setCatalog_item_id(long catalog_item_id) {
    this.catalog_item_id = catalog_item_id;
    setCatalog_item_idIsSet(true);
  }

  public void unsetCatalog_item_id() {
    __isset_bit_vector.clear(__CATALOG_ITEM_ID_ISSET_ID);
  }

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

  public void setCatalog_item_idIsSet(boolean value) {
    __isset_bit_vector.set(__CATALOG_ITEM_ID_ISSET_ID, value);
  }

  public long getMinimumBuyQuantity() {
    return this.minimumBuyQuantity;
  }

  public void setMinimumBuyQuantity(long minimumBuyQuantity) {
    this.minimumBuyQuantity = minimumBuyQuantity;
    setMinimumBuyQuantityIsSet(true);
  }

  public void unsetMinimumBuyQuantity() {
    __isset_bit_vector.clear(__MINIMUMBUYQUANTITY_ISSET_ID);
  }

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

  public void setMinimumBuyQuantityIsSet(boolean value) {
    __isset_bit_vector.set(__MINIMUMBUYQUANTITY_ISSET_ID, value);
  }

  public long getMaximumBuyQuantity() {
    return this.maximumBuyQuantity;
  }

  public void setMaximumBuyQuantity(long maximumBuyQuantity) {
    this.maximumBuyQuantity = maximumBuyQuantity;
    setMaximumBuyQuantityIsSet(true);
  }

  public void unsetMaximumBuyQuantity() {
    __isset_bit_vector.clear(__MAXIMUMBUYQUANTITY_ISSET_ID);
  }

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

  public void setMaximumBuyQuantityIsSet(boolean value) {
    __isset_bit_vector.set(__MAXIMUMBUYQUANTITY_ISSET_ID, value);
  }

  public void setFieldValue(_Fields field, Object value) {
    switch (field) {
    case SELLING_PRICE:
      if (value == null) {
        unsetSellingPrice();
      } else {
        setSellingPrice((Double)value);
      }
      break;

    case BULK_PRICING:
      if (value == null) {
        unsetBulkPricing();
      } else {
        setBulkPricing((Map<Long,Double>)value);
      }
      break;

    case CATALOG_ITEM_ID:
      if (value == null) {
        unsetCatalog_item_id();
      } else {
        setCatalog_item_id((Long)value);
      }
      break;

    case MINIMUM_BUY_QUANTITY:
      if (value == null) {
        unsetMinimumBuyQuantity();
      } else {
        setMinimumBuyQuantity((Long)value);
      }
      break;

    case MAXIMUM_BUY_QUANTITY:
      if (value == null) {
        unsetMaximumBuyQuantity();
      } else {
        setMaximumBuyQuantity((Long)value);
      }
      break;

    }
  }

  public Object getFieldValue(_Fields field) {
    switch (field) {
    case SELLING_PRICE:
      return Double.valueOf(getSellingPrice());

    case BULK_PRICING:
      return getBulkPricing();

    case CATALOG_ITEM_ID:
      return Long.valueOf(getCatalog_item_id());

    case MINIMUM_BUY_QUANTITY:
      return Long.valueOf(getMinimumBuyQuantity());

    case MAXIMUM_BUY_QUANTITY:
      return Long.valueOf(getMaximumBuyQuantity());

    }
    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 SELLING_PRICE:
      return isSetSellingPrice();
    case BULK_PRICING:
      return isSetBulkPricing();
    case CATALOG_ITEM_ID:
      return isSetCatalog_item_id();
    case MINIMUM_BUY_QUANTITY:
      return isSetMinimumBuyQuantity();
    case MAXIMUM_BUY_QUANTITY:
      return isSetMaximumBuyQuantity();
    }
    throw new IllegalStateException();
  }

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

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

    boolean this_present_sellingPrice = true;
    boolean that_present_sellingPrice = true;
    if (this_present_sellingPrice || that_present_sellingPrice) {
      if (!(this_present_sellingPrice && that_present_sellingPrice))
        return false;
      if (this.sellingPrice != that.sellingPrice)
        return false;
    }

    boolean this_present_bulkPricing = true && this.isSetBulkPricing();
    boolean that_present_bulkPricing = true && that.isSetBulkPricing();
    if (this_present_bulkPricing || that_present_bulkPricing) {
      if (!(this_present_bulkPricing && that_present_bulkPricing))
        return false;
      if (!this.bulkPricing.equals(that.bulkPricing))
        return false;
    }

    boolean this_present_catalog_item_id = true;
    boolean that_present_catalog_item_id = true;
    if (this_present_catalog_item_id || that_present_catalog_item_id) {
      if (!(this_present_catalog_item_id && that_present_catalog_item_id))
        return false;
      if (this.catalog_item_id != that.catalog_item_id)
        return false;
    }

    boolean this_present_minimumBuyQuantity = true;
    boolean that_present_minimumBuyQuantity = true;
    if (this_present_minimumBuyQuantity || that_present_minimumBuyQuantity) {
      if (!(this_present_minimumBuyQuantity && that_present_minimumBuyQuantity))
        return false;
      if (this.minimumBuyQuantity != that.minimumBuyQuantity)
        return false;
    }

    boolean this_present_maximumBuyQuantity = true;
    boolean that_present_maximumBuyQuantity = true;
    if (this_present_maximumBuyQuantity || that_present_maximumBuyQuantity) {
      if (!(this_present_maximumBuyQuantity && that_present_maximumBuyQuantity))
        return false;
      if (this.maximumBuyQuantity != that.maximumBuyQuantity)
        return false;
    }

    return true;
  }

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

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

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

    lastComparison = Boolean.valueOf(isSetSellingPrice()).compareTo(typedOther.isSetSellingPrice());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSellingPrice()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sellingPrice, typedOther.sellingPrice);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetBulkPricing()).compareTo(typedOther.isSetBulkPricing());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetBulkPricing()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.bulkPricing, typedOther.bulkPricing);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetCatalog_item_id()).compareTo(typedOther.isSetCatalog_item_id());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetCatalog_item_id()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.catalog_item_id, typedOther.catalog_item_id);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetMinimumBuyQuantity()).compareTo(typedOther.isSetMinimumBuyQuantity());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMinimumBuyQuantity()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.minimumBuyQuantity, typedOther.minimumBuyQuantity);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetMaximumBuyQuantity()).compareTo(typedOther.isSetMaximumBuyQuantity());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMaximumBuyQuantity()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.maximumBuyQuantity, typedOther.maximumBuyQuantity);
      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: // SELLING_PRICE
          if (field.type == org.apache.thrift.protocol.TType.DOUBLE) {
            this.sellingPrice = iprot.readDouble();
            setSellingPriceIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 2: // BULK_PRICING
          if (field.type == org.apache.thrift.protocol.TType.MAP) {
            {
              org.apache.thrift.protocol.TMap _map22 = iprot.readMapBegin();
              this.bulkPricing = new HashMap<Long,Double>(2*_map22.size);
              for (int _i23 = 0; _i23 < _map22.size; ++_i23)
              {
                long _key24; // required
                double _val25; // required
                _key24 = iprot.readI64();
                _val25 = iprot.readDouble();
                this.bulkPricing.put(_key24, _val25);
              }
              iprot.readMapEnd();
            }
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 3: // CATALOG_ITEM_ID
          if (field.type == org.apache.thrift.protocol.TType.I64) {
            this.catalog_item_id = iprot.readI64();
            setCatalog_item_idIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 4: // MINIMUM_BUY_QUANTITY
          if (field.type == org.apache.thrift.protocol.TType.I64) {
            this.minimumBuyQuantity = iprot.readI64();
            setMinimumBuyQuantityIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 5: // MAXIMUM_BUY_QUANTITY
          if (field.type == org.apache.thrift.protocol.TType.I64) {
            this.maximumBuyQuantity = iprot.readI64();
            setMaximumBuyQuantityIsSet(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(SELLING_PRICE_FIELD_DESC);
    oprot.writeDouble(this.sellingPrice);
    oprot.writeFieldEnd();
    if (this.bulkPricing != null) {
      oprot.writeFieldBegin(BULK_PRICING_FIELD_DESC);
      {
        oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I64, org.apache.thrift.protocol.TType.DOUBLE, this.bulkPricing.size()));
        for (Map.Entry<Long, Double> _iter26 : this.bulkPricing.entrySet())
        {
          oprot.writeI64(_iter26.getKey());
          oprot.writeDouble(_iter26.getValue());
        }
        oprot.writeMapEnd();
      }
      oprot.writeFieldEnd();
    }
    oprot.writeFieldBegin(CATALOG_ITEM_ID_FIELD_DESC);
    oprot.writeI64(this.catalog_item_id);
    oprot.writeFieldEnd();
    oprot.writeFieldBegin(MINIMUM_BUY_QUANTITY_FIELD_DESC);
    oprot.writeI64(this.minimumBuyQuantity);
    oprot.writeFieldEnd();
    oprot.writeFieldBegin(MAXIMUM_BUY_QUANTITY_FIELD_DESC);
    oprot.writeI64(this.maximumBuyQuantity);
    oprot.writeFieldEnd();
    oprot.writeFieldStop();
    oprot.writeStructEnd();
  }

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

    sb.append("sellingPrice:");
    sb.append(this.sellingPrice);
    first = false;
    if (!first) sb.append(", ");
    sb.append("bulkPricing:");
    if (this.bulkPricing == null) {
      sb.append("null");
    } else {
      sb.append(this.bulkPricing);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("catalog_item_id:");
    sb.append(this.catalog_item_id);
    first = false;
    if (!first) sb.append(", ");
    sb.append("minimumBuyQuantity:");
    sb.append(this.minimumBuyQuantity);
    first = false;
    if (!first) sb.append(", ");
    sb.append("maximumBuyQuantity:");
    sb.append(this.maximumBuyQuantity);
    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);
    }
  }

}