- private void readObject(final ObjectInputStream inputStream) throws IOException, ClassNotFoundException {
- inputStream.defaultReadObject();
-
- final FixedYangInstanceIdentifier p = (FixedYangInstanceIdentifier) inputStream.readObject();
- try {
- PARENT_FIELD.set(this, p);
- } catch (IllegalArgumentException | IllegalAccessException e) {
- throw new IOException("Failed to set parent", e);
- }
- }
-
- private void writeObject(final ObjectOutputStream outputStream) throws IOException {
- outputStream.defaultWriteObject();
-
- final FixedYangInstanceIdentifier p;
- if (parent instanceof FixedYangInstanceIdentifier) {
- p = (FixedYangInstanceIdentifier) parent;
- } else {
- p = FixedYangInstanceIdentifier.of(parent.getPathArguments());
- }
- outputStream.writeObject(p);
- }
-