2 * Copyright (c) 2015 Cisco Systems, Inc. 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.eclipse.jdt.annotation.Nullable;
13 import org.opendaylight.yangtools.yang.common.UnqualifiedQName;
14 import org.opendaylight.yangtools.yang.model.api.YangStmtMapping;
15 import org.opendaylight.yangtools.yang.model.api.meta.StatementDefinition;
17 public interface SubmoduleStatement extends MetaDeclaredStatement<UnqualifiedQName>, LinkageDeclaredStatement,
18 RevisionAwareDeclaredStatement, BodyDeclaredStatement {
20 default StatementDefinition statementDefinition() {
21 return YangStmtMapping.SUBMODULE;
24 default @Nullable YangVersionStatement getYangVersion() {
25 final Optional<YangVersionStatement> opt = findFirstDeclaredSubstatement(YangVersionStatement.class);
26 return opt.isPresent() ? opt.get() : null;
29 default @NonNull BelongsToStatement getBelongsTo() {
30 return findFirstDeclaredSubstatement(BelongsToStatement.class).get();