Address RFC7950 API changes
[yangtools.git] / yang / yang-model-api / src / main / java / org / opendaylight / yangtools / yang / model / api / stmt / TypeStatement.java
1 /*
2  * Copyright (c) 2015 Cisco Systems, Inc. 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.yangtools.yang.model.api.stmt;
9
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;
14
15 @Rfc6020AbnfRule("type-stmt")
16 public interface TypeStatement extends DeclaredStatement<String> {
17
18     @Nonnull String getName();
19
20     @Rfc6020AbnfRule("numerical-restrictions")
21     interface NumericalRestrictions extends TypeStatement {
22
23         @Nonnull RangeStatement getRange();
24     }
25
26     @Rfc6020AbnfRule("decimal64-specification")
27     interface Decimal64Specification extends TypeStatement {
28
29         @Nonnull FractionDigitsStatement getFractionDigits();
30
31         @Nullable RangeStatement getRange();
32     }
33
34     @Rfc6020AbnfRule("string-restrictions")
35     interface StringRestrictions extends TypeStatement {
36
37         @Nullable LengthStatement getLength();
38
39         @Nonnull Collection<? extends PatternStatement> getPatterns();
40     }
41
42     @Rfc6020AbnfRule("enum-specification")
43     interface EnumSpecification extends TypeStatement {
44
45         @Nonnull Collection<? extends EnumStatement> getEnums();
46     }
47
48     @Rfc6020AbnfRule("leafref-specification")
49     interface LeafrefSpecification extends TypeStatement {
50
51         @Nonnull PathStatement getPath();
52
53         /**
54          * Return require-instance statement child, if present. For RFC6020 semantics, this method always returns
55          * null.
56          *
57          * @return require-instance statement, if present.
58          */
59         @Nullable RequireInstanceStatement getRequireInstance();
60     }
61
62     @Rfc6020AbnfRule("instanceidentifier-specification")
63     interface InstanceIdentifierSpecification extends TypeStatement {
64
65         @Nullable RequireInstanceStatement getRequireInstance();
66     }
67
68     @Rfc6020AbnfRule("identityref-specification")
69     interface IdentityRefSpecification extends TypeStatement {
70         /**
71          * Returns the base statements.
72          *
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)
75          */
76         @Nonnull Collection<? extends BaseStatement> getBases();
77     }
78
79     @Rfc6020AbnfRule("bits-specification")
80     interface BitsSpecification extends TypeStatement {
81
82         @Nonnull Collection<? extends BitStatement> getBits();
83     }
84
85     @Rfc6020AbnfRule("union-specification")
86     interface UnionSpecification extends TypeStatement {
87
88         @Nonnull Collection<? extends TypeStatement> getTypes();
89     }
90
91     @Rfc6020AbnfRule("binary-specification")
92     interface BinarySpecification extends TypeStatement {
93
94         @Nullable LengthStatement getLength();
95     }
96 }