All Downloads are FREE. Search and download functionalities are using the official Maven repository.

open_rtb.BidResponseThrift Maven / Gradle / Ivy

There is a newer version: 3.1.2
Show newest version
/**
 * Autogenerated by Thrift Compiler (0.9.2)
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */
package open_rtb;

import org.apache.thrift.scheme.IScheme;
import org.apache.thrift.scheme.SchemeFactory;
import org.apache.thrift.scheme.StandardScheme;

import org.apache.thrift.scheme.TupleScheme;
import org.apache.thrift.protocol.TTupleProtocol;
import org.apache.thrift.protocol.TProtocolException;
import org.apache.thrift.EncodingUtils;
import org.apache.thrift.TException;
import org.apache.thrift.async.AsyncMethodCallback;
import org.apache.thrift.server.AbstractNonblockingServer.*;
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 javax.annotation.Generated;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
/**
 * 4.3.1 Bid Response Object
 * The top-level bid response object is defined below. The “id” attribute is a reflection of the bid request ID for logging purposes. Similarly, “bidid” is an optional response tracking ID for bidders. If specified, it can be included in the subsequent win notice call if the bidder wins. At least one “seatbid” object is required, which contains a bid on at least one impression. Other attributes are optional since an exchange may establish default values.
 * No-Bids on all impressions should be indicated as a HTTP 204 response. For no-bids on specific impressions, the bidder should omit these from the bid response.
 */
@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2016-6-3")
public class BidResponseThrift implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable {
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("BidResponseThrift");

  private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.STRING, (short)1);
  private static final org.apache.thrift.protocol.TField SEATBID_FIELD_DESC = new org.apache.thrift.protocol.TField("seatbid", org.apache.thrift.protocol.TType.LIST, (short)2);
  private static final org.apache.thrift.protocol.TField BIDID_FIELD_DESC = new org.apache.thrift.protocol.TField("bidid", org.apache.thrift.protocol.TType.STRING, (short)3);
  private static final org.apache.thrift.protocol.TField CUR_FIELD_DESC = new org.apache.thrift.protocol.TField("cur", org.apache.thrift.protocol.TType.STRING, (short)4);
  private static final org.apache.thrift.protocol.TField CUSTOMDATA_FIELD_DESC = new org.apache.thrift.protocol.TField("customdata", org.apache.thrift.protocol.TType.STRING, (short)5);
  private static final org.apache.thrift.protocol.TField NBR_FIELD_DESC = new org.apache.thrift.protocol.TField("nbr", org.apache.thrift.protocol.TType.I16, (short)6);

  private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
  static {
    schemes.put(StandardScheme.class, new BidResponseThriftStandardSchemeFactory());
    schemes.put(TupleScheme.class, new BidResponseThriftTupleSchemeFactory());
  }

  /**
   * ID of the bid request.
   */
  public String id; // optional
  /**
   * Array of seatbid objects.
   */
  public List seatbid; // optional
  /**
   * Bid response ID to assist tracking for bidders. This value is chosen by the bidder for cross-reference.
   */
  public String bidid; // optional
  /**
   * Bid currency using ISO-4217 alphabetic codes; default is “USD”.
   */
  public String cur; // optional
  /**
   * This is an optional feature, which allows a bidder to set data in the exchange’s cookie. The string may be in base85 cookie safe characters, and be in any format. This may be useful for storing user features. Note: Proper JSON encoding must be used to include “escaped” quotation marks.
   */
  public String customdata; // optional
  /**
   * Reason for not bidding. See Table 6.19 No-Bid Reason Codes.
   */
  public short nbr; // optional

  /** 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 of the bid request.
     */
    ID((short)1, "id"),
    /**
     * Array of seatbid objects.
     */
    SEATBID((short)2, "seatbid"),
    /**
     * Bid response ID to assist tracking for bidders. This value is chosen by the bidder for cross-reference.
     */
    BIDID((short)3, "bidid"),
    /**
     * Bid currency using ISO-4217 alphabetic codes; default is “USD”.
     */
    CUR((short)4, "cur"),
    /**
     * This is an optional feature, which allows a bidder to set data in the exchange’s cookie. The string may be in base85 cookie safe characters, and be in any format. This may be useful for storing user features. Note: Proper JSON encoding must be used to include “escaped” quotation marks.
     */
    CUSTOMDATA((short)5, "customdata"),
    /**
     * Reason for not bidding. See Table 6.19 No-Bid Reason Codes.
     */
    NBR((short)6, "nbr");

    private static final Map byName = new HashMap();

    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: // SEATBID
          return SEATBID;
        case 3: // BIDID
          return BIDID;
        case 4: // CUR
          return CUR;
        case 5: // CUSTOMDATA
          return CUSTOMDATA;
        case 6: // NBR
          return NBR;
        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 __NBR_ISSET_ID = 0;
  private byte __isset_bitfield = 0;
  private static final _Fields optionals[] = {_Fields.ID,_Fields.SEATBID,_Fields.BIDID,_Fields.CUR,_Fields.CUSTOMDATA,_Fields.NBR};
  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.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.SEATBID, new org.apache.thrift.meta_data.FieldMetaData("seatbid", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        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, SeatBidThrift.class))));
    tmpMap.put(_Fields.BIDID, new org.apache.thrift.meta_data.FieldMetaData("bidid", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.CUR, new org.apache.thrift.meta_data.FieldMetaData("cur", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.CUSTOMDATA, new org.apache.thrift.meta_data.FieldMetaData("customdata", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.NBR, new org.apache.thrift.meta_data.FieldMetaData("nbr", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I16)));
    metaDataMap = Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(BidResponseThrift.class, metaDataMap);
  }

  public BidResponseThrift() {
    this.id = "";

    this.bidid = "";

    this.cur = "USD";

    this.customdata = "";

    this.nbr = (short)0;

  }

  /**
   * Performs a deep copy on other.
   */
  public BidResponseThrift(BidResponseThrift other) {
    __isset_bitfield = other.__isset_bitfield;
    if (other.isSetId()) {
      this.id = other.id;
    }
    if (other.isSetSeatbid()) {
      List __this__seatbid = new ArrayList(other.seatbid.size());
      for (SeatBidThrift other_element : other.seatbid) {
        __this__seatbid.add(new SeatBidThrift(other_element));
      }
      this.seatbid = __this__seatbid;
    }
    if (other.isSetBidid()) {
      this.bidid = other.bidid;
    }
    if (other.isSetCur()) {
      this.cur = other.cur;
    }
    if (other.isSetCustomdata()) {
      this.customdata = other.customdata;
    }
    this.nbr = other.nbr;
  }

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

  @Override
  public void clear() {
    this.id = "";

    this.seatbid = null;
    this.bidid = "";

    this.cur = "USD";

    this.customdata = "";

    this.nbr = (short)0;

  }

  /**
   * ID of the bid request.
   */
  public String getId() {
    return this.id;
  }

  /**
   * ID of the bid request.
   */
  public BidResponseThrift setId(String id) {
    this.id = id;
    return this;
  }

  public void unsetId() {
    this.id = null;
  }

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

  public void setIdIsSet(boolean value) {
    if (!value) {
      this.id = null;
    }
  }

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

  public java.util.Iterator getSeatbidIterator() {
    return (this.seatbid == null) ? null : this.seatbid.iterator();
  }

  public void addToSeatbid(SeatBidThrift elem) {
    if (this.seatbid == null) {
      this.seatbid = new ArrayList();
    }
    this.seatbid.add(elem);
  }

  /**
   * Array of seatbid objects.
   */
  public List getSeatbid() {
    return this.seatbid;
  }

  /**
   * Array of seatbid objects.
   */
  public BidResponseThrift setSeatbid(List seatbid) {
    this.seatbid = seatbid;
    return this;
  }

  public void unsetSeatbid() {
    this.seatbid = null;
  }

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

  public void setSeatbidIsSet(boolean value) {
    if (!value) {
      this.seatbid = null;
    }
  }

  /**
   * Bid response ID to assist tracking for bidders. This value is chosen by the bidder for cross-reference.
   */
  public String getBidid() {
    return this.bidid;
  }

  /**
   * Bid response ID to assist tracking for bidders. This value is chosen by the bidder for cross-reference.
   */
  public BidResponseThrift setBidid(String bidid) {
    this.bidid = bidid;
    return this;
  }

  public void unsetBidid() {
    this.bidid = null;
  }

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

  public void setBididIsSet(boolean value) {
    if (!value) {
      this.bidid = null;
    }
  }

  /**
   * Bid currency using ISO-4217 alphabetic codes; default is “USD”.
   */
  public String getCur() {
    return this.cur;
  }

  /**
   * Bid currency using ISO-4217 alphabetic codes; default is “USD”.
   */
  public BidResponseThrift setCur(String cur) {
    this.cur = cur;
    return this;
  }

  public void unsetCur() {
    this.cur = null;
  }

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

  public void setCurIsSet(boolean value) {
    if (!value) {
      this.cur = null;
    }
  }

  /**
   * This is an optional feature, which allows a bidder to set data in the exchange’s cookie. The string may be in base85 cookie safe characters, and be in any format. This may be useful for storing user features. Note: Proper JSON encoding must be used to include “escaped” quotation marks.
   */
  public String getCustomdata() {
    return this.customdata;
  }

  /**
   * This is an optional feature, which allows a bidder to set data in the exchange’s cookie. The string may be in base85 cookie safe characters, and be in any format. This may be useful for storing user features. Note: Proper JSON encoding must be used to include “escaped” quotation marks.
   */
  public BidResponseThrift setCustomdata(String customdata) {
    this.customdata = customdata;
    return this;
  }

  public void unsetCustomdata() {
    this.customdata = null;
  }

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

  public void setCustomdataIsSet(boolean value) {
    if (!value) {
      this.customdata = null;
    }
  }

  /**
   * Reason for not bidding. See Table 6.19 No-Bid Reason Codes.
   */
  public short getNbr() {
    return this.nbr;
  }

  /**
   * Reason for not bidding. See Table 6.19 No-Bid Reason Codes.
   */
  public BidResponseThrift setNbr(short nbr) {
    this.nbr = nbr;
    setNbrIsSet(true);
    return this;
  }

  public void unsetNbr() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __NBR_ISSET_ID);
  }

  /** Returns true if field nbr is set (has been assigned a value) and false otherwise */
  public boolean isSetNbr() {
    return EncodingUtils.testBit(__isset_bitfield, __NBR_ISSET_ID);
  }

  public void setNbrIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __NBR_ISSET_ID, value);
  }

  public void setFieldValue(_Fields field, Object value) {
    switch (field) {
    case ID:
      if (value == null) {
        unsetId();
      } else {
        setId((String)value);
      }
      break;

    case SEATBID:
      if (value == null) {
        unsetSeatbid();
      } else {
        setSeatbid((List)value);
      }
      break;

    case BIDID:
      if (value == null) {
        unsetBidid();
      } else {
        setBidid((String)value);
      }
      break;

    case CUR:
      if (value == null) {
        unsetCur();
      } else {
        setCur((String)value);
      }
      break;

    case CUSTOMDATA:
      if (value == null) {
        unsetCustomdata();
      } else {
        setCustomdata((String)value);
      }
      break;

    case NBR:
      if (value == null) {
        unsetNbr();
      } else {
        setNbr((Short)value);
      }
      break;

    }
  }

  public Object getFieldValue(_Fields field) {
    switch (field) {
    case ID:
      return getId();

    case SEATBID:
      return getSeatbid();

    case BIDID:
      return getBidid();

    case CUR:
      return getCur();

    case CUSTOMDATA:
      return getCustomdata();

    case NBR:
      return Short.valueOf(getNbr());

    }
    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 isSetId();
    case SEATBID:
      return isSetSeatbid();
    case BIDID:
      return isSetBidid();
    case CUR:
      return isSetCur();
    case CUSTOMDATA:
      return isSetCustomdata();
    case NBR:
      return isSetNbr();
    }
    throw new IllegalStateException();
  }

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

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

    boolean this_present_id = true && this.isSetId();
    boolean that_present_id = true && that.isSetId();
    if (this_present_id || that_present_id) {
      if (!(this_present_id && that_present_id))
        return false;
      if (!this.id.equals(that.id))
        return false;
    }

    boolean this_present_seatbid = true && this.isSetSeatbid();
    boolean that_present_seatbid = true && that.isSetSeatbid();
    if (this_present_seatbid || that_present_seatbid) {
      if (!(this_present_seatbid && that_present_seatbid))
        return false;
      if (!this.seatbid.equals(that.seatbid))
        return false;
    }

    boolean this_present_bidid = true && this.isSetBidid();
    boolean that_present_bidid = true && that.isSetBidid();
    if (this_present_bidid || that_present_bidid) {
      if (!(this_present_bidid && that_present_bidid))
        return false;
      if (!this.bidid.equals(that.bidid))
        return false;
    }

    boolean this_present_cur = true && this.isSetCur();
    boolean that_present_cur = true && that.isSetCur();
    if (this_present_cur || that_present_cur) {
      if (!(this_present_cur && that_present_cur))
        return false;
      if (!this.cur.equals(that.cur))
        return false;
    }

    boolean this_present_customdata = true && this.isSetCustomdata();
    boolean that_present_customdata = true && that.isSetCustomdata();
    if (this_present_customdata || that_present_customdata) {
      if (!(this_present_customdata && that_present_customdata))
        return false;
      if (!this.customdata.equals(that.customdata))
        return false;
    }

    boolean this_present_nbr = true && this.isSetNbr();
    boolean that_present_nbr = true && that.isSetNbr();
    if (this_present_nbr || that_present_nbr) {
      if (!(this_present_nbr && that_present_nbr))
        return false;
      if (this.nbr != that.nbr)
        return false;
    }

    return true;
  }

  @Override
  public int hashCode() {
    List list = new ArrayList();

    boolean present_id = true && (isSetId());
    list.add(present_id);
    if (present_id)
      list.add(id);

    boolean present_seatbid = true && (isSetSeatbid());
    list.add(present_seatbid);
    if (present_seatbid)
      list.add(seatbid);

    boolean present_bidid = true && (isSetBidid());
    list.add(present_bidid);
    if (present_bidid)
      list.add(bidid);

    boolean present_cur = true && (isSetCur());
    list.add(present_cur);
    if (present_cur)
      list.add(cur);

    boolean present_customdata = true && (isSetCustomdata());
    list.add(present_customdata);
    if (present_customdata)
      list.add(customdata);

    boolean present_nbr = true && (isSetNbr());
    list.add(present_nbr);
    if (present_nbr)
      list.add(nbr);

    return list.hashCode();
  }

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

    int lastComparison = 0;

    lastComparison = Boolean.valueOf(isSetId()).compareTo(other.isSetId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetId()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, other.id);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetSeatbid()).compareTo(other.isSetSeatbid());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSeatbid()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.seatbid, other.seatbid);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetBidid()).compareTo(other.isSetBidid());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetBidid()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.bidid, other.bidid);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetCur()).compareTo(other.isSetCur());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetCur()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cur, other.cur);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetCustomdata()).compareTo(other.isSetCustomdata());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetCustomdata()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.customdata, other.customdata);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetNbr()).compareTo(other.isSetNbr());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetNbr()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nbr, other.nbr);
      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 {
    schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
  }

  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
    schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
  }

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

    if (isSetId()) {
      sb.append("id:");
      if (this.id == null) {
        sb.append("null");
      } else {
        sb.append(this.id);
      }
      first = false;
    }
    if (isSetSeatbid()) {
      if (!first) sb.append(", ");
      sb.append("seatbid:");
      if (this.seatbid == null) {
        sb.append("null");
      } else {
        sb.append(this.seatbid);
      }
      first = false;
    }
    if (isSetBidid()) {
      if (!first) sb.append(", ");
      sb.append("bidid:");
      if (this.bidid == null) {
        sb.append("null");
      } else {
        sb.append(this.bidid);
      }
      first = false;
    }
    if (isSetCur()) {
      if (!first) sb.append(", ");
      sb.append("cur:");
      if (this.cur == null) {
        sb.append("null");
      } else {
        sb.append(this.cur);
      }
      first = false;
    }
    if (isSetCustomdata()) {
      if (!first) sb.append(", ");
      sb.append("customdata:");
      if (this.customdata == null) {
        sb.append("null");
      } else {
        sb.append(this.customdata);
      }
      first = false;
    }
    if (isSetNbr()) {
      if (!first) sb.append(", ");
      sb.append("nbr:");
      sb.append(this.nbr);
      first = false;
    }
    sb.append(")");
    return sb.toString();
  }

  public void validate() throws org.apache.thrift.TException {
    // check for required fields
    // check for sub-struct validity
  }

  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_bitfield = 0;
      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);
    }
  }

  private static class BidResponseThriftStandardSchemeFactory implements SchemeFactory {
    public BidResponseThriftStandardScheme getScheme() {
      return new BidResponseThriftStandardScheme();
    }
  }

  private static class BidResponseThriftStandardScheme extends StandardScheme {

    public void read(org.apache.thrift.protocol.TProtocol iprot, BidResponseThrift struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField schemeField;
      iprot.readStructBegin();
      while (true)
      {
        schemeField = iprot.readFieldBegin();
        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (schemeField.id) {
          case 1: // ID
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.id = iprot.readString();
              struct.setIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // SEATBID
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list288 = iprot.readListBegin();
                struct.seatbid = new ArrayList(_list288.size);
                SeatBidThrift _elem289;
                for (int _i290 = 0; _i290 < _list288.size; ++_i290)
                {
                  _elem289 = new SeatBidThrift();
                  _elem289.read(iprot);
                  struct.seatbid.add(_elem289);
                }
                iprot.readListEnd();
              }
              struct.setSeatbidIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // BIDID
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.bidid = iprot.readString();
              struct.setBididIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // CUR
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.cur = iprot.readString();
              struct.setCurIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 5: // CUSTOMDATA
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.customdata = iprot.readString();
              struct.setCustomdataIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 6: // NBR
            if (schemeField.type == org.apache.thrift.protocol.TType.I16) {
              struct.nbr = iprot.readI16();
              struct.setNbrIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();

      // check for required fields of primitive type, which can't be checked in the validate method
      struct.validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot, BidResponseThrift struct) throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.id != null) {
        if (struct.isSetId()) {
          oprot.writeFieldBegin(ID_FIELD_DESC);
          oprot.writeString(struct.id);
          oprot.writeFieldEnd();
        }
      }
      if (struct.seatbid != null) {
        if (struct.isSetSeatbid()) {
          oprot.writeFieldBegin(SEATBID_FIELD_DESC);
          {
            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.seatbid.size()));
            for (SeatBidThrift _iter291 : struct.seatbid)
            {
              _iter291.write(oprot);
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      if (struct.bidid != null) {
        if (struct.isSetBidid()) {
          oprot.writeFieldBegin(BIDID_FIELD_DESC);
          oprot.writeString(struct.bidid);
          oprot.writeFieldEnd();
        }
      }
      if (struct.cur != null) {
        if (struct.isSetCur()) {
          oprot.writeFieldBegin(CUR_FIELD_DESC);
          oprot.writeString(struct.cur);
          oprot.writeFieldEnd();
        }
      }
      if (struct.customdata != null) {
        if (struct.isSetCustomdata()) {
          oprot.writeFieldBegin(CUSTOMDATA_FIELD_DESC);
          oprot.writeString(struct.customdata);
          oprot.writeFieldEnd();
        }
      }
      if (struct.isSetNbr()) {
        oprot.writeFieldBegin(NBR_FIELD_DESC);
        oprot.writeI16(struct.nbr);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

  private static class BidResponseThriftTupleSchemeFactory implements SchemeFactory {
    public BidResponseThriftTupleScheme getScheme() {
      return new BidResponseThriftTupleScheme();
    }
  }

  private static class BidResponseThriftTupleScheme extends TupleScheme {

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, BidResponseThrift struct) throws org.apache.thrift.TException {
      TTupleProtocol oprot = (TTupleProtocol) prot;
      BitSet optionals = new BitSet();
      if (struct.isSetId()) {
        optionals.set(0);
      }
      if (struct.isSetSeatbid()) {
        optionals.set(1);
      }
      if (struct.isSetBidid()) {
        optionals.set(2);
      }
      if (struct.isSetCur()) {
        optionals.set(3);
      }
      if (struct.isSetCustomdata()) {
        optionals.set(4);
      }
      if (struct.isSetNbr()) {
        optionals.set(5);
      }
      oprot.writeBitSet(optionals, 6);
      if (struct.isSetId()) {
        oprot.writeString(struct.id);
      }
      if (struct.isSetSeatbid()) {
        {
          oprot.writeI32(struct.seatbid.size());
          for (SeatBidThrift _iter292 : struct.seatbid)
          {
            _iter292.write(oprot);
          }
        }
      }
      if (struct.isSetBidid()) {
        oprot.writeString(struct.bidid);
      }
      if (struct.isSetCur()) {
        oprot.writeString(struct.cur);
      }
      if (struct.isSetCustomdata()) {
        oprot.writeString(struct.customdata);
      }
      if (struct.isSetNbr()) {
        oprot.writeI16(struct.nbr);
      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, BidResponseThrift struct) throws org.apache.thrift.TException {
      TTupleProtocol iprot = (TTupleProtocol) prot;
      BitSet incoming = iprot.readBitSet(6);
      if (incoming.get(0)) {
        struct.id = iprot.readString();
        struct.setIdIsSet(true);
      }
      if (incoming.get(1)) {
        {
          org.apache.thrift.protocol.TList _list293 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
          struct.seatbid = new ArrayList(_list293.size);
          SeatBidThrift _elem294;
          for (int _i295 = 0; _i295 < _list293.size; ++_i295)
          {
            _elem294 = new SeatBidThrift();
            _elem294.read(iprot);
            struct.seatbid.add(_elem294);
          }
        }
        struct.setSeatbidIsSet(true);
      }
      if (incoming.get(2)) {
        struct.bidid = iprot.readString();
        struct.setBididIsSet(true);
      }
      if (incoming.get(3)) {
        struct.cur = iprot.readString();
        struct.setCurIsSet(true);
      }
      if (incoming.get(4)) {
        struct.customdata = iprot.readString();
        struct.setCustomdataIsSet(true);
      }
      if (incoming.get(5)) {
        struct.nbr = iprot.readI16();
        struct.setNbrIsSet(true);
      }
    }
  }

}