/** * Autogenerated by Thrift Compiler (0.8.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package com.profiler.dto; 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 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; public class RequestDataListThriftDTO implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("RequestDataListThriftDTO"); private static final org.apache.thrift.protocol.TField HOST_HASH_CODE_FIELD_DESC = new org.apache.thrift.protocol.TField("hostHashCode", org.apache.thrift.protocol.TType.I32, (short)1); private static final org.apache.thrift.protocol.TField REQUEST_HASH_CODE_FIELD_DESC = new org.apache.thrift.protocol.TField("requestHashCode", org.apache.thrift.protocol.TType.I32, (short)2); private static final org.apache.thrift.protocol.TField REQUEST_DATA_LIST_FIELD_DESC = new org.apache.thrift.protocol.TField("requestDataList", org.apache.thrift.protocol.TType.LIST, (short)3); private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); static { schemes.put(StandardScheme.class, new RequestDataListThriftDTOStandardSchemeFactory()); schemes.put(TupleScheme.class, new RequestDataListThriftDTOTupleSchemeFactory()); } private int hostHashCode; // required private int requestHashCode; // required private List requestDataList; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { HOST_HASH_CODE((short)1, "hostHashCode"), REQUEST_HASH_CODE((short)2, "requestHashCode"), REQUEST_DATA_LIST((short)3, "requestDataList"); 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: // HOST_HASH_CODE return HOST_HASH_CODE; case 2: // REQUEST_HASH_CODE return REQUEST_HASH_CODE; case 3: // REQUEST_DATA_LIST return REQUEST_DATA_LIST; 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 __HOSTHASHCODE_ISSET_ID = 0; private static final int __REQUESTHASHCODE_ISSET_ID = 1; private BitSet __isset_bit_vector = new BitSet(2); 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.HOST_HASH_CODE, new org.apache.thrift.meta_data.FieldMetaData("hostHashCode", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); tmpMap.put(_Fields.REQUEST_HASH_CODE, new org.apache.thrift.meta_data.FieldMetaData("requestHashCode", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); tmpMap.put(_Fields.REQUEST_DATA_LIST, new org.apache.thrift.meta_data.FieldMetaData("requestDataList", org.apache.thrift.TFieldRequirementType.DEFAULT, 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, RequestDataThriftDTO.class)))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(RequestDataListThriftDTO.class, metaDataMap); } public RequestDataListThriftDTO() { } public RequestDataListThriftDTO( int hostHashCode, int requestHashCode, List requestDataList) { this(); this.hostHashCode = hostHashCode; setHostHashCodeIsSet(true); this.requestHashCode = requestHashCode; setRequestHashCodeIsSet(true); this.requestDataList = requestDataList; } /** * Performs a deep copy on other. */ public RequestDataListThriftDTO(RequestDataListThriftDTO other) { __isset_bit_vector.clear(); __isset_bit_vector.or(other.__isset_bit_vector); this.hostHashCode = other.hostHashCode; this.requestHashCode = other.requestHashCode; if (other.isSetRequestDataList()) { List __this__requestDataList = new ArrayList(); for (RequestDataThriftDTO other_element : other.requestDataList) { __this__requestDataList.add(new RequestDataThriftDTO(other_element)); } this.requestDataList = __this__requestDataList; } } public RequestDataListThriftDTO deepCopy() { return new RequestDataListThriftDTO(this); } @Override public void clear() { setHostHashCodeIsSet(false); this.hostHashCode = 0; setRequestHashCodeIsSet(false); this.requestHashCode = 0; this.requestDataList = null; } public int getHostHashCode() { return this.hostHashCode; } public void setHostHashCode(int hostHashCode) { this.hostHashCode = hostHashCode; setHostHashCodeIsSet(true); } public void unsetHostHashCode() { __isset_bit_vector.clear(__HOSTHASHCODE_ISSET_ID); } /** Returns true if field hostHashCode is set (has been assigned a value) and false otherwise */ public boolean isSetHostHashCode() { return __isset_bit_vector.get(__HOSTHASHCODE_ISSET_ID); } public void setHostHashCodeIsSet(boolean value) { __isset_bit_vector.set(__HOSTHASHCODE_ISSET_ID, value); } public int getRequestHashCode() { return this.requestHashCode; } public void setRequestHashCode(int requestHashCode) { this.requestHashCode = requestHashCode; setRequestHashCodeIsSet(true); } public void unsetRequestHashCode() { __isset_bit_vector.clear(__REQUESTHASHCODE_ISSET_ID); } /** Returns true if field requestHashCode is set (has been assigned a value) and false otherwise */ public boolean isSetRequestHashCode() { return __isset_bit_vector.get(__REQUESTHASHCODE_ISSET_ID); } public void setRequestHashCodeIsSet(boolean value) { __isset_bit_vector.set(__REQUESTHASHCODE_ISSET_ID, value); } public int getRequestDataListSize() { return (this.requestDataList == null) ? 0 : this.requestDataList.size(); } public java.util.Iterator getRequestDataListIterator() { return (this.requestDataList == null) ? null : this.requestDataList.iterator(); } public void addToRequestDataList(RequestDataThriftDTO elem) { if (this.requestDataList == null) { this.requestDataList = new ArrayList(); } this.requestDataList.add(elem); } public List getRequestDataList() { return this.requestDataList; } public void setRequestDataList(List requestDataList) { this.requestDataList = requestDataList; } public void unsetRequestDataList() { this.requestDataList = null; } /** Returns true if field requestDataList is set (has been assigned a value) and false otherwise */ public boolean isSetRequestDataList() { return this.requestDataList != null; } public void setRequestDataListIsSet(boolean value) { if (!value) { this.requestDataList = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case HOST_HASH_CODE: if (value == null) { unsetHostHashCode(); } else { setHostHashCode((Integer)value); } break; case REQUEST_HASH_CODE: if (value == null) { unsetRequestHashCode(); } else { setRequestHashCode((Integer)value); } break; case REQUEST_DATA_LIST: if (value == null) { unsetRequestDataList(); } else { setRequestDataList((List)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case HOST_HASH_CODE: return Integer.valueOf(getHostHashCode()); case REQUEST_HASH_CODE: return Integer.valueOf(getRequestHashCode()); case REQUEST_DATA_LIST: return getRequestDataList(); } 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 HOST_HASH_CODE: return isSetHostHashCode(); case REQUEST_HASH_CODE: return isSetRequestHashCode(); case REQUEST_DATA_LIST: return isSetRequestDataList(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof RequestDataListThriftDTO) return this.equals((RequestDataListThriftDTO)that); return false; } public boolean equals(RequestDataListThriftDTO that) { if (that == null) return false; boolean this_present_hostHashCode = true; boolean that_present_hostHashCode = true; if (this_present_hostHashCode || that_present_hostHashCode) { if (!(this_present_hostHashCode && that_present_hostHashCode)) return false; if (this.hostHashCode != that.hostHashCode) return false; } boolean this_present_requestHashCode = true; boolean that_present_requestHashCode = true; if (this_present_requestHashCode || that_present_requestHashCode) { if (!(this_present_requestHashCode && that_present_requestHashCode)) return false; if (this.requestHashCode != that.requestHashCode) return false; } boolean this_present_requestDataList = true && this.isSetRequestDataList(); boolean that_present_requestDataList = true && that.isSetRequestDataList(); if (this_present_requestDataList || that_present_requestDataList) { if (!(this_present_requestDataList && that_present_requestDataList)) return false; if (!this.requestDataList.equals(that.requestDataList)) return false; } return true; } @Override public int hashCode() { return 0; } public int compareTo(RequestDataListThriftDTO other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; RequestDataListThriftDTO typedOther = (RequestDataListThriftDTO)other; lastComparison = Boolean.valueOf(isSetHostHashCode()).compareTo(typedOther.isSetHostHashCode()); if (lastComparison != 0) { return lastComparison; } if (isSetHostHashCode()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.hostHashCode, typedOther.hostHashCode); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetRequestHashCode()).compareTo(typedOther.isSetRequestHashCode()); if (lastComparison != 0) { return lastComparison; } if (isSetRequestHashCode()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.requestHashCode, typedOther.requestHashCode); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetRequestDataList()).compareTo(typedOther.isSetRequestDataList()); if (lastComparison != 0) { return lastComparison; } if (isSetRequestDataList()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.requestDataList, typedOther.requestDataList); 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("RequestDataListThriftDTO("); boolean first = true; sb.append("hostHashCode:"); sb.append(this.hostHashCode); first = false; if (!first) sb.append(", "); sb.append("requestHashCode:"); sb.append(this.requestHashCode); first = false; if (!first) sb.append(", "); sb.append("requestDataList:"); if (this.requestDataList == null) { sb.append("null"); } else { sb.append(this.requestDataList); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields } 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_bit_vector = new BitSet(1); 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 RequestDataListThriftDTOStandardSchemeFactory implements SchemeFactory { public RequestDataListThriftDTOStandardScheme getScheme() { return new RequestDataListThriftDTOStandardScheme(); } } private static class RequestDataListThriftDTOStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, RequestDataListThriftDTO 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: // HOST_HASH_CODE if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.hostHashCode = iprot.readI32(); struct.setHostHashCodeIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // REQUEST_HASH_CODE if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.requestHashCode = iprot.readI32(); struct.setRequestHashCodeIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // REQUEST_DATA_LIST if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list0 = iprot.readListBegin(); struct.requestDataList = new ArrayList(_list0.size); for (int _i1 = 0; _i1 < _list0.size; ++_i1) { RequestDataThriftDTO _elem2; // required _elem2 = new RequestDataThriftDTO(); _elem2.read(iprot); struct.requestDataList.add(_elem2); } iprot.readListEnd(); } struct.setRequestDataListIsSet(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(); struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, RequestDataListThriftDTO struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldBegin(HOST_HASH_CODE_FIELD_DESC); oprot.writeI32(struct.hostHashCode); oprot.writeFieldEnd(); oprot.writeFieldBegin(REQUEST_HASH_CODE_FIELD_DESC); oprot.writeI32(struct.requestHashCode); oprot.writeFieldEnd(); if (struct.requestDataList != null) { oprot.writeFieldBegin(REQUEST_DATA_LIST_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.requestDataList.size())); for (RequestDataThriftDTO _iter3 : struct.requestDataList) { _iter3.write(oprot); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class RequestDataListThriftDTOTupleSchemeFactory implements SchemeFactory { public RequestDataListThriftDTOTupleScheme getScheme() { return new RequestDataListThriftDTOTupleScheme(); } } private static class RequestDataListThriftDTOTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, RequestDataListThriftDTO struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetHostHashCode()) { optionals.set(0); } if (struct.isSetRequestHashCode()) { optionals.set(1); } if (struct.isSetRequestDataList()) { optionals.set(2); } oprot.writeBitSet(optionals, 3); if (struct.isSetHostHashCode()) { oprot.writeI32(struct.hostHashCode); } if (struct.isSetRequestHashCode()) { oprot.writeI32(struct.requestHashCode); } if (struct.isSetRequestDataList()) { { oprot.writeI32(struct.requestDataList.size()); for (RequestDataThriftDTO _iter4 : struct.requestDataList) { _iter4.write(oprot); } } } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, RequestDataListThriftDTO struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(3); if (incoming.get(0)) { struct.hostHashCode = iprot.readI32(); struct.setHostHashCodeIsSet(true); } if (incoming.get(1)) { struct.requestHashCode = iprot.readI32(); struct.setRequestHashCodeIsSet(true); } if (incoming.get(2)) { { org.apache.thrift.protocol.TList _list5 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); struct.requestDataList = new ArrayList(_list5.size); for (int _i6 = 0; _i6 < _list5.size; ++_i6) { RequestDataThriftDTO _elem7; // required _elem7 = new RequestDataThriftDTO(); _elem7.read(iprot); struct.requestDataList.add(_elem7); } } struct.setRequestDataListIsSet(true); } } } }