2 * Copyright (c) 2020 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.NonNull;
12 import org.eclipse.jdt.annotation.Nullable;
13 import org.opendaylight.yangtools.binding.lib.DataObject;
14 import org.opendaylight.yangtools.binding.lib.InstanceIdentifier;
15 import org.opendaylight.yangtools.concepts.Immutable;
16 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
19 public interface BindingInstanceIdentifierCodec extends Immutable {
21 * Translates supplied {@link YangInstanceIdentifier} into an {@link InstanceIdentifier}, if possible.
23 * @param domPath YANG Instance Identifier
24 * @return Binding Instance Identifier, or null if the instance identifier is not representable.
25 * @throws NullPointerException if domPath is null
26 * @throws IllegalArgumentException if domPath is not valid.
28 // FIXME: Document MissingSchemaException being thrown?
29 // FIXME: Document MissingSchemaForClassException being thrown?
30 <T extends DataObject> @Nullable InstanceIdentifier<T> toBinding(@NonNull YangInstanceIdentifier domPath);
33 * Translates supplied {@link InstanceIdentifier} into {@link YangInstanceIdentifier}.
35 * @param bindingPath Binding Instance Identifier
36 * @return DOM Instance Identifier
37 * @throws NullPointerException if bindingPath is null
38 * @throws IllegalArgumentException if bindingPath is not valid.
40 // FIXME: Document MissingSchemaException being thrown
41 // FIXME: Document MissingSchemaForClassException being thrown
42 @NonNull YangInstanceIdentifier fromBinding(@NonNull InstanceIdentifier<?> bindingPath);