- public DataContainerCodecContext<?,?> bindingPathArgumentChild(final InstanceIdentifier.PathArgument arg,
- final List<YangInstanceIdentifier.PathArgument> builder) {
-
- final Class<? extends DataObject> argType = arg.getType();
- DataContainerCodecPrototype<?> ctxProto = byBindingArgClass.get(argType);
- if (ctxProto == null && Augmentation.class.isAssignableFrom(argType)) {
- ctxProto = augmentationByClass(argType);
- }
- final DataContainerCodecContext<?, ?> context = childNonNull(ctxProto, argType,
- "Class %s is not valid child of %s", argType, getBindingClass()).get();
- if (context instanceof ChoiceNodeCodecContext) {
- final ChoiceNodeCodecContext<?> choice = (ChoiceNodeCodecContext<?>) context;
- choice.addYangPathArgument(arg, builder);
-
- final Optional<? extends Class<? extends DataObject>> caseType = arg.getCaseType();
- final Class<? extends DataObject> type = arg.getType();
- final DataContainerCodecContext<?, ?> caze;
- if (caseType.isPresent()) {
- // Non-ambiguous addressing this should not pose any problems
- caze = choice.streamChild(caseType.get());
- } else {
- caze = choice.getCaseByChildClass(type);
- }
-
- caze.addYangPathArgument(arg, builder);
- return caze.bindingPathArgumentChild(arg, builder);
+ final DataContainerPrototype<?, ?> streamChildPrototype(final Class<?> childClass) {
+ final var child = super.streamChildPrototype(childClass);
+ if (child == null && Augmentation.class.isAssignableFrom(childClass)) {
+ return getAugmentationProtoByClass(childClass);