import org.opendaylight.yangtools.yang.binding.Augmentation;
import org.opendaylight.yangtools.yang.binding.DataContainer;
import org.opendaylight.yangtools.yang.binding.DataObject;
-import org.opendaylight.yangtools.yang.binding.Identifiable;
-import org.opendaylight.yangtools.yang.binding.Identifier;
+import org.opendaylight.yangtools.yang.binding.Key;
+import org.opendaylight.yangtools.yang.binding.KeyAware;
import org.opendaylight.yangtools.yang.binding.OpaqueObject;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
private <T extends YangInstanceIdentifier.PathArgument> T enter(final String localName, final Class<T> identifier) {
final var current = current();
- final var next = ((DataObjectCodecContext<?, ?>) current).getLeafChild(localName);
+ final var next = ((AbstractDataObjectCodecContext<?, ?>) current).getLeafChild(localName);
schema.push(next);
return identifier.cast(next.getDomPathArgument());
}
CodecContext left = schema.pop();
// Due to writer does not start a new node on startCase() and on startAugmentationNode()
// node ending should not be triggered when associated endNode() is invoked.
- if (!(left instanceof CaseNodeCodecContext) && !(left instanceof AugmentationCodecContext)) {
+ if (!(left instanceof CaseCodecContext) && !(left instanceof AugmentationCodecContext)) {
delegate.endNode();
}
}
}
@Override
- public void startMapEntryNode(final Identifier<?> key, final int childSizeHint) throws IOException {
+ public void startMapEntryNode(final Key<?> key, final int childSizeHint) throws IOException {
duplicateSchemaEnter();
- NodeIdentifierWithPredicates identifier = ((KeyedListNodeCodecContext<?, ?>) current()).serialize(key);
+ NodeIdentifierWithPredicates identifier = ((MapCodecContext<?, ?>) current()).serialize(key);
delegate.startMapEntryNode(identifier, childSizeHint);
}
@Override
- public <T extends DataObject & Identifiable<?>> void startMapNode(final Class<T> mapEntryType,
- final int childSizeHint) throws IOException {
+ public <T extends DataObject & KeyAware<?>> void startMapNode(final Class<T> mapEntryType, final int childSizeHint)
+ throws IOException {
delegate.startMapNode(enter(mapEntryType, NodeIdentifier.class), childSizeHint);
}
@Override
- public <T extends DataObject & Identifiable<?>> void startOrderedMapNode(final Class<T> mapEntryType,
+ public <T extends DataObject & KeyAware<?>> void startOrderedMapNode(final Class<T> mapEntryType,
final int childSizeHint) throws IOException {
delegate.startOrderedMapNode(enter(mapEntryType, NodeIdentifier.class), childSizeHint);
}