+ /**
+ * Result of a {@link BindingNormalizedNodeSerializer#toNormalizedNode(InstanceIdentifier, DataObject)}. Since the
+ * Binding {@link Augmentation} does not have an exact equivalent, there are two specializations of this class:
+ * {@link NodeResult} and {@link AugmentationResult}.
+ */
+ sealed interface NormalizedResult {
+ /**
+ * Return the {@link YangInstanceIdentifier} path of this result.
+ *
+ * @return A {@link YangInstanceIdentifier}
+ */
+ @NonNull YangInstanceIdentifier path();
+ }
+
+ /**
+ * A {@link NormalizedResult} for an {@link Augmentation}.
+ *
+ * @param path A YangInstanceIdentifier identifying the parent of this augmentation
+ * @param possibleChildren {@link NodeIdentifier}s of each possible child
+ * @param children Augmentation children
+ */
+ record AugmentationResult(
+ @NonNull YangInstanceIdentifier path,
+ @NonNull ImmutableSet<NodeIdentifier> possibleChildren,
+ @NonNull ImmutableList<DataContainerChild> children) implements NormalizedResult {
+ public AugmentationResult {
+ requireNonNull(path);
+ requireNonNull(possibleChildren);
+ requireNonNull(children);
+ }
+ }
+
+ record NodeResult(@NonNull YangInstanceIdentifier path, @NonNull NormalizedNode node) implements NormalizedResult {
+ public NodeResult {
+ requireNonNull(path);
+ requireNonNull(node);
+ }
+ }
+