Added instance identifier support.
[yangtools.git] / code-generator / binding-generator-impl / src / main / java / org / opendaylight / yangtools / sal / binding / yang / types / BaseYangTypes.java
index 6f9503ae4fca4c9252cf5961f92a71641b19cec4..964731d78206eab8eec72a94f11d3e0f88534088 100644 (file)
@@ -1,69 +1,70 @@
-/*
- * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.yangtools.sal.binding.yang.types;
-
-import java.math.BigInteger;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.opendaylight.yangtools.binding.generator.util.Types;
-import org.opendaylight.yangtools.sal.binding.generator.spi.TypeProvider;
-import org.opendaylight.yangtools.sal.binding.model.api.Type;
-import org.opendaylight.yangtools.yang.model.api.TypeDefinition;
-
-public final class BaseYangTypes {
-
-    private static Map<String, Type> typeMap = new HashMap<String, Type>();
-
-    public static final Type BOOLEAN_TYPE = Types.typeForClass(Boolean.class);
-    public static final Type EMPTY_TYPE = Types.typeForClass(Boolean.class);
-    public static final Type INT8_TYPE = Types.typeForClass(Byte.class);
-    public static final Type INT16_TYPE = Types.typeForClass(Short.class);
-    public static final Type INT32_TYPE = Types.typeForClass(Integer.class);
-    public static final Type INT64_TYPE = Types.typeForClass(Long.class);
-    public static final Type STRING_TYPE = Types.typeForClass(String.class);
-    public static final Type DECIMAL64_TYPE = Types.typeForClass(Double.class);
-    public static final Type UINT8_TYPE = Types.typeForClass(Short.class);
-    public static final Type UINT16_TYPE = Types.typeForClass(Integer.class);
-    public static final Type UINT32_TYPE = Types.typeForClass(Long.class);
-    public static final Type UINT64_TYPE = Types.typeForClass(BigInteger.class);
-    public static final Type BINARY_TYPE = Types.primitiveType("byte[]");
-
-    static {
-        typeMap.put("boolean", BOOLEAN_TYPE);
-        typeMap.put("empty", EMPTY_TYPE);
-        typeMap.put("int8", INT8_TYPE);
-        typeMap.put("int16", INT16_TYPE);
-        typeMap.put("int32", INT32_TYPE);
-        typeMap.put("int64", INT64_TYPE);
-        typeMap.put("string", STRING_TYPE);
-        typeMap.put("decimal64", DECIMAL64_TYPE);
-        typeMap.put("uint8", UINT8_TYPE);
-        typeMap.put("uint16", UINT16_TYPE);
-        typeMap.put("uint32", UINT32_TYPE);
-        typeMap.put("uint64", UINT64_TYPE);
-        typeMap.put("binary", BINARY_TYPE);
-    }
-
-    public static final TypeProvider BASE_YANG_TYPES_PROVIDER = new TypeProvider() {
-
-        @Override
-        public Type javaTypeForYangType(String type) {
-            return typeMap.get(type);
-        }
-
-        @Override
-        public Type javaTypeForSchemaDefinitionType(TypeDefinition<?> type) {
-            if (type != null) {
-                return typeMap.get(type.getQName().getLocalName());
-            }
-
-            return null;
-        }
-    };
-}
+/*\r
+ * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.\r
+ *\r
+ * This program and the accompanying materials are made available under the\r
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
+ * and is available at http://www.eclipse.org/legal/epl-v10.html\r
+ */\r
+package org.opendaylight.yangtools.sal.binding.yang.types;\r
+\r
+import java.math.BigDecimal;\r
+import java.math.BigInteger;\r
+import java.util.HashMap;\r
+import java.util.Map;\r
+\r
+import org.opendaylight.yangtools.binding.generator.util.Types;\r
+import org.opendaylight.yangtools.sal.binding.generator.spi.TypeProvider;\r
+import org.opendaylight.yangtools.sal.binding.model.api.Type;\r
+import org.opendaylight.yangtools.yang.model.api.TypeDefinition;\r
+\r
+public final class BaseYangTypes {\r
+\r
+    private static Map<String, Type> typeMap = new HashMap<String, Type>();\r
+\r
+    public static final Type BOOLEAN_TYPE = Types.typeForClass(Boolean.class);\r
+    public static final Type EMPTY_TYPE = Types.typeForClass(Boolean.class);\r
+    public static final Type INT8_TYPE = Types.typeForClass(Byte.class);\r
+    public static final Type INT16_TYPE = Types.typeForClass(Short.class);\r
+    public static final Type INT32_TYPE = Types.typeForClass(Integer.class);\r
+    public static final Type INT64_TYPE = Types.typeForClass(Long.class);\r
+    public static final Type STRING_TYPE = Types.typeForClass(String.class);\r
+    public static final Type DECIMAL64_TYPE = Types.typeForClass(BigDecimal.class);\r
+    public static final Type UINT8_TYPE = Types.typeForClass(Short.class);\r
+    public static final Type UINT16_TYPE = Types.typeForClass(Integer.class);\r
+    public static final Type UINT32_TYPE = Types.typeForClass(Long.class);\r
+    public static final Type UINT64_TYPE = Types.typeForClass(BigInteger.class);\r
+    public static final Type BINARY_TYPE = Types.primitiveType("byte[]");\r
+\r
+    static {\r
+        typeMap.put("boolean", BOOLEAN_TYPE);\r
+        typeMap.put("empty", EMPTY_TYPE);\r
+        typeMap.put("int8", INT8_TYPE);\r
+        typeMap.put("int16", INT16_TYPE);\r
+        typeMap.put("int32", INT32_TYPE);\r
+        typeMap.put("int64", INT64_TYPE);\r
+        typeMap.put("string", STRING_TYPE);\r
+        typeMap.put("decimal64", DECIMAL64_TYPE);\r
+        typeMap.put("uint8", UINT8_TYPE);\r
+        typeMap.put("uint16", UINT16_TYPE);\r
+        typeMap.put("uint32", UINT32_TYPE);\r
+        typeMap.put("uint64", UINT64_TYPE);\r
+        typeMap.put("binary", BINARY_TYPE);\r
+    }\r
+\r
+    public static final TypeProvider BASE_YANG_TYPES_PROVIDER = new TypeProvider() {\r
+\r
+        @Override\r
+        public Type javaTypeForYangType(String type) {\r
+            return typeMap.get(type);\r
+        }\r
+\r
+        @Override\r
+        public Type javaTypeForSchemaDefinitionType(TypeDefinition<?> type) {\r
+            if (type != null) {\r
+                return typeMap.get(type.getQName().getLocalName());\r
+            }\r
+\r
+            return null;\r
+        }\r
+    };\r
+}\r