/** * Autogenerated by Thrift Compiler (0.9.1) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package thales.stcuo.mtg; 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; public class DAI 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("DAI"); private static final org.apache.thrift.protocol.TField MEASURE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("measureName", org.apache.thrift.protocol.TType.STRING, (short)1); private static final org.apache.thrift.protocol.TField ACQUISITION_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("acquisitionName", org.apache.thrift.protocol.TType.STRING, (short)2); private static final org.apache.thrift.protocol.TField CYCLE_INDEX_FIELD_DESC = new org.apache.thrift.protocol.TField("cycleIndex", org.apache.thrift.protocol.TType.STRING, (short)3); private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); static { schemes.put(StandardScheme.class, new DAIStandardSchemeFactory()); schemes.put(TupleScheme.class, new DAITupleSchemeFactory()); } public String measureName; // required public String acquisitionName; // required public String cycleIndex; // 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 { MEASURE_NAME((short)1, "measureName"), ACQUISITION_NAME((short)2, "acquisitionName"), CYCLE_INDEX((short)3, "cycleIndex"); 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: // MEASURE_NAME return MEASURE_NAME; case 2: // ACQUISITION_NAME return ACQUISITION_NAME; case 3: // CYCLE_INDEX return CYCLE_INDEX; 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 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.MEASURE_NAME, new org.apache.thrift.meta_data.FieldMetaData("measureName", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.ACQUISITION_NAME, new org.apache.thrift.meta_data.FieldMetaData("acquisitionName", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.CYCLE_INDEX, new org.apache.thrift.meta_data.FieldMetaData("cycleIndex", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(DAI.class, metaDataMap); } public DAI() { } public DAI( String measureName, String acquisitionName, String cycleIndex) { this(); this.measureName = measureName; this.acquisitionName = acquisitionName; this.cycleIndex = cycleIndex; } /** * Performs a deep copy on other. */ public DAI(DAI other) { if (other.isSetMeasureName()) { this.measureName = other.measureName; } if (other.isSetAcquisitionName()) { this.acquisitionName = other.acquisitionName; } if (other.isSetCycleIndex()) { this.cycleIndex = other.cycleIndex; } } public DAI deepCopy() { return new DAI(this); } @Override public void clear() { this.measureName = null; this.acquisitionName = null; this.cycleIndex = null; } public String getMeasureName() { return this.measureName; } public DAI setMeasureName(String measureName) { this.measureName = measureName; return this; } public void unsetMeasureName() { this.measureName = null; } /** Returns true if field measureName is set (has been assigned a value) and false otherwise */ public boolean isSetMeasureName() { return this.measureName != null; } public void setMeasureNameIsSet(boolean value) { if (!value) { this.measureName = null; } } public String getAcquisitionName() { return this.acquisitionName; } public DAI setAcquisitionName(String acquisitionName) { this.acquisitionName = acquisitionName; return this; } public void unsetAcquisitionName() { this.acquisitionName = null; } /** Returns true if field acquisitionName is set (has been assigned a value) and false otherwise */ public boolean isSetAcquisitionName() { return this.acquisitionName != null; } public void setAcquisitionNameIsSet(boolean value) { if (!value) { this.acquisitionName = null; } } public String getCycleIndex() { return this.cycleIndex; } public DAI setCycleIndex(String cycleIndex) { this.cycleIndex = cycleIndex; return this; } public void unsetCycleIndex() { this.cycleIndex = null; } /** Returns true if field cycleIndex is set (has been assigned a value) and false otherwise */ public boolean isSetCycleIndex() { return this.cycleIndex != null; } public void setCycleIndexIsSet(boolean value) { if (!value) { this.cycleIndex = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case MEASURE_NAME: if (value == null) { unsetMeasureName(); } else { setMeasureName((String)value); } break; case ACQUISITION_NAME: if (value == null) { unsetAcquisitionName(); } else { setAcquisitionName((String)value); } break; case CYCLE_INDEX: if (value == null) { unsetCycleIndex(); } else { setCycleIndex((String)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case MEASURE_NAME: return getMeasureName(); case ACQUISITION_NAME: return getAcquisitionName(); case CYCLE_INDEX: return getCycleIndex(); } 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 MEASURE_NAME: return isSetMeasureName(); case ACQUISITION_NAME: return isSetAcquisitionName(); case CYCLE_INDEX: return isSetCycleIndex(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof DAI) return this.equals((DAI)that); return false; } public boolean equals(DAI that) { if (that == null) return false; boolean this_present_measureName = true && this.isSetMeasureName(); boolean that_present_measureName = true && that.isSetMeasureName(); if (this_present_measureName || that_present_measureName) { if (!(this_present_measureName && that_present_measureName)) return false; if (!this.measureName.equals(that.measureName)) return false; } boolean this_present_acquisitionName = true && this.isSetAcquisitionName(); boolean that_present_acquisitionName = true && that.isSetAcquisitionName(); if (this_present_acquisitionName || that_present_acquisitionName) { if (!(this_present_acquisitionName && that_present_acquisitionName)) return false; if (!this.acquisitionName.equals(that.acquisitionName)) return false; } boolean this_present_cycleIndex = true && this.isSetCycleIndex(); boolean that_present_cycleIndex = true && that.isSetCycleIndex(); if (this_present_cycleIndex || that_present_cycleIndex) { if (!(this_present_cycleIndex && that_present_cycleIndex)) return false; if (!this.cycleIndex.equals(that.cycleIndex)) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(DAI other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetMeasureName()).compareTo(other.isSetMeasureName()); if (lastComparison != 0) { return lastComparison; } if (isSetMeasureName()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.measureName, other.measureName); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetAcquisitionName()).compareTo(other.isSetAcquisitionName()); if (lastComparison != 0) { return lastComparison; } if (isSetAcquisitionName()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.acquisitionName, other.acquisitionName); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetCycleIndex()).compareTo(other.isSetCycleIndex()); if (lastComparison != 0) { return lastComparison; } if (isSetCycleIndex()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cycleIndex, other.cycleIndex); 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("DAI("); boolean first = true; sb.append("measureName:"); if (this.measureName == null) { sb.append("null"); } else { sb.append(this.measureName); } first = false; if (!first) sb.append(", "); sb.append("acquisitionName:"); if (this.acquisitionName == null) { sb.append("null"); } else { sb.append(this.acquisitionName); } first = false; if (!first) sb.append(", "); sb.append("cycleIndex:"); if (this.cycleIndex == null) { sb.append("null"); } else { sb.append(this.cycleIndex); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields if (measureName == null) { throw new org.apache.thrift.protocol.TProtocolException("Required field 'measureName' was not present! Struct: " + toString()); } if (acquisitionName == null) { throw new org.apache.thrift.protocol.TProtocolException("Required field 'acquisitionName' was not present! Struct: " + toString()); } if (cycleIndex == null) { throw new org.apache.thrift.protocol.TProtocolException("Required field 'cycleIndex' was not present! Struct: " + toString()); } // 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 { 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 DAIStandardSchemeFactory implements SchemeFactory { public DAIStandardScheme getScheme() { return new DAIStandardScheme(); } } private static class DAIStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, DAI 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: // MEASURE_NAME if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.measureName = iprot.readString(); struct.setMeasureNameIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // ACQUISITION_NAME if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.acquisitionName = iprot.readString(); struct.setAcquisitionNameIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // CYCLE_INDEX if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.cycleIndex = iprot.readString(); struct.setCycleIndexIsSet(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, DAI struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.measureName != null) { oprot.writeFieldBegin(MEASURE_NAME_FIELD_DESC); oprot.writeString(struct.measureName); oprot.writeFieldEnd(); } if (struct.acquisitionName != null) { oprot.writeFieldBegin(ACQUISITION_NAME_FIELD_DESC); oprot.writeString(struct.acquisitionName); oprot.writeFieldEnd(); } if (struct.cycleIndex != null) { oprot.writeFieldBegin(CYCLE_INDEX_FIELD_DESC); oprot.writeString(struct.cycleIndex); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class DAITupleSchemeFactory implements SchemeFactory { public DAITupleScheme getScheme() { return new DAITupleScheme(); } } private static class DAITupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, DAI struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; oprot.writeString(struct.measureName); oprot.writeString(struct.acquisitionName); oprot.writeString(struct.cycleIndex); } @Override public void read(org.apache.thrift.protocol.TProtocol prot, DAI struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; struct.measureName = iprot.readString(); struct.setMeasureNameIsSet(true); struct.acquisitionName = iprot.readString(); struct.setAcquisitionNameIsSet(true); struct.cycleIndex = iprot.readString(); struct.setCycleIndexIsSet(true); } } }