/**
* 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 OrderLineRow implements org.apache.thrift.TBase<OrderLineRow, OrderLineRow._Fields>, java.io.Serializable, Cloneable {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("OrderLineRow");
private static final org.apache.thrift.protocol.TField OL_SUPPLY_W_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("ol_supply_w_id", org.apache.thrift.protocol.TType.I32, (short)3);
private static final org.apache.thrift.protocol.TField OL_DELIVERY_D_FIELD_DESC = new org.apache.thrift.protocol.TField("ol_delivery_d", org.apache.thrift.protocol.TType.STRING, (short)4);
private static final org.apache.thrift.protocol.TField OL_QUANTITY_FIELD_DESC = new org.apache.thrift.protocol.TField("ol_quantity", org.apache.thrift.protocol.TType.I16, (short)5);
private static final org.apache.thrift.protocol.TField OL_AMOUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("ol_amount", org.apache.thrift.protocol.TType.DOUBLE, (short)6);
private static final org.apache.thrift.protocol.TField OL_DIST_INFO_FIELD_DESC = new org.apache.thrift.protocol.TField("ol_dist_info", org.apache.thrift.protocol.TType.STRING, (short)7);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new OrderLineRowStandardSchemeFactory());
schemes.put(TupleScheme.class, new OrderLineRowTupleSchemeFactory());
}
public int ol_supply_w_id; // required
public String ol_delivery_d; // required
public short ol_quantity; // required
public double ol_amount; // required
public String ol_dist_info; // 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 {
OL_SUPPLY_W_ID((short)3, "ol_supply_w_id"),
OL_DELIVERY_D((short)4, "ol_delivery_d"),
OL_QUANTITY((short)5, "ol_quantity"),
OL_AMOUNT((short)6, "ol_amount"),
OL_DIST_INFO((short)7, "ol_dist_info");
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 3: // OL_SUPPLY_W_ID
return OL_SUPPLY_W_ID;
case 4: // OL_DELIVERY_D
return OL_DELIVERY_D;
case 5: // OL_QUANTITY
return OL_QUANTITY;
case 6: // OL_AMOUNT
return OL_AMOUNT;
case 7: // OL_DIST_INFO
return OL_DIST_INFO;
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 __OL_SUPPLY_W_ID_ISSET_ID = 0;
private static final int __OL_QUANTITY_ISSET_ID = 1;
private static final int __OL_AMOUNT_ISSET_ID = 2;
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.OL_SUPPLY_W_ID, new org.apache.thrift.meta_data.FieldMetaData("ol_supply_w_id", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
tmpMap.put(_Fields.OL_DELIVERY_D, new org.apache.thrift.meta_data.FieldMetaData("ol_delivery_d", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.OL_QUANTITY, new org.apache.thrift.meta_data.FieldMetaData("ol_quantity", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I16)));
tmpMap.put(_Fields.OL_AMOUNT, new org.apache.thrift.meta_data.FieldMetaData("ol_amount", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
tmpMap.put(_Fields.OL_DIST_INFO, new org.apache.thrift.meta_data.FieldMetaData("ol_dist_info", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(OrderLineRow.class, metaDataMap);
}
public OrderLineRow() {
}
public OrderLineRow(
int ol_supply_w_id,
String ol_delivery_d,
short ol_quantity,
double ol_amount,
String ol_dist_info)
{
this();
this.ol_supply_w_id = ol_supply_w_id;
setOl_supply_w_idIsSet(true);
this.ol_delivery_d = ol_delivery_d;
this.ol_quantity = ol_quantity;
setOl_quantityIsSet(true);
this.ol_amount = ol_amount;
setOl_amountIsSet(true);
this.ol_dist_info = ol_dist_info;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public OrderLineRow(OrderLineRow other) {
__isset_bitfield = other.__isset_bitfield;
this.ol_supply_w_id = other.ol_supply_w_id;
if (other.isSetOl_delivery_d()) {
this.ol_delivery_d = other.ol_delivery_d;
}
this.ol_quantity = other.ol_quantity;
this.ol_amount = other.ol_amount;
if (other.isSetOl_dist_info()) {
this.ol_dist_info = other.ol_dist_info;
}
}
public OrderLineRow deepCopy() {
return new OrderLineRow(this);
}
@Override
public void clear() {
setOl_supply_w_idIsSet(false);
this.ol_supply_w_id = 0;
this.ol_delivery_d = null;
setOl_quantityIsSet(false);
this.ol_quantity = 0;
setOl_amountIsSet(false);
this.ol_amount = 0.0;
this.ol_dist_info = null;
}
public int getOl_supply_w_id() {
return this.ol_supply_w_id;
}
public OrderLineRow setOl_supply_w_id(int ol_supply_w_id) {
this.ol_supply_w_id = ol_supply_w_id;
setOl_supply_w_idIsSet(true);
return this;
}
public void unsetOl_supply_w_id() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __OL_SUPPLY_W_ID_ISSET_ID);
}
/** Returns true if field ol_supply_w_id is set (has been assigned a value) and false otherwise */
public boolean isSetOl_supply_w_id() {
return EncodingUtils.testBit(__isset_bitfield, __OL_SUPPLY_W_ID_ISSET_ID);
}
public void setOl_supply_w_idIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __OL_SUPPLY_W_ID_ISSET_ID, value);
}
public String getOl_delivery_d() {
return this.ol_delivery_d;
}
public OrderLineRow setOl_delivery_d(String ol_delivery_d) {
this.ol_delivery_d = ol_delivery_d;
return this;
}
public void unsetOl_delivery_d() {
this.ol_delivery_d = null;
}
/** Returns true if field ol_delivery_d is set (has been assigned a value) and false otherwise */
public boolean isSetOl_delivery_d() {
return this.ol_delivery_d != null;
}
public void setOl_delivery_dIsSet(boolean value) {
if (!value) {
this.ol_delivery_d = null;
}
}
public short getOl_quantity() {
return this.ol_quantity;
}
public OrderLineRow setOl_quantity(short ol_quantity) {
this.ol_quantity = ol_quantity;
setOl_quantityIsSet(true);
return this;
}
public void unsetOl_quantity() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __OL_QUANTITY_ISSET_ID);
}
/** Returns true if field ol_quantity is set (has been assigned a value) and false otherwise */
public boolean isSetOl_quantity() {
return EncodingUtils.testBit(__isset_bitfield, __OL_QUANTITY_ISSET_ID);
}
public void setOl_quantityIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __OL_QUANTITY_ISSET_ID, value);
}
public double getOl_amount() {
return this.ol_amount;
}
public OrderLineRow setOl_amount(double ol_amount) {
this.ol_amount = ol_amount;
setOl_amountIsSet(true);
return this;
}
public void unsetOl_amount() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __OL_AMOUNT_ISSET_ID);
}
/** Returns true if field ol_amount is set (has been assigned a value) and false otherwise */
public boolean isSetOl_amount() {
return EncodingUtils.testBit(__isset_bitfield, __OL_AMOUNT_ISSET_ID);
}
public void setOl_amountIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __OL_AMOUNT_ISSET_ID, value);
}
public String getOl_dist_info() {
return this.ol_dist_info;
}
public OrderLineRow setOl_dist_info(String ol_dist_info) {
this.ol_dist_info = ol_dist_info;
return this;
}
public void unsetOl_dist_info() {
this.ol_dist_info = null;
}
/** Returns true if field ol_dist_info is set (has been assigned a value) and false otherwise */
public boolean isSetOl_dist_info() {
return this.ol_dist_info != null;
}
public void setOl_dist_infoIsSet(boolean value) {
if (!value) {
this.ol_dist_info = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case OL_SUPPLY_W_ID:
if (value == null) {
unsetOl_supply_w_id();
} else {
setOl_supply_w_id((Integer)value);
}
break;
case OL_DELIVERY_D:
if (value == null) {
unsetOl_delivery_d();
} else {
setOl_delivery_d((String)value);
}
break;
case OL_QUANTITY:
if (value == null) {
unsetOl_quantity();
} else {
setOl_quantity((Short)value);
}
break;
case OL_AMOUNT:
if (value == null) {
unsetOl_amount();
} else {
setOl_amount((Double)value);
}
break;
case OL_DIST_INFO:
if (value == null) {
unsetOl_dist_info();
} else {
setOl_dist_info((String)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case OL_SUPPLY_W_ID:
return Integer.valueOf(getOl_supply_w_id());
case OL_DELIVERY_D:
return getOl_delivery_d();
case OL_QUANTITY:
return Short.valueOf(getOl_quantity());
case OL_AMOUNT:
return Double.valueOf(getOl_amount());
case OL_DIST_INFO:
return getOl_dist_info();
}
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 OL_SUPPLY_W_ID:
return isSetOl_supply_w_id();
case OL_DELIVERY_D:
return isSetOl_delivery_d();
case OL_QUANTITY:
return isSetOl_quantity();
case OL_AMOUNT:
return isSetOl_amount();
case OL_DIST_INFO:
return isSetOl_dist_info();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof OrderLineRow)
return this.equals((OrderLineRow)that);
return false;
}
public boolean equals(OrderLineRow that) {
if (that == null)
return false;
boolean this_present_ol_supply_w_id = true;
boolean that_present_ol_supply_w_id = true;
if (this_present_ol_supply_w_id || that_present_ol_supply_w_id) {
if (!(this_present_ol_supply_w_id && that_present_ol_supply_w_id))
return false;
if (this.ol_supply_w_id != that.ol_supply_w_id)
return false;
}
boolean this_present_ol_delivery_d = true && this.isSetOl_delivery_d();
boolean that_present_ol_delivery_d = true && that.isSetOl_delivery_d();
if (this_present_ol_delivery_d || that_present_ol_delivery_d) {
if (!(this_present_ol_delivery_d && that_present_ol_delivery_d))
return false;
if (!this.ol_delivery_d.equals(that.ol_delivery_d))
return false;
}
boolean this_present_ol_quantity = true;
boolean that_present_ol_quantity = true;
if (this_present_ol_quantity || that_present_ol_quantity) {
if (!(this_present_ol_quantity && that_present_ol_quantity))
return false;
if (this.ol_quantity != that.ol_quantity)
return false;
}
boolean this_present_ol_amount = true;
boolean that_present_ol_amount = true;
if (this_present_ol_amount || that_present_ol_amount) {
if (!(this_present_ol_amount && that_present_ol_amount))
return false;
if (this.ol_amount != that.ol_amount)
return false;
}
boolean this_present_ol_dist_info = true && this.isSetOl_dist_info();
boolean that_present_ol_dist_info = true && that.isSetOl_dist_info();
if (this_present_ol_dist_info || that_present_ol_dist_info) {
if (!(this_present_ol_dist_info && that_present_ol_dist_info))
return false;
if (!this.ol_dist_info.equals(that.ol_dist_info))
return false;
}
return true;
}
@Override
public int hashCode() {
return 0;
}
public int compareTo(OrderLineRow other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
OrderLineRow typedOther = (OrderLineRow)other;
lastComparison = Boolean.valueOf(isSetOl_supply_w_id()).compareTo(typedOther.isSetOl_supply_w_id());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetOl_supply_w_id()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ol_supply_w_id, typedOther.ol_supply_w_id);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetOl_delivery_d()).compareTo(typedOther.isSetOl_delivery_d());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetOl_delivery_d()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ol_delivery_d, typedOther.ol_delivery_d);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetOl_quantity()).compareTo(typedOther.isSetOl_quantity());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetOl_quantity()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ol_quantity, typedOther.ol_quantity);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetOl_amount()).compareTo(typedOther.isSetOl_amount());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetOl_amount()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ol_amount, typedOther.ol_amount);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetOl_dist_info()).compareTo(typedOther.isSetOl_dist_info());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetOl_dist_info()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ol_dist_info, typedOther.ol_dist_info);
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("OrderLineRow(");
boolean first = true;
sb.append("ol_supply_w_id:");
sb.append(this.ol_supply_w_id);
first = false;
if (!first) sb.append(", ");
sb.append("ol_delivery_d:");
if (this.ol_delivery_d == null) {
sb.append("null");
} else {
sb.append(this.ol_delivery_d);
}
first = false;
if (!first) sb.append(", ");
sb.append("ol_quantity:");
sb.append(this.ol_quantity);
first = false;
if (!first) sb.append(", ");
sb.append("ol_amount:");
sb.append(this.ol_amount);
first = false;
if (!first) sb.append(", ");
sb.append("ol_dist_info:");
if (this.ol_dist_info == null) {
sb.append("null");
} else {
sb.append(this.ol_dist_info);
}
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 OrderLineRowStandardSchemeFactory implements SchemeFactory {
public OrderLineRowStandardScheme getScheme() {
return new OrderLineRowStandardScheme();
}
}
private static class OrderLineRowStandardScheme extends StandardScheme<OrderLineRow> {
public void read(org.apache.thrift.protocol.TProtocol iprot, OrderLineRow 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 3: // OL_SUPPLY_W_ID
if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
struct.ol_supply_w_id = iprot.readI32();
struct.setOl_supply_w_idIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 4: // OL_DELIVERY_D
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.ol_delivery_d = iprot.readString();
struct.setOl_delivery_dIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 5: // OL_QUANTITY
if (schemeField.type == org.apache.thrift.protocol.TType.I16) {
struct.ol_quantity = iprot.readI16();
struct.setOl_quantityIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 6: // OL_AMOUNT
if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) {
struct.ol_amount = iprot.readDouble();
struct.setOl_amountIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 7: // OL_DIST_INFO
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.ol_dist_info = iprot.readString();
struct.setOl_dist_infoIsSet(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, OrderLineRow struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
oprot.writeFieldBegin(OL_SUPPLY_W_ID_FIELD_DESC);
oprot.writeI32(struct.ol_supply_w_id);
oprot.writeFieldEnd();
if (struct.ol_delivery_d != null) {
oprot.writeFieldBegin(OL_DELIVERY_D_FIELD_DESC);
oprot.writeString(struct.ol_delivery_d);
oprot.writeFieldEnd();
}
oprot.writeFieldBegin(OL_QUANTITY_FIELD_DESC);
oprot.writeI16(struct.ol_quantity);
oprot.writeFieldEnd();
oprot.writeFieldBegin(OL_AMOUNT_FIELD_DESC);
oprot.writeDouble(struct.ol_amount);
oprot.writeFieldEnd();
if (struct.ol_dist_info != null) {
oprot.writeFieldBegin(OL_DIST_INFO_FIELD_DESC);
oprot.writeString(struct.ol_dist_info);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class OrderLineRowTupleSchemeFactory implements SchemeFactory {
public OrderLineRowTupleScheme getScheme() {
return new OrderLineRowTupleScheme();
}
}
private static class OrderLineRowTupleScheme extends TupleScheme<OrderLineRow> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, OrderLineRow struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetOl_supply_w_id()) {
optionals.set(0);
}
if (struct.isSetOl_delivery_d()) {
optionals.set(1);
}
if (struct.isSetOl_quantity()) {
optionals.set(2);
}
if (struct.isSetOl_amount()) {
optionals.set(3);
}
if (struct.isSetOl_dist_info()) {
optionals.set(4);
}
oprot.writeBitSet(optionals, 5);
if (struct.isSetOl_supply_w_id()) {
oprot.writeI32(struct.ol_supply_w_id);
}
if (struct.isSetOl_delivery_d()) {
oprot.writeString(struct.ol_delivery_d);
}
if (struct.isSetOl_quantity()) {
oprot.writeI16(struct.ol_quantity);
}
if (struct.isSetOl_amount()) {
oprot.writeDouble(struct.ol_amount);
}
if (struct.isSetOl_dist_info()) {
oprot.writeString(struct.ol_dist_info);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, OrderLineRow struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(5);
if (incoming.get(0)) {
struct.ol_supply_w_id = iprot.readI32();
struct.setOl_supply_w_idIsSet(true);
}
if (incoming.get(1)) {
struct.ol_delivery_d = iprot.readString();
struct.setOl_delivery_dIsSet(true);
}
if (incoming.get(2)) {
struct.ol_quantity = iprot.readI16();
struct.setOl_quantityIsSet(true);
}
if (incoming.get(3)) {
struct.ol_amount = iprot.readDouble();
struct.setOl_amountIsSet(true);
}
if (incoming.get(4)) {
struct.ol_dist_info = iprot.readString();
struct.setOl_dist_infoIsSet(true);
}
}
}
}