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