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

  private static final org.apache.thrift.protocol.TField _ID_FIELD_DESC = new org.apache.thrift.protocol.TField("_id", org.apache.thrift.protocol.TType.I64, (short)1);
  private static final org.apache.thrift.protocol.TField AVAILABLE_PRICE_FIELD_DESC = new org.apache.thrift.protocol.TField("available_price", org.apache.thrift.protocol.TType.DOUBLE, (short)2);
  private static final org.apache.thrift.protocol.TField MARKET_PLACE_URL_FIELD_DESC = new org.apache.thrift.protocol.TField("marketPlaceUrl", org.apache.thrift.protocol.TType.STRING, (short)3);
  private static final org.apache.thrift.protocol.TField IN_STOCK_FIELD_DESC = new org.apache.thrift.protocol.TField("in_stock", org.apache.thrift.protocol.TType.I64, (short)4);
  private static final org.apache.thrift.protocol.TField SOURCE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("source_id", org.apache.thrift.protocol.TType.I64, (short)5);
  private static final org.apache.thrift.protocol.TField SOURCE_PRODUCT_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("source_product_name", org.apache.thrift.protocol.TType.STRING, (short)6);
  private static final org.apache.thrift.protocol.TField THUMBNAIL_FIELD_DESC = new org.apache.thrift.protocol.TField("thumbnail", org.apache.thrift.protocol.TType.STRING, (short)7);

  private long _id; // required
  private double available_price; // required
  private String marketPlaceUrl; // required
  private long in_stock; // required
  private long source_id; // required
  private String source_product_name; // required
  private String thumbnail; // 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 {
    _ID((short)1, "_id"),
    AVAILABLE_PRICE((short)2, "available_price"),
    MARKET_PLACE_URL((short)3, "marketPlaceUrl"),
    IN_STOCK((short)4, "in_stock"),
    SOURCE_ID((short)5, "source_id"),
    SOURCE_PRODUCT_NAME((short)6, "source_product_name"),
    THUMBNAIL((short)7, "thumbnail");

    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: // _ID
          return _ID;
        case 2: // AVAILABLE_PRICE
          return AVAILABLE_PRICE;
        case 3: // MARKET_PLACE_URL
          return MARKET_PLACE_URL;
        case 4: // IN_STOCK
          return IN_STOCK;
        case 5: // SOURCE_ID
          return SOURCE_ID;
        case 6: // SOURCE_PRODUCT_NAME
          return SOURCE_PRODUCT_NAME;
        case 7: // THUMBNAIL
          return THUMBNAIL;
        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 ___ID_ISSET_ID = 0;
  private static final int __AVAILABLE_PRICE_ISSET_ID = 1;
  private static final int __IN_STOCK_ISSET_ID = 2;
  private static final int __SOURCE_ID_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._ID, new org.apache.thrift.meta_data.FieldMetaData("_id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.AVAILABLE_PRICE, new org.apache.thrift.meta_data.FieldMetaData("available_price", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
    tmpMap.put(_Fields.MARKET_PLACE_URL, new org.apache.thrift.meta_data.FieldMetaData("marketPlaceUrl", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.IN_STOCK, new org.apache.thrift.meta_data.FieldMetaData("in_stock", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.SOURCE_ID, new org.apache.thrift.meta_data.FieldMetaData("source_id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.SOURCE_PRODUCT_NAME, new org.apache.thrift.meta_data.FieldMetaData("source_product_name", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.THUMBNAIL, new org.apache.thrift.meta_data.FieldMetaData("thumbnail", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    metaDataMap = Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(LivePricing.class, metaDataMap);
  }

  public LivePricing() {
  }

  public LivePricing(
    long _id,
    double available_price,
    String marketPlaceUrl,
    long in_stock,
    long source_id,
    String source_product_name,
    String thumbnail)
  {
    this();
    this._id = _id;
    set_idIsSet(true);
    this.available_price = available_price;
    setAvailable_priceIsSet(true);
    this.marketPlaceUrl = marketPlaceUrl;
    this.in_stock = in_stock;
    setIn_stockIsSet(true);
    this.source_id = source_id;
    setSource_idIsSet(true);
    this.source_product_name = source_product_name;
    this.thumbnail = thumbnail;
  }

  /**
   * Performs a deep copy on <i>other</i>.
   */
  public LivePricing(LivePricing other) {
    __isset_bit_vector.clear();
    __isset_bit_vector.or(other.__isset_bit_vector);
    this._id = other._id;
    this.available_price = other.available_price;
    if (other.isSetMarketPlaceUrl()) {
      this.marketPlaceUrl = other.marketPlaceUrl;
    }
    this.in_stock = other.in_stock;
    this.source_id = other.source_id;
    if (other.isSetSource_product_name()) {
      this.source_product_name = other.source_product_name;
    }
    if (other.isSetThumbnail()) {
      this.thumbnail = other.thumbnail;
    }
  }

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

  @Override
  public void clear() {
    set_idIsSet(false);
    this._id = 0;
    setAvailable_priceIsSet(false);
    this.available_price = 0.0;
    this.marketPlaceUrl = null;
    setIn_stockIsSet(false);
    this.in_stock = 0;
    setSource_idIsSet(false);
    this.source_id = 0;
    this.source_product_name = null;
    this.thumbnail = null;
  }

  public long get_id() {
    return this._id;
  }

  public void set_id(long _id) {
    this._id = _id;
    set_idIsSet(true);
  }

  public void unset_id() {
    __isset_bit_vector.clear(___ID_ISSET_ID);
  }

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

  public void set_idIsSet(boolean value) {
    __isset_bit_vector.set(___ID_ISSET_ID, value);
  }

  public double getAvailable_price() {
    return this.available_price;
  }

  public void setAvailable_price(double available_price) {
    this.available_price = available_price;
    setAvailable_priceIsSet(true);
  }

  public void unsetAvailable_price() {
    __isset_bit_vector.clear(__AVAILABLE_PRICE_ISSET_ID);
  }

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

  public void setAvailable_priceIsSet(boolean value) {
    __isset_bit_vector.set(__AVAILABLE_PRICE_ISSET_ID, value);
  }

  public String getMarketPlaceUrl() {
    return this.marketPlaceUrl;
  }

  public void setMarketPlaceUrl(String marketPlaceUrl) {
    this.marketPlaceUrl = marketPlaceUrl;
  }

  public void unsetMarketPlaceUrl() {
    this.marketPlaceUrl = null;
  }

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

  public void setMarketPlaceUrlIsSet(boolean value) {
    if (!value) {
      this.marketPlaceUrl = null;
    }
  }

  public long getIn_stock() {
    return this.in_stock;
  }

  public void setIn_stock(long in_stock) {
    this.in_stock = in_stock;
    setIn_stockIsSet(true);
  }

  public void unsetIn_stock() {
    __isset_bit_vector.clear(__IN_STOCK_ISSET_ID);
  }

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

  public void setIn_stockIsSet(boolean value) {
    __isset_bit_vector.set(__IN_STOCK_ISSET_ID, value);
  }

  public long getSource_id() {
    return this.source_id;
  }

  public void setSource_id(long source_id) {
    this.source_id = source_id;
    setSource_idIsSet(true);
  }

  public void unsetSource_id() {
    __isset_bit_vector.clear(__SOURCE_ID_ISSET_ID);
  }

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

  public void setSource_idIsSet(boolean value) {
    __isset_bit_vector.set(__SOURCE_ID_ISSET_ID, value);
  }

  public String getSource_product_name() {
    return this.source_product_name;
  }

  public void setSource_product_name(String source_product_name) {
    this.source_product_name = source_product_name;
  }

  public void unsetSource_product_name() {
    this.source_product_name = null;
  }

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

  public void setSource_product_nameIsSet(boolean value) {
    if (!value) {
      this.source_product_name = null;
    }
  }

  public String getThumbnail() {
    return this.thumbnail;
  }

  public void setThumbnail(String thumbnail) {
    this.thumbnail = thumbnail;
  }

  public void unsetThumbnail() {
    this.thumbnail = null;
  }

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

  public void setThumbnailIsSet(boolean value) {
    if (!value) {
      this.thumbnail = null;
    }
  }

  public void setFieldValue(_Fields field, Object value) {
    switch (field) {
    case _ID:
      if (value == null) {
        unset_id();
      } else {
        set_id((Long)value);
      }
      break;

    case AVAILABLE_PRICE:
      if (value == null) {
        unsetAvailable_price();
      } else {
        setAvailable_price((Double)value);
      }
      break;

    case MARKET_PLACE_URL:
      if (value == null) {
        unsetMarketPlaceUrl();
      } else {
        setMarketPlaceUrl((String)value);
      }
      break;

    case IN_STOCK:
      if (value == null) {
        unsetIn_stock();
      } else {
        setIn_stock((Long)value);
      }
      break;

    case SOURCE_ID:
      if (value == null) {
        unsetSource_id();
      } else {
        setSource_id((Long)value);
      }
      break;

    case SOURCE_PRODUCT_NAME:
      if (value == null) {
        unsetSource_product_name();
      } else {
        setSource_product_name((String)value);
      }
      break;

    case THUMBNAIL:
      if (value == null) {
        unsetThumbnail();
      } else {
        setThumbnail((String)value);
      }
      break;

    }
  }

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

    case AVAILABLE_PRICE:
      return Double.valueOf(getAvailable_price());

    case MARKET_PLACE_URL:
      return getMarketPlaceUrl();

    case IN_STOCK:
      return Long.valueOf(getIn_stock());

    case SOURCE_ID:
      return Long.valueOf(getSource_id());

    case SOURCE_PRODUCT_NAME:
      return getSource_product_name();

    case THUMBNAIL:
      return getThumbnail();

    }
    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 _ID:
      return isSet_id();
    case AVAILABLE_PRICE:
      return isSetAvailable_price();
    case MARKET_PLACE_URL:
      return isSetMarketPlaceUrl();
    case IN_STOCK:
      return isSetIn_stock();
    case SOURCE_ID:
      return isSetSource_id();
    case SOURCE_PRODUCT_NAME:
      return isSetSource_product_name();
    case THUMBNAIL:
      return isSetThumbnail();
    }
    throw new IllegalStateException();
  }

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

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

    boolean this_present__id = true;
    boolean that_present__id = true;
    if (this_present__id || that_present__id) {
      if (!(this_present__id && that_present__id))
        return false;
      if (this._id != that._id)
        return false;
    }

    boolean this_present_available_price = true;
    boolean that_present_available_price = true;
    if (this_present_available_price || that_present_available_price) {
      if (!(this_present_available_price && that_present_available_price))
        return false;
      if (this.available_price != that.available_price)
        return false;
    }

    boolean this_present_marketPlaceUrl = true && this.isSetMarketPlaceUrl();
    boolean that_present_marketPlaceUrl = true && that.isSetMarketPlaceUrl();
    if (this_present_marketPlaceUrl || that_present_marketPlaceUrl) {
      if (!(this_present_marketPlaceUrl && that_present_marketPlaceUrl))
        return false;
      if (!this.marketPlaceUrl.equals(that.marketPlaceUrl))
        return false;
    }

    boolean this_present_in_stock = true;
    boolean that_present_in_stock = true;
    if (this_present_in_stock || that_present_in_stock) {
      if (!(this_present_in_stock && that_present_in_stock))
        return false;
      if (this.in_stock != that.in_stock)
        return false;
    }

    boolean this_present_source_id = true;
    boolean that_present_source_id = true;
    if (this_present_source_id || that_present_source_id) {
      if (!(this_present_source_id && that_present_source_id))
        return false;
      if (this.source_id != that.source_id)
        return false;
    }

    boolean this_present_source_product_name = true && this.isSetSource_product_name();
    boolean that_present_source_product_name = true && that.isSetSource_product_name();
    if (this_present_source_product_name || that_present_source_product_name) {
      if (!(this_present_source_product_name && that_present_source_product_name))
        return false;
      if (!this.source_product_name.equals(that.source_product_name))
        return false;
    }

    boolean this_present_thumbnail = true && this.isSetThumbnail();
    boolean that_present_thumbnail = true && that.isSetThumbnail();
    if (this_present_thumbnail || that_present_thumbnail) {
      if (!(this_present_thumbnail && that_present_thumbnail))
        return false;
      if (!this.thumbnail.equals(that.thumbnail))
        return false;
    }

    return true;
  }

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

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

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

    lastComparison = Boolean.valueOf(isSet_id()).compareTo(typedOther.isSet_id());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSet_id()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this._id, typedOther._id);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetAvailable_price()).compareTo(typedOther.isSetAvailable_price());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetAvailable_price()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.available_price, typedOther.available_price);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetMarketPlaceUrl()).compareTo(typedOther.isSetMarketPlaceUrl());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMarketPlaceUrl()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.marketPlaceUrl, typedOther.marketPlaceUrl);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetIn_stock()).compareTo(typedOther.isSetIn_stock());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetIn_stock()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.in_stock, typedOther.in_stock);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetSource_id()).compareTo(typedOther.isSetSource_id());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSource_id()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.source_id, typedOther.source_id);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetSource_product_name()).compareTo(typedOther.isSetSource_product_name());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSource_product_name()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.source_product_name, typedOther.source_product_name);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetThumbnail()).compareTo(typedOther.isSetThumbnail());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetThumbnail()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.thumbnail, typedOther.thumbnail);
      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: // _ID
          if (field.type == org.apache.thrift.protocol.TType.I64) {
            this._id = iprot.readI64();
            set_idIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 2: // AVAILABLE_PRICE
          if (field.type == org.apache.thrift.protocol.TType.DOUBLE) {
            this.available_price = iprot.readDouble();
            setAvailable_priceIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 3: // MARKET_PLACE_URL
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
            this.marketPlaceUrl = iprot.readString();
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 4: // IN_STOCK
          if (field.type == org.apache.thrift.protocol.TType.I64) {
            this.in_stock = iprot.readI64();
            setIn_stockIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 5: // SOURCE_ID
          if (field.type == org.apache.thrift.protocol.TType.I64) {
            this.source_id = iprot.readI64();
            setSource_idIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 6: // SOURCE_PRODUCT_NAME
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
            this.source_product_name = iprot.readString();
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 7: // THUMBNAIL
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
            this.thumbnail = iprot.readString();
          } 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(_ID_FIELD_DESC);
    oprot.writeI64(this._id);
    oprot.writeFieldEnd();
    oprot.writeFieldBegin(AVAILABLE_PRICE_FIELD_DESC);
    oprot.writeDouble(this.available_price);
    oprot.writeFieldEnd();
    if (this.marketPlaceUrl != null) {
      oprot.writeFieldBegin(MARKET_PLACE_URL_FIELD_DESC);
      oprot.writeString(this.marketPlaceUrl);
      oprot.writeFieldEnd();
    }
    oprot.writeFieldBegin(IN_STOCK_FIELD_DESC);
    oprot.writeI64(this.in_stock);
    oprot.writeFieldEnd();
    oprot.writeFieldBegin(SOURCE_ID_FIELD_DESC);
    oprot.writeI64(this.source_id);
    oprot.writeFieldEnd();
    if (this.source_product_name != null) {
      oprot.writeFieldBegin(SOURCE_PRODUCT_NAME_FIELD_DESC);
      oprot.writeString(this.source_product_name);
      oprot.writeFieldEnd();
    }
    if (this.thumbnail != null) {
      oprot.writeFieldBegin(THUMBNAIL_FIELD_DESC);
      oprot.writeString(this.thumbnail);
      oprot.writeFieldEnd();
    }
    oprot.writeFieldStop();
    oprot.writeStructEnd();
  }

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

    sb.append("_id:");
    sb.append(this._id);
    first = false;
    if (!first) sb.append(", ");
    sb.append("available_price:");
    sb.append(this.available_price);
    first = false;
    if (!first) sb.append(", ");
    sb.append("marketPlaceUrl:");
    if (this.marketPlaceUrl == null) {
      sb.append("null");
    } else {
      sb.append(this.marketPlaceUrl);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("in_stock:");
    sb.append(this.in_stock);
    first = false;
    if (!first) sb.append(", ");
    sb.append("source_id:");
    sb.append(this.source_id);
    first = false;
    if (!first) sb.append(", ");
    sb.append("source_product_name:");
    if (this.source_product_name == null) {
      sb.append("null");
    } else {
      sb.append(this.source_product_name);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("thumbnail:");
    if (this.thumbnail == null) {
      sb.append("null");
    } else {
      sb.append(this.thumbnail);
    }
    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);
    }
  }

}