
open_rtb.DataThrift 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.13 Data Object
* The data and segment objects together allow data about the user to be passed to bidders in the bid request. This data may be from multiple sources (e.g., the exchange itself, third party providers) as specified by the data object ID field. A bid request can mix data objects from multiple providers.
* The data object itself and all of its parameters are optional, so default values are not provided. If an optional parameter is not specified, it should be considered unknown.
*/
@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2016-6-3")
public class DataThrift 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("DataThrift");
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 NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)2);
private static final org.apache.thrift.protocol.TField SEGMENT_FIELD_DESC = new org.apache.thrift.protocol.TField("segment", org.apache.thrift.protocol.TType.LIST, (short)3);
private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new DataThriftStandardSchemeFactory());
schemes.put(TupleScheme.class, new DataThriftTupleSchemeFactory());
}
/**
* Exchange specific ID for the data provider.
*/
public String id; // optional
/**
* Data provider name.
*/
public String name; // optional
/**
* Array of segment objects.
*/
public List segment; // 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 {
/**
* Exchange specific ID for the data provider.
*/
ID((short)1, "id"),
/**
* Data provider name.
*/
NAME((short)2, "name"),
/**
* Array of segment objects.
*/
SEGMENT((short)3, "segment");
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: // NAME
return NAME;
case 3: // SEGMENT
return SEGMENT;
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 _Fields optionals[] = {_Fields.ID,_Fields.NAME,_Fields.SEGMENT};
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.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.SEGMENT, new org.apache.thrift.meta_data.FieldMetaData("segment", 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, SegmentThrift.class))));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(DataThrift.class, metaDataMap);
}
public DataThrift() {
this.id = "";
this.name = "";
}
/**
* Performs a deep copy on other.
*/
public DataThrift(DataThrift other) {
if (other.isSetId()) {
this.id = other.id;
}
if (other.isSetName()) {
this.name = other.name;
}
if (other.isSetSegment()) {
List __this__segment = new ArrayList(other.segment.size());
for (SegmentThrift other_element : other.segment) {
__this__segment.add(new SegmentThrift(other_element));
}
this.segment = __this__segment;
}
}
public DataThrift deepCopy() {
return new DataThrift(this);
}
@Override
public void clear() {
this.id = "";
this.name = "";
this.segment = null;
}
/**
* Exchange specific ID for the data provider.
*/
public String getId() {
return this.id;
}
/**
* Exchange specific ID for the data provider.
*/
public DataThrift 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;
}
}
/**
* Data provider name.
*/
public String getName() {
return this.name;
}
/**
* Data provider name.
*/
public DataThrift setName(String name) {
this.name = name;
return this;
}
public void unsetName() {
this.name = null;
}
/** Returns true if field name is set (has been assigned a value) and false otherwise */
public boolean isSetName() {
return this.name != null;
}
public void setNameIsSet(boolean value) {
if (!value) {
this.name = null;
}
}
public int getSegmentSize() {
return (this.segment == null) ? 0 : this.segment.size();
}
public java.util.Iterator getSegmentIterator() {
return (this.segment == null) ? null : this.segment.iterator();
}
public void addToSegment(SegmentThrift elem) {
if (this.segment == null) {
this.segment = new ArrayList();
}
this.segment.add(elem);
}
/**
* Array of segment objects.
*/
public List getSegment() {
return this.segment;
}
/**
* Array of segment objects.
*/
public DataThrift setSegment(List segment) {
this.segment = segment;
return this;
}
public void unsetSegment() {
this.segment = null;
}
/** Returns true if field segment is set (has been assigned a value) and false otherwise */
public boolean isSetSegment() {
return this.segment != null;
}
public void setSegmentIsSet(boolean value) {
if (!value) {
this.segment = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case ID:
if (value == null) {
unsetId();
} else {
setId((String)value);
}
break;
case NAME:
if (value == null) {
unsetName();
} else {
setName((String)value);
}
break;
case SEGMENT:
if (value == null) {
unsetSegment();
} else {
setSegment((List)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case ID:
return getId();
case NAME:
return getName();
case SEGMENT:
return getSegment();
}
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 NAME:
return isSetName();
case SEGMENT:
return isSetSegment();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof DataThrift)
return this.equals((DataThrift)that);
return false;
}
public boolean equals(DataThrift 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_name = true && this.isSetName();
boolean that_present_name = true && that.isSetName();
if (this_present_name || that_present_name) {
if (!(this_present_name && that_present_name))
return false;
if (!this.name.equals(that.name))
return false;
}
boolean this_present_segment = true && this.isSetSegment();
boolean that_present_segment = true && that.isSetSegment();
if (this_present_segment || that_present_segment) {
if (!(this_present_segment && that_present_segment))
return false;
if (!this.segment.equals(that.segment))
return false;
}
return true;
}
@Override
public int hashCode() {
List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy