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