
open_rtb.PmpThrift 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"})
/**
* 3.3.16 PMP Object
* The “pmp” object contains a parent object for usage within the context of private marketplaces and the use of the RTB protocol to execute Direct Deals.
*/
@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2016-6-3")
public class PmpThrift 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("PmpThrift");
private static final org.apache.thrift.protocol.TField PRIVATE_AUCTION_FIELD_DESC = new org.apache.thrift.protocol.TField("private_auction", org.apache.thrift.protocol.TType.BYTE, (short)1);
private static final org.apache.thrift.protocol.TField DEALS_FIELD_DESC = new org.apache.thrift.protocol.TField("deals", org.apache.thrift.protocol.TType.LIST, (short)2);
private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new PmpThriftStandardSchemeFactory());
schemes.put(TupleScheme.class, new PmpThriftTupleSchemeFactory());
}
/**
* An integer flag indicating that this impression is a private auction eligible only to seats named in the Direct Deals object. (e.g., 1 = bids for this impression are restricted to the deals specified and the terms thereof; 0 = all bids are accepted)
*/
public byte private_auction; // optional
/**
* A collection of “deal” objects encapsulating a list of direct deals eligible for this impression.
*/
public List deals; // 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 {
/**
* An integer flag indicating that this impression is a private auction eligible only to seats named in the Direct Deals object. (e.g., 1 = bids for this impression are restricted to the deals specified and the terms thereof; 0 = all bids are accepted)
*/
PRIVATE_AUCTION((short)1, "private_auction"),
/**
* A collection of “deal” objects encapsulating a list of direct deals eligible for this impression.
*/
DEALS((short)2, "deals");
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: // PRIVATE_AUCTION
return PRIVATE_AUCTION;
case 2: // DEALS
return DEALS;
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 __PRIVATE_AUCTION_ISSET_ID = 0;
private byte __isset_bitfield = 0;
private static final _Fields optionals[] = {_Fields.PRIVATE_AUCTION,_Fields.DEALS};
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.PRIVATE_AUCTION, new org.apache.thrift.meta_data.FieldMetaData("private_auction", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BYTE)));
tmpMap.put(_Fields.DEALS, new org.apache.thrift.meta_data.FieldMetaData("deals", 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, DealThrift.class))));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(PmpThrift.class, metaDataMap);
}
public PmpThrift() {
this.private_auction = (byte)0;
}
/**
* Performs a deep copy on other.
*/
public PmpThrift(PmpThrift other) {
__isset_bitfield = other.__isset_bitfield;
this.private_auction = other.private_auction;
if (other.isSetDeals()) {
List __this__deals = new ArrayList(other.deals.size());
for (DealThrift other_element : other.deals) {
__this__deals.add(new DealThrift(other_element));
}
this.deals = __this__deals;
}
}
public PmpThrift deepCopy() {
return new PmpThrift(this);
}
@Override
public void clear() {
this.private_auction = (byte)0;
this.deals = null;
}
/**
* An integer flag indicating that this impression is a private auction eligible only to seats named in the Direct Deals object. (e.g., 1 = bids for this impression are restricted to the deals specified and the terms thereof; 0 = all bids are accepted)
*/
public byte getPrivate_auction() {
return this.private_auction;
}
/**
* An integer flag indicating that this impression is a private auction eligible only to seats named in the Direct Deals object. (e.g., 1 = bids for this impression are restricted to the deals specified and the terms thereof; 0 = all bids are accepted)
*/
public PmpThrift setPrivate_auction(byte private_auction) {
this.private_auction = private_auction;
setPrivate_auctionIsSet(true);
return this;
}
public void unsetPrivate_auction() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __PRIVATE_AUCTION_ISSET_ID);
}
/** Returns true if field private_auction is set (has been assigned a value) and false otherwise */
public boolean isSetPrivate_auction() {
return EncodingUtils.testBit(__isset_bitfield, __PRIVATE_AUCTION_ISSET_ID);
}
public void setPrivate_auctionIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __PRIVATE_AUCTION_ISSET_ID, value);
}
public int getDealsSize() {
return (this.deals == null) ? 0 : this.deals.size();
}
public java.util.Iterator getDealsIterator() {
return (this.deals == null) ? null : this.deals.iterator();
}
public void addToDeals(DealThrift elem) {
if (this.deals == null) {
this.deals = new ArrayList();
}
this.deals.add(elem);
}
/**
* A collection of “deal” objects encapsulating a list of direct deals eligible for this impression.
*/
public List getDeals() {
return this.deals;
}
/**
* A collection of “deal” objects encapsulating a list of direct deals eligible for this impression.
*/
public PmpThrift setDeals(List deals) {
this.deals = deals;
return this;
}
public void unsetDeals() {
this.deals = null;
}
/** Returns true if field deals is set (has been assigned a value) and false otherwise */
public boolean isSetDeals() {
return this.deals != null;
}
public void setDealsIsSet(boolean value) {
if (!value) {
this.deals = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case PRIVATE_AUCTION:
if (value == null) {
unsetPrivate_auction();
} else {
setPrivate_auction((Byte)value);
}
break;
case DEALS:
if (value == null) {
unsetDeals();
} else {
setDeals((List)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case PRIVATE_AUCTION:
return Byte.valueOf(getPrivate_auction());
case DEALS:
return getDeals();
}
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 PRIVATE_AUCTION:
return isSetPrivate_auction();
case DEALS:
return isSetDeals();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof PmpThrift)
return this.equals((PmpThrift)that);
return false;
}
public boolean equals(PmpThrift that) {
if (that == null)
return false;
boolean this_present_private_auction = true && this.isSetPrivate_auction();
boolean that_present_private_auction = true && that.isSetPrivate_auction();
if (this_present_private_auction || that_present_private_auction) {
if (!(this_present_private_auction && that_present_private_auction))
return false;
if (this.private_auction != that.private_auction)
return false;
}
boolean this_present_deals = true && this.isSetDeals();
boolean that_present_deals = true && that.isSetDeals();
if (this_present_deals || that_present_deals) {
if (!(this_present_deals && that_present_deals))
return false;
if (!this.deals.equals(that.deals))
return false;
}
return true;
}
@Override
public int hashCode() {
List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy