2 * Copyright (c) 2021 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.runtime.api;
10 import com.google.common.annotations.Beta;
11 import java.util.Collection;
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.model.api.stmt.ChoiceEffectiveStatement;
18 * A {@link RuntimeType} associated with a {@code choice} statement.
21 public interface ChoiceRuntimeType extends CompositeRuntimeType, DataRuntimeType {
23 ChoiceEffectiveStatement statement();
26 * Returns resolved {@link CaseRuntimeType} for specified binding class name.
28 * @param typeName Binding class name
29 * @return {@link CaseRuntimeType}, or null if absent
30 * @throws NullPointerException if {@code typeName} is null
32 @Nullable CaseRuntimeType bindingCaseChild(JavaTypeName typeName);
35 * Return the runtime type for the original manifestation of this type's {@code choice} statement.
36 * Returns {@code null} if this type is the original.
38 * @return Original manifestatation, or {@code null} if this is the original manifestation.
40 @Nullable ChoiceRuntimeType originalType();
43 * Return all {@link CaseRuntimeType} valid at this type's statement.
45 * @return Valid {@link CaseRuntimeType}s
47 @NonNull Collection<CaseRuntimeType> validCaseChildren();
50 * Return any additional {@link CaseRuntimeType}s which may be encountered when dealing with DataObjects supported
51 * by this type. These are not strictly valid in YANG view of modeled data, but may have potentially-equivalent
52 * representation, such as in the following case:
69 * augment /foo/foo/bar {
73 * augment /bar/foo/bar {
78 * and, more notably, the two augments being in different modules. Since {@code choice bar}'s is part of a reusable
79 * construct, {@code grouping one}, DataObjects' copy builders can propagate them without translating them to the
80 * appropriate manifestation -- and they can do nothing about that as they lack the complete view of the effecitve
83 * @return Additional {@link CaseRuntimeType}s
85 @NonNull Collection<CaseRuntimeType> additionalCaseChildren();