2 * Copyright (c) 2023 PANTHEON.tech, s.r.o. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.mdsal.binding.dom.codec.impl;
10 import static java.util.Objects.requireNonNull;
12 import org.eclipse.jdt.annotation.NonNull;
13 import org.opendaylight.mdsal.binding.runtime.api.CompositeRuntimeType;
14 import org.opendaylight.yangtools.yang.binding.DataObject;
15 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.Item;
16 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
18 abstract sealed class DataObjectCodecPrototype<T extends CompositeRuntimeType> extends CommonDataObjectCodecPrototype<T>
19 permits CaseCodecPrototype, ContainerLikeCodecPrototype, ListCodecPrototype,
20 NotificationCodecContext.Prototype {
21 private final @NonNull NodeIdentifier yangArg;
23 // FIXME: this should not be needed
24 @SuppressWarnings("unchecked")
25 DataObjectCodecPrototype(final Class<?> cls, final NodeIdentifier yangArg, final T type,
26 final CodecContextFactory factory) {
27 this(Item.of((Class<? extends DataObject>) cls), yangArg, type, factory);
30 DataObjectCodecPrototype(final Item<?> bindingArg, final NodeIdentifier yangArg, final T type,
31 final CodecContextFactory factory) {
32 super(bindingArg, type, factory);
33 this.yangArg = requireNonNull(yangArg);
37 final NodeIdentifier yangArg() {