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.Collection;
11 import javax.annotation.Nonnull;
12 import javax.annotation.Nullable;
13 import org.opendaylight.yangtools.yang.model.api.meta.DeclaredStatement;
15 @Rfc6020AbnfRule("type-stmt")
16 public interface TypeStatement extends DeclaredStatement<String> {
18 @Nonnull String getName();
20 @Rfc6020AbnfRule("numerical-restrictions")
21 interface NumericalRestrictions extends TypeStatement {
23 @Nonnull RangeStatement getRange();
26 @Rfc6020AbnfRule("decimal64-specification")
27 interface Decimal64Specification extends TypeStatement {
29 @Nonnull FractionDigitsStatement getFractionDigits();
31 @Nullable RangeStatement getRange();
34 @Rfc6020AbnfRule("string-restrictions")
35 interface StringRestrictions extends TypeStatement {
37 @Nullable LengthStatement getLength();
39 @Nonnull Collection<? extends PatternStatement> getPatterns();
42 @Rfc6020AbnfRule("enum-specification")
43 interface EnumSpecification extends TypeStatement {
45 @Nonnull Collection<? extends EnumStatement> getEnums();
48 @Rfc6020AbnfRule("leafref-specification")
49 interface LeafrefSpecification extends TypeStatement {
51 @Nonnull PathStatement getPath();
54 * Return require-instance statement child, if present. For RFC6020 semantics, this method always returns
57 * @return require-instance statement, if present.
59 @Nullable RequireInstanceStatement getRequireInstance();
62 @Rfc6020AbnfRule("instanceidentifier-specification")
63 interface InstanceIdentifierSpecification extends TypeStatement {
65 @Nullable RequireInstanceStatement getRequireInstance();
68 @Rfc6020AbnfRule("identityref-specification")
69 interface IdentityRefSpecification extends TypeStatement {
71 * Returns the base statements.
73 * @return collection of base statements (in YANG 1.1 models) or a collection containing just one base
74 * statement (in YANG 1.0 models)
76 @Nonnull Collection<? extends BaseStatement> getBases();
79 @Rfc6020AbnfRule("bits-specification")
80 interface BitsSpecification extends TypeStatement {
82 @Nonnull Collection<? extends BitStatement> getBits();
85 @Rfc6020AbnfRule("union-specification")
86 interface UnionSpecification extends TypeStatement {
88 @Nonnull Collection<? extends TypeStatement> getTypes();
91 @Rfc6020AbnfRule("binary-specification")
92 interface BinarySpecification extends TypeStatement {
94 @Nullable LengthStatement getLength();