- YangInstanceIdentifier path = InstanceIdentifierUtils.fromSerializable(o.getPath());
- NormalizedNode data = new NormalizedNodeToNodeCodec(schemaContext).decode(
- path, o.getData());
+ @Override
+ public byte getType() {
+ return WRITE;
+ }
+
+ @Override
+ public void readExternal(final ObjectInput in) throws IOException {
+ SerializationUtils.readNodeAndPath(in, this, (instance, path, node) -> {
+ instance.setPath(path);
+ instance.data = node;
+ });
+ }
+
+ @Override
+ public void writeExternal(final ObjectOutput out) throws IOException {
+ SerializationUtils.writeNodeAndPath(out, getPath(), data);
+ }
+
+ public static WriteModification fromStream(final NormalizedNodeDataInput in, final short version,
+ final ReusableStreamReceiver receiver) throws IOException {
+ final NormalizedNode<?, ?> node = in.readNormalizedNode(receiver);
+ final YangInstanceIdentifier path = in.readYangInstanceIdentifier();
+ return new WriteModification(version, path, node);
+ }