/** * Autogenerated by Thrift Compiler (0.9.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package com.yahoo.ycsb.db.tpcc.helper.rows; 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 DistrictRow implements org.apache.thrift.TBase<DistrictRow, DistrictRow._Fields>, java.io.Serializable, Cloneable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("DistrictRow"); private static final org.apache.thrift.protocol.TField D_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("d_name", org.apache.thrift.protocol.TType.STRING, (short)1); private static final org.apache.thrift.protocol.TField D_STREET_1_FIELD_DESC = new org.apache.thrift.protocol.TField("d_street_1", org.apache.thrift.protocol.TType.STRING, (short)2); private static final org.apache.thrift.protocol.TField D_STREET_2_FIELD_DESC = new org.apache.thrift.protocol.TField("d_street_2", org.apache.thrift.protocol.TType.STRING, (short)3); private static final org.apache.thrift.protocol.TField D_CITY_FIELD_DESC = new org.apache.thrift.protocol.TField("d_city", org.apache.thrift.protocol.TType.STRING, (short)4); private static final org.apache.thrift.protocol.TField D_STATE_FIELD_DESC = new org.apache.thrift.protocol.TField("d_state", org.apache.thrift.protocol.TType.STRING, (short)5); private static final org.apache.thrift.protocol.TField D_ZIP_FIELD_DESC = new org.apache.thrift.protocol.TField("d_zip", org.apache.thrift.protocol.TType.STRING, (short)6); private static final org.apache.thrift.protocol.TField D_TAX_FIELD_DESC = new org.apache.thrift.protocol.TField("d_tax", org.apache.thrift.protocol.TType.DOUBLE, (short)7); private static final org.apache.thrift.protocol.TField D_YTD_FIELD_DESC = new org.apache.thrift.protocol.TField("d_ytd", org.apache.thrift.protocol.TType.DOUBLE, (short)8); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new DistrictRowStandardSchemeFactory()); schemes.put(TupleScheme.class, new DistrictRowTupleSchemeFactory()); } public String d_name; // required public String d_street_1; // required public String d_street_2; // required public String d_city; // required public String d_state; // required public String d_zip; // required public double d_tax; // required public double d_ytd; // 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 { D_NAME((short)1, "d_name"), D_STREET_1((short)2, "d_street_1"), D_STREET_2((short)3, "d_street_2"), D_CITY((short)4, "d_city"), D_STATE((short)5, "d_state"), D_ZIP((short)6, "d_zip"), D_TAX((short)7, "d_tax"), D_YTD((short)8, "d_ytd"); 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: // D_NAME return D_NAME; case 2: // D_STREET_1 return D_STREET_1; case 3: // D_STREET_2 return D_STREET_2; case 4: // D_CITY return D_CITY; case 5: // D_STATE return D_STATE; case 6: // D_ZIP return D_ZIP; case 7: // D_TAX return D_TAX; case 8: // D_YTD return D_YTD; 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 __D_TAX_ISSET_ID = 0; private static final int __D_YTD_ISSET_ID = 1; 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.D_NAME, new org.apache.thrift.meta_data.FieldMetaData("d_name", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.D_STREET_1, new org.apache.thrift.meta_data.FieldMetaData("d_street_1", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.D_STREET_2, new org.apache.thrift.meta_data.FieldMetaData("d_street_2", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.D_CITY, new org.apache.thrift.meta_data.FieldMetaData("d_city", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.D_STATE, new org.apache.thrift.meta_data.FieldMetaData("d_state", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.D_ZIP, new org.apache.thrift.meta_data.FieldMetaData("d_zip", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.D_TAX, new org.apache.thrift.meta_data.FieldMetaData("d_tax", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE))); tmpMap.put(_Fields.D_YTD, new org.apache.thrift.meta_data.FieldMetaData("d_ytd", 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(DistrictRow.class, metaDataMap); } public DistrictRow() { } public DistrictRow( String d_name, String d_street_1, String d_street_2, String d_city, String d_state, String d_zip, double d_tax, double d_ytd) { this(); this.d_name = d_name; this.d_street_1 = d_street_1; this.d_street_2 = d_street_2; this.d_city = d_city; this.d_state = d_state; this.d_zip = d_zip; this.d_tax = d_tax; setD_taxIsSet(true); this.d_ytd = d_ytd; setD_ytdIsSet(true); } /** * Performs a deep copy on <i>other</i>. */ public DistrictRow(DistrictRow other) { __isset_bitfield = other.__isset_bitfield; if (other.isSetD_name()) { this.d_name = other.d_name; } if (other.isSetD_street_1()) { this.d_street_1 = other.d_street_1; } if (other.isSetD_street_2()) { this.d_street_2 = other.d_street_2; } if (other.isSetD_city()) { this.d_city = other.d_city; } if (other.isSetD_state()) { this.d_state = other.d_state; } if (other.isSetD_zip()) { this.d_zip = other.d_zip; } this.d_tax = other.d_tax; this.d_ytd = other.d_ytd; } public DistrictRow deepCopy() { return new DistrictRow(this); } @Override public void clear() { this.d_name = null; this.d_street_1 = null; this.d_street_2 = null; this.d_city = null; this.d_state = null; this.d_zip = null; setD_taxIsSet(false); this.d_tax = 0.0; setD_ytdIsSet(false); this.d_ytd = 0.0; } public String getD_name() { return this.d_name; } public DistrictRow setD_name(String d_name) { this.d_name = d_name; return this; } public void unsetD_name() { this.d_name = null; } /** Returns true if field d_name is set (has been assigned a value) and false otherwise */ public boolean isSetD_name() { return this.d_name != null; } public void setD_nameIsSet(boolean value) { if (!value) { this.d_name = null; } } public String getD_street_1() { return this.d_street_1; } public DistrictRow setD_street_1(String d_street_1) { this.d_street_1 = d_street_1; return this; } public void unsetD_street_1() { this.d_street_1 = null; } /** Returns true if field d_street_1 is set (has been assigned a value) and false otherwise */ public boolean isSetD_street_1() { return this.d_street_1 != null; } public void setD_street_1IsSet(boolean value) { if (!value) { this.d_street_1 = null; } } public String getD_street_2() { return this.d_street_2; } public DistrictRow setD_street_2(String d_street_2) { this.d_street_2 = d_street_2; return this; } public void unsetD_street_2() { this.d_street_2 = null; } /** Returns true if field d_street_2 is set (has been assigned a value) and false otherwise */ public boolean isSetD_street_2() { return this.d_street_2 != null; } public void setD_street_2IsSet(boolean value) { if (!value) { this.d_street_2 = null; } } public String getD_city() { return this.d_city; } public DistrictRow setD_city(String d_city) { this.d_city = d_city; return this; } public void unsetD_city() { this.d_city = null; } /** Returns true if field d_city is set (has been assigned a value) and false otherwise */ public boolean isSetD_city() { return this.d_city != null; } public void setD_cityIsSet(boolean value) { if (!value) { this.d_city = null; } } public String getD_state() { return this.d_state; } public DistrictRow setD_state(String d_state) { this.d_state = d_state; return this; } public void unsetD_state() { this.d_state = null; } /** Returns true if field d_state is set (has been assigned a value) and false otherwise */ public boolean isSetD_state() { return this.d_state != null; } public void setD_stateIsSet(boolean value) { if (!value) { this.d_state = null; } } public String getD_zip() { return this.d_zip; } public DistrictRow setD_zip(String d_zip) { this.d_zip = d_zip; return this; } public void unsetD_zip() { this.d_zip = null; } /** Returns true if field d_zip is set (has been assigned a value) and false otherwise */ public boolean isSetD_zip() { return this.d_zip != null; } public void setD_zipIsSet(boolean value) { if (!value) { this.d_zip = null; } } public double getD_tax() { return this.d_tax; } public DistrictRow setD_tax(double d_tax) { this.d_tax = d_tax; setD_taxIsSet(true); return this; } public void unsetD_tax() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __D_TAX_ISSET_ID); } /** Returns true if field d_tax is set (has been assigned a value) and false otherwise */ public boolean isSetD_tax() { return EncodingUtils.testBit(__isset_bitfield, __D_TAX_ISSET_ID); } public void setD_taxIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __D_TAX_ISSET_ID, value); } public double getD_ytd() { return this.d_ytd; } public DistrictRow setD_ytd(double d_ytd) { this.d_ytd = d_ytd; setD_ytdIsSet(true); return this; } public void unsetD_ytd() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __D_YTD_ISSET_ID); } /** Returns true if field d_ytd is set (has been assigned a value) and false otherwise */ public boolean isSetD_ytd() { return EncodingUtils.testBit(__isset_bitfield, __D_YTD_ISSET_ID); } public void setD_ytdIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __D_YTD_ISSET_ID, value); } public void setFieldValue(_Fields field, Object value) { switch (field) { case D_NAME: if (value == null) { unsetD_name(); } else { setD_name((String)value); } break; case D_STREET_1: if (value == null) { unsetD_street_1(); } else { setD_street_1((String)value); } break; case D_STREET_2: if (value == null) { unsetD_street_2(); } else { setD_street_2((String)value); } break; case D_CITY: if (value == null) { unsetD_city(); } else { setD_city((String)value); } break; case D_STATE: if (value == null) { unsetD_state(); } else { setD_state((String)value); } break; case D_ZIP: if (value == null) { unsetD_zip(); } else { setD_zip((String)value); } break; case D_TAX: if (value == null) { unsetD_tax(); } else { setD_tax((Double)value); } break; case D_YTD: if (value == null) { unsetD_ytd(); } else { setD_ytd((Double)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case D_NAME: return getD_name(); case D_STREET_1: return getD_street_1(); case D_STREET_2: return getD_street_2(); case D_CITY: return getD_city(); case D_STATE: return getD_state(); case D_ZIP: return getD_zip(); case D_TAX: return Double.valueOf(getD_tax()); case D_YTD: return Double.valueOf(getD_ytd()); } 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 D_NAME: return isSetD_name(); case D_STREET_1: return isSetD_street_1(); case D_STREET_2: return isSetD_street_2(); case D_CITY: return isSetD_city(); case D_STATE: return isSetD_state(); case D_ZIP: return isSetD_zip(); case D_TAX: return isSetD_tax(); case D_YTD: return isSetD_ytd(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof DistrictRow) return this.equals((DistrictRow)that); return false; } public boolean equals(DistrictRow that) { if (that == null) return false; boolean this_present_d_name = true && this.isSetD_name(); boolean that_present_d_name = true && that.isSetD_name(); if (this_present_d_name || that_present_d_name) { if (!(this_present_d_name && that_present_d_name)) return false; if (!this.d_name.equals(that.d_name)) return false; } boolean this_present_d_street_1 = true && this.isSetD_street_1(); boolean that_present_d_street_1 = true && that.isSetD_street_1(); if (this_present_d_street_1 || that_present_d_street_1) { if (!(this_present_d_street_1 && that_present_d_street_1)) return false; if (!this.d_street_1.equals(that.d_street_1)) return false; } boolean this_present_d_street_2 = true && this.isSetD_street_2(); boolean that_present_d_street_2 = true && that.isSetD_street_2(); if (this_present_d_street_2 || that_present_d_street_2) { if (!(this_present_d_street_2 && that_present_d_street_2)) return false; if (!this.d_street_2.equals(that.d_street_2)) return false; } boolean this_present_d_city = true && this.isSetD_city(); boolean that_present_d_city = true && that.isSetD_city(); if (this_present_d_city || that_present_d_city) { if (!(this_present_d_city && that_present_d_city)) return false; if (!this.d_city.equals(that.d_city)) return false; } boolean this_present_d_state = true && this.isSetD_state(); boolean that_present_d_state = true && that.isSetD_state(); if (this_present_d_state || that_present_d_state) { if (!(this_present_d_state && that_present_d_state)) return false; if (!this.d_state.equals(that.d_state)) return false; } boolean this_present_d_zip = true && this.isSetD_zip(); boolean that_present_d_zip = true && that.isSetD_zip(); if (this_present_d_zip || that_present_d_zip) { if (!(this_present_d_zip && that_present_d_zip)) return false; if (!this.d_zip.equals(that.d_zip)) return false; } boolean this_present_d_tax = true; boolean that_present_d_tax = true; if (this_present_d_tax || that_present_d_tax) { if (!(this_present_d_tax && that_present_d_tax)) return false; if (this.d_tax != that.d_tax) return false; } boolean this_present_d_ytd = true; boolean that_present_d_ytd = true; if (this_present_d_ytd || that_present_d_ytd) { if (!(this_present_d_ytd && that_present_d_ytd)) return false; if (this.d_ytd != that.d_ytd) return false; } return true; } @Override public int hashCode() { return 0; } public int compareTo(DistrictRow other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; DistrictRow typedOther = (DistrictRow)other; lastComparison = Boolean.valueOf(isSetD_name()).compareTo(typedOther.isSetD_name()); if (lastComparison != 0) { return lastComparison; } if (isSetD_name()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.d_name, typedOther.d_name); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetD_street_1()).compareTo(typedOther.isSetD_street_1()); if (lastComparison != 0) { return lastComparison; } if (isSetD_street_1()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.d_street_1, typedOther.d_street_1); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetD_street_2()).compareTo(typedOther.isSetD_street_2()); if (lastComparison != 0) { return lastComparison; } if (isSetD_street_2()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.d_street_2, typedOther.d_street_2); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetD_city()).compareTo(typedOther.isSetD_city()); if (lastComparison != 0) { return lastComparison; } if (isSetD_city()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.d_city, typedOther.d_city); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetD_state()).compareTo(typedOther.isSetD_state()); if (lastComparison != 0) { return lastComparison; } if (isSetD_state()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.d_state, typedOther.d_state); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetD_zip()).compareTo(typedOther.isSetD_zip()); if (lastComparison != 0) { return lastComparison; } if (isSetD_zip()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.d_zip, typedOther.d_zip); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetD_tax()).compareTo(typedOther.isSetD_tax()); if (lastComparison != 0) { return lastComparison; } if (isSetD_tax()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.d_tax, typedOther.d_tax); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetD_ytd()).compareTo(typedOther.isSetD_ytd()); if (lastComparison != 0) { return lastComparison; } if (isSetD_ytd()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.d_ytd, typedOther.d_ytd); 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("DistrictRow("); boolean first = true; sb.append("d_name:"); if (this.d_name == null) { sb.append("null"); } else { sb.append(this.d_name); } first = false; if (!first) sb.append(", "); sb.append("d_street_1:"); if (this.d_street_1 == null) { sb.append("null"); } else { sb.append(this.d_street_1); } first = false; if (!first) sb.append(", "); sb.append("d_street_2:"); if (this.d_street_2 == null) { sb.append("null"); } else { sb.append(this.d_street_2); } first = false; if (!first) sb.append(", "); sb.append("d_city:"); if (this.d_city == null) { sb.append("null"); } else { sb.append(this.d_city); } first = false; if (!first) sb.append(", "); sb.append("d_state:"); if (this.d_state == null) { sb.append("null"); } else { sb.append(this.d_state); } first = false; if (!first) sb.append(", "); sb.append("d_zip:"); if (this.d_zip == null) { sb.append("null"); } else { sb.append(this.d_zip); } first = false; if (!first) sb.append(", "); sb.append("d_tax:"); sb.append(this.d_tax); first = false; if (!first) sb.append(", "); sb.append("d_ytd:"); sb.append(this.d_ytd); 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 DistrictRowStandardSchemeFactory implements SchemeFactory { public DistrictRowStandardScheme getScheme() { return new DistrictRowStandardScheme(); } } private static class DistrictRowStandardScheme extends StandardScheme<DistrictRow> { public void read(org.apache.thrift.protocol.TProtocol iprot, DistrictRow 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: // D_NAME if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.d_name = iprot.readString(); struct.setD_nameIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // D_STREET_1 if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.d_street_1 = iprot.readString(); struct.setD_street_1IsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // D_STREET_2 if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.d_street_2 = iprot.readString(); struct.setD_street_2IsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 4: // D_CITY if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.d_city = iprot.readString(); struct.setD_cityIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 5: // D_STATE if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.d_state = iprot.readString(); struct.setD_stateIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 6: // D_ZIP if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.d_zip = iprot.readString(); struct.setD_zipIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 7: // D_TAX if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) { struct.d_tax = iprot.readDouble(); struct.setD_taxIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 8: // D_YTD if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) { struct.d_ytd = iprot.readDouble(); struct.setD_ytdIsSet(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, DistrictRow struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.d_name != null) { oprot.writeFieldBegin(D_NAME_FIELD_DESC); oprot.writeString(struct.d_name); oprot.writeFieldEnd(); } if (struct.d_street_1 != null) { oprot.writeFieldBegin(D_STREET_1_FIELD_DESC); oprot.writeString(struct.d_street_1); oprot.writeFieldEnd(); } if (struct.d_street_2 != null) { oprot.writeFieldBegin(D_STREET_2_FIELD_DESC); oprot.writeString(struct.d_street_2); oprot.writeFieldEnd(); } if (struct.d_city != null) { oprot.writeFieldBegin(D_CITY_FIELD_DESC); oprot.writeString(struct.d_city); oprot.writeFieldEnd(); } if (struct.d_state != null) { oprot.writeFieldBegin(D_STATE_FIELD_DESC); oprot.writeString(struct.d_state); oprot.writeFieldEnd(); } if (struct.d_zip != null) { oprot.writeFieldBegin(D_ZIP_FIELD_DESC); oprot.writeString(struct.d_zip); oprot.writeFieldEnd(); } oprot.writeFieldBegin(D_TAX_FIELD_DESC); oprot.writeDouble(struct.d_tax); oprot.writeFieldEnd(); oprot.writeFieldBegin(D_YTD_FIELD_DESC); oprot.writeDouble(struct.d_ytd); oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class DistrictRowTupleSchemeFactory implements SchemeFactory { public DistrictRowTupleScheme getScheme() { return new DistrictRowTupleScheme(); } } private static class DistrictRowTupleScheme extends TupleScheme<DistrictRow> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, DistrictRow struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetD_name()) { optionals.set(0); } if (struct.isSetD_street_1()) { optionals.set(1); } if (struct.isSetD_street_2()) { optionals.set(2); } if (struct.isSetD_city()) { optionals.set(3); } if (struct.isSetD_state()) { optionals.set(4); } if (struct.isSetD_zip()) { optionals.set(5); } if (struct.isSetD_tax()) { optionals.set(6); } if (struct.isSetD_ytd()) { optionals.set(7); } oprot.writeBitSet(optionals, 8); if (struct.isSetD_name()) { oprot.writeString(struct.d_name); } if (struct.isSetD_street_1()) { oprot.writeString(struct.d_street_1); } if (struct.isSetD_street_2()) { oprot.writeString(struct.d_street_2); } if (struct.isSetD_city()) { oprot.writeString(struct.d_city); } if (struct.isSetD_state()) { oprot.writeString(struct.d_state); } if (struct.isSetD_zip()) { oprot.writeString(struct.d_zip); } if (struct.isSetD_tax()) { oprot.writeDouble(struct.d_tax); } if (struct.isSetD_ytd()) { oprot.writeDouble(struct.d_ytd); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, DistrictRow struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(8); if (incoming.get(0)) { struct.d_name = iprot.readString(); struct.setD_nameIsSet(true); } if (incoming.get(1)) { struct.d_street_1 = iprot.readString(); struct.setD_street_1IsSet(true); } if (incoming.get(2)) { struct.d_street_2 = iprot.readString(); struct.setD_street_2IsSet(true); } if (incoming.get(3)) { struct.d_city = iprot.readString(); struct.setD_cityIsSet(true); } if (incoming.get(4)) { struct.d_state = iprot.readString(); struct.setD_stateIsSet(true); } if (incoming.get(5)) { struct.d_zip = iprot.readString(); struct.setD_zipIsSet(true); } if (incoming.get(6)) { struct.d_tax = iprot.readDouble(); struct.setD_taxIsSet(true); } if (incoming.get(7)) { struct.d_ytd = iprot.readDouble(); struct.setD_ytdIsSet(true); } } } }