2 * Copyright (c) 2017 Pantheon Technologies, 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.yangtools.yang.model.api.stmt;
10 import java.util.Optional;
11 import org.eclipse.jdt.annotation.NonNull;
12 import org.opendaylight.yangtools.yang.common.QName;
13 import org.opendaylight.yangtools.yang.model.api.YangStmtMapping;
14 import org.opendaylight.yangtools.yang.model.api.meta.StatementDefinition;
17 * Effective representation of a {@code choice} statement.
19 public interface ChoiceEffectiveStatement
20 extends SchemaTreeEffectiveStatement<ChoiceStatement>, DataTreeAwareEffectiveStatement<QName, ChoiceStatement> {
22 default StatementDefinition statementDefinition() {
23 return YangStmtMapping.CHOICE;
27 * Namespace of available cases in a choice node. According to RFC7950 section 6.2.1:
29 * All cases within a choice share the same case identifier
30 * namespace. This namespace is scoped to the parent choice node.
33 default @NonNull Optional<CaseEffectiveStatement> findCase(final @NonNull QName qname) {
34 return DefaultMethodHelpers.filterOptional(findSchemaTreeNode(qname), CaseEffectiveStatement.class);