Seal more Binding contracts
[mdsal.git] / binding / yang-binding / src / main / java / org / opendaylight / yangtools / yang / binding / ChoiceIn.java
1 /*
2  * Copyright (c) 2018 Pantheon Technologies, s.r.o. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.yangtools.yang.binding;
9
10 /**
11  * A choice of child nodes within a parent container. This marker interface allows binding interfaces generated for
12  * {@code choice} statements to their defining container, without implying {@link DataObject} and {@link ChildOf}
13  * relationship.
14  *
15  * <p>
16  * This marker interface is also inherited by interfaces generated for {@code case} statements, similarly marking those
17  * interfaces as usable within scope when the statement which defined the {@code choice} statement. This allows us to
18  * bind {@code grouping}s to their {@code uses} references within an (implicit or explicit) {@code case}, effectively
19  * forming an addressing path from {@link DataRoot} or a {@link DataContainer} like this:
20  *
21  * <pre>
22  * interface Grouping extends DataObject
23  * interface GroupingChild extends ChildOf&lt;Grouping&gt;
24  *
25  * interface Parent extends DataContainer
26  * interface Choice implements Choice&lt;Parent&gt;
27  * interface Case extends Choice, Grouping
28  *
29  * Parent -&gt; choiceOf -&gt; Case -&gt; childOf-&gt; GroupingChild
30  * </pre>
31  *
32  * @param <P> Parent container
33  * @author Robert Varga
34  */
35 public non-sealed interface ChoiceIn<P> extends DataContainer {
36
37 }