
open_rtb.BidResponseThrift Maven / Gradle / Ivy
/**
* 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
© 2015 - 2025 Weber Informatics LLC | Privacy Policy