public void write(org.apache.thrift.protocol.TProtocol oprot, DateTime struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldBegin(SECS_SINCE_EPOCH_FIELD_DESC); oprot.writeI64(struct.secsSinceEpoch); oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); }
public void read(org.apache.thrift.protocol.TProtocol iprot, DateTime 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: // SECS_SINCE_EPOCH if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.secsSinceEpoch = iprot.readI64(); struct.setSecsSinceEpochIsSet(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 if (!struct.isSetSecsSinceEpoch()) { throw new org.apache.thrift.protocol.TProtocolException("Required field 'secsSinceEpoch' was not found in serialized data! Struct: " + toString()); } struct.validate(); }
public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity if (decimal_val != null) { decimal_val.validate(); } if (date_val != null) { date_val.validate(); } if (time_val != null) { time_val.validate(); } if (timestamp_val != null) { timestamp_val.validate(); } if (blob_val != null) { blob_val.validate(); } if (clob_val != null) { clob_val.validate(); } if (pdx_val != null) { pdx_val.validate(); } if (json_val != null) { json_val.validate(); } }