Promote RuntimeType interface hierarchy
[mdsal.git] / binding / mdsal-binding-runtime-api / src / main / java / org / opendaylight / mdsal / binding / runtime / api / ChoiceRuntimeType.java
1 /*
2  * Copyright (c) 2021 PANTHEON.tech, 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.mdsal.binding.runtime.api;
9
10 import java.util.List;
11 import org.eclipse.jdt.annotation.NonNull;
12 import org.eclipse.jdt.annotation.Nullable;
13 import org.opendaylight.mdsal.binding.model.api.JavaTypeName;
14 import org.opendaylight.yangtools.yang.binding.Augmentable;
15 import org.opendaylight.yangtools.yang.model.api.stmt.ChoiceEffectiveStatement;
16
17 /**
18  * A {@link RuntimeType} associated with a {@code choice} statement. Note that unlike YANG semantics, in Binding Spec
19  * semantics a type generated for a 'choice' statement is <b>does not</b> implement {@link Augmentable}.
20  */
21 public interface ChoiceRuntimeType extends CompositeRuntimeType, DataRuntimeType {
22     @Override
23     ChoiceEffectiveStatement statement();
24
25     /**
26      * Returns resolved {@link CaseRuntimeType} for specified binding class name.
27      *
28      * @param typeName Binding class name
29      * @return {@link CaseRuntimeType}, or null if absent
30      * @throws NullPointerException if {@code typeName} is null
31      */
32     @Nullable CaseRuntimeType bindingCaseChild(JavaTypeName typeName);
33
34     /**
35      * Return all {@link CaseRuntimeType} valid at this type's statement.
36      *
37      * @return Valid {@link CaseRuntimeType}s
38      */
39     @NonNull List<CaseRuntimeType> validCaseChildren();
40 }