ca18c43115a67ced314c61179ee5bcf0770401a4
[appc.git] / appc-sdc-listener / appc-yang-generator / src / main / java / org / openecomp / appc / yang / type / YangTypes.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP : APPC
4  * ================================================================================
5  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6  * ================================================================================
7  * Copyright (C) 2017 Amdocs
8  * =============================================================================
9  * Licensed under the Apache License, Version 2.0 (the "License");
10  * you may not use this file except in compliance with the License.
11  * You may obtain a copy of the License at
12  * 
13  *      http://www.apache.org/licenses/LICENSE-2.0
14  * 
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  * 
21  * ECOMP is a trademark and service mark of AT&T Intellectual Property.
22  * ============LICENSE_END=========================================================
23  */
24
25 package org.openecomp.appc.yang.type;
26
27 import java.util.Collections;
28 import java.util.HashMap;
29 import java.util.Map;
30
31 public class YangTypes {
32
33     private static final Map<String, String> yangTypeMap;
34     private YangTypes(){}
35     static {
36         Map<String, String> typeMap = new HashMap<>();
37
38         /* standard Types */
39       /*  typeMap.put("bits","bits");
40         typeMap.put("leafref","leafref");
41         typeMap.put("decimal64","decimal64");
42         typeMap.put("enumeration","enumeration");
43         typeMap.put("identityref","identityref");
44         typeMap.put("union","union");*/
45         typeMap.put("binary","binary");
46         typeMap.put("boolean","boolean");
47         typeMap.put("empty","empty");
48         typeMap.put("instance-identifier","instance-identifier");
49         typeMap.put("int8","int8");
50         typeMap.put("int16","int16");
51         typeMap.put("int32","int32");
52         typeMap.put("int64","int64");
53         typeMap.put("string","string");
54         typeMap.put("uint8","uint8");
55         typeMap.put("uint16","uint16");
56         typeMap.put("uint32","uint32");
57         typeMap.put("uint64","uint64");
58
59
60         /* ietf-yang-types */
61
62         typeMap.put("counter32","yang:counter32");
63         typeMap.put("zero-based-counter32","yang:zero-based-counter32");
64         typeMap.put("counter64","yang:counter64");
65         typeMap.put("zero-based-counter64","yang:zero-based-counter64");
66         typeMap.put("gauge32","yang:gauge32");
67         typeMap.put("gauge64","yang:gauge64");
68         typeMap.put("object-identifier","yang:object-identifier");
69         typeMap.put("object-identifier-128","yang:object-identifier-128");
70         typeMap.put("yang-identifier","yang:yang-identifier");
71         typeMap.put("date-and-time","yang:date-and-time");
72         typeMap.put("timeticks","yang:timeticks");
73         typeMap.put("timestamp","yang:timestamp");
74         typeMap.put("phys-address","yang:phys-address");
75         typeMap.put("mac-address","yang:mac-address");
76         typeMap.put("xpath1.0","yang:xpath1.0");
77         typeMap.put("hex-string","yang:hex-string");
78         typeMap.put("uuid","yang:uuid");
79         typeMap.put("dotted-quad","yang:dotted-quad");
80
81         /* ietf-inet-types */
82
83         typeMap.put("ip-version","inet:ip-version");
84         typeMap.put("dscp","inet:dscp");
85         typeMap.put("ipv6-flow-label","inet:ipv6-flow-label");
86         typeMap.put("port-number","inet:port-number");
87         typeMap.put("as-number","inet:as-number");
88         typeMap.put("ip-address","inet:ip-address");
89         typeMap.put("ipv4-address","inet:ipv4-address");
90         typeMap.put("ipv6-address","inet:ipv6-address");
91         typeMap.put("ip-address-no-zone","inet:ip-address-no-zone");
92         typeMap.put("ipv4-address-no-zone","inet:ipv4-address-no-zone");
93         typeMap.put("ipv6-address-no-zone","inet:ipv6-address-no-zone");
94         typeMap.put("ip-prefix","inet:ip-prefix");
95         typeMap.put("ipv4-prefix","inet:ipv4-prefix");
96         typeMap.put("ipv6-prefix","inet:ipv6-prefix");
97         typeMap.put("domain-name","inet:domain-name");
98         typeMap.put("host","inet:host");
99         typeMap.put("uri","inet:uri");
100
101         yangTypeMap = Collections.unmodifiableMap(typeMap);
102     }
103
104     public static Map<String, String> getYangTypeMap(){
105         return yangTypeMap;
106     }
107
108 }