
com.adgear.anoa.test.ad_exchange.LogEventThrift 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 com.adgear.anoa.test.ad_exchange;
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"})
/**
* Log event for real-time bidding ad exchange client.
*/
@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2016-6-3")
public class LogEventThrift 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("LogEventThrift");
private static final org.apache.thrift.protocol.TField UUID_FIELD_DESC = new org.apache.thrift.protocol.TField("uuid", org.apache.thrift.protocol.TType.STRING, (short)1);
private static final org.apache.thrift.protocol.TField TIMESTAMP_FIELD_DESC = new org.apache.thrift.protocol.TField("timestamp", org.apache.thrift.protocol.TType.I64, (short)2);
private static final org.apache.thrift.protocol.TField TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("type", org.apache.thrift.protocol.TType.I32, (short)3);
private static final org.apache.thrift.protocol.TField REQUEST_FIELD_DESC = new org.apache.thrift.protocol.TField("request", org.apache.thrift.protocol.TType.STRUCT, (short)4);
private static final org.apache.thrift.protocol.TField RESPONSE_FIELD_DESC = new org.apache.thrift.protocol.TField("response", org.apache.thrift.protocol.TType.STRUCT, (short)5);
private static final org.apache.thrift.protocol.TField PROPERTIES_FIELD_DESC = new org.apache.thrift.protocol.TField("properties", org.apache.thrift.protocol.TType.MAP, (short)6);
private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new LogEventThriftStandardSchemeFactory());
schemes.put(TupleScheme.class, new LogEventThriftTupleSchemeFactory());
}
/**
* Log event unique identifier.
*/
public ByteBuffer uuid; // optional
/**
* Log event timestamp, in milliseconds from epoch.
*/
public long timestamp; // optional
/**
* Log event type.
*
* @see LogEventTypeThrift
*/
public LogEventTypeThrift type; // optional
public open_rtb.BidRequestThrift request; // optional
/**
* Bid response submitted to the real-time bidding ad exchange.
*/
public open_rtb.BidResponseThrift response; // optional
/**
* Log event custom properties.
*/
public Map properties; // 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 {
/**
* Log event unique identifier.
*/
UUID((short)1, "uuid"),
/**
* Log event timestamp, in milliseconds from epoch.
*/
TIMESTAMP((short)2, "timestamp"),
/**
* Log event type.
*
* @see LogEventTypeThrift
*/
TYPE((short)3, "type"),
REQUEST((short)4, "request"),
/**
* Bid response submitted to the real-time bidding ad exchange.
*/
RESPONSE((short)5, "response"),
/**
* Log event custom properties.
*/
PROPERTIES((short)6, "properties");
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: // UUID
return UUID;
case 2: // TIMESTAMP
return TIMESTAMP;
case 3: // TYPE
return TYPE;
case 4: // REQUEST
return REQUEST;
case 5: // RESPONSE
return RESPONSE;
case 6: // PROPERTIES
return PROPERTIES;
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 __TIMESTAMP_ISSET_ID = 0;
private byte __isset_bitfield = 0;
private static final _Fields optionals[] = {_Fields.UUID,_Fields.TIMESTAMP,_Fields.TYPE,_Fields.REQUEST,_Fields.RESPONSE,_Fields.PROPERTIES};
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.UUID, new org.apache.thrift.meta_data.FieldMetaData("uuid", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true)));
tmpMap.put(_Fields.TIMESTAMP, new org.apache.thrift.meta_data.FieldMetaData("timestamp", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
tmpMap.put(_Fields.TYPE, new org.apache.thrift.meta_data.FieldMetaData("type", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, LogEventTypeThrift.class)));
tmpMap.put(_Fields.REQUEST, new org.apache.thrift.meta_data.FieldMetaData("request", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, open_rtb.BidRequestThrift.class)));
tmpMap.put(_Fields.RESPONSE, new org.apache.thrift.meta_data.FieldMetaData("response", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, open_rtb.BidResponseThrift.class)));
tmpMap.put(_Fields.PROPERTIES, new org.apache.thrift.meta_data.FieldMetaData("properties", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING),
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(LogEventThrift.class, metaDataMap);
}
public LogEventThrift() {
this.uuid = java.nio.ByteBuffer.wrap("\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0".getBytes());
this.timestamp = 0L;
this.type = com.adgear.anoa.test.ad_exchange.LogEventTypeThrift.UNKNOWN_LOG_EVENT_TYPE;
}
/**
* Performs a deep copy on other.
*/
public LogEventThrift(LogEventThrift other) {
__isset_bitfield = other.__isset_bitfield;
if (other.isSetUuid()) {
this.uuid = org.apache.thrift.TBaseHelper.copyBinary(other.uuid);
}
this.timestamp = other.timestamp;
if (other.isSetType()) {
this.type = other.type;
}
if (other.isSetRequest()) {
this.request = new open_rtb.BidRequestThrift(other.request);
}
if (other.isSetResponse()) {
this.response = new open_rtb.BidResponseThrift(other.response);
}
if (other.isSetProperties()) {
Map __this__properties = new HashMap(other.properties);
this.properties = __this__properties;
}
}
public LogEventThrift deepCopy() {
return new LogEventThrift(this);
}
@Override
public void clear() {
this.uuid = java.nio.ByteBuffer.wrap("\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0".getBytes());
this.timestamp = 0L;
this.type = com.adgear.anoa.test.ad_exchange.LogEventTypeThrift.UNKNOWN_LOG_EVENT_TYPE;
this.request = null;
this.response = null;
this.properties = null;
}
/**
* Log event unique identifier.
*/
public byte[] getUuid() {
setUuid(org.apache.thrift.TBaseHelper.rightSize(uuid));
return uuid == null ? null : uuid.array();
}
public ByteBuffer bufferForUuid() {
return org.apache.thrift.TBaseHelper.copyBinary(uuid);
}
/**
* Log event unique identifier.
*/
public LogEventThrift setUuid(byte[] uuid) {
this.uuid = uuid == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(uuid, uuid.length));
return this;
}
public LogEventThrift setUuid(ByteBuffer uuid) {
this.uuid = org.apache.thrift.TBaseHelper.copyBinary(uuid);
return this;
}
public void unsetUuid() {
this.uuid = null;
}
/** Returns true if field uuid is set (has been assigned a value) and false otherwise */
public boolean isSetUuid() {
return this.uuid != null;
}
public void setUuidIsSet(boolean value) {
if (!value) {
this.uuid = null;
}
}
/**
* Log event timestamp, in milliseconds from epoch.
*/
public long getTimestamp() {
return this.timestamp;
}
/**
* Log event timestamp, in milliseconds from epoch.
*/
public LogEventThrift setTimestamp(long timestamp) {
this.timestamp = timestamp;
setTimestampIsSet(true);
return this;
}
public void unsetTimestamp() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __TIMESTAMP_ISSET_ID);
}
/** Returns true if field timestamp is set (has been assigned a value) and false otherwise */
public boolean isSetTimestamp() {
return EncodingUtils.testBit(__isset_bitfield, __TIMESTAMP_ISSET_ID);
}
public void setTimestampIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __TIMESTAMP_ISSET_ID, value);
}
/**
* Log event type.
*
* @see LogEventTypeThrift
*/
public LogEventTypeThrift getType() {
return this.type;
}
/**
* Log event type.
*
* @see LogEventTypeThrift
*/
public LogEventThrift setType(LogEventTypeThrift type) {
this.type = type;
return this;
}
public void unsetType() {
this.type = null;
}
/** Returns true if field type is set (has been assigned a value) and false otherwise */
public boolean isSetType() {
return this.type != null;
}
public void setTypeIsSet(boolean value) {
if (!value) {
this.type = null;
}
}
public open_rtb.BidRequestThrift getRequest() {
return this.request;
}
public LogEventThrift setRequest(open_rtb.BidRequestThrift request) {
this.request = request;
return this;
}
public void unsetRequest() {
this.request = null;
}
/** Returns true if field request is set (has been assigned a value) and false otherwise */
public boolean isSetRequest() {
return this.request != null;
}
public void setRequestIsSet(boolean value) {
if (!value) {
this.request = null;
}
}
/**
* Bid response submitted to the real-time bidding ad exchange.
*/
public open_rtb.BidResponseThrift getResponse() {
return this.response;
}
/**
* Bid response submitted to the real-time bidding ad exchange.
*/
public LogEventThrift setResponse(open_rtb.BidResponseThrift response) {
this.response = response;
return this;
}
public void unsetResponse() {
this.response = null;
}
/** Returns true if field response is set (has been assigned a value) and false otherwise */
public boolean isSetResponse() {
return this.response != null;
}
public void setResponseIsSet(boolean value) {
if (!value) {
this.response = null;
}
}
public int getPropertiesSize() {
return (this.properties == null) ? 0 : this.properties.size();
}
public void putToProperties(String key, String val) {
if (this.properties == null) {
this.properties = new HashMap();
}
this.properties.put(key, val);
}
/**
* Log event custom properties.
*/
public Map getProperties() {
return this.properties;
}
/**
* Log event custom properties.
*/
public LogEventThrift setProperties(Map properties) {
this.properties = properties;
return this;
}
public void unsetProperties() {
this.properties = null;
}
/** Returns true if field properties is set (has been assigned a value) and false otherwise */
public boolean isSetProperties() {
return this.properties != null;
}
public void setPropertiesIsSet(boolean value) {
if (!value) {
this.properties = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case UUID:
if (value == null) {
unsetUuid();
} else {
setUuid((ByteBuffer)value);
}
break;
case TIMESTAMP:
if (value == null) {
unsetTimestamp();
} else {
setTimestamp((Long)value);
}
break;
case TYPE:
if (value == null) {
unsetType();
} else {
setType((LogEventTypeThrift)value);
}
break;
case REQUEST:
if (value == null) {
unsetRequest();
} else {
setRequest((open_rtb.BidRequestThrift)value);
}
break;
case RESPONSE:
if (value == null) {
unsetResponse();
} else {
setResponse((open_rtb.BidResponseThrift)value);
}
break;
case PROPERTIES:
if (value == null) {
unsetProperties();
} else {
setProperties((Map)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case UUID:
return getUuid();
case TIMESTAMP:
return Long.valueOf(getTimestamp());
case TYPE:
return getType();
case REQUEST:
return getRequest();
case RESPONSE:
return getResponse();
case PROPERTIES:
return getProperties();
}
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 UUID:
return isSetUuid();
case TIMESTAMP:
return isSetTimestamp();
case TYPE:
return isSetType();
case REQUEST:
return isSetRequest();
case RESPONSE:
return isSetResponse();
case PROPERTIES:
return isSetProperties();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof LogEventThrift)
return this.equals((LogEventThrift)that);
return false;
}
public boolean equals(LogEventThrift that) {
if (that == null)
return false;
boolean this_present_uuid = true && this.isSetUuid();
boolean that_present_uuid = true && that.isSetUuid();
if (this_present_uuid || that_present_uuid) {
if (!(this_present_uuid && that_present_uuid))
return false;
if (!this.uuid.equals(that.uuid))
return false;
}
boolean this_present_timestamp = true && this.isSetTimestamp();
boolean that_present_timestamp = true && that.isSetTimestamp();
if (this_present_timestamp || that_present_timestamp) {
if (!(this_present_timestamp && that_present_timestamp))
return false;
if (this.timestamp != that.timestamp)
return false;
}
boolean this_present_type = true && this.isSetType();
boolean that_present_type = true && that.isSetType();
if (this_present_type || that_present_type) {
if (!(this_present_type && that_present_type))
return false;
if (!this.type.equals(that.type))
return false;
}
boolean this_present_request = true && this.isSetRequest();
boolean that_present_request = true && that.isSetRequest();
if (this_present_request || that_present_request) {
if (!(this_present_request && that_present_request))
return false;
if (!this.request.equals(that.request))
return false;
}
boolean this_present_response = true && this.isSetResponse();
boolean that_present_response = true && that.isSetResponse();
if (this_present_response || that_present_response) {
if (!(this_present_response && that_present_response))
return false;
if (!this.response.equals(that.response))
return false;
}
boolean this_present_properties = true && this.isSetProperties();
boolean that_present_properties = true && that.isSetProperties();
if (this_present_properties || that_present_properties) {
if (!(this_present_properties && that_present_properties))
return false;
if (!this.properties.equals(that.properties))
return false;
}
return true;
}
@Override
public int hashCode() {
List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy