- public Object toSerializable(){
- if(normalizedNode != null) {
- return ShardTransactionMessages.ReadDataReply.newBuilder()
- .setNormalizedNode(new NormalizedNodeToNodeCodec(schemaContext)
- .encode(normalizedNode).getNormalizedNode()).build();
- } else {
- return ShardTransactionMessages.ReadDataReply.newBuilder().build();
-
- }
+ public void readExternal(final ObjectInput in) throws IOException, ClassNotFoundException {
+ super.readExternal(in);
+ normalizedNode = SerializationUtils.readNormalizedNode(in).orElse(null);
+ }
+
+ @Override
+ public void writeExternal(final ObjectOutput out) throws IOException {
+ super.writeExternal(out);
+ SerializationUtils.writeNormalizedNode(out, getStreamVersion(), normalizedNode);