public void write(org.apache.thrift.protocol.TProtocol oprot, ODSRateOfChangeKeyInfo struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.key != null) { oprot.writeFieldBegin(KEY_FIELD_DESC); oprot.writeString(struct.key); oprot.writeFieldEnd(); } oprot.writeFieldBegin(UNIX_TIME_FIELD_DESC); oprot.writeI64(struct.unixTime); oprot.writeFieldEnd(); oprot.writeFieldBegin(ALLOWABLE_TIME_DIFF_FIELD_DESC); oprot.writeI64(struct.allowable_time_diff); oprot.writeFieldEnd(); oprot.writeFieldBegin(VALUE_FIELD_DESC); oprot.writeI64(struct.value); oprot.writeFieldEnd(); oprot.writeFieldBegin(MIN_RATE_FIELD_DESC); oprot.writeI64(struct.min_rate); oprot.writeFieldEnd(); oprot.writeFieldBegin(MAX_RATE_FIELD_DESC); oprot.writeI64(struct.max_rate); oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); }
public void read(org.apache.thrift.protocol.TProtocol iprot, ODSRateOfChangeKeyInfo 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: // KEY if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.key = iprot.readString(); struct.setKeyIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // UNIX_TIME if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.unixTime = iprot.readI64(); struct.setUnixTimeIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // ALLOWABLE_TIME_DIFF if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.allowable_time_diff = iprot.readI64(); struct.setAllowable_time_diffIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 4: // VALUE if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.value = iprot.readI64(); struct.setValueIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 5: // MIN_RATE if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.min_rate = iprot.readI64(); struct.setMin_rateIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 6: // MAX_RATE if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.max_rate = iprot.readI64(); struct.setMax_rateIsSet(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(); }