- public CommonDataObjectCodecContext<?, ?> bindingPathArgumentChild(final PathArgument arg,
- final List<YangInstanceIdentifier.PathArgument> builder) {
- final var child = getStreamChild(arg.getType());
- child.addYangPathArgument(arg, builder);
- return child;
+ public CodecContext yangPathArgumentChild(final PathArgument arg) {
+ CodecContextSupplier supplier;
+ if (arg instanceof NodeIdentifier nodeId) {
+ supplier = yangChildSupplier(nodeId);
+ } else if (arg instanceof NodeIdentifierWithPredicates nip) {
+ supplier = yangChildSupplier(new NodeIdentifier(nip.getNodeType()));
+ } else {
+ supplier = null;
+ }
+ return childNonNull(supplier, arg, "Argument %s is not valid child of %s", arg, getSchema()).getCodecContext();