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

open_rtb.BidThrift 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.3 Bid Object
 * For each bid, the “nurl” attribute contains the win notice URL. If the bidder wins the impression, the exchange calls this notice URL a) to inform the bidder of the win and b) to convey certain information using substitution macros (see Section 4.6 Substitution Macros).
 * The “adomain” attribute can be used to check advertiser block list compliance. The “iurl” attribute can provide a link to an image that is representative of the campaign’s content (irrespective of whether the campaign may have multiple creatives). This enables human review for spotting inappropriate content. The “cid” attribute can be used to block ads that were previously identified as inappropriate; essentially a safety net beyond the block lists. The “crid” attribute can be helpful in reporting creative issues back to bidders. Finally, the “attr” array indicates the creative attributes that describe the ad to be served.
 * BEST PRACTICE: Substitution macros may allow a bidder to use a static notice URL for all of its bids. Thus, exchanges should offer the option of a default notice URL that can be pre- configured per bidder to reduce redundant data transfer.
 */
@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2016-6-3")
public class BidThrift 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("BidThrift");

  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 IMPID_FIELD_DESC = new org.apache.thrift.protocol.TField("impid", org.apache.thrift.protocol.TType.STRING, (short)2);
  private static final org.apache.thrift.protocol.TField PRICE_FIELD_DESC = new org.apache.thrift.protocol.TField("price", org.apache.thrift.protocol.TType.DOUBLE, (short)3);
  private static final org.apache.thrift.protocol.TField ADID_FIELD_DESC = new org.apache.thrift.protocol.TField("adid", org.apache.thrift.protocol.TType.STRING, (short)4);
  private static final org.apache.thrift.protocol.TField NURL_FIELD_DESC = new org.apache.thrift.protocol.TField("nurl", org.apache.thrift.protocol.TType.STRING, (short)5);
  private static final org.apache.thrift.protocol.TField ADM_FIELD_DESC = new org.apache.thrift.protocol.TField("adm", org.apache.thrift.protocol.TType.STRING, (short)6);
  private static final org.apache.thrift.protocol.TField ADOMAIN_FIELD_DESC = new org.apache.thrift.protocol.TField("adomain", org.apache.thrift.protocol.TType.LIST, (short)7);
  private static final org.apache.thrift.protocol.TField LURL_FIELD_DESC = new org.apache.thrift.protocol.TField("lurl", org.apache.thrift.protocol.TType.STRING, (short)8);
  private static final org.apache.thrift.protocol.TField CID_FIELD_DESC = new org.apache.thrift.protocol.TField("cid", org.apache.thrift.protocol.TType.STRING, (short)9);
  private static final org.apache.thrift.protocol.TField CRID_FIELD_DESC = new org.apache.thrift.protocol.TField("crid", org.apache.thrift.protocol.TType.STRING, (short)10);
  private static final org.apache.thrift.protocol.TField ATTR_FIELD_DESC = new org.apache.thrift.protocol.TField("attr", org.apache.thrift.protocol.TType.LIST, (short)11);
  private static final org.apache.thrift.protocol.TField DEALID_FIELD_DESC = new org.apache.thrift.protocol.TField("dealid", org.apache.thrift.protocol.TType.STRING, (short)12);
  private static final org.apache.thrift.protocol.TField W_FIELD_DESC = new org.apache.thrift.protocol.TField("w", org.apache.thrift.protocol.TType.I32, (short)13);
  private static final org.apache.thrift.protocol.TField H_FIELD_DESC = new org.apache.thrift.protocol.TField("h", org.apache.thrift.protocol.TType.I32, (short)14);

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

  /**
   * ID for the bid object chosen by the bidder for tracking and debugging purposes. Useful when multiple bids are submitted for a single impression for a given seat.
   */
  public String id; // optional
  /**
   * ID of the impression object to which this bid applies.
   */
  public String impid; // optional
  /**
   * Bid price in CPM. WARNING/Best Practice Note: Although this value is a float, OpenRTB strongly suggests using integer math for accounting to avoid rounding errors.
   */
  public double price; // optional
  /**
   * ID that references the ad to be served if the bid wins.
   */
  public String adid; // optional
  /**
   * Win notice URL. Note that ad markup is also typically, but not necessarily, returned via this URL.
   */
  public String nurl; // optional
  /**
   * Actual ad markup. XHTML if a response to a banner object, or VAST XML if a response to a video object.
   */
  public String adm; // optional
  /**
   * Advertiser’s primary or top-level domain for advertiser checking. This can be a list of domains if there is a rotating creative. However, exchanges may mandate that only one landing domain is allowed.
   */
  public List adomain; // optional
  /**
   * Sample image URL (without cache busting) for content checking.
   */
  public String lurl; // optional
  /**
   * Campaign ID or similar that appears within the ad markup.
   */
  public String cid; // optional
  /**
   * Creative ID for reporting content issues or defects. This could also be used as a reference to a creative ID that is posted with an exchange.
   */
  public String crid; // optional
  /**
   * Array of creative attributes. See Table 6.3 Creative Attributes.
   */
  public List attr; // optional
  /**
   * A unique identifier for the direct deal associated with the bid. If the bid is associated and in response to a dealid in the request object it is _required_ in the response object.
   */
  public String dealid; // optional
  /**
   * Width of the ad in pixels. If the bid request contained the wmax/hmax and wmin/hmin optional fields it is recommended that the response bid contains this field to signal the size of ad chosen.
   */
  public int w; // optional
  /**
   * Height of the ad in pixels. If the bid request contained the wmax/hmax and wmin/hmin optional fields it is recommended that the response bid contains this field to signal the size of ad chosen.
   */
  public int h; // 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 for the bid object chosen by the bidder for tracking and debugging purposes. Useful when multiple bids are submitted for a single impression for a given seat.
     */
    ID((short)1, "id"),
    /**
     * ID of the impression object to which this bid applies.
     */
    IMPID((short)2, "impid"),
    /**
     * Bid price in CPM. WARNING/Best Practice Note: Although this value is a float, OpenRTB strongly suggests using integer math for accounting to avoid rounding errors.
     */
    PRICE((short)3, "price"),
    /**
     * ID that references the ad to be served if the bid wins.
     */
    ADID((short)4, "adid"),
    /**
     * Win notice URL. Note that ad markup is also typically, but not necessarily, returned via this URL.
     */
    NURL((short)5, "nurl"),
    /**
     * Actual ad markup. XHTML if a response to a banner object, or VAST XML if a response to a video object.
     */
    ADM((short)6, "adm"),
    /**
     * Advertiser’s primary or top-level domain for advertiser checking. This can be a list of domains if there is a rotating creative. However, exchanges may mandate that only one landing domain is allowed.
     */
    ADOMAIN((short)7, "adomain"),
    /**
     * Sample image URL (without cache busting) for content checking.
     */
    LURL((short)8, "lurl"),
    /**
     * Campaign ID or similar that appears within the ad markup.
     */
    CID((short)9, "cid"),
    /**
     * Creative ID for reporting content issues or defects. This could also be used as a reference to a creative ID that is posted with an exchange.
     */
    CRID((short)10, "crid"),
    /**
     * Array of creative attributes. See Table 6.3 Creative Attributes.
     */
    ATTR((short)11, "attr"),
    /**
     * A unique identifier for the direct deal associated with the bid. If the bid is associated and in response to a dealid in the request object it is _required_ in the response object.
     */
    DEALID((short)12, "dealid"),
    /**
     * Width of the ad in pixels. If the bid request contained the wmax/hmax and wmin/hmin optional fields it is recommended that the response bid contains this field to signal the size of ad chosen.
     */
    W((short)13, "w"),
    /**
     * Height of the ad in pixels. If the bid request contained the wmax/hmax and wmin/hmin optional fields it is recommended that the response bid contains this field to signal the size of ad chosen.
     */
    H((short)14, "h");

    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: // IMPID
          return IMPID;
        case 3: // PRICE
          return PRICE;
        case 4: // ADID
          return ADID;
        case 5: // NURL
          return NURL;
        case 6: // ADM
          return ADM;
        case 7: // ADOMAIN
          return ADOMAIN;
        case 8: // LURL
          return LURL;
        case 9: // CID
          return CID;
        case 10: // CRID
          return CRID;
        case 11: // ATTR
          return ATTR;
        case 12: // DEALID
          return DEALID;
        case 13: // W
          return W;
        case 14: // H
          return H;
        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 __PRICE_ISSET_ID = 0;
  private static final int __W_ISSET_ID = 1;
  private static final int __H_ISSET_ID = 2;
  private byte __isset_bitfield = 0;
  private static final _Fields optionals[] = {_Fields.ID,_Fields.IMPID,_Fields.PRICE,_Fields.ADID,_Fields.NURL,_Fields.ADM,_Fields.ADOMAIN,_Fields.LURL,_Fields.CID,_Fields.CRID,_Fields.ATTR,_Fields.DEALID,_Fields.W,_Fields.H};
  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.IMPID, new org.apache.thrift.meta_data.FieldMetaData("impid", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.PRICE, new org.apache.thrift.meta_data.FieldMetaData("price", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
    tmpMap.put(_Fields.ADID, new org.apache.thrift.meta_data.FieldMetaData("adid", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.NURL, new org.apache.thrift.meta_data.FieldMetaData("nurl", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.ADM, new org.apache.thrift.meta_data.FieldMetaData("adm", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.ADOMAIN, new org.apache.thrift.meta_data.FieldMetaData("adomain", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
            new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
    tmpMap.put(_Fields.LURL, new org.apache.thrift.meta_data.FieldMetaData("lurl", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.CID, new org.apache.thrift.meta_data.FieldMetaData("cid", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.CRID, new org.apache.thrift.meta_data.FieldMetaData("crid", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.ATTR, new org.apache.thrift.meta_data.FieldMetaData("attr", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
            new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I16))));
    tmpMap.put(_Fields.DEALID, new org.apache.thrift.meta_data.FieldMetaData("dealid", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.W, new org.apache.thrift.meta_data.FieldMetaData("w", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
    tmpMap.put(_Fields.H, new org.apache.thrift.meta_data.FieldMetaData("h", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
    metaDataMap = Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(BidThrift.class, metaDataMap);
  }

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

    this.impid = "";

    this.price = 0;

    this.adid = "";

    this.nurl = "";

    this.adm = "";

    this.lurl = "";

    this.cid = "";

    this.crid = "";

    this.dealid = "";

    this.w = 0;

    this.h = 0;

  }

  /**
   * Performs a deep copy on other.
   */
  public BidThrift(BidThrift other) {
    __isset_bitfield = other.__isset_bitfield;
    if (other.isSetId()) {
      this.id = other.id;
    }
    if (other.isSetImpid()) {
      this.impid = other.impid;
    }
    this.price = other.price;
    if (other.isSetAdid()) {
      this.adid = other.adid;
    }
    if (other.isSetNurl()) {
      this.nurl = other.nurl;
    }
    if (other.isSetAdm()) {
      this.adm = other.adm;
    }
    if (other.isSetAdomain()) {
      List __this__adomain = new ArrayList(other.adomain);
      this.adomain = __this__adomain;
    }
    if (other.isSetLurl()) {
      this.lurl = other.lurl;
    }
    if (other.isSetCid()) {
      this.cid = other.cid;
    }
    if (other.isSetCrid()) {
      this.crid = other.crid;
    }
    if (other.isSetAttr()) {
      List __this__attr = new ArrayList(other.attr);
      this.attr = __this__attr;
    }
    if (other.isSetDealid()) {
      this.dealid = other.dealid;
    }
    this.w = other.w;
    this.h = other.h;
  }

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

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

    this.impid = "";

    this.price = 0;

    this.adid = "";

    this.nurl = "";

    this.adm = "";

    this.adomain = null;
    this.lurl = "";

    this.cid = "";

    this.crid = "";

    this.attr = null;
    this.dealid = "";

    this.w = 0;

    this.h = 0;

  }

  /**
   * ID for the bid object chosen by the bidder for tracking and debugging purposes. Useful when multiple bids are submitted for a single impression for a given seat.
   */
  public String getId() {
    return this.id;
  }

  /**
   * ID for the bid object chosen by the bidder for tracking and debugging purposes. Useful when multiple bids are submitted for a single impression for a given seat.
   */
  public BidThrift 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;
    }
  }

  /**
   * ID of the impression object to which this bid applies.
   */
  public String getImpid() {
    return this.impid;
  }

  /**
   * ID of the impression object to which this bid applies.
   */
  public BidThrift setImpid(String impid) {
    this.impid = impid;
    return this;
  }

  public void unsetImpid() {
    this.impid = null;
  }

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

  public void setImpidIsSet(boolean value) {
    if (!value) {
      this.impid = null;
    }
  }

  /**
   * Bid price in CPM. WARNING/Best Practice Note: Although this value is a float, OpenRTB strongly suggests using integer math for accounting to avoid rounding errors.
   */
  public double getPrice() {
    return this.price;
  }

  /**
   * Bid price in CPM. WARNING/Best Practice Note: Although this value is a float, OpenRTB strongly suggests using integer math for accounting to avoid rounding errors.
   */
  public BidThrift setPrice(double price) {
    this.price = price;
    setPriceIsSet(true);
    return this;
  }

  public void unsetPrice() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __PRICE_ISSET_ID);
  }

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

  public void setPriceIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __PRICE_ISSET_ID, value);
  }

  /**
   * ID that references the ad to be served if the bid wins.
   */
  public String getAdid() {
    return this.adid;
  }

  /**
   * ID that references the ad to be served if the bid wins.
   */
  public BidThrift setAdid(String adid) {
    this.adid = adid;
    return this;
  }

  public void unsetAdid() {
    this.adid = null;
  }

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

  public void setAdidIsSet(boolean value) {
    if (!value) {
      this.adid = null;
    }
  }

  /**
   * Win notice URL. Note that ad markup is also typically, but not necessarily, returned via this URL.
   */
  public String getNurl() {
    return this.nurl;
  }

  /**
   * Win notice URL. Note that ad markup is also typically, but not necessarily, returned via this URL.
   */
  public BidThrift setNurl(String nurl) {
    this.nurl = nurl;
    return this;
  }

  public void unsetNurl() {
    this.nurl = null;
  }

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

  public void setNurlIsSet(boolean value) {
    if (!value) {
      this.nurl = null;
    }
  }

  /**
   * Actual ad markup. XHTML if a response to a banner object, or VAST XML if a response to a video object.
   */
  public String getAdm() {
    return this.adm;
  }

  /**
   * Actual ad markup. XHTML if a response to a banner object, or VAST XML if a response to a video object.
   */
  public BidThrift setAdm(String adm) {
    this.adm = adm;
    return this;
  }

  public void unsetAdm() {
    this.adm = null;
  }

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

  public void setAdmIsSet(boolean value) {
    if (!value) {
      this.adm = null;
    }
  }

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

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

  public void addToAdomain(String elem) {
    if (this.adomain == null) {
      this.adomain = new ArrayList();
    }
    this.adomain.add(elem);
  }

  /**
   * Advertiser’s primary or top-level domain for advertiser checking. This can be a list of domains if there is a rotating creative. However, exchanges may mandate that only one landing domain is allowed.
   */
  public List getAdomain() {
    return this.adomain;
  }

  /**
   * Advertiser’s primary or top-level domain for advertiser checking. This can be a list of domains if there is a rotating creative. However, exchanges may mandate that only one landing domain is allowed.
   */
  public BidThrift setAdomain(List adomain) {
    this.adomain = adomain;
    return this;
  }

  public void unsetAdomain() {
    this.adomain = null;
  }

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

  public void setAdomainIsSet(boolean value) {
    if (!value) {
      this.adomain = null;
    }
  }

  /**
   * Sample image URL (without cache busting) for content checking.
   */
  public String getLurl() {
    return this.lurl;
  }

  /**
   * Sample image URL (without cache busting) for content checking.
   */
  public BidThrift setLurl(String lurl) {
    this.lurl = lurl;
    return this;
  }

  public void unsetLurl() {
    this.lurl = null;
  }

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

  public void setLurlIsSet(boolean value) {
    if (!value) {
      this.lurl = null;
    }
  }

  /**
   * Campaign ID or similar that appears within the ad markup.
   */
  public String getCid() {
    return this.cid;
  }

  /**
   * Campaign ID or similar that appears within the ad markup.
   */
  public BidThrift setCid(String cid) {
    this.cid = cid;
    return this;
  }

  public void unsetCid() {
    this.cid = null;
  }

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

  public void setCidIsSet(boolean value) {
    if (!value) {
      this.cid = null;
    }
  }

  /**
   * Creative ID for reporting content issues or defects. This could also be used as a reference to a creative ID that is posted with an exchange.
   */
  public String getCrid() {
    return this.crid;
  }

  /**
   * Creative ID for reporting content issues or defects. This could also be used as a reference to a creative ID that is posted with an exchange.
   */
  public BidThrift setCrid(String crid) {
    this.crid = crid;
    return this;
  }

  public void unsetCrid() {
    this.crid = null;
  }

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

  public void setCridIsSet(boolean value) {
    if (!value) {
      this.crid = null;
    }
  }

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

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

  public void addToAttr(short elem) {
    if (this.attr == null) {
      this.attr = new ArrayList();
    }
    this.attr.add(elem);
  }

  /**
   * Array of creative attributes. See Table 6.3 Creative Attributes.
   */
  public List getAttr() {
    return this.attr;
  }

  /**
   * Array of creative attributes. See Table 6.3 Creative Attributes.
   */
  public BidThrift setAttr(List attr) {
    this.attr = attr;
    return this;
  }

  public void unsetAttr() {
    this.attr = null;
  }

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

  public void setAttrIsSet(boolean value) {
    if (!value) {
      this.attr = null;
    }
  }

  /**
   * A unique identifier for the direct deal associated with the bid. If the bid is associated and in response to a dealid in the request object it is _required_ in the response object.
   */
  public String getDealid() {
    return this.dealid;
  }

  /**
   * A unique identifier for the direct deal associated with the bid. If the bid is associated and in response to a dealid in the request object it is _required_ in the response object.
   */
  public BidThrift setDealid(String dealid) {
    this.dealid = dealid;
    return this;
  }

  public void unsetDealid() {
    this.dealid = null;
  }

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

  public void setDealidIsSet(boolean value) {
    if (!value) {
      this.dealid = null;
    }
  }

  /**
   * Width of the ad in pixels. If the bid request contained the wmax/hmax and wmin/hmin optional fields it is recommended that the response bid contains this field to signal the size of ad chosen.
   */
  public int getW() {
    return this.w;
  }

  /**
   * Width of the ad in pixels. If the bid request contained the wmax/hmax and wmin/hmin optional fields it is recommended that the response bid contains this field to signal the size of ad chosen.
   */
  public BidThrift setW(int w) {
    this.w = w;
    setWIsSet(true);
    return this;
  }

  public void unsetW() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __W_ISSET_ID);
  }

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

  public void setWIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __W_ISSET_ID, value);
  }

  /**
   * Height of the ad in pixels. If the bid request contained the wmax/hmax and wmin/hmin optional fields it is recommended that the response bid contains this field to signal the size of ad chosen.
   */
  public int getH() {
    return this.h;
  }

  /**
   * Height of the ad in pixels. If the bid request contained the wmax/hmax and wmin/hmin optional fields it is recommended that the response bid contains this field to signal the size of ad chosen.
   */
  public BidThrift setH(int h) {
    this.h = h;
    setHIsSet(true);
    return this;
  }

  public void unsetH() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __H_ISSET_ID);
  }

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

  public void setHIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __H_ISSET_ID, value);
  }

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

    case IMPID:
      if (value == null) {
        unsetImpid();
      } else {
        setImpid((String)value);
      }
      break;

    case PRICE:
      if (value == null) {
        unsetPrice();
      } else {
        setPrice((Double)value);
      }
      break;

    case ADID:
      if (value == null) {
        unsetAdid();
      } else {
        setAdid((String)value);
      }
      break;

    case NURL:
      if (value == null) {
        unsetNurl();
      } else {
        setNurl((String)value);
      }
      break;

    case ADM:
      if (value == null) {
        unsetAdm();
      } else {
        setAdm((String)value);
      }
      break;

    case ADOMAIN:
      if (value == null) {
        unsetAdomain();
      } else {
        setAdomain((List)value);
      }
      break;

    case LURL:
      if (value == null) {
        unsetLurl();
      } else {
        setLurl((String)value);
      }
      break;

    case CID:
      if (value == null) {
        unsetCid();
      } else {
        setCid((String)value);
      }
      break;

    case CRID:
      if (value == null) {
        unsetCrid();
      } else {
        setCrid((String)value);
      }
      break;

    case ATTR:
      if (value == null) {
        unsetAttr();
      } else {
        setAttr((List)value);
      }
      break;

    case DEALID:
      if (value == null) {
        unsetDealid();
      } else {
        setDealid((String)value);
      }
      break;

    case W:
      if (value == null) {
        unsetW();
      } else {
        setW((Integer)value);
      }
      break;

    case H:
      if (value == null) {
        unsetH();
      } else {
        setH((Integer)value);
      }
      break;

    }
  }

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

    case IMPID:
      return getImpid();

    case PRICE:
      return Double.valueOf(getPrice());

    case ADID:
      return getAdid();

    case NURL:
      return getNurl();

    case ADM:
      return getAdm();

    case ADOMAIN:
      return getAdomain();

    case LURL:
      return getLurl();

    case CID:
      return getCid();

    case CRID:
      return getCrid();

    case ATTR:
      return getAttr();

    case DEALID:
      return getDealid();

    case W:
      return Integer.valueOf(getW());

    case H:
      return Integer.valueOf(getH());

    }
    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 IMPID:
      return isSetImpid();
    case PRICE:
      return isSetPrice();
    case ADID:
      return isSetAdid();
    case NURL:
      return isSetNurl();
    case ADM:
      return isSetAdm();
    case ADOMAIN:
      return isSetAdomain();
    case LURL:
      return isSetLurl();
    case CID:
      return isSetCid();
    case CRID:
      return isSetCrid();
    case ATTR:
      return isSetAttr();
    case DEALID:
      return isSetDealid();
    case W:
      return isSetW();
    case H:
      return isSetH();
    }
    throw new IllegalStateException();
  }

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

  public boolean equals(BidThrift 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_impid = true && this.isSetImpid();
    boolean that_present_impid = true && that.isSetImpid();
    if (this_present_impid || that_present_impid) {
      if (!(this_present_impid && that_present_impid))
        return false;
      if (!this.impid.equals(that.impid))
        return false;
    }

    boolean this_present_price = true && this.isSetPrice();
    boolean that_present_price = true && that.isSetPrice();
    if (this_present_price || that_present_price) {
      if (!(this_present_price && that_present_price))
        return false;
      if (this.price != that.price)
        return false;
    }

    boolean this_present_adid = true && this.isSetAdid();
    boolean that_present_adid = true && that.isSetAdid();
    if (this_present_adid || that_present_adid) {
      if (!(this_present_adid && that_present_adid))
        return false;
      if (!this.adid.equals(that.adid))
        return false;
    }

    boolean this_present_nurl = true && this.isSetNurl();
    boolean that_present_nurl = true && that.isSetNurl();
    if (this_present_nurl || that_present_nurl) {
      if (!(this_present_nurl && that_present_nurl))
        return false;
      if (!this.nurl.equals(that.nurl))
        return false;
    }

    boolean this_present_adm = true && this.isSetAdm();
    boolean that_present_adm = true && that.isSetAdm();
    if (this_present_adm || that_present_adm) {
      if (!(this_present_adm && that_present_adm))
        return false;
      if (!this.adm.equals(that.adm))
        return false;
    }

    boolean this_present_adomain = true && this.isSetAdomain();
    boolean that_present_adomain = true && that.isSetAdomain();
    if (this_present_adomain || that_present_adomain) {
      if (!(this_present_adomain && that_present_adomain))
        return false;
      if (!this.adomain.equals(that.adomain))
        return false;
    }

    boolean this_present_lurl = true && this.isSetLurl();
    boolean that_present_lurl = true && that.isSetLurl();
    if (this_present_lurl || that_present_lurl) {
      if (!(this_present_lurl && that_present_lurl))
        return false;
      if (!this.lurl.equals(that.lurl))
        return false;
    }

    boolean this_present_cid = true && this.isSetCid();
    boolean that_present_cid = true && that.isSetCid();
    if (this_present_cid || that_present_cid) {
      if (!(this_present_cid && that_present_cid))
        return false;
      if (!this.cid.equals(that.cid))
        return false;
    }

    boolean this_present_crid = true && this.isSetCrid();
    boolean that_present_crid = true && that.isSetCrid();
    if (this_present_crid || that_present_crid) {
      if (!(this_present_crid && that_present_crid))
        return false;
      if (!this.crid.equals(that.crid))
        return false;
    }

    boolean this_present_attr = true && this.isSetAttr();
    boolean that_present_attr = true && that.isSetAttr();
    if (this_present_attr || that_present_attr) {
      if (!(this_present_attr && that_present_attr))
        return false;
      if (!this.attr.equals(that.attr))
        return false;
    }

    boolean this_present_dealid = true && this.isSetDealid();
    boolean that_present_dealid = true && that.isSetDealid();
    if (this_present_dealid || that_present_dealid) {
      if (!(this_present_dealid && that_present_dealid))
        return false;
      if (!this.dealid.equals(that.dealid))
        return false;
    }

    boolean this_present_w = true && this.isSetW();
    boolean that_present_w = true && that.isSetW();
    if (this_present_w || that_present_w) {
      if (!(this_present_w && that_present_w))
        return false;
      if (this.w != that.w)
        return false;
    }

    boolean this_present_h = true && this.isSetH();
    boolean that_present_h = true && that.isSetH();
    if (this_present_h || that_present_h) {
      if (!(this_present_h && that_present_h))
        return false;
      if (this.h != that.h)
        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_impid = true && (isSetImpid());
    list.add(present_impid);
    if (present_impid)
      list.add(impid);

    boolean present_price = true && (isSetPrice());
    list.add(present_price);
    if (present_price)
      list.add(price);

    boolean present_adid = true && (isSetAdid());
    list.add(present_adid);
    if (present_adid)
      list.add(adid);

    boolean present_nurl = true && (isSetNurl());
    list.add(present_nurl);
    if (present_nurl)
      list.add(nurl);

    boolean present_adm = true && (isSetAdm());
    list.add(present_adm);
    if (present_adm)
      list.add(adm);

    boolean present_adomain = true && (isSetAdomain());
    list.add(present_adomain);
    if (present_adomain)
      list.add(adomain);

    boolean present_lurl = true && (isSetLurl());
    list.add(present_lurl);
    if (present_lurl)
      list.add(lurl);

    boolean present_cid = true && (isSetCid());
    list.add(present_cid);
    if (present_cid)
      list.add(cid);

    boolean present_crid = true && (isSetCrid());
    list.add(present_crid);
    if (present_crid)
      list.add(crid);

    boolean present_attr = true && (isSetAttr());
    list.add(present_attr);
    if (present_attr)
      list.add(attr);

    boolean present_dealid = true && (isSetDealid());
    list.add(present_dealid);
    if (present_dealid)
      list.add(dealid);

    boolean present_w = true && (isSetW());
    list.add(present_w);
    if (present_w)
      list.add(w);

    boolean present_h = true && (isSetH());
    list.add(present_h);
    if (present_h)
      list.add(h);

    return list.hashCode();
  }

  @Override
  public int compareTo(BidThrift 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(isSetImpid()).compareTo(other.isSetImpid());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetImpid()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.impid, other.impid);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetPrice()).compareTo(other.isSetPrice());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetPrice()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.price, other.price);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetAdid()).compareTo(other.isSetAdid());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetAdid()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.adid, other.adid);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetNurl()).compareTo(other.isSetNurl());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetNurl()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nurl, other.nurl);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetAdm()).compareTo(other.isSetAdm());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetAdm()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.adm, other.adm);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetAdomain()).compareTo(other.isSetAdomain());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetAdomain()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.adomain, other.adomain);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetLurl()).compareTo(other.isSetLurl());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetLurl()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.lurl, other.lurl);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetCid()).compareTo(other.isSetCid());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetCid()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cid, other.cid);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetCrid()).compareTo(other.isSetCrid());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetCrid()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.crid, other.crid);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetAttr()).compareTo(other.isSetAttr());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetAttr()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.attr, other.attr);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetDealid()).compareTo(other.isSetDealid());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetDealid()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.dealid, other.dealid);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetW()).compareTo(other.isSetW());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetW()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.w, other.w);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetH()).compareTo(other.isSetH());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetH()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.h, other.h);
      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("BidThrift(");
    boolean first = true;

    if (isSetId()) {
      sb.append("id:");
      if (this.id == null) {
        sb.append("null");
      } else {
        sb.append(this.id);
      }
      first = false;
    }
    if (isSetImpid()) {
      if (!first) sb.append(", ");
      sb.append("impid:");
      if (this.impid == null) {
        sb.append("null");
      } else {
        sb.append(this.impid);
      }
      first = false;
    }
    if (isSetPrice()) {
      if (!first) sb.append(", ");
      sb.append("price:");
      sb.append(this.price);
      first = false;
    }
    if (isSetAdid()) {
      if (!first) sb.append(", ");
      sb.append("adid:");
      if (this.adid == null) {
        sb.append("null");
      } else {
        sb.append(this.adid);
      }
      first = false;
    }
    if (isSetNurl()) {
      if (!first) sb.append(", ");
      sb.append("nurl:");
      if (this.nurl == null) {
        sb.append("null");
      } else {
        sb.append(this.nurl);
      }
      first = false;
    }
    if (isSetAdm()) {
      if (!first) sb.append(", ");
      sb.append("adm:");
      if (this.adm == null) {
        sb.append("null");
      } else {
        sb.append(this.adm);
      }
      first = false;
    }
    if (isSetAdomain()) {
      if (!first) sb.append(", ");
      sb.append("adomain:");
      if (this.adomain == null) {
        sb.append("null");
      } else {
        sb.append(this.adomain);
      }
      first = false;
    }
    if (isSetLurl()) {
      if (!first) sb.append(", ");
      sb.append("lurl:");
      if (this.lurl == null) {
        sb.append("null");
      } else {
        sb.append(this.lurl);
      }
      first = false;
    }
    if (isSetCid()) {
      if (!first) sb.append(", ");
      sb.append("cid:");
      if (this.cid == null) {
        sb.append("null");
      } else {
        sb.append(this.cid);
      }
      first = false;
    }
    if (isSetCrid()) {
      if (!first) sb.append(", ");
      sb.append("crid:");
      if (this.crid == null) {
        sb.append("null");
      } else {
        sb.append(this.crid);
      }
      first = false;
    }
    if (isSetAttr()) {
      if (!first) sb.append(", ");
      sb.append("attr:");
      if (this.attr == null) {
        sb.append("null");
      } else {
        sb.append(this.attr);
      }
      first = false;
    }
    if (isSetDealid()) {
      if (!first) sb.append(", ");
      sb.append("dealid:");
      if (this.dealid == null) {
        sb.append("null");
      } else {
        sb.append(this.dealid);
      }
      first = false;
    }
    if (isSetW()) {
      if (!first) sb.append(", ");
      sb.append("w:");
      sb.append(this.w);
      first = false;
    }
    if (isSetH()) {
      if (!first) sb.append(", ");
      sb.append("h:");
      sb.append(this.h);
      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 BidThriftStandardSchemeFactory implements SchemeFactory {
    public BidThriftStandardScheme getScheme() {
      return new BidThriftStandardScheme();
    }
  }

  private static class BidThriftStandardScheme extends StandardScheme {

    public void read(org.apache.thrift.protocol.TProtocol iprot, BidThrift 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: // IMPID
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.impid = iprot.readString();
              struct.setImpidIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // PRICE
            if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) {
              struct.price = iprot.readDouble();
              struct.setPriceIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // ADID
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.adid = iprot.readString();
              struct.setAdidIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 5: // NURL
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.nurl = iprot.readString();
              struct.setNurlIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 6: // ADM
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.adm = iprot.readString();
              struct.setAdmIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 7: // ADOMAIN
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list264 = iprot.readListBegin();
                struct.adomain = new ArrayList(_list264.size);
                String _elem265;
                for (int _i266 = 0; _i266 < _list264.size; ++_i266)
                {
                  _elem265 = iprot.readString();
                  struct.adomain.add(_elem265);
                }
                iprot.readListEnd();
              }
              struct.setAdomainIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 8: // LURL
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.lurl = iprot.readString();
              struct.setLurlIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 9: // CID
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.cid = iprot.readString();
              struct.setCidIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 10: // CRID
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.crid = iprot.readString();
              struct.setCridIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 11: // ATTR
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list267 = iprot.readListBegin();
                struct.attr = new ArrayList(_list267.size);
                short _elem268;
                for (int _i269 = 0; _i269 < _list267.size; ++_i269)
                {
                  _elem268 = iprot.readI16();
                  struct.attr.add(_elem268);
                }
                iprot.readListEnd();
              }
              struct.setAttrIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 12: // DEALID
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.dealid = iprot.readString();
              struct.setDealidIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 13: // W
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.w = iprot.readI32();
              struct.setWIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 14: // H
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.h = iprot.readI32();
              struct.setHIsSet(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, BidThrift 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.impid != null) {
        if (struct.isSetImpid()) {
          oprot.writeFieldBegin(IMPID_FIELD_DESC);
          oprot.writeString(struct.impid);
          oprot.writeFieldEnd();
        }
      }
      if (struct.isSetPrice()) {
        oprot.writeFieldBegin(PRICE_FIELD_DESC);
        oprot.writeDouble(struct.price);
        oprot.writeFieldEnd();
      }
      if (struct.adid != null) {
        if (struct.isSetAdid()) {
          oprot.writeFieldBegin(ADID_FIELD_DESC);
          oprot.writeString(struct.adid);
          oprot.writeFieldEnd();
        }
      }
      if (struct.nurl != null) {
        if (struct.isSetNurl()) {
          oprot.writeFieldBegin(NURL_FIELD_DESC);
          oprot.writeString(struct.nurl);
          oprot.writeFieldEnd();
        }
      }
      if (struct.adm != null) {
        if (struct.isSetAdm()) {
          oprot.writeFieldBegin(ADM_FIELD_DESC);
          oprot.writeString(struct.adm);
          oprot.writeFieldEnd();
        }
      }
      if (struct.adomain != null) {
        if (struct.isSetAdomain()) {
          oprot.writeFieldBegin(ADOMAIN_FIELD_DESC);
          {
            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.adomain.size()));
            for (String _iter270 : struct.adomain)
            {
              oprot.writeString(_iter270);
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      if (struct.lurl != null) {
        if (struct.isSetLurl()) {
          oprot.writeFieldBegin(LURL_FIELD_DESC);
          oprot.writeString(struct.lurl);
          oprot.writeFieldEnd();
        }
      }
      if (struct.cid != null) {
        if (struct.isSetCid()) {
          oprot.writeFieldBegin(CID_FIELD_DESC);
          oprot.writeString(struct.cid);
          oprot.writeFieldEnd();
        }
      }
      if (struct.crid != null) {
        if (struct.isSetCrid()) {
          oprot.writeFieldBegin(CRID_FIELD_DESC);
          oprot.writeString(struct.crid);
          oprot.writeFieldEnd();
        }
      }
      if (struct.attr != null) {
        if (struct.isSetAttr()) {
          oprot.writeFieldBegin(ATTR_FIELD_DESC);
          {
            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I16, struct.attr.size()));
            for (short _iter271 : struct.attr)
            {
              oprot.writeI16(_iter271);
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      if (struct.dealid != null) {
        if (struct.isSetDealid()) {
          oprot.writeFieldBegin(DEALID_FIELD_DESC);
          oprot.writeString(struct.dealid);
          oprot.writeFieldEnd();
        }
      }
      if (struct.isSetW()) {
        oprot.writeFieldBegin(W_FIELD_DESC);
        oprot.writeI32(struct.w);
        oprot.writeFieldEnd();
      }
      if (struct.isSetH()) {
        oprot.writeFieldBegin(H_FIELD_DESC);
        oprot.writeI32(struct.h);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

  private static class BidThriftTupleSchemeFactory implements SchemeFactory {
    public BidThriftTupleScheme getScheme() {
      return new BidThriftTupleScheme();
    }
  }

  private static class BidThriftTupleScheme extends TupleScheme {

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, BidThrift struct) throws org.apache.thrift.TException {
      TTupleProtocol oprot = (TTupleProtocol) prot;
      BitSet optionals = new BitSet();
      if (struct.isSetId()) {
        optionals.set(0);
      }
      if (struct.isSetImpid()) {
        optionals.set(1);
      }
      if (struct.isSetPrice()) {
        optionals.set(2);
      }
      if (struct.isSetAdid()) {
        optionals.set(3);
      }
      if (struct.isSetNurl()) {
        optionals.set(4);
      }
      if (struct.isSetAdm()) {
        optionals.set(5);
      }
      if (struct.isSetAdomain()) {
        optionals.set(6);
      }
      if (struct.isSetLurl()) {
        optionals.set(7);
      }
      if (struct.isSetCid()) {
        optionals.set(8);
      }
      if (struct.isSetCrid()) {
        optionals.set(9);
      }
      if (struct.isSetAttr()) {
        optionals.set(10);
      }
      if (struct.isSetDealid()) {
        optionals.set(11);
      }
      if (struct.isSetW()) {
        optionals.set(12);
      }
      if (struct.isSetH()) {
        optionals.set(13);
      }
      oprot.writeBitSet(optionals, 14);
      if (struct.isSetId()) {
        oprot.writeString(struct.id);
      }
      if (struct.isSetImpid()) {
        oprot.writeString(struct.impid);
      }
      if (struct.isSetPrice()) {
        oprot.writeDouble(struct.price);
      }
      if (struct.isSetAdid()) {
        oprot.writeString(struct.adid);
      }
      if (struct.isSetNurl()) {
        oprot.writeString(struct.nurl);
      }
      if (struct.isSetAdm()) {
        oprot.writeString(struct.adm);
      }
      if (struct.isSetAdomain()) {
        {
          oprot.writeI32(struct.adomain.size());
          for (String _iter272 : struct.adomain)
          {
            oprot.writeString(_iter272);
          }
        }
      }
      if (struct.isSetLurl()) {
        oprot.writeString(struct.lurl);
      }
      if (struct.isSetCid()) {
        oprot.writeString(struct.cid);
      }
      if (struct.isSetCrid()) {
        oprot.writeString(struct.crid);
      }
      if (struct.isSetAttr()) {
        {
          oprot.writeI32(struct.attr.size());
          for (short _iter273 : struct.attr)
          {
            oprot.writeI16(_iter273);
          }
        }
      }
      if (struct.isSetDealid()) {
        oprot.writeString(struct.dealid);
      }
      if (struct.isSetW()) {
        oprot.writeI32(struct.w);
      }
      if (struct.isSetH()) {
        oprot.writeI32(struct.h);
      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, BidThrift struct) throws org.apache.thrift.TException {
      TTupleProtocol iprot = (TTupleProtocol) prot;
      BitSet incoming = iprot.readBitSet(14);
      if (incoming.get(0)) {
        struct.id = iprot.readString();
        struct.setIdIsSet(true);
      }
      if (incoming.get(1)) {
        struct.impid = iprot.readString();
        struct.setImpidIsSet(true);
      }
      if (incoming.get(2)) {
        struct.price = iprot.readDouble();
        struct.setPriceIsSet(true);
      }
      if (incoming.get(3)) {
        struct.adid = iprot.readString();
        struct.setAdidIsSet(true);
      }
      if (incoming.get(4)) {
        struct.nurl = iprot.readString();
        struct.setNurlIsSet(true);
      }
      if (incoming.get(5)) {
        struct.adm = iprot.readString();
        struct.setAdmIsSet(true);
      }
      if (incoming.get(6)) {
        {
          org.apache.thrift.protocol.TList _list274 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
          struct.adomain = new ArrayList(_list274.size);
          String _elem275;
          for (int _i276 = 0; _i276 < _list274.size; ++_i276)
          {
            _elem275 = iprot.readString();
            struct.adomain.add(_elem275);
          }
        }
        struct.setAdomainIsSet(true);
      }
      if (incoming.get(7)) {
        struct.lurl = iprot.readString();
        struct.setLurlIsSet(true);
      }
      if (incoming.get(8)) {
        struct.cid = iprot.readString();
        struct.setCidIsSet(true);
      }
      if (incoming.get(9)) {
        struct.crid = iprot.readString();
        struct.setCridIsSet(true);
      }
      if (incoming.get(10)) {
        {
          org.apache.thrift.protocol.TList _list277 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I16, iprot.readI32());
          struct.attr = new ArrayList(_list277.size);
          short _elem278;
          for (int _i279 = 0; _i279 < _list277.size; ++_i279)
          {
            _elem278 = iprot.readI16();
            struct.attr.add(_elem278);
          }
        }
        struct.setAttrIsSet(true);
      }
      if (incoming.get(11)) {
        struct.dealid = iprot.readString();
        struct.setDealidIsSet(true);
      }
      if (incoming.get(12)) {
        struct.w = iprot.readI32();
        struct.setWIsSet(true);
      }
      if (incoming.get(13)) {
        struct.h = iprot.readI32();
        struct.setHIsSet(true);
      }
    }
  }

}