public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField field; iprot.readStructBegin(); while (true) { field = iprot.readFieldBegin(); if (field.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (field.id) { case 1: // START if (field.type == org.apache.thrift.protocol.TType.STRING) { this.start = iprot.readBinary(); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); } break; case 2: // FINISH if (field.type == org.apache.thrift.protocol.TType.STRING) { this.finish = iprot.readBinary(); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); } break; case 3: // REVERSED if (field.type == org.apache.thrift.protocol.TType.BOOL) { this.reversed = iprot.readBool(); setReversedIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); } break; case 4: // COUNT if (field.type == org.apache.thrift.protocol.TType.I32) { this.count = iprot.readI32(); setCountIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method if (!isSetReversed()) { throw new org.apache.thrift.protocol.TProtocolException( "Required field 'reversed' was not found in serialized data! Struct: " + toString()); } if (!isSetCount()) { throw new org.apache.thrift.protocol.TProtocolException( "Required field 'count' was not found in serialized data! Struct: " + toString()); } validate(); }
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { validate(); oprot.writeStructBegin(STRUCT_DESC); if (this.start != null) { oprot.writeFieldBegin(START_FIELD_DESC); oprot.writeBinary(this.start); oprot.writeFieldEnd(); } if (this.finish != null) { oprot.writeFieldBegin(FINISH_FIELD_DESC); oprot.writeBinary(this.finish); oprot.writeFieldEnd(); } oprot.writeFieldBegin(REVERSED_FIELD_DESC); oprot.writeBool(this.reversed); oprot.writeFieldEnd(); oprot.writeFieldBegin(COUNT_FIELD_DESC); oprot.writeI32(this.count); oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); }