Bug 8831 - Yang 1.1 default values are not checked correctly
[yangtools.git] / yang / yang-parser-impl / src / main / java / org / opendaylight / yangtools / yang / parser / stmt / rfc6020 / effective / type / BuiltinEffectiveStatements.java
1 /*
2  * Copyright (c) 2015 Pantheon Technologies s.r.o. 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.parser.stmt.rfc6020.effective.type;
9
10 import javax.annotation.Nonnull;
11 import org.opendaylight.yangtools.yang.model.api.stmt.TypeEffectiveStatement;
12 import org.opendaylight.yangtools.yang.model.api.stmt.TypeStatement;
13 import org.opendaylight.yangtools.yang.model.api.type.BinaryTypeDefinition;
14 import org.opendaylight.yangtools.yang.model.api.type.BooleanTypeDefinition;
15 import org.opendaylight.yangtools.yang.model.api.type.EmptyTypeDefinition;
16 import org.opendaylight.yangtools.yang.model.api.type.InstanceIdentifierTypeDefinition;
17 import org.opendaylight.yangtools.yang.model.api.type.IntegerTypeDefinition;
18 import org.opendaylight.yangtools.yang.model.api.type.StringTypeDefinition;
19 import org.opendaylight.yangtools.yang.model.api.type.UnsignedIntegerTypeDefinition;
20 import org.opendaylight.yangtools.yang.model.util.type.BaseTypes;
21
22 public final class BuiltinEffectiveStatements {
23     private BuiltinEffectiveStatements() {
24         throw new UnsupportedOperationException();
25     }
26
27     public static final TypeEffectiveStatement<TypeStatement> BINARY = new AbstractBuiltinEffectiveStatement() {
28         @Nonnull
29         @Override
30         public BinaryTypeDefinition getTypeDefinition() {
31             return BaseTypes.binaryType();
32         }
33     };
34     public static final TypeEffectiveStatement<TypeStatement> BOOLEAN = new AbstractBuiltinEffectiveStatement() {
35         @Nonnull
36         @Override
37         public BooleanTypeDefinition getTypeDefinition() {
38             return BaseTypes.booleanType();
39         }
40     };
41     public static final TypeEffectiveStatement<TypeStatement> EMPTY = new AbstractBuiltinEffectiveStatement() {
42         @Nonnull
43         @Override
44         public EmptyTypeDefinition getTypeDefinition() {
45             return BaseTypes.emptyType();
46         }
47     };
48     public static final TypeEffectiveStatement<TypeStatement> INSTANCE_IDENTIFIER = new AbstractBuiltinEffectiveStatement() {
49         @Nonnull
50         @Override
51         public InstanceIdentifierTypeDefinition getTypeDefinition() {
52             return BaseTypes.instanceIdentifierType();
53         }
54     };
55     public static final TypeEffectiveStatement<TypeStatement> INT8 = new AbstractBuiltinEffectiveStatement() {
56         @Nonnull
57         @Override
58         public IntegerTypeDefinition getTypeDefinition() {
59             return BaseTypes.int8Type();
60         }
61     };
62     public static final TypeEffectiveStatement<TypeStatement> INT16 = new AbstractBuiltinEffectiveStatement() {
63         @Nonnull
64         @Override
65         public IntegerTypeDefinition getTypeDefinition() {
66             return BaseTypes.int16Type();
67         }
68     };
69     public static final TypeEffectiveStatement<TypeStatement> INT32 = new AbstractBuiltinEffectiveStatement() {
70         @Nonnull
71         @Override
72         public IntegerTypeDefinition getTypeDefinition() {
73             return BaseTypes.int32Type();
74         }
75     };
76     public static final TypeEffectiveStatement<TypeStatement> INT64 = new AbstractBuiltinEffectiveStatement() {
77         @Nonnull
78         @Override
79         public IntegerTypeDefinition getTypeDefinition() {
80             return BaseTypes.int64Type();
81         }
82     };
83     public static final TypeEffectiveStatement<TypeStatement> STRING = new AbstractBuiltinEffectiveStatement() {
84         @Nonnull
85         @Override
86         public StringTypeDefinition getTypeDefinition() {
87             return BaseTypes.stringType();
88         }
89     };
90     public static final TypeEffectiveStatement<TypeStatement> UINT8 = new AbstractBuiltinEffectiveStatement() {
91         @Nonnull
92         @Override
93         public UnsignedIntegerTypeDefinition getTypeDefinition() {
94             return BaseTypes.uint8Type();
95         }
96     };
97     public static final TypeEffectiveStatement<TypeStatement> UINT16 = new AbstractBuiltinEffectiveStatement() {
98         @Nonnull
99         @Override
100         public UnsignedIntegerTypeDefinition getTypeDefinition() {
101             return BaseTypes.uint16Type();
102         }
103     };
104     public static final TypeEffectiveStatement<TypeStatement> UINT32 = new AbstractBuiltinEffectiveStatement() {
105         @Nonnull
106         @Override
107         public UnsignedIntegerTypeDefinition getTypeDefinition() {
108             return BaseTypes.uint32Type();
109         }
110     };
111     public static final TypeEffectiveStatement<TypeStatement> UINT64 = new AbstractBuiltinEffectiveStatement() {
112         @Nonnull
113         @Override
114         public UnsignedIntegerTypeDefinition getTypeDefinition() {
115             return BaseTypes.uint64Type();
116         }
117     };
118 }