/** * Autogenerated by Thrift Compiler (0.9.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package com.datascience.utils.transformations.thrift.generated; 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 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 TDatumContResults implements org.apache.thrift.TBase<TDatumContResults, TDatumContResults._Fields>, java.io.Serializable, Cloneable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TDatumContResults"); private static final org.apache.thrift.protocol.TField EST_VAL_FIELD_DESC = new org.apache.thrift.protocol.TField("est_val", org.apache.thrift.protocol.TType.DOUBLE, (short)1); private static final org.apache.thrift.protocol.TField EST_ZETA_FIELD_DESC = new org.apache.thrift.protocol.TField("est_zeta", org.apache.thrift.protocol.TType.DOUBLE, (short)2); private static final org.apache.thrift.protocol.TField DISTRIB_MU_FIELD_DESC = new org.apache.thrift.protocol.TField("distribMu", org.apache.thrift.protocol.TType.DOUBLE, (short)3); private static final org.apache.thrift.protocol.TField DISTRIB_SIGMA_FIELD_DESC = new org.apache.thrift.protocol.TField("distribSigma", org.apache.thrift.protocol.TType.DOUBLE, (short)4); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new TDatumContResultsStandardSchemeFactory()); schemes.put(TupleScheme.class, new TDatumContResultsTupleSchemeFactory()); } public double est_val; // required public double est_zeta; // required public double distribMu; // required public double distribSigma; // 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 { EST_VAL((short)1, "est_val"), EST_ZETA((short)2, "est_zeta"), DISTRIB_MU((short)3, "distribMu"), DISTRIB_SIGMA((short)4, "distribSigma"); 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: // EST_VAL return EST_VAL; case 2: // EST_ZETA return EST_ZETA; case 3: // DISTRIB_MU return DISTRIB_MU; case 4: // DISTRIB_SIGMA return DISTRIB_SIGMA; 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 __EST_VAL_ISSET_ID = 0; private static final int __EST_ZETA_ISSET_ID = 1; private static final int __DISTRIBMU_ISSET_ID = 2; private static final int __DISTRIBSIGMA_ISSET_ID = 3; private byte __isset_bitfield = 0; 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.EST_VAL, new org.apache.thrift.meta_data.FieldMetaData("est_val", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE))); tmpMap.put(_Fields.EST_ZETA, new org.apache.thrift.meta_data.FieldMetaData("est_zeta", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE))); tmpMap.put(_Fields.DISTRIB_MU, new org.apache.thrift.meta_data.FieldMetaData("distribMu", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE))); tmpMap.put(_Fields.DISTRIB_SIGMA, new org.apache.thrift.meta_data.FieldMetaData("distribSigma", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TDatumContResults.class, metaDataMap); } public TDatumContResults() { } public TDatumContResults( double est_val, double est_zeta, double distribMu, double distribSigma) { this(); this.est_val = est_val; setEst_valIsSet(true); this.est_zeta = est_zeta; setEst_zetaIsSet(true); this.distribMu = distribMu; setDistribMuIsSet(true); this.distribSigma = distribSigma; setDistribSigmaIsSet(true); } /** * Performs a deep copy on <i>other</i>. */ public TDatumContResults(TDatumContResults other) { __isset_bitfield = other.__isset_bitfield; this.est_val = other.est_val; this.est_zeta = other.est_zeta; this.distribMu = other.distribMu; this.distribSigma = other.distribSigma; } public TDatumContResults deepCopy() { return new TDatumContResults(this); } @Override public void clear() { setEst_valIsSet(false); this.est_val = 0.0; setEst_zetaIsSet(false); this.est_zeta = 0.0; setDistribMuIsSet(false); this.distribMu = 0.0; setDistribSigmaIsSet(false); this.distribSigma = 0.0; } public double getEst_val() { return this.est_val; } public TDatumContResults setEst_val(double est_val) { this.est_val = est_val; setEst_valIsSet(true); return this; } public void unsetEst_val() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __EST_VAL_ISSET_ID); } /** Returns true if field est_val is set (has been assigned a value) and false otherwise */ public boolean isSetEst_val() { return EncodingUtils.testBit(__isset_bitfield, __EST_VAL_ISSET_ID); } public void setEst_valIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __EST_VAL_ISSET_ID, value); } public double getEst_zeta() { return this.est_zeta; } public TDatumContResults setEst_zeta(double est_zeta) { this.est_zeta = est_zeta; setEst_zetaIsSet(true); return this; } public void unsetEst_zeta() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __EST_ZETA_ISSET_ID); } /** Returns true if field est_zeta is set (has been assigned a value) and false otherwise */ public boolean isSetEst_zeta() { return EncodingUtils.testBit(__isset_bitfield, __EST_ZETA_ISSET_ID); } public void setEst_zetaIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __EST_ZETA_ISSET_ID, value); } public double getDistribMu() { return this.distribMu; } public TDatumContResults setDistribMu(double distribMu) { this.distribMu = distribMu; setDistribMuIsSet(true); return this; } public void unsetDistribMu() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __DISTRIBMU_ISSET_ID); } /** Returns true if field distribMu is set (has been assigned a value) and false otherwise */ public boolean isSetDistribMu() { return EncodingUtils.testBit(__isset_bitfield, __DISTRIBMU_ISSET_ID); } public void setDistribMuIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __DISTRIBMU_ISSET_ID, value); } public double getDistribSigma() { return this.distribSigma; } public TDatumContResults setDistribSigma(double distribSigma) { this.distribSigma = distribSigma; setDistribSigmaIsSet(true); return this; } public void unsetDistribSigma() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __DISTRIBSIGMA_ISSET_ID); } /** Returns true if field distribSigma is set (has been assigned a value) and false otherwise */ public boolean isSetDistribSigma() { return EncodingUtils.testBit(__isset_bitfield, __DISTRIBSIGMA_ISSET_ID); } public void setDistribSigmaIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __DISTRIBSIGMA_ISSET_ID, value); } public void setFieldValue(_Fields field, Object value) { switch (field) { case EST_VAL: if (value == null) { unsetEst_val(); } else { setEst_val((Double)value); } break; case EST_ZETA: if (value == null) { unsetEst_zeta(); } else { setEst_zeta((Double)value); } break; case DISTRIB_MU: if (value == null) { unsetDistribMu(); } else { setDistribMu((Double)value); } break; case DISTRIB_SIGMA: if (value == null) { unsetDistribSigma(); } else { setDistribSigma((Double)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case EST_VAL: return Double.valueOf(getEst_val()); case EST_ZETA: return Double.valueOf(getEst_zeta()); case DISTRIB_MU: return Double.valueOf(getDistribMu()); case DISTRIB_SIGMA: return Double.valueOf(getDistribSigma()); } 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 EST_VAL: return isSetEst_val(); case EST_ZETA: return isSetEst_zeta(); case DISTRIB_MU: return isSetDistribMu(); case DISTRIB_SIGMA: return isSetDistribSigma(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof TDatumContResults) return this.equals((TDatumContResults)that); return false; } public boolean equals(TDatumContResults that) { if (that == null) return false; boolean this_present_est_val = true; boolean that_present_est_val = true; if (this_present_est_val || that_present_est_val) { if (!(this_present_est_val && that_present_est_val)) return false; if (this.est_val != that.est_val) return false; } boolean this_present_est_zeta = true; boolean that_present_est_zeta = true; if (this_present_est_zeta || that_present_est_zeta) { if (!(this_present_est_zeta && that_present_est_zeta)) return false; if (this.est_zeta != that.est_zeta) return false; } boolean this_present_distribMu = true; boolean that_present_distribMu = true; if (this_present_distribMu || that_present_distribMu) { if (!(this_present_distribMu && that_present_distribMu)) return false; if (this.distribMu != that.distribMu) return false; } boolean this_present_distribSigma = true; boolean that_present_distribSigma = true; if (this_present_distribSigma || that_present_distribSigma) { if (!(this_present_distribSigma && that_present_distribSigma)) return false; if (this.distribSigma != that.distribSigma) return false; } return true; } @Override public int hashCode() { return 0; } public int compareTo(TDatumContResults other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; TDatumContResults typedOther = (TDatumContResults)other; lastComparison = Boolean.valueOf(isSetEst_val()).compareTo(typedOther.isSetEst_val()); if (lastComparison != 0) { return lastComparison; } if (isSetEst_val()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.est_val, typedOther.est_val); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetEst_zeta()).compareTo(typedOther.isSetEst_zeta()); if (lastComparison != 0) { return lastComparison; } if (isSetEst_zeta()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.est_zeta, typedOther.est_zeta); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetDistribMu()).compareTo(typedOther.isSetDistribMu()); if (lastComparison != 0) { return lastComparison; } if (isSetDistribMu()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.distribMu, typedOther.distribMu); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetDistribSigma()).compareTo(typedOther.isSetDistribSigma()); if (lastComparison != 0) { return lastComparison; } if (isSetDistribSigma()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.distribSigma, typedOther.distribSigma); 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("TDatumContResults("); boolean first = true; sb.append("est_val:"); sb.append(this.est_val); first = false; if (!first) sb.append(", "); sb.append("est_zeta:"); sb.append(this.est_zeta); first = false; if (!first) sb.append(", "); sb.append("distribMu:"); sb.append(this.distribMu); first = false; if (!first) sb.append(", "); sb.append("distribSigma:"); sb.append(this.distribSigma); 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 TDatumContResultsStandardSchemeFactory implements SchemeFactory { public TDatumContResultsStandardScheme getScheme() { return new TDatumContResultsStandardScheme(); } } private static class TDatumContResultsStandardScheme extends StandardScheme<TDatumContResults> { public void read(org.apache.thrift.protocol.TProtocol iprot, TDatumContResults 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: // EST_VAL if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) { struct.est_val = iprot.readDouble(); struct.setEst_valIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // EST_ZETA if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) { struct.est_zeta = iprot.readDouble(); struct.setEst_zetaIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // DISTRIB_MU if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) { struct.distribMu = iprot.readDouble(); struct.setDistribMuIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 4: // DISTRIB_SIGMA if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) { struct.distribSigma = iprot.readDouble(); struct.setDistribSigmaIsSet(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, TDatumContResults struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldBegin(EST_VAL_FIELD_DESC); oprot.writeDouble(struct.est_val); oprot.writeFieldEnd(); oprot.writeFieldBegin(EST_ZETA_FIELD_DESC); oprot.writeDouble(struct.est_zeta); oprot.writeFieldEnd(); oprot.writeFieldBegin(DISTRIB_MU_FIELD_DESC); oprot.writeDouble(struct.distribMu); oprot.writeFieldEnd(); oprot.writeFieldBegin(DISTRIB_SIGMA_FIELD_DESC); oprot.writeDouble(struct.distribSigma); oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class TDatumContResultsTupleSchemeFactory implements SchemeFactory { public TDatumContResultsTupleScheme getScheme() { return new TDatumContResultsTupleScheme(); } } private static class TDatumContResultsTupleScheme extends TupleScheme<TDatumContResults> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TDatumContResults struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetEst_val()) { optionals.set(0); } if (struct.isSetEst_zeta()) { optionals.set(1); } if (struct.isSetDistribMu()) { optionals.set(2); } if (struct.isSetDistribSigma()) { optionals.set(3); } oprot.writeBitSet(optionals, 4); if (struct.isSetEst_val()) { oprot.writeDouble(struct.est_val); } if (struct.isSetEst_zeta()) { oprot.writeDouble(struct.est_zeta); } if (struct.isSetDistribMu()) { oprot.writeDouble(struct.distribMu); } if (struct.isSetDistribSigma()) { oprot.writeDouble(struct.distribSigma); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TDatumContResults struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(4); if (incoming.get(0)) { struct.est_val = iprot.readDouble(); struct.setEst_valIsSet(true); } if (incoming.get(1)) { struct.est_zeta = iprot.readDouble(); struct.setEst_zetaIsSet(true); } if (incoming.get(2)) { struct.distribMu = iprot.readDouble(); struct.setDistribMuIsSet(true); } if (incoming.get(3)) { struct.distribSigma = iprot.readDouble(); struct.setDistribSigmaIsSet(true); } } } }