/**
* Autogenerated by Thrift Compiler (0.9.3)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
package com.facebook.buck.log.thrift;
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 org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
public class ExperimentStatsRemoteLogEntry implements org.apache.thrift.TBase<ExperimentStatsRemoteLogEntry, ExperimentStatsRemoteLogEntry._Fields>, java.io.Serializable, Cloneable, Comparable<ExperimentStatsRemoteLogEntry> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ExperimentStatsRemoteLogEntry");
private static final org.apache.thrift.protocol.TField TAG_FIELD_DESC = new org.apache.thrift.protocol.TField("tag", org.apache.thrift.protocol.TType.STRING, (short)1);
private static final org.apache.thrift.protocol.TField VARIANT_FIELD_DESC = new org.apache.thrift.protocol.TField("variant", org.apache.thrift.protocol.TType.STRING, (short)2);
private static final org.apache.thrift.protocol.TField PROPERTY_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("propertyName", org.apache.thrift.protocol.TType.STRING, (short)3);
private static final org.apache.thrift.protocol.TField VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("value", org.apache.thrift.protocol.TType.I64, (short)4);
private static final org.apache.thrift.protocol.TField CONTENT_FIELD_DESC = new org.apache.thrift.protocol.TField("content", org.apache.thrift.protocol.TType.STRING, (short)5);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new ExperimentStatsRemoteLogEntryStandardSchemeFactory());
schemes.put(TupleScheme.class, new ExperimentStatsRemoteLogEntryTupleSchemeFactory());
}
public String tag; // required
public String variant; // required
public String propertyName; // required
public long value; // optional
public String content; // 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 {
TAG((short)1, "tag"),
VARIANT((short)2, "variant"),
PROPERTY_NAME((short)3, "propertyName"),
VALUE((short)4, "value"),
CONTENT((short)5, "content");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
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: // TAG
return TAG;
case 2: // VARIANT
return VARIANT;
case 3: // PROPERTY_NAME
return PROPERTY_NAME;
case 4: // VALUE
return VALUE;
case 5: // CONTENT
return CONTENT;
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 __VALUE_ISSET_ID = 0;
private byte __isset_bitfield = 0;
private static final _Fields optionals[] = {_Fields.VALUE,_Fields.CONTENT};
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.TAG, new org.apache.thrift.meta_data.FieldMetaData("tag", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.VARIANT, new org.apache.thrift.meta_data.FieldMetaData("variant", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.PROPERTY_NAME, new org.apache.thrift.meta_data.FieldMetaData("propertyName", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.VALUE, new org.apache.thrift.meta_data.FieldMetaData("value", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
tmpMap.put(_Fields.CONTENT, new org.apache.thrift.meta_data.FieldMetaData("content", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ExperimentStatsRemoteLogEntry.class, metaDataMap);
}
public ExperimentStatsRemoteLogEntry() {
}
public ExperimentStatsRemoteLogEntry(
String tag,
String variant,
String propertyName)
{
this();
this.tag = tag;
this.variant = variant;
this.propertyName = propertyName;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public ExperimentStatsRemoteLogEntry(ExperimentStatsRemoteLogEntry other) {
__isset_bitfield = other.__isset_bitfield;
if (other.isSetTag()) {
this.tag = other.tag;
}
if (other.isSetVariant()) {
this.variant = other.variant;
}
if (other.isSetPropertyName()) {
this.propertyName = other.propertyName;
}
this.value = other.value;
if (other.isSetContent()) {
this.content = other.content;
}
}
public ExperimentStatsRemoteLogEntry deepCopy() {
return new ExperimentStatsRemoteLogEntry(this);
}
@Override
public void clear() {
this.tag = null;
this.variant = null;
this.propertyName = null;
setValueIsSet(false);
this.value = 0;
this.content = null;
}
public String getTag() {
return this.tag;
}
public ExperimentStatsRemoteLogEntry setTag(String tag) {
this.tag = tag;
return this;
}
public void unsetTag() {
this.tag = null;
}
/** Returns true if field tag is set (has been assigned a value) and false otherwise */
public boolean isSetTag() {
return this.tag != null;
}
public void setTagIsSet(boolean value) {
if (!value) {
this.tag = null;
}
}
public String getVariant() {
return this.variant;
}
public ExperimentStatsRemoteLogEntry setVariant(String variant) {
this.variant = variant;
return this;
}
public void unsetVariant() {
this.variant = null;
}
/** Returns true if field variant is set (has been assigned a value) and false otherwise */
public boolean isSetVariant() {
return this.variant != null;
}
public void setVariantIsSet(boolean value) {
if (!value) {
this.variant = null;
}
}
public String getPropertyName() {
return this.propertyName;
}
public ExperimentStatsRemoteLogEntry setPropertyName(String propertyName) {
this.propertyName = propertyName;
return this;
}
public void unsetPropertyName() {
this.propertyName = null;
}
/** Returns true if field propertyName is set (has been assigned a value) and false otherwise */
public boolean isSetPropertyName() {
return this.propertyName != null;
}
public void setPropertyNameIsSet(boolean value) {
if (!value) {
this.propertyName = null;
}
}
public long getValue() {
return this.value;
}
public ExperimentStatsRemoteLogEntry setValue(long value) {
this.value = value;
setValueIsSet(true);
return this;
}
public void unsetValue() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __VALUE_ISSET_ID);
}
/** Returns true if field value is set (has been assigned a value) and false otherwise */
public boolean isSetValue() {
return EncodingUtils.testBit(__isset_bitfield, __VALUE_ISSET_ID);
}
public void setValueIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __VALUE_ISSET_ID, value);
}
public String getContent() {
return this.content;
}
public ExperimentStatsRemoteLogEntry setContent(String content) {
this.content = content;
return this;
}
public void unsetContent() {
this.content = null;
}
/** Returns true if field content is set (has been assigned a value) and false otherwise */
public boolean isSetContent() {
return this.content != null;
}
public void setContentIsSet(boolean value) {
if (!value) {
this.content = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case TAG:
if (value == null) {
unsetTag();
} else {
setTag((String)value);
}
break;
case VARIANT:
if (value == null) {
unsetVariant();
} else {
setVariant((String)value);
}
break;
case PROPERTY_NAME:
if (value == null) {
unsetPropertyName();
} else {
setPropertyName((String)value);
}
break;
case VALUE:
if (value == null) {
unsetValue();
} else {
setValue((Long)value);
}
break;
case CONTENT:
if (value == null) {
unsetContent();
} else {
setContent((String)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case TAG:
return getTag();
case VARIANT:
return getVariant();
case PROPERTY_NAME:
return getPropertyName();
case VALUE:
return getValue();
case CONTENT:
return getContent();
}
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 TAG:
return isSetTag();
case VARIANT:
return isSetVariant();
case PROPERTY_NAME:
return isSetPropertyName();
case VALUE:
return isSetValue();
case CONTENT:
return isSetContent();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof ExperimentStatsRemoteLogEntry)
return this.equals((ExperimentStatsRemoteLogEntry)that);
return false;
}
public boolean equals(ExperimentStatsRemoteLogEntry that) {
if (that == null)
return false;
boolean this_present_tag = true && this.isSetTag();
boolean that_present_tag = true && that.isSetTag();
if (this_present_tag || that_present_tag) {
if (!(this_present_tag && that_present_tag))
return false;
if (!this.tag.equals(that.tag))
return false;
}
boolean this_present_variant = true && this.isSetVariant();
boolean that_present_variant = true && that.isSetVariant();
if (this_present_variant || that_present_variant) {
if (!(this_present_variant && that_present_variant))
return false;
if (!this.variant.equals(that.variant))
return false;
}
boolean this_present_propertyName = true && this.isSetPropertyName();
boolean that_present_propertyName = true && that.isSetPropertyName();
if (this_present_propertyName || that_present_propertyName) {
if (!(this_present_propertyName && that_present_propertyName))
return false;
if (!this.propertyName.equals(that.propertyName))
return false;
}
boolean this_present_value = true && this.isSetValue();
boolean that_present_value = true && that.isSetValue();
if (this_present_value || that_present_value) {
if (!(this_present_value && that_present_value))
return false;
if (this.value != that.value)
return false;
}
boolean this_present_content = true && this.isSetContent();
boolean that_present_content = true && that.isSetContent();
if (this_present_content || that_present_content) {
if (!(this_present_content && that_present_content))
return false;
if (!this.content.equals(that.content))
return false;
}
return true;
}
@Override
public int hashCode() {
List<Object> list = new ArrayList<Object>();
boolean present_tag = true && (isSetTag());
list.add(present_tag);
if (present_tag)
list.add(tag);
boolean present_variant = true && (isSetVariant());
list.add(present_variant);
if (present_variant)
list.add(variant);
boolean present_propertyName = true && (isSetPropertyName());
list.add(present_propertyName);
if (present_propertyName)
list.add(propertyName);
boolean present_value = true && (isSetValue());
list.add(present_value);
if (present_value)
list.add(value);
boolean present_content = true && (isSetContent());
list.add(present_content);
if (present_content)
list.add(content);
return list.hashCode();
}
@Override
public int compareTo(ExperimentStatsRemoteLogEntry other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = Boolean.valueOf(isSetTag()).compareTo(other.isSetTag());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetTag()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tag, other.tag);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetVariant()).compareTo(other.isSetVariant());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetVariant()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.variant, other.variant);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetPropertyName()).compareTo(other.isSetPropertyName());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetPropertyName()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.propertyName, other.propertyName);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetValue()).compareTo(other.isSetValue());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetValue()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.value, other.value);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetContent()).compareTo(other.isSetContent());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetContent()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.content, other.content);
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("ExperimentStatsRemoteLogEntry(");
boolean first = true;
sb.append("tag:");
if (this.tag == null) {
sb.append("null");
} else {
sb.append(this.tag);
}
first = false;
if (!first) sb.append(", ");
sb.append("variant:");
if (this.variant == null) {
sb.append("null");
} else {
sb.append(this.variant);
}
first = false;
if (!first) sb.append(", ");
sb.append("propertyName:");
if (this.propertyName == null) {
sb.append("null");
} else {
sb.append(this.propertyName);
}
first = false;
if (isSetValue()) {
if (!first) sb.append(", ");
sb.append("value:");
sb.append(this.value);
first = false;
}
if (isSetContent()) {
if (!first) sb.append(", ");
sb.append("content:");
if (this.content == null) {
sb.append("null");
} else {
sb.append(this.content);
}
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 ExperimentStatsRemoteLogEntryStandardSchemeFactory implements SchemeFactory {
public ExperimentStatsRemoteLogEntryStandardScheme getScheme() {
return new ExperimentStatsRemoteLogEntryStandardScheme();
}
}
private static class ExperimentStatsRemoteLogEntryStandardScheme extends StandardScheme<ExperimentStatsRemoteLogEntry> {
public void read(org.apache.thrift.protocol.TProtocol iprot, ExperimentStatsRemoteLogEntry 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: // TAG
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.tag = iprot.readString();
struct.setTagIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 2: // VARIANT
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.variant = iprot.readString();
struct.setVariantIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 3: // PROPERTY_NAME
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.propertyName = iprot.readString();
struct.setPropertyNameIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 4: // VALUE
if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
struct.value = iprot.readI64();
struct.setValueIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 5: // CONTENT
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.content = iprot.readString();
struct.setContentIsSet(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, ExperimentStatsRemoteLogEntry struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.tag != null) {
oprot.writeFieldBegin(TAG_FIELD_DESC);
oprot.writeString(struct.tag);
oprot.writeFieldEnd();
}
if (struct.variant != null) {
oprot.writeFieldBegin(VARIANT_FIELD_DESC);
oprot.writeString(struct.variant);
oprot.writeFieldEnd();
}
if (struct.propertyName != null) {
oprot.writeFieldBegin(PROPERTY_NAME_FIELD_DESC);
oprot.writeString(struct.propertyName);
oprot.writeFieldEnd();
}
if (struct.isSetValue()) {
oprot.writeFieldBegin(VALUE_FIELD_DESC);
oprot.writeI64(struct.value);
oprot.writeFieldEnd();
}
if (struct.content != null) {
if (struct.isSetContent()) {
oprot.writeFieldBegin(CONTENT_FIELD_DESC);
oprot.writeString(struct.content);
oprot.writeFieldEnd();
}
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class ExperimentStatsRemoteLogEntryTupleSchemeFactory implements SchemeFactory {
public ExperimentStatsRemoteLogEntryTupleScheme getScheme() {
return new ExperimentStatsRemoteLogEntryTupleScheme();
}
}
private static class ExperimentStatsRemoteLogEntryTupleScheme extends TupleScheme<ExperimentStatsRemoteLogEntry> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, ExperimentStatsRemoteLogEntry struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetTag()) {
optionals.set(0);
}
if (struct.isSetVariant()) {
optionals.set(1);
}
if (struct.isSetPropertyName()) {
optionals.set(2);
}
if (struct.isSetValue()) {
optionals.set(3);
}
if (struct.isSetContent()) {
optionals.set(4);
}
oprot.writeBitSet(optionals, 5);
if (struct.isSetTag()) {
oprot.writeString(struct.tag);
}
if (struct.isSetVariant()) {
oprot.writeString(struct.variant);
}
if (struct.isSetPropertyName()) {
oprot.writeString(struct.propertyName);
}
if (struct.isSetValue()) {
oprot.writeI64(struct.value);
}
if (struct.isSetContent()) {
oprot.writeString(struct.content);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, ExperimentStatsRemoteLogEntry struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(5);
if (incoming.get(0)) {
struct.tag = iprot.readString();
struct.setTagIsSet(true);
}
if (incoming.get(1)) {
struct.variant = iprot.readString();
struct.setVariantIsSet(true);
}
if (incoming.get(2)) {
struct.propertyName = iprot.readString();
struct.setPropertyNameIsSet(true);
}
if (incoming.get(3)) {
struct.value = iprot.readI64();
struct.setValueIsSet(true);
}
if (incoming.get(4)) {
struct.content = iprot.readString();
struct.setContentIsSet(true);
}
}
}
}