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.api;
10 import com.google.common.annotations.Beta;
11 import org.eclipse.jdt.annotation.Nullable;
12 import org.opendaylight.yangtools.yang.binding.DataObject;
13 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
14 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
17 * Common interface shared between {@link BindingDataObjectCodecTreeNode} and {@link BindingAugmentationCodecTreeNode}.
18 * This interface should never be implemented on its own.
20 * @param <T> DataObject type
22 public interface CommonDataObjectCodecTreeNode<T extends DataObject> extends BindingDataContainerCodecTreeNode<T> {
24 * Serializes path argument for current node.
26 * @param arg Binding Path Argument, may be null if Binding Instance Identifier does not have a representation for
27 * current node (e.g. choice or case).
28 * @return Yang Path Argument, may be null if Yang Instance Identifier does not have representation for current node
30 * @throws IllegalArgumentException If supplied {@code arg} is not valid.
33 YangInstanceIdentifier.@Nullable PathArgument serializePathArgument(InstanceIdentifier.@Nullable PathArgument arg);
36 * Deserializes path argument for current node.
38 * @param arg Yang Path Argument, may be null if Yang Instance Identifier does not have
39 * representation for current node (e.g. case).
40 * @return Binding Path Argument, may be null if Binding Instance Identifier does not have
41 * representation for current node (e.g. choice or case).
42 * @throws IllegalArgumentException If supplied {@code arg} is not valid.
45 InstanceIdentifier.@Nullable PathArgument deserializePathArgument(
46 YangInstanceIdentifier.@Nullable PathArgument arg);